devilutionX/Source/DiabloUI/art_draw.h
Gleb Mazovetskiy 117695489b
DrawArt: Fix bounds check (#3395)
The bounds checks were performed against the global screen dimensions
instead of the output buffer dimensions.

Also includes some minor cleanup of DrawArt.

Fixes #3388
2021-11-05 14:17:56 +00:00

18 lines
510 B
C++

#pragma once
#include "DiabloUI/art.h"
#include "engine.h"
namespace devilution {
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);
void DrawAnimatedArt(Art *art, Point screenPosition);
int GetAnimationFrame(int frames, int fps = 60);
} // namespace devilution