diff options
author | peter1138 <peter1138@openttd.org> | 2014-10-05 21:18:37 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2014-10-05 21:18:37 +0000 |
commit | 5a924dcbbc25762ec770a32e6f14c2798bf9f92f (patch) | |
tree | d7bce9c379945f3c0740f787f1c7cdbb540f2ce6 /src/gfx.cpp | |
parent | 9ab2263fda4bda2477ed6bf69ed26e03bb989155 (diff) | |
download | openttd-5a924dcbbc25762ec770a32e6f14c2798bf9f92f.tar.xz |
(svn r26965) -Codechange: Add palette bit to indicate that palette is actually a text colour remap, and draw closebox as a sprite, using said bit. Change news popup to use closebox widget for its closebox.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index e90e2babf..5a1f75abc 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -797,7 +797,11 @@ void DrawSpriteViewport(SpriteID img, PaletteID pal, int x, int y, const SubSpri _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; GfxMainBlitterViewport(GetSprite(real_sprite, ST_NORMAL), x, y, BM_TRANSPARENT, sub, real_sprite); } else if (pal != PAL_NONE) { - _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + if (HasBit(pal, PALETTE_TEXT_RECOLOUR)) { + SetColourRemap((TextColour)GB(pal, 0, PALETTE_WIDTH)); + } else { + _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + } GfxMainBlitterViewport(GetSprite(real_sprite, ST_NORMAL), x, y, pal == PALETTE_CRASH ? BM_CRASH_REMAP : BM_COLOUR_REMAP, sub, real_sprite); } else { GfxMainBlitterViewport(GetSprite(real_sprite, ST_NORMAL), x, y, BM_NORMAL, sub, real_sprite); @@ -820,7 +824,11 @@ void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub, _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; GfxMainBlitter(GetSprite(real_sprite, ST_NORMAL), x, y, BM_TRANSPARENT, sub, real_sprite, zoom); } else if (pal != PAL_NONE) { - _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + if (HasBit(pal, PALETTE_TEXT_RECOLOUR)) { + SetColourRemap((TextColour)GB(pal, 0, PALETTE_WIDTH)); + } else { + _colour_remap_ptr = GetNonSprite(GB(pal, 0, PALETTE_WIDTH), ST_RECOLOUR) + 1; + } GfxMainBlitter(GetSprite(real_sprite, ST_NORMAL), x, y, pal == PALETTE_CRASH ? BM_CRASH_REMAP : BM_COLOUR_REMAP, sub, real_sprite, zoom); } else { GfxMainBlitter(GetSprite(real_sprite, ST_NORMAL), x, y, BM_NORMAL, sub, real_sprite, zoom); |