1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 18:19:43 +01:00

Move horizontal warp background to Graphics::updatebackground()

This is so the background doesn't NYOOOOM past at light speed. Although
for a game set in space like VVVVVV, light speed ain't bad.

And this finally requires that editorlogic() have a call to
Graphics::updatebackground().
This commit is contained in:
Misa 2020-04-29 10:37:56 -07:00 committed by Ethan Lee
parent 9d104b68ee
commit c9c55d0c8b
2 changed files with 48 additions and 33 deletions

View file

@ -1957,39 +1957,6 @@ void Graphics::drawbackground( int t )
} }
break; break;
case 3: //Warp zone (horizontal) case 3: //Warp zone (horizontal)
backoffset+=3;
if (backoffset >= 16) backoffset -= 16;
if (backgrounddrawn)
{
ScrollSurface(towerbuffer, -3, 0 );
for (int j = 0; j < 15; j++)
{
temp = 680 + (rcol * 3);
drawtowertile(317 - backoffset, (j * 16), temp+40); //20*16 = 320
drawtowertile(317 - backoffset + 8, (j * 16), temp + 41);
drawtowertile(317 - backoffset, (j * 16) + 8, temp + 80);
drawtowertile(317 - backoffset + 8, (j * 16) + 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 = 680 + (rcol * 3);
drawtowertile((i * 16) - backoffset - 3, (j * 16), temp+40);
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41);
drawtowertile((i * 16) - backoffset - 3, (j * 16) + 8, temp + 80);
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16) + 8, temp + 81);
}
}
backgrounddrawn = true;
}
BlitSurfaceStandard(towerbuffer, NULL, backBuffer, NULL); BlitSurfaceStandard(towerbuffer, NULL, backBuffer, NULL);
break; break;
case 4: //Warp zone (vertical) case 4: //Warp zone (vertical)
@ -2204,6 +2171,41 @@ void Graphics::updatebackground(int t)
} }
} }
break; break;
case 3: //Warp zone (horizontal)
backoffset+=3;
if (backoffset >= 16) backoffset -= 16;
if (backgrounddrawn)
{
ScrollSurface(towerbuffer, -3, 0 );
for (int j = 0; j < 15; j++)
{
int temp = 680 + (rcol * 3);
drawtowertile(317 - backoffset, (j * 16), temp+40); //20*16 = 320
drawtowertile(317 - backoffset + 8, (j * 16), temp + 41);
drawtowertile(317 - backoffset, (j * 16) + 8, temp + 80);
drawtowertile(317 - backoffset + 8, (j * 16) + 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 = 680 + (rcol * 3);
drawtowertile((i * 16) - backoffset - 3, (j * 16), temp+40);
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16), temp + 41);
drawtowertile((i * 16) - backoffset - 3, (j * 16) + 8, temp + 80);
drawtowertile((i * 16) - backoffset + 8 - 3, (j * 16) + 8, temp + 81);
}
}
backgrounddrawn = true;
}
break;
case 6: case 6:
//Final Starfield //Final Starfield
for (int i = 0; i < 50; i++) for (int i = 0; i < 50; i++)

View file

@ -3606,6 +3606,19 @@ void editorlogic()
ed.notedelay--; ed.notedelay--;
} }
if (!ed.settingsmod)
{
switch(ed.level[ed.levx+(ed.levy*ed.maxwidth)].warpdir)
{
case 1:
graphics.rcol=ed.getwarpbackground(ed.levx, ed.levy);
graphics.updatebackground(3);
break;
default:
break;
}
}
if (graphics.fademode == 1) if (graphics.fademode == 1)
{ {
//Return to game //Return to game