mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Fix background smearing pushing tower camera with invincibility
If you have invincibility enabled and push the camera, the background would smear. This is because the game doesn't calculate the proper bscroll and bypos of the tower background, and also doesn't end up redrawing it. We do both these things now, so this is fixed.
This commit is contained in:
parent
7c55b449e0
commit
5c3fbd0022
1 changed files with 13 additions and 5 deletions
|
@ -896,17 +896,25 @@ void gamelogic(void)
|
|||
}
|
||||
else if (INBOUNDS_VEC(player, obj.entities))
|
||||
{
|
||||
if (obj.entities[player].yp-map.ypos <= 0)
|
||||
const bool above_screen = obj.entities[player].yp-map.ypos <= 8;
|
||||
const bool below_screen = obj.entities[player].yp-map.ypos >= 200;
|
||||
|
||||
if (above_screen)
|
||||
{
|
||||
map.ypos-=10;
|
||||
graphics.towerbg.bypos = map.ypos / 2;
|
||||
graphics.towerbg.bscroll = 0;
|
||||
}
|
||||
else if (obj.entities[player].yp-map.ypos >= 208)
|
||||
else if (below_screen)
|
||||
{
|
||||
map.ypos+=2;
|
||||
}
|
||||
|
||||
if (above_screen || below_screen)
|
||||
{
|
||||
graphics.towerbg.bypos = map.ypos / 2;
|
||||
graphics.towerbg.bscroll = 0;
|
||||
graphics.towerbg.bscroll = (map.ypos - map.oldypos) / 2;
|
||||
|
||||
/* The buffer isn't big enough; we have to redraw */
|
||||
graphics.towerbg.tdrawback = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue