Re-color one-way tiles to match their tileset

One-ways have always had this problem where they're always yellow. That
means unless you specifically use yellow, it'll never match the tileset.

The best way to fix this without requiring new graphics or changing
existing ones is to simply re-tint the one-way with the given color of
the room. That way, the black part of the tile is still black, but the
yellow is now some other color.
This commit is contained in:
Misa
2020-06-30 11:47:22 -07:00
committed by Ethan Lee
parent b5783007b3
commit e84194db55
3 changed files with 230 additions and 4 deletions

View File

@@ -636,8 +636,20 @@ void Graphics::drawtile( int x, int y, int t )
{
return;
}
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
BlitSurfaceStandard(tiles[t], NULL, backBuffer, &rect);
#if !defined(NO_CUSTOM_LEVELS)
if (t >= 14 && t <= 17)
{
colourTransform thect = {ed.getonewaycol()};
BlitSurfaceTinted(tiles[t], NULL, backBuffer, &rect, thect);
}
else
#endif
{
BlitSurfaceStandard(tiles[t], NULL, backBuffer, &rect);
}
}
@@ -647,8 +659,20 @@ void Graphics::drawtile2( int x, int y, int t )
{
return;
}
SDL_Rect rect = { Sint16(x), Sint16(y), tiles_rect.w, tiles_rect.h };
BlitSurfaceStandard(tiles2[t], NULL, backBuffer, &rect);
#if !defined(NO_CUSTOM_LEVELS)
if (t >= 14 && t <= 17)
{
colourTransform thect = {ed.getonewaycol()};
BlitSurfaceTinted(tiles2[t], NULL, backBuffer, &rect, thect);
}
else
#endif
{
BlitSurfaceStandard(tiles2[t], NULL, backBuffer, &rect);
}
}
@@ -3088,14 +3112,36 @@ void Graphics::drawforetile(int x, int y, int t)
{
SDL_Rect rect;
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
BlitSurfaceStandard(tiles[t],NULL, foregroundBuffer, &rect );
#if !defined(NO_CUSTOM_LEVELS)
if (t >= 14 && t <= 17)
{
colourTransform thect = {ed.getonewaycol()};
BlitSurfaceTinted(tiles[t], NULL, foregroundBuffer, &rect, thect);
}
else
#endif
{
BlitSurfaceStandard(tiles[t],NULL, foregroundBuffer, &rect );
}
}
void Graphics::drawforetile2(int x, int y, int t)
{
SDL_Rect rect;
setRect(rect, x,y,tiles_rect.w, tiles_rect.h);
BlitSurfaceStandard(tiles2[t],NULL, foregroundBuffer, &rect );
#if !defined(NO_CUSTOM_LEVELS)
if (t >= 14 && t <= 17)
{
colourTransform thect = {ed.getonewaycol()};
BlitSurfaceTinted(tiles2[t], NULL, foregroundBuffer, &rect, thect);
}
else
#endif
{
BlitSurfaceStandard(tiles2[t],NULL, foregroundBuffer, &rect );
}
}
void Graphics::drawforetile3(int x, int y, int t, int off)