Changeset - r16892:366c9fbdb3a0
[Not reviewed]
master
0 5 0
rubidium - 13 years ago 2010-12-25 19:47:15
rubidium@openttd.org
(svn r21637) -Codechange: make it more clear that IS_PALETTE_COLOUR belongs to TextColour
5 files changed with 8 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/company_cmd.cpp
Show inline comments
 
@@ -118,8 +118,8 @@ void SetLocalCompany(CompanyID new_compa
 
 */
 
uint16 GetDrawStringCompanyColour(CompanyID company)
 
{
 
	if (!Company::IsValidID(company)) return _colour_gradient[COLOUR_WHITE][4] | IS_PALETTE_COLOUR;
 
	return (_colour_gradient[_company_colours[company]][4]) | IS_PALETTE_COLOUR;
 
	if (!Company::IsValidID(company)) return _colour_gradient[COLOUR_WHITE][4] | TC_IS_PALETTE_COLOUR;
 
	return (_colour_gradient[_company_colours[company]][4]) | TC_IS_PALETTE_COLOUR;
 
}
 

	
 
/**
src/gfx.cpp
Show inline comments
 
@@ -284,8 +284,8 @@ static void SetColourRemap(TextColour co
 
{
 
	if (colour == TC_INVALID) return;
 

	
 
	if (colour & IS_PALETTE_COLOUR) {
 
		_string_colourremap[1] = colour & ~IS_PALETTE_COLOUR;
 
	if (colour & TC_IS_PALETTE_COLOUR) {
 
		_string_colourremap[1] = colour & ~TC_IS_PALETTE_COLOUR;
 
		_string_colourremap[2] = (_use_palette == PAL_DOS) ? 1 : 215;
 
	} else {
 
		_string_colourremap[1] = _string_colourmap[_use_palette][colour].text;
src/gfx_type.h
Show inline comments
 
@@ -224,7 +224,7 @@ enum TextColour {
 
	TC_BLACK       = 0x10,
 
	TC_INVALID     = 0xFF,
 

	
 
	IS_PALETTE_COLOUR = 0x100, ///< colour value is already a real palette colour index, not an index of a StringColour
 
	TC_IS_PALETTE_COLOUR = 0x100, ///< Colour value is already a real palette colour index, not an index of a StringColour.
 
};
 
DECLARE_ENUM_AS_BIT_SET(TextColour)
 

	
src/network/network_chat_gui.cpp
Show inline comments
 
@@ -103,7 +103,7 @@ void CDECL NetworkAddChatMessage(TextCol
 

	
 
		/* The default colour for a message is company colour. Replace this with
 
		 * white for any additional lines */
 
		cmsg->colour = (bufp == buf && (colour & IS_PALETTE_COLOUR)) ? colour : TC_WHITE;
 
		cmsg->colour = (bufp == buf && (colour & TC_IS_PALETTE_COLOUR)) ? colour : TC_WHITE;
 
		cmsg->remove_time = _realtime_tick + duration * 1000;
 

	
 
		bufp += strlen(bufp) + 1; // jump to 'next line' in the formatted string
src/viewport.cpp
Show inline comments
 
@@ -1407,9 +1407,9 @@ static void ViewportDrawStrings(DrawPixe
 
			/* if we didn't draw a rectangle, or if transparant building is on,
 
			 * draw the text in the colour the rectangle would have */
 
			if (IsTransparencySet(TO_SIGNS) && ss->string != STR_WHITE_SIGN) {
 
				/* Real colours need the IS_PALETTE_COLOUR flag
 
				/* Real colours need the TC_IS_PALETTE_COLOUR flag
 
				 * otherwise colours from _string_colourmap are assumed. */
 
				colour = (TextColour)_colour_gradient[ss->colour][6] | IS_PALETTE_COLOUR;
 
				colour = (TextColour)_colour_gradient[ss->colour][6] | TC_IS_PALETTE_COLOUR;
 
			}
 

	
 
			/* Draw the rectangle if 'tranparent station signs' is off,
0 comments (0 inline, 0 general)