mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59: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:
parent
f33cbfbe62
commit
b50ca5b9e6
1 changed files with 12 additions and 4 deletions
|
@ -2244,8 +2244,6 @@ void Graphics::drawtowerbackground()
|
||||||
|
|
||||||
if (map.bypos < 0) map.bypos += 120 * 8;
|
if (map.bypos < 0) map.bypos += 120 * 8;
|
||||||
|
|
||||||
if (map.scrolldir == 1) map.tdrawback = true;
|
|
||||||
|
|
||||||
if (map.tdrawback)
|
if (map.tdrawback)
|
||||||
{
|
{
|
||||||
//Draw the whole thing; needed for every colour cycle!
|
//Draw the whole thing; needed for every colour cycle!
|
||||||
|
@ -2268,8 +2266,18 @@ void Graphics::drawtowerbackground()
|
||||||
ScrollSurface(towerbuffer, 0, -map.bscroll);
|
ScrollSurface(towerbuffer, 0, -map.bscroll);
|
||||||
for (int i = 0; i < 40; i++)
|
for (int i = 0; i < 40; i++)
|
||||||
{
|
{
|
||||||
temp = map.tower.backat(i, 0, map.bypos);
|
if (map.scrolldir == 0)
|
||||||
drawtowertile3(i * 8, -(map.bypos % 8), temp, map.colstate);
|
{
|
||||||
|
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);
|
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
||||||
|
|
Loading…
Reference in a new issue