forked from mirror/OpenTTD
(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.
This commit is contained in:
12
src/gfx.cpp
12
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);
|
||||
|
Reference in New Issue
Block a user