Browse Source

Remove unused `DrawArt` overload

pull/5191/head
Gleb Mazovetskiy 4 years ago committed by Anders Jenbo
parent
commit
fcd163cac6
  1. 23
      Source/DiabloUI/art_draw.cpp
  2. 2
      Source/DiabloUI/art_draw.h

23
Source/DiabloUI/art_draw.cpp

@ -50,29 +50,6 @@ void DrawArt(Point screenPosition, Art *art, int nFrame, Uint16 srcW, Uint16 src
ErrSdl();
}
void DrawArt(const Surface &out, Point position, Art *art, int nFrame, Uint16 srcW, Uint16 srcH)
{
if (art->surface == nullptr || position.y >= out.h() || position.x >= out.w())
return;
SDL_Rect srcRect = MakeSdlRect(0, nFrame * art->h(), art->w(), art->h());
if (srcW != 0 && srcW < srcRect.w)
srcRect.w = srcW;
if (srcH != 0 && srcH < srcRect.h)
srcRect.h = srcH;
if (position.x + srcRect.w <= 0 || position.y + srcRect.h <= 0)
return;
out.Clip(&srcRect, &position);
SDL_Rect dstRect = MakeSdlRect(position.x + out.region.x, position.y + out.region.y, 0, 0);
UpdatePalette(art, out.surface);
if (SDL_BlitSurface(art->surface.get(), &srcRect, out.surface, &dstRect) < 0)
ErrSdl();
}
int GetAnimationFrame(int frames, int fps)
{
int frame = (SDL_GetTicks() / fps) % frames;

2
Source/DiabloUI/art_draw.h

@ -9,8 +9,6 @@ void UpdatePalette(Art *art, const SDL_Surface *output = nullptr);
void DrawArt(Point screenPosition, Art *art, int nFrame = 0, Uint16 srcW = 0, Uint16 srcH = 0);
void DrawArt(const Surface &out, Point position, Art *art, int nFrame = 0, Uint16 srcW = 0, Uint16 srcH = 0);
int GetAnimationFrame(int frames, int fps = 60);
} // namespace devilution

Loading…
Cancel
Save