From 2c41b8ee97f4b6211a4cb88dc4df460b615470fb Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 25 Dec 2010 19:47:15 +0000 Subject: (svn r21637) -Codechange: make it more clear that IS_PALETTE_COLOUR belongs to TextColour --- src/company_cmd.cpp | 4 ++-- src/gfx.cpp | 4 ++-- src/gfx_type.h | 2 +- src/network/network_chat_gui.cpp | 2 +- src/viewport.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp index 3e9cf9463..40a603916 100644 --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -118,8 +118,8 @@ void SetLocalCompany(CompanyID new_company) */ 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; } /** diff --git a/src/gfx.cpp b/src/gfx.cpp index 44c480cfb..594a2d2cb 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -284,8 +284,8 @@ static void SetColourRemap(TextColour colour) { 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; diff --git a/src/gfx_type.h b/src/gfx_type.h index b1ee21172..0442fa3d8 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -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) diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 28a3afc99..dc6b4005f 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -103,7 +103,7 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint duration, const char *m /* 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 diff --git a/src/viewport.cpp b/src/viewport.cpp index ef78356c4..3fcc45125 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1407,9 +1407,9 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDrawVect /* 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, -- cgit v1.2.3-70-g09d2