(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
authortron
Sat, 10 Sep 2005 07:38:03 +0000
changeset 2406 8c873205483a
parent 2405 6ac3d99f35cb
child 2407 6c378ce4d469
(svn r2932) Give the strings consisting of an up/a down arrow symbolic names
aircraft_gui.c
gfx.h
industry_gui.c
misc_gui.c
roadveh_gui.c
ship_gui.c
town_gui.c
train_gui.c
widget.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) {
--- 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);
--- 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;
--- 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;
--- 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) {
--- 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) {
--- 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;
--- 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) {
--- 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;