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

Fix discoloration when entities warp in flip mode

In flip mode, warping entities would appear to change color for a brief
moment. This is actually them defaulting to the actual color used in
flipsprites.png, instead of first being whited-out and then re-colored
using graphics.setcol().

To fix this, use BlitSurfaceColoured() and pass `ct` along instead of
using BlitSurfaceStandard().
This commit is contained in:
Info Teddy 2020-02-02 14:43:42 -08:00 committed by Ethan Lee
parent 45491a03f3
commit 4bc76416f5

View file

@ -1464,7 +1464,7 @@ void Graphics::drawentities( mapclass& map, entityclass& obj, UtilityClass& help
drawRect = sprites_rect; drawRect = sprites_rect;
drawRect.x += tpoint.x; drawRect.x += tpoint.x;
drawRect.y += tpoint.y; drawRect.y += tpoint.y;
BlitSurfaceStandard(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
} }
if (tpoint.x > 300) if (tpoint.x > 300)
{ {
@ -1472,7 +1472,7 @@ void Graphics::drawentities( mapclass& map, entityclass& obj, UtilityClass& help
drawRect = sprites_rect; drawRect = sprites_rect;
drawRect.x += tpoint.x; drawRect.x += tpoint.x;
drawRect.y += tpoint.y; drawRect.y += tpoint.y;
BlitSurfaceStandard(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
} }
} }
else if (map.warpy) else if (map.warpy)
@ -1483,7 +1483,7 @@ void Graphics::drawentities( mapclass& map, entityclass& obj, UtilityClass& help
drawRect = sprites_rect; drawRect = sprites_rect;
drawRect.x += tpoint.x; drawRect.x += tpoint.x;
drawRect.y += tpoint.y; drawRect.y += tpoint.y;
BlitSurfaceStandard(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
} }
if (tpoint.y > 210) if (tpoint.y > 210)
{ {
@ -1491,7 +1491,7 @@ void Graphics::drawentities( mapclass& map, entityclass& obj, UtilityClass& help
drawRect = sprites_rect; drawRect = sprites_rect;
drawRect.x += tpoint.x; drawRect.x += tpoint.x;
drawRect.y += tpoint.y; drawRect.y += tpoint.y;
BlitSurfaceStandard(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect); BlitSurfaceColoured(flipsprites[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
} }
} }
} }