mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Add bounds checks to both versions of Graphics::drawsprite()
For some reason, I forgot to add bounds checks to these functions. Well, I'm glad I caught it, anyways.
This commit is contained in:
parent
76d6a3536b
commit
140861a79d
1 changed files with 10 additions and 0 deletions
|
@ -622,6 +622,11 @@ void Graphics::printcrewnamestatus( int x, int y, int t )
|
|||
|
||||
void Graphics::drawsprite( int x, int y, int t, int r, int g, int b )
|
||||
{
|
||||
if (!INBOUNDS_VEC(t, sprites))
|
||||
{
|
||||
WHINE_ONCE("drawsprite() out-of-bounds!");
|
||||
}
|
||||
|
||||
SDL_Rect rect = { Sint16(x), Sint16(y), sprites_rect.w, sprites_rect.h };
|
||||
setcolreal(getRGB(r,g,b));
|
||||
BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct);
|
||||
|
@ -629,6 +634,11 @@ void Graphics::drawsprite( int x, int y, int t, int r, int g, int b )
|
|||
|
||||
void Graphics::drawsprite(int x, int y, int t, Uint32 c)
|
||||
{
|
||||
if (!INBOUNDS_VEC(t, sprites))
|
||||
{
|
||||
WHINE_ONCE("drawsprite() out-of-bounds!");
|
||||
}
|
||||
|
||||
SDL_Rect rect = { Sint16(x), Sint16(y), sprites_rect.w, sprites_rect.h };
|
||||
setcolreal(c);
|
||||
BlitSurfaceColoured(sprites[t], NULL, backBuffer, &rect, ct);
|
||||
|
|
Loading…
Reference in a new issue