1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-22 17:49:43 +01:00

Don't redraw tower background in descending towers

Looks like this was done as a quick fix instead of taking the time to
figure out the math needed to actually draw the incoming textures, which
is fair enough - it only makes one room, Panic Room, slightly laggier.

While I was working on my over-30-FPS patch, though, I came across the
fact that this background kept getting entirely redrawn every frame, and
it seems like it would be easier to interpolate descending tower
backgrounds if we scrolled what was already there instead.

Here, we have to draw two rows of incoming textures, otherwise the
scrolling surface will produce black lines.
This commit is contained in:
Misa 2020-04-29 13:44:28 -07:00 committed by Ethan Lee
parent f33cbfbe62
commit b50ca5b9e6

View file

@ -2244,8 +2244,6 @@ void Graphics::drawtowerbackground()
if (map.bypos < 0) map.bypos += 120 * 8;
if (map.scrolldir == 1) map.tdrawback = true;
if (map.tdrawback)
{
//Draw the whole thing; needed for every colour cycle!
@ -2268,8 +2266,18 @@ void Graphics::drawtowerbackground()
ScrollSurface(towerbuffer, 0, -map.bscroll);
for (int i = 0; i < 40; i++)
{
temp = map.tower.backat(i, 0, map.bypos);
drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate);
if (map.scrolldir == 0)
{
temp = map.tower.backat(i, 0, map.bypos);
drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate);
}
else
{
temp = map.tower.backat(i, 29, map.bypos);
drawtowertile3(i * 8, 29*8 - (map.bypos % 8) - map.bscroll, temp, map.colstate);
temp = map.tower.backat(i, 30, map.bypos);
drawtowertile3(i * 8, 30*8 - (map.bypos % 8) - map.bscroll, temp, map.colstate);
}
}
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);