1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 14:38:30 +02:00

Prevent double-rendering of warping sprites on left and top of screen

Previously, the game could end up rendering a warping sprite twice due
to the fact that it could run "if entity is on the right side of the
screen" right after "if entity is on the left side of the screen" (but
not the other way around). This is most noticeable if you have a custom
player sprite with translucent pixels and stand on the left side of a
warping screen, but the code suggests it happens when warping through
the top of the screen, too.
This commit is contained in:
Misa 2020-04-26 11:17:53 -07:00 committed by Ethan Lee
parent 276daa11bb
commit 4c45a8ac47

View File

@ -1449,7 +1449,7 @@ void Graphics::drawentities()
drawRect.y += tpoint.y;
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
}
if (tpoint.x > 300)
else if (tpoint.x > 300)
{
tpoint.x -= 320;
drawRect = sprites_rect;
@ -1468,7 +1468,7 @@ void Graphics::drawentities()
drawRect.y += tpoint.y;
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
}
if (tpoint.y > 210)
else if (tpoint.y > 210)
{
tpoint.y -= 230;
drawRect = sprites_rect;