diff options
author | frosch <frosch@openttd.org> | 2011-05-06 21:13:29 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-05-06 21:13:29 +0000 |
commit | 5e449b8fae1f5f9941a385a49eb1e958788809c2 (patch) | |
tree | 25417fb45b1166841824fccffbbd217810246bf6 | |
parent | 4b0a2fbe293acbfe138b788701b6e71c5356d0e8 (diff) | |
download | openttd-5e449b8fae1f5f9941a385a49eb1e958788809c2.tar.xz |
(svn r22429) -Add: some constants for specific palette colours used in the GUI.
-rw-r--r-- | src/ai/ai_gui.cpp | 2 | ||||
-rw-r--r-- | src/airport_gui.cpp | 2 | ||||
-rw-r--r-- | src/company_gui.cpp | 6 | ||||
-rw-r--r-- | src/console_gui.cpp | 2 | ||||
-rw-r--r-- | src/fios_gui.cpp | 6 | ||||
-rw-r--r-- | src/gfx.cpp | 2 | ||||
-rw-r--r-- | src/gfx_func.h | 16 | ||||
-rw-r--r-- | src/graph_gui.cpp | 6 | ||||
-rw-r--r-- | src/industry_gui.cpp | 8 | ||||
-rw-r--r-- | src/misc_gui.cpp | 6 | ||||
-rw-r--r-- | src/music_gui.cpp | 16 | ||||
-rw-r--r-- | src/network/network_content_gui.cpp | 4 | ||||
-rw-r--r-- | src/network/network_gui.cpp | 12 | ||||
-rw-r--r-- | src/newgrf_gui.cpp | 10 | ||||
-rw-r--r-- | src/news_gui.cpp | 12 | ||||
-rw-r--r-- | src/object_gui.cpp | 2 | ||||
-rw-r--r-- | src/rail_gui.cpp | 4 | ||||
-rw-r--r-- | src/smallmap_gui.cpp | 16 | ||||
-rw-r--r-- | src/station_gui.cpp | 4 | ||||
-rw-r--r-- | src/toolbar_gui.cpp | 4 | ||||
-rw-r--r-- | src/widgets/dropdown.cpp | 2 |
21 files changed, 79 insertions, 63 deletions
diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 31bcf6605..8c552a804 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -978,7 +978,7 @@ struct AIDebugWindow : public QueryStringBaseWindow { /* Check if the current line should be highlighted */ if (pos == this->highlight_row) { - GfxFillRect(r.left + 1, r.top + y, r.right - 1, r.top + y + this->resize.step_height - WD_PAR_VSEP_NORMAL, GREY_SCALE(0)); + GfxFillRect(r.left + 1, r.top + y, r.right - 1, r.top + y + this->resize.step_height - WD_PAR_VSEP_NORMAL, PC_BLACK); if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white. } diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index 378f51439..56f90b8c4 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -356,7 +356,7 @@ public: for (uint i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && i < AirportClass::GetCount(_selected_airport_class); i++) { const AirportSpec *as = AirportClass::Get(_selected_airport_class, i); if (!as->IsAvailable()) { - GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, GREY_SCALE(0), FILLRECT_CHECKER); + GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->line_height - 2, PC_BLACK, FILLRECT_CHECKER); } DrawString(r.left + WD_MATRIX_LEFT, r.right + WD_MATRIX_RIGHT, y + WD_MATRIX_TOP, as->name, ((int)i == _selected_airport_index) ? TC_WHITE : TC_BLACK); y += this->line_height; diff --git a/src/company_gui.cpp b/src/company_gui.cpp index 020258fd5..92a9d722f 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -209,7 +209,7 @@ static void DrawYearColumn(const Rect &r, int year, const Money (*tbl)[EXPENSES_ if (et == INVALID_EXPENSES) { Money cost = subtotal; subtotal = 0; - GfxFillRect(r.left, y, r.right, y, GREY_SCALE(1)); + GfxFillRect(r.left, y, r.right, y, PC_BLACK); y += EXP_LINESPACE; DrawPrice(cost, r.left, r.right, y); y += FONT_HEIGHT_NORMAL + EXP_BLOCKSPACE; @@ -222,7 +222,7 @@ static void DrawYearColumn(const Rect &r, int year, const Money (*tbl)[EXPENSES_ } } - GfxFillRect(r.left, y, r.right, y, GREY_SCALE(1)); + GfxFillRect(r.left, y, r.right, y, PC_BLACK); y += EXP_LINESPACE; DrawPrice(sum, r.left, r.right, y); } @@ -385,7 +385,7 @@ struct CompanyFinancesWindow : Window { } case CFW_LOAN_LINE: - GfxFillRect(r.left, r.top, r.right, r.top, GREY_SCALE(1)); + GfxFillRect(r.left, r.top, r.right, r.top, PC_BLACK); break; } } diff --git a/src/console_gui.cpp b/src/console_gui.cpp index c815a2f90..eb9ddf8d0 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -204,7 +204,7 @@ struct IConsoleWindow : Window { const int right = this->width - 5; - GfxFillRect(0, 0, this->width - 1, this->height - 1, GREY_SCALE(0)); + GfxFillRect(0, 0, this->width - 1, this->height - 1, PC_BLACK); int ypos = this->height - this->line_height; for (const IConsoleLine *print = IConsoleLine::Get(IConsoleWindow::scroll); print != NULL; print = print->previous) { SetDParamStr(0, print->buffer); diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 766a9678a..13c2a3532 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -351,14 +351,14 @@ public: } case SLWW_DRIVES_DIRECTORIES_LIST: { - GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, GREY_SCALE(1)); + GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK); uint y = r.top + WD_FRAMERECT_TOP; for (uint pos = this->vscroll->GetPosition(); pos < _fios_items.Length(); pos++) { const FiosItem *item = _fios_items.Get(pos); if (item == this->selected) { - GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, 156); + GfxFillRect(r.left + 1, y, r.right, y + this->resize.step_height, PC_DARK_BLUE); } DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, item->title, _fios_colours[item->type]); y += this->resize.step_height; @@ -369,7 +369,7 @@ public: case SLWW_DETAILS: { GfxFillRect(r.left + WD_FRAMERECT_LEFT, r.top + WD_FRAMERECT_TOP, - r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL * 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, GREY_SCALE(10)); + r.right - WD_FRAMERECT_RIGHT, r.top + FONT_HEIGHT_NORMAL * 2 + WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM, PC_GREY); DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL / 2 + WD_FRAMERECT_TOP, STR_SAVELOAD_DETAIL_CAPTION, TC_FROMSTRING, SA_HOR_CENTER); if (this->selected == NULL) break; diff --git a/src/gfx.cpp b/src/gfx.cpp index 21c95e2fd..5862e7ee0 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -264,7 +264,7 @@ void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3) * ....V. */ - static const byte colour = GREY_SCALE(15); + static const byte colour = PC_WHITE; GfxDrawLineUnscaled(x, y, x + dx1, y + dy1, colour); GfxDrawLineUnscaled(x, y, x + dx2, y + dy2, colour); diff --git a/src/gfx_func.h b/src/gfx_func.h index a0beed105..e864bbbb3 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -189,4 +189,20 @@ extern bool _palette_remap_grf[]; */ #define GREY_SCALE(level) (level) +static const uint8 PC_BLACK = GREY_SCALE(1); ///< Black palette colour. +static const uint8 PC_GREY = GREY_SCALE(10); ///< Grey palette colour. +static const uint8 PC_WHITE = GREY_SCALE(15); ///< White palette colour. + +static const uint8 PC_VERY_DARK_RED = 0xB2; ///< Almost-black red palette colour. +static const uint8 PC_DARK_RED = 0xB4; ///< Dark red palette colour. +static const uint8 PC_RED = 0xB8; ///< Red palette colour. + +static const uint8 PC_YELLOW = 0xBF; ///< Yellow palette colour. +static const uint8 PC_LIGHT_YELLOW = 0x44; ///< Light yellow palette colour. +static const uint8 PC_VERY_LIGHT_YELLOW = 0x45; ///< Almost-white yellow palette colour. + +static const uint8 PC_GREEN = 0xD0; ///< Green palette colour. + +static const uint8 PC_DARK_BLUE = 0x9D; ///< Dark blue palette colour. + #endif /* GFX_FUNC_H */ diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index b4bf3174a..e852e2f88 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -177,7 +177,7 @@ enum CompanyValueWidgets { struct BaseGraphWindow : Window { protected: static const int GRAPH_MAX_DATASETS = 32; - static const int GRAPH_AXIS_LINE_COLOUR = GREY_SCALE(1); + static const int GRAPH_AXIS_LINE_COLOUR = PC_BLACK; static const int GRAPH_NUM_MONTHS = 24; ///< Number of months displayed in the graph. static const int MIN_GRAPH_NUM_LINES_Y = 9; ///< Minimal number of horizontal lines to draw. @@ -977,7 +977,7 @@ struct PaymentRatesGraphWindow : BaseGraphWindow { int rect_x = clk_dif + (rtl ? r.right - 12 : r.left + WD_FRAMERECT_LEFT); - GfxFillRect(rect_x, y + clk_dif, rect_x + 8, y + 5 + clk_dif, GREY_SCALE(0)); + GfxFillRect(rect_x, y + clk_dif, rect_x + 8, y + 5 + clk_dif, PC_BLACK); GfxFillRect(rect_x + 1, y + 1 + clk_dif, rect_x + 7, y + 4 + clk_dif, cs->legend_colour); SetDParam(0, cs->name); DrawString(rtl ? r.left : x + 14 + clk_dif, (rtl ? r.right - 14 + clk_dif : r.right), y + clk_dif, STR_GRAPH_CARGO_PAYMENT_CARGO); @@ -1425,7 +1425,7 @@ struct PerformanceRatingDetailWindow : Window { ScoreID score_type = (ScoreID)(widget - PRW_SCORE_FIRST); - /* The colours used to show how the progress is going */ + /* The colours used to show how the progress is going */ int colour_done = _colour_gradient[COLOUR_GREEN][4]; int colour_notdone = _colour_gradient[COLOUR_RED][4]; diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 0de2f63a0..b50eddd91 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -396,7 +396,7 @@ public: /* Draw the name of the industry in white is selected, otherwise, in orange */ DrawString(x + MATRIX_TEXT_OFFSET, r.right - WD_MATRIX_RIGHT, y, indsp->name, selected ? TC_WHITE : TC_ORANGE); - GfxFillRect(x, y + 1, x + 10, y + 7, selected ? GREY_SCALE(15) : GREY_SCALE(0)); + GfxFillRect(x, y + 1, x + 10, y + 7, selected ? PC_WHITE : PC_BLACK); GfxFillRect(x + 1, y + 2, x + 9, y + 6, indsp->map_colour); } break; @@ -1677,7 +1677,7 @@ struct CargoesField { blob_left = xpos + BLOB_DISTANCE; blob_right = blob_left + BLOB_WIDTH; } - GfxFillRect(blob_left, ypos2 - BLOB_DISTANCE - BLOB_HEIGHT, blob_right, ypos2 - BLOB_DISTANCE, GREY_SCALE(0)); // Border + GfxFillRect(blob_left, ypos2 - BLOB_DISTANCE - BLOB_HEIGHT, blob_right, ypos2 - BLOB_DISTANCE, PC_BLACK); // Border GfxFillRect(blob_left + 1, ypos2 - BLOB_DISTANCE - BLOB_HEIGHT + 1, blob_right - 1, ypos2 - BLOB_DISTANCE - 1, indsp->map_colour); } else { DrawString(xpos, xpos2, ypos, STR_INDUSTRY_CARGOES_HOUSES, TC_FROMSTRING, SA_HOR_CENTER); @@ -1899,8 +1899,8 @@ const int CargoesField::BLOB_HEIGHT = 9; ///< Height of the industry legend c /** Width of a #CFT_CARGO field. */ const int CargoesField::CARGO_FIELD_WIDTH = HOR_CARGO_BORDER_SPACE * 2 + HOR_CARGO_WIDTH * MAX_CARGOES + HOR_CARGO_SPACE * (MAX_CARGOES - 1); -const int CargoesField::INDUSTRY_LINE_COLOUR = 191; ///< Line colour of the industry type box. -const int CargoesField::CARGO_LINE_COLOUR = 191; ///< Line colour around the cargo. +const int CargoesField::INDUSTRY_LINE_COLOUR = PC_YELLOW; ///< Line colour of the industry type box. +const int CargoesField::CARGO_LINE_COLOUR = PC_YELLOW; ///< Line colour around the cargo. /** A single row of #CargoesField. */ struct CargoesRow { diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 2a3ded6bc..bf4916278 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -930,8 +930,8 @@ struct TooltipsWindow : public Window virtual void DrawWidget(const Rect &r, int widget) const { /* There is only one widget. */ - GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(0)); - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0x44); + GfxFillRect(r.left, r.top, r.right, r.bottom, PC_BLACK); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_LIGHT_YELLOW); for (uint arg = 0; arg < this->paramcount; arg++) { SetDParam(arg, this->params[arg]); @@ -1303,7 +1303,7 @@ void QueryString::DrawEditBox(Window *w, int wid) int top = wi->pos_y; int bottom = wi->pos_y + wi->current_y - 1; - GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, GREY_SCALE(1)); + GfxFillRect(left + 1, top + 1, right - 1, bottom - 1, PC_BLACK); /* Limit the drawing of the string inside the widget boundaries */ DrawPixelInfo dpi; diff --git a/src/music_gui.cpp b/src/music_gui.cpp index c5813ca2c..b2a3cbf1c 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -370,7 +370,7 @@ struct MusicTrackSelectionWindow : public Window { { switch (widget) { case MTSW_LIST_LEFT: { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0)); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK); int y = r.top + WD_FRAMERECT_TOP; for (uint i = 0; i < NUM_SONGS_AVAILABLE; i++) { @@ -387,7 +387,7 @@ struct MusicTrackSelectionWindow : public Window { } case MTSW_LIST_RIGHT: { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0)); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK); int y = r.top + WD_FRAMERECT_TOP; for (const byte *p = _playlists[_settings_client.music.playlist]; *p != 0; p++) { @@ -592,14 +592,14 @@ struct MusicWindow : public Window { { switch (widget) { case MW_GAUGE: - GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(0)); + GfxFillRect(r.left, r.top, r.right, r.bottom, PC_BLACK); for (uint i = 0; i != 8; i++) { - int colour = 0xD0; + int colour = PC_GREEN; if (i > 4) { - colour = 0xBF; + colour = PC_YELLOW; if (i > 6) { - colour = 0xB8; + colour = PC_RED; } } GfxFillRect(r.left, r.bottom - i * 2, r.right, r.bottom - i * 2, colour); @@ -607,7 +607,7 @@ struct MusicWindow : public Window { break; case MW_TRACK_NR: { - GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, GREY_SCALE(0)); + GfxFillRect(r.left + 1, r.top + 1, r.right, r.bottom, PC_BLACK); StringID str = STR_MUSIC_TRACK_NONE; if (_song_is_active != 0 && _music_wnd_cursong != 0) { SetDParam(0, GetTrackNumber(_music_wnd_cursong - 1)); @@ -619,7 +619,7 @@ struct MusicWindow : public Window { } case MW_TRACK_NAME: { - GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, GREY_SCALE(0)); + GfxFillRect(r.left, r.top + 1, r.right - 1, r.bottom, PC_BLACK); StringID str = STR_MUSIC_TITLE_NONE; if (_song_is_active != 0 && _music_wnd_cursong != 0) { str = STR_MUSIC_TITLE_NAME; diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 7f96c48d5..b27f46083 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -455,7 +455,7 @@ public: for (ConstContentIterator iter = this->content.Get(this->vscroll->GetPosition()); iter != this->content.End() && cnt < this->vscroll->GetCapacity(); iter++, cnt++) { const ContentInfo *ci = *iter; - if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, GREY_SCALE(10)); + if (ci == this->selected) GfxFillRect(r.left + 1, y + 1, r.right - 1, y + this->resize.step_height - 1, PC_GREY); SpriteID sprite; SpriteID pal = PAL_NONE; @@ -491,7 +491,7 @@ public: int DETAIL_TITLE_HEIGHT = 5 * FONT_HEIGHT_NORMAL; /* Create the nice grayish rectangle at the details top */ - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, 157); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + DETAIL_TITLE_HEIGHT, PC_DARK_BLUE); DrawString(r.left + WD_INSET_LEFT, r.right - WD_INSET_RIGHT, r.top + FONT_HEIGHT_NORMAL + WD_INSET_TOP, STR_CONTENT_DETAIL_TITLE, TC_FROMSTRING, SA_HOR_CENTER); /* Draw the total download size */ diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index ac3e383de..305394ba2 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -382,7 +382,7 @@ protected: const NWidgetBase *nwi_info = this->GetWidget<NWidgetBase>(NGWW_INFO); /* show highlighted item with a different colour */ - if (highlight) GfxFillRect(nwi_name->pos_x + 1, y - 2, nwi_info->pos_x + nwi_info->current_x - 2, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(10)); + if (highlight) GfxFillRect(nwi_name->pos_x + 1, y - 2, nwi_info->pos_x + nwi_info->current_x - 2, y + FONT_HEIGHT_NORMAL - 1, PC_GREY); DrawString(nwi_name->pos_x + WD_FRAMERECT_LEFT, nwi_name->pos_x + nwi_name->current_x - WD_FRAMERECT_RIGHT, y, cur_item->info.server_name, TC_BLACK); @@ -610,7 +610,7 @@ public: const int detail_height = 6 + 8 + 6 + 3 * FONT_HEIGHT_NORMAL; /* Draw the right menu */ - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE); if (sel == NULL) { DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 6 + 4 + FONT_HEIGHT_NORMAL, STR_NETWORK_SERVER_LIST_GAME_INFO, TC_FROMSTRING, SA_HOR_CENTER); } else if (!sel->online) { @@ -1490,7 +1490,7 @@ struct NetworkLobbyWindow : public Window { byte company = NetworkLobbyFindCompanyIndex(pos); bool income = false; if (this->company == company) { - GfxFillRect(r.left + 1, y - 2, r.right - 1, y + FONT_HEIGHT_NORMAL, GREY_SCALE(10)); // show highlighted item with a different colour + GfxFillRect(r.left + 1, y - 2, r.right - 1, y + FONT_HEIGHT_NORMAL, PC_GREY); // show highlighted item with a different colour } DrawString(text_left, text_right, y, this->company_info[company].company_name, TC_BLACK); @@ -1510,7 +1510,7 @@ struct NetworkLobbyWindow : public Window { { const int detail_height = 12 + FONT_HEIGHT_NORMAL + 12; /* Draw info about selected company when it is selected in the left window */ - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, 157); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.top + detail_height - 1, PC_DARK_BLUE); DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + 12, STR_NETWORK_GAME_LOBBY_COMPANY_INFO, TC_FROMSTRING, SA_HOR_CENTER); if (this->company == INVALID_COMPANY || StrEmpty(this->company_info[this->company].company_name)) return; @@ -1826,7 +1826,7 @@ struct NetworkClientListPopupWindow : Window { for (const ClientListAction *action = this->actions.Begin(); action != this->actions.End(); action++, y += FONT_HEIGHT_NORMAL) { TextColour colour; if (sel-- == 0) { // Selected item, highlight it - GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(0)); + GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, PC_BLACK); colour = TC_WHITE; } else { colour = TC_BLACK; @@ -1978,7 +1978,7 @@ struct NetworkClientListWindow : Window { FOR_ALL_CLIENT_INFOS(ci) { TextColour colour; if (this->selected_item == i++) { // Selected item, highlight it - GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, GREY_SCALE(0)); + GfxFillRect(r.left + 1, y, r.right - 1, y + FONT_HEIGHT_NORMAL - 1, PC_BLACK); colour = TC_WHITE; } else { colour = TC_BLACK; diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index 9d7f2bc44..398f3c4bd 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -695,7 +695,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { { switch (widget) { case SNGRFS_FILE_LIST: { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(1)); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK); uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_FILE_LIST)->resize_y; uint y = r.top + WD_FRAMERECT_TOP; @@ -715,7 +715,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { bool h = (this->active_sel == c); PaletteID pal = this->GetPalette(c); - if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, 156); + if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, PC_DARK_BLUE); DrawSprite(SPR_SQUARE, pal, square_left, y + sprite_offset_y); if (c->error != NULL) DrawSprite(SPR_WARNING_SIGN, 0, warning_left, y + sprite_offset_y); uint txtoffset = c->error == NULL ? 0 : 10; @@ -727,7 +727,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { } case SNGRFS_AVAIL_LIST: { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(1)); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK); uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_AVAIL_LIST)->resize_y; int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2; @@ -740,7 +740,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { bool h = (c == this->avail_sel); const char *text = c->GetName(); - if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, 156); + if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, PC_DARK_BLUE); DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + offset_y, text, h ? TC_WHITE : TC_SILVER); y += step_height; } @@ -749,7 +749,7 @@ struct NewGRFWindow : public QueryStringBaseWindow { case SNGRFS_NEWGRF_INFO_TITLE: /* Create the nice grayish rectangle at the details top. */ - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 157); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_DARK_BLUE); DrawString(r.left, r.right, (r.top + r.bottom - FONT_HEIGHT_NORMAL) / 2, STR_NEWGRF_SETTINGS_INFO_TITLE, TC_FROMSTRING, SA_HOR_CENTER); break; diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 7ce0ae8be..ff21b1788 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -335,12 +335,12 @@ struct NewsWindow : Window { void DrawNewsBorder(const Rect &r) const { - GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(15)); + GfxFillRect(r.left, r.top, r.right, r.bottom, PC_WHITE); - GfxFillRect(r.left, r.top, r.left, r.bottom, GREY_SCALE(1)); - GfxFillRect(r.right, r.top, r.right, r.bottom, GREY_SCALE(1)); - GfxFillRect(r.left, r.top, r.right, r.top, GREY_SCALE(1)); - GfxFillRect(r.left, r.bottom, r.right, r.bottom, GREY_SCALE(1)); + GfxFillRect(r.left, r.top, r.left, r.bottom, PC_BLACK); + GfxFillRect(r.right, r.top, r.right, r.bottom, PC_BLACK); + GfxFillRect(r.left, r.top, r.right, r.top, PC_BLACK); + GfxFillRect(r.left, r.bottom, r.right, r.bottom, PC_BLACK); } virtual Point OnInitialPosition(const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number) @@ -425,7 +425,7 @@ struct NewsWindow : Window { break; case NTW_VEH_BKGND: - GfxFillRect(r.left, r.top, r.right, r.bottom, GREY_SCALE(10)); + GfxFillRect(r.left, r.top, r.right, r.bottom, PC_GREY); break; case NTW_VEH_NAME: diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 778967713..b04463d83 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -206,7 +206,7 @@ public: if (spec == NULL) break; if (!spec->IsAvailable()) { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0), FILLRECT_CHECKER); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER); } DrawPixelInfo tmp_dpi; /* Set up a clipping area for the preview. */ diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index aa0f19fef..6a86830a5 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -1163,7 +1163,7 @@ public: const StationSpec *statspec = StationClass::Get(_railstation.station_class, type); if (statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_AVAIL) && GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, GREY_SCALE(0), FILLRECT_CHECKER); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER); } /* Set up a clipping area for the station preview. */ @@ -1815,7 +1815,7 @@ struct BuildRailWaypointWindow : PickerWindowBase { if (statspec != NULL && HasBit(statspec->callback_mask, CBM_STATION_AVAIL) && GB(GetStationCallback(CBID_STATION_AVAILABILITY, 0, 0, statspec, NULL, INVALID_TILE), 0, 8) == 0) { - GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0, FILLRECT_CHECKER); + GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, PC_BLACK, FILLRECT_CHECKER); } } } diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index d99d51ae3..e957c1c7c 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -893,8 +893,8 @@ class SmallMapWindow : public Window { */ static inline void DrawVertMapIndicator(int x, int y, int y2) { - GfxFillRect(x, y, x, y + 3, 69); - GfxFillRect(x, y2 - 3, x, y2, 69); + GfxFillRect(x, y, x, y + 3, PC_VERY_LIGHT_YELLOW); + GfxFillRect(x, y2 - 3, x, y2, PC_VERY_LIGHT_YELLOW); } /** @@ -905,8 +905,8 @@ class SmallMapWindow : public Window { */ static inline void DrawHorizMapIndicator(int x, int x2, int y) { - GfxFillRect(x, y, x + 3, y, 69); - GfxFillRect(x2 - 3, y, x2, y, 69); + GfxFillRect(x, y, x + 3, y, PC_VERY_LIGHT_YELLOW); + GfxFillRect(x2 - 3, y, x2, y, PC_VERY_LIGHT_YELLOW); } /** @@ -952,7 +952,7 @@ class SmallMapWindow : public Window { _cur_dpi = dpi; /* Clear it */ - GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, GREY_SCALE(0)); + GfxFillRect(dpi->left, dpi->top, dpi->left + dpi->width - 1, dpi->top + dpi->height - 1, PC_BLACK); /* Which tile is displayed at (dpi->left, dpi->top)? */ int dx; @@ -1204,7 +1204,7 @@ public: DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_INDUSTRY, TC_GREY); } else { DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_INDUSTRY, TC_BLACK); - GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0)); // Outer border of the legend colour + GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK); // Outer border of the legend colour } } else if (this->map_type == SMT_OWNER && tbl->company != INVALID_COMPANY) { SetDParam(0, tbl->company); @@ -1214,13 +1214,13 @@ public: DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_COMPANY, TC_GREY); } else { DrawString(x + text_left, x + text_right, y, STR_SMALLMAP_COMPANY, TC_BLACK); - GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0)); // Outer border of the legend colour + GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK); // Outer border of the legend colour } } else { if (this->map_type == SMT_CONTOUR) SetDParam(0, tbl->height * TILE_HEIGHT_STEP); /* Anything that is not an industry or a company is using normal process */ - GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, GREY_SCALE(0)); + GfxFillRect(x + blob_left, y + 1, x + blob_right, y + row_height - 1, PC_BLACK); DrawString(x + text_left, x + text_right, y, tbl->legend); } GfxFillRect(x + blob_left + 1, y + 2, x + blob_right - 1, y + row_height - 2, tbl->colour); // Legend colour diff --git a/src/station_gui.cpp b/src/station_gui.cpp index b70e92290..b2f5a6ed2 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -168,9 +168,9 @@ static void StationsWndShowStationRating(int left, int right, int y, CargoID typ /* Draw green/red ratings bar (fits into 14 pixels) */ y += height + 2; - GfxFillRect(left + 1, y, left + 14, y, 0xB8); + GfxFillRect(left + 1, y, left + 14, y, PC_RED); rating = minu(rating, rating_full) / 16; - if (rating != 0) GfxFillRect(left + 1, y, left + rating, y, 0xD0); + if (rating != 0) GfxFillRect(left + 1, y, left + rating, y, PC_GREEN); } typedef GUIList<const Station*> GUIStationList; diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index fd6552611..4bd5efcf6 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -1133,8 +1133,8 @@ public: /* virtual */ void Draw(const Window *w) { /* Draw brown-red toolbar bg. */ - GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, 0xB2); - GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, 0xB4, FILLRECT_CHECKER); + GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_VERY_DARK_RED); + GfxFillRect(this->pos_x, this->pos_y, this->pos_x + this->current_x - 1, this->pos_y + this->current_y - 1, PC_DARK_RED, FILLRECT_CHECKER); bool rtl = _current_text_dir == TD_RTL; for (NWidgetBase *child_wid = rtl ? this->tail : this->head; child_wid != NULL; child_wid = rtl ? child_wid->prev : child_wid->next) { diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index 7e45e5f8c..d6680479c 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -248,7 +248,7 @@ struct DropdownWindow : Window { if (y + item_height < r.bottom) { bool selected = (this->selected_index == item->result); - if (selected) GfxFillRect(r.left + 2, y, r.right - 1, y + item_height - 1, GREY_SCALE(0)); + if (selected) GfxFillRect(r.left + 2, y, r.right - 1, y + item_height - 1, PC_BLACK); item->Draw(r.left, r.right, y, r.bottom, selected, colour); |