diff options
author | rubidium <rubidium@openttd.org> | 2010-12-25 20:02:04 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2010-12-25 20:02:04 +0000 |
commit | 9b2a54bfbf418952941a4b4e62a21c1f96281129 (patch) | |
tree | 4e5c3b66614442bdd76b70c7cf5537d442c52429 /src | |
parent | 1d21903eb40cc4463c3fd01a4e14129a14b07445 (diff) | |
download | openttd-9b2a54bfbf418952941a4b4e62a21c1f96281129.tar.xz |
(svn r21640) -Change/Feature-ish: allow disabling the shading when drawing text
Diffstat (limited to 'src')
-rw-r--r-- | src/gfx.cpp | 4 | ||||
-rw-r--r-- | src/gfx_type.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 0a61805ca..61df67745 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -286,9 +286,9 @@ static void SetColourRemap(TextColour colour) /* Black strings have no shading ever; the shading is black, so it * would be invisible at best, but it actually makes it illegible. */ - bool no_shade = colour == TC_BLACK; + bool no_shade = colour & TC_NO_SHADE || colour == TC_BLACK; bool raw_colour = colour & TC_IS_PALETTE_COLOUR; - colour &= ~TC_IS_PALETTE_COLOUR; + colour &= ~(TC_NO_SHADE | TC_IS_PALETTE_COLOUR); _string_colourremap[1] = raw_colour ? (byte)colour : _string_colourmap[_use_palette][colour]; _string_colourremap[2] = no_shade ? 0 : (_use_palette == PAL_DOS ? 1 : 215); diff --git a/src/gfx_type.h b/src/gfx_type.h index 0442fa3d8..e99e3414d 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -225,6 +225,7 @@ enum TextColour { TC_INVALID = 0xFF, TC_IS_PALETTE_COLOUR = 0x100, ///< Colour value is already a real palette colour index, not an index of a StringColour. + TC_NO_SHADE = 0x200, ///< Do not add shading to this text colour. }; DECLARE_ENUM_AS_BIT_SET(TextColour) |