1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00

Crop bottom tower spikes so they don't get drawn behind room name

If you have the translucent room name option enabled, you'd always be
seeing the spikes at the bottom of the screen hidden behind the room
name. This patch makes it so that the spikes get carefully cropped so
they only appear above the room name when the player gets close to the
bottom of the screen.
This commit is contained in:
Misa 2020-08-03 19:13:08 -07:00 committed by Ethan Lee
parent f544e95e85
commit 154e81292e
2 changed files with 5 additions and 4 deletions

View File

@ -683,7 +683,7 @@ void Graphics::drawtile2( int x, int y, int t )
void Graphics::drawtile3( int x, int y, int t, int off )
void Graphics::drawtile3( int x, int y, int t, int off, int height_subtract /*= 0*/ )
{
t += off * 30;
if (!INBOUNDS(t, tiles3))
@ -691,8 +691,9 @@ void Graphics::drawtile3( int x, int y, int t, int off )
WHINE_ONCE("drawtile3() out-of-bounds!")
return;
}
SDL_Rect src_rect = { 0, 0, tiles_rect.w, tiles_rect.h - height_subtract };
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
BlitSurfaceStandard(tiles3[t], NULL, backBuffer, &rect);
BlitSurfaceStandard(tiles3[t], &src_rect, backBuffer, &rect);
}
void Graphics::drawentcolours( int x, int y, int t)
@ -2458,7 +2459,7 @@ void Graphics::drawtowerspikes()
for (int i = 0; i < 40; i++)
{
drawtile3(i * 8, -8+spikeleveltop, 9, map.colstate);
drawtile3(i * 8, 230-spikelevelbottom, 8, map.colstate);
drawtile3(i * 8, 230-spikelevelbottom, 8, map.colstate, 8 - spikelevelbottom);
}
}

View File

@ -163,7 +163,7 @@ public:
void drawbackground(int t);
void updatebackground(int t);
void drawtile3( int x, int y, int t, int off );
void drawtile3( int x, int y, int t, int off, int height_subtract = 0 );
void drawentcolours( int x, int y, int t);
void drawtile2( int x, int y, int t );
void drawtile( int x, int y, int t );