mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 18:19:43 +01:00
Interpolate upwards-moving star BG
So that it's smooth at full FPS.
This commit is contained in:
parent
3b09bb36e8
commit
4e533c65a5
1 changed files with 6 additions and 2 deletions
|
@ -2101,13 +2101,17 @@ void Graphics::drawbackground( int t )
|
||||||
FillRect(backBuffer,0x000000);
|
FillRect(backBuffer,0x000000);
|
||||||
for (int i = 0; i < 50; i++)
|
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)
|
if (starsspeed[i] <= 8)
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, stars[i], getRGB(0x22, 0x22, 0x22));
|
FillRect(backBuffer, star_rect, getRGB(0x22, 0x22, 0x22));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, stars[i], getRGB(0x55, 0x55, 0x55));
|
FillRect(backBuffer, star_rect, getRGB(0x55, 0x55, 0x55));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue