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

Add 8 pixels of padding above and left of towerbuffer[_lerp]

In order to fix the weird title screen pixels at the top on deltaframes,
we'll need to have a bit more space at the top. Also to the left, in
case we need a background to scroll from the left in the future.
This commit is contained in:
Misa 2020-11-02 10:44:53 -08:00 committed by Ethan Lee
parent 39c88a3c1c
commit b98c99fd7a
2 changed files with 9 additions and 3 deletions

View File

@ -26,6 +26,7 @@ void Graphics::init()
setRect(prect, 0, 0, 4, 4);
setRect(line_rect, 0,0,0,0);
setRect(tele_rect,0,0,96,96);
setRect(towerbuffer_rect, 8, 8, 320, 240);
//We initialise a few things
@ -735,6 +736,8 @@ void Graphics::drawtowertile( int x, int y, int t )
WHINE_ONCE("drawtowertile() out-of-bounds!")
return;
}
x += 8;
y += 8;
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
BlitSurfaceStandard(tiles2[t], NULL, towerbuffer, &rect);
}
@ -748,6 +751,8 @@ void Graphics::drawtowertile3( int x, int y, int t, int off )
WHINE_ONCE("drawtowertile3() out-of-bounds!")
return;
}
x += 8;
y += 8;
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
BlitSurfaceStandard(tiles3[t], NULL, towerbuffer, &rect);
}
@ -2112,13 +2117,13 @@ void Graphics::drawbackground( int t )
FillRect(backBuffer, 0x000000);
BlitSurfaceStandard(towerbuffer, NULL, towerbuffer_lerp, NULL);
ScrollSurface(towerbuffer_lerp, lerp(0, -3), 0);
BlitSurfaceStandard(towerbuffer_lerp, NULL, backBuffer, NULL);
BlitSurfaceStandard(towerbuffer_lerp, &towerbuffer_rect, backBuffer, NULL);
break;
case 4: //Warp zone (vertical)
FillRect(backBuffer, 0x000000);
SDL_BlitSurface(towerbuffer, NULL, towerbuffer_lerp, NULL);
ScrollSurface(towerbuffer_lerp, 0, lerp(0, -3));
SDL_BlitSurface(towerbuffer_lerp,NULL, backBuffer,NULL);
SDL_BlitSurface(towerbuffer_lerp, &towerbuffer_rect, backBuffer, NULL);
break;
case 5:
//Warp zone, central
@ -2489,7 +2494,7 @@ void Graphics::drawtowerbackground()
FillRect(backBuffer, 0x000000);
SDL_BlitSurface(towerbuffer, NULL, towerbuffer_lerp, NULL);
ScrollSurface(towerbuffer_lerp, 0, lerp(0, -map.bscroll));
SDL_BlitSurface(towerbuffer_lerp,NULL, backBuffer,NULL);
SDL_BlitSurface(towerbuffer_lerp, &towerbuffer_rect, backBuffer, NULL);
}
void Graphics::updatetowerbackground()

View File

@ -238,6 +238,7 @@ public:
SDL_Rect bg_rect;
SDL_Rect line_rect;
SDL_Rect tele_rect;
SDL_Rect towerbuffer_rect;
SDL_Rect foot_rect;
SDL_Rect prect;