mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Move vertical warp background updating to Graphics::updatebackground()
Otherwise it will zoom by pretty quickly.
This commit is contained in:
parent
c7d3a684ea
commit
921960d23a
2 changed files with 39 additions and 34 deletions
|
@ -1963,40 +1963,6 @@ void Graphics::drawbackground( int t )
|
|||
BlitSurfaceStandard(towerbuffer_lerp, NULL, backBuffer, NULL);
|
||||
break;
|
||||
case 4: //Warp zone (vertical)
|
||||
backoffset+=3;
|
||||
if (backoffset >= 16) backoffset -= 16;
|
||||
|
||||
if (backgrounddrawn)
|
||||
{
|
||||
ScrollSurface(towerbuffer,0,-3);
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
temp = 760 + (rcol * 3);
|
||||
drawtowertile((i * 16), 237 - backoffset, temp + 40); //14*17=240 - 3
|
||||
drawtowertile((i * 16) + 8, 237 - backoffset, temp + 41);
|
||||
drawtowertile((i * 16), 237 - backoffset + 8, temp + 80);
|
||||
drawtowertile((i * 16) + 8, 237 - backoffset + 8, temp + 81);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//draw the whole thing for the first time!
|
||||
backoffset = 0;
|
||||
FillRect(towerbuffer,0x000000 );
|
||||
for (int j = 0; j < 15; j++)
|
||||
{
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
temp = 760 + (rcol * 3);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset - 3, temp+40);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset - 3, temp + 41);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset + 8 - 3, temp + 80);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8 - 3, temp + 81);
|
||||
}
|
||||
}
|
||||
backgrounddrawn = true;
|
||||
}
|
||||
|
||||
SDL_BlitSurface(towerbuffer,NULL, backBuffer,NULL);
|
||||
break;
|
||||
case 5:
|
||||
|
@ -2209,6 +2175,41 @@ void Graphics::updatebackground(int t)
|
|||
backgrounddrawn = true;
|
||||
}
|
||||
break;
|
||||
case 4: //Warp zone (vertical)
|
||||
backoffset+=3;
|
||||
if (backoffset >= 16) backoffset -= 16;
|
||||
|
||||
if (backgrounddrawn)
|
||||
{
|
||||
ScrollSurface(towerbuffer,0,-3);
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
int temp = 760 + (rcol * 3);
|
||||
drawtowertile((i * 16), 237 - backoffset, temp + 40); //14*17=240 - 3
|
||||
drawtowertile((i * 16) + 8, 237 - backoffset, temp + 41);
|
||||
drawtowertile((i * 16), 237 - backoffset + 8, temp + 80);
|
||||
drawtowertile((i * 16) + 8, 237 - backoffset + 8, temp + 81);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//draw the whole thing for the first time!
|
||||
backoffset = 0;
|
||||
FillRect(towerbuffer,0x000000 );
|
||||
for (int j = 0; j < 15; j++)
|
||||
{
|
||||
for (int i = 0; i < 21; i++)
|
||||
{
|
||||
int temp = 760 + (rcol * 3);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset - 3, temp+40);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset - 3, temp + 41);
|
||||
drawtowertile((i * 16), (j * 16)- backoffset + 8 - 3, temp + 80);
|
||||
drawtowertile((i * 16)+ 8, (j * 16)- backoffset + 8 - 3, temp + 81);
|
||||
}
|
||||
}
|
||||
backgrounddrawn = true;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
//Final Starfield
|
||||
for (int i = 0; i < 50; i++)
|
||||
|
|
|
@ -3614,6 +3614,10 @@ void editorlogic()
|
|||
graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy);
|
||||
graphics.updatebackground(3);
|
||||
break;
|
||||
case 2:
|
||||
graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy);
|
||||
graphics.updatebackground(4);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue