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

Interpolate upwards-moving star BG

So that it's smooth at full FPS.
This commit is contained in:
Misa 2020-04-28 19:52:59 -07:00 committed by Ethan Lee
parent 3b09bb36e8
commit 4e533c65a5

View file

@ -2101,13 +2101,17 @@ void Graphics::drawbackground( int t )
FillRect(backBuffer,0x000000);
for (int i = 0; i < 50; i++)
{
stars[i].w = 2;
stars[i].h = 2;
SDL_Rect star_rect = stars[i];
star_rect.y = lerp(star_rect.y + starsspeed[i], star_rect.y);
if (starsspeed[i] <= 8)
{
FillRect(backBuffer, stars[i], getRGB(0x22, 0x22, 0x22));
FillRect(backBuffer, star_rect, getRGB(0x22, 0x22, 0x22));
}
else
{
FillRect(backBuffer, stars[i], getRGB(0x55, 0x55, 0x55));
FillRect(backBuffer, star_rect, getRGB(0x55, 0x55, 0x55));
}
}
break;