# HG changeset patch # User tron # Date 1126337883 0 # Node ID be5cfb8cd20d1efbfd4d6bbdb8a75eacae6231db # Parent 15bd795d36141c069ad293847ee3d44dea746168 (svn r2932) Give the strings consisting of an up/a down arrow symbolic names diff -r 15bd795d3614 -r be5cfb8cd20d aircraft_gui.c --- a/aircraft_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/aircraft_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -1051,7 +1051,7 @@ /* draw sorting criteria string */ DrawString(85, 15, _vehicle_sort_listing[vl->sort_type], 0x10); /* draw arrow pointing up/down for ascending/descending sorting */ - DoDrawString(vl->flags & VL_DESC ? "\xAA" : "\xA0", 69, 15, 0x10); + DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); for (i = w->vscroll.pos; i < max; ++i) { diff -r 15bd795d3614 -r be5cfb8cd20d gfx.h --- a/gfx.h Sat Sep 10 06:39:36 2005 +0000 +++ b/gfx.h Sat Sep 10 07:38:03 2005 +0000 @@ -38,6 +38,13 @@ void RedrawScreenRect(int left, int top, int right, int bottom); void GfxScroll(int left, int top, int width, int height, int xo, int yo); + +// XXX doesn't really belong here, but the only +// consumers always use it in conjunction with DoDrawString() +#define UPARROW "\xA0" +#define DOWNARROW "\xAA" + + int DrawStringCentered(int x, int y, StringID str, uint16 color); int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color); int DoDrawStringCentered(int x, int y, const char *str, uint16 color); diff -r 15bd795d3614 -r be5cfb8cd20d industry_gui.c --- a/industry_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/industry_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -581,7 +581,7 @@ SetVScrollCount(w, _num_industry_sort); DrawWindowWidgets(w); - DoDrawString(_industry_sort_order & 1 ? "\xAA" : "\xA0", _indicator_positions[_industry_sort_order>>1], 15, 0x10); + DoDrawString(_industry_sort_order & 1 ? DOWNARROW : UPARROW, _indicator_positions[_industry_sort_order>>1], 15, 0x10); p = w->vscroll.pos; n = 0; diff -r 15bd795d3614 -r be5cfb8cd20d misc_gui.c --- a/misc_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/misc_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -1246,7 +1246,7 @@ } GfxFillRect(w->widget[6].left + 1, w->widget[6].top + 1, w->widget[6].right, w->widget[6].bottom, 0xD7); - DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? w->widget[3].right - 9 : w->widget[2].right - 9, 15, 0x10); + DoDrawString(_savegame_sort_order & 1 ? DOWNARROW : UPARROW, _savegame_sort_order <= 1 ? w->widget[3].right - 9 : w->widget[2].right - 9, 15, 0x10); y = w->widget[6].top + 1; pos = w->vscroll.pos; @@ -1489,7 +1489,7 @@ SetVScrollCount(w, _fios_num); DrawWindowWidgets(w); - DoDrawString(_savegame_sort_order & 1 ? "\xAA" : "\xA0", _savegame_sort_order <= 1 ? w->widget[4].right - 9 : w->widget[3].right - 9, 15, 0x10); + DoDrawString(_savegame_sort_order & 1 ? DOWNARROW : UPARROW, _savegame_sort_order <= 1 ? w->widget[4].right - 9 : w->widget[3].right - 9, 15, 0x10); DrawString(4, 32, STR_4010_GENERATE_RANDOM_NEW_GAME, 9); y = list_start; diff -r 15bd795d3614 -r be5cfb8cd20d roadveh_gui.c --- a/roadveh_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/roadveh_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -926,7 +926,7 @@ /* draw sorting criteria string */ DrawString(85, 15, _vehicle_sort_listing[vl->sort_type], 0x10); /* draw arrow pointing up/down for ascending/descending sorting */ - DoDrawString(vl->flags & VL_DESC ? "\xAA" : "\xA0", 69, 15, 0x10); + DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); for (i = w->vscroll.pos; i < max; ++i) { diff -r 15bd795d3614 -r be5cfb8cd20d ship_gui.c --- a/ship_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/ship_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -1030,7 +1030,7 @@ /* draw sorting criteria string */ DrawString(85, 15, _vehicle_sort_listing[vl->sort_type], 0x10); /* draw arrow pointing up/down for ascending/descending sorting */ - DoDrawString(vl->flags & VL_DESC ? "\xAA" : "\xA0", 69, 15, 0x10); + DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); for (i = w->vscroll.pos; i < max; ++i) { diff -r 15bd795d3614 -r be5cfb8cd20d town_gui.c --- a/town_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/town_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -436,7 +436,7 @@ SetVScrollCount(w, _num_town_sort); DrawWindowWidgets(w); - DoDrawString(_town_sort_order & 1 ? "\xAA" : "\xA0", (_town_sort_order <= 1) ? 88 : 187, 15, 0x10); + DoDrawString(_town_sort_order & 1 ? DOWNARROW : UPARROW, (_town_sort_order <= 1) ? 88 : 187, 15, 0x10); { Town *t; diff -r 15bd795d3614 -r be5cfb8cd20d train_gui.c --- a/train_gui.c Sat Sep 10 06:39:36 2005 +0000 +++ b/train_gui.c Sat Sep 10 07:38:03 2005 +0000 @@ -1403,7 +1403,7 @@ /* draw sorting criteria string */ DrawString(85, 15, _vehicle_sort_listing[vl->sort_type], 0x10); /* draw arrow pointing up/down for ascending/descending sorting */ - DoDrawString(vl->flags & VL_DESC ? "\xAA" : "\xA0", 69, 15, 0x10); + DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); for (i = w->vscroll.pos; i < max; ++i) { diff -r 15bd795d3614 -r be5cfb8cd20d widget.c --- a/widget.c Sat Sep 10 06:39:36 2005 +0000 +++ b/widget.c Sat Sep 10 07:38:03 2005 +0000 @@ -274,11 +274,11 @@ // draw up/down buttons clicked = !!((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_UP); DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color, (clicked) ? FR_LOWERED : 0); - DoDrawString("\xA0", r.left + 2 + clicked, r.top + clicked, 0x10); + DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, 0x10); clicked = !!(((w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == WF_SCROLL_DOWN)); DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0); - DoDrawString("\xAA", r.left + 2 + clicked, r.bottom - 9 + clicked, 0x10); + DoDrawString(DOWNARROW, r.left + 2 + clicked, r.bottom - 9 + clicked, 0x10); c1 = _color_list[wi->color&0xF].window_color_1a; c2 = _color_list[wi->color&0xF].window_color_2; @@ -306,11 +306,11 @@ // draw up/down buttons clicked = !!((w->flags4 & (WF_SCROLL_UP | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_UP | WF_SCROLL2)); DrawFrameRect(r.left, r.top, r.right, r.top + 9, wi->color, (clicked) ? FR_LOWERED : 0); - DoDrawString("\xA0", r.left + 2 + clicked, r.top + clicked, 0x10); + DoDrawString(UPARROW, r.left + 2 + clicked, r.top + clicked, 0x10); clicked = !!((w->flags4 & (WF_SCROLL_DOWN | WF_HSCROLL | WF_SCROLL2)) == (WF_SCROLL_DOWN | WF_SCROLL2)); DrawFrameRect(r.left, r.bottom - 9, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : 0); - DoDrawString("\xAA", r.left + 2 + clicked, r.bottom - 9 + clicked, 0x10); + DoDrawString(DOWNARROW, r.left + 2 + clicked, r.bottom - 9 + clicked, 0x10); c1 = _color_list[wi->color&0xF].window_color_1a; c2 = _color_list[wi->color&0xF].window_color_2;