Changeset - r16895:a79cc0d003c2
[Not reviewed]
master
0 2 0
rubidium - 13 years ago 2010-12-25 20:02:04
rubidium@openttd.org
(svn r21640) -Change/Feature-ish: allow disabling the shading when drawing text
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -283,15 +283,15 @@ void DrawBox(int x, int y, int dx1, int 
 
static void SetColourRemap(TextColour colour)
 
{
 
	if (colour == TC_INVALID) return;
 

	
 
	/* 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);
 
	_colour_remap_ptr = _string_colourremap;
 
}
 

	
src/gfx_type.h
Show inline comments
 
@@ -222,12 +222,13 @@ enum TextColour {
 
	TC_GREY        = 0x0E,
 
	TC_DARK_BLUE   = 0x0F,
 
	TC_BLACK       = 0x10,
 
	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)
 

	
 
/** Defines a few values that are related to animations using palette changes */
 
enum PaletteAnimationSizes {
 
	PALETTE_ANIM_SIZE_WIN   = 28,   ///< number of animated colours in Windows palette
0 comments (0 inline, 0 general)