(svn r822) Use a struct instead of pairs of bytes for the string colormap.
authortron
Fri, 26 Nov 2004 16:55:35 +0000
changeset 510 b499a3da3ddc
parent 509 3217af6d2d6a
child 511 7c89b8581876
(svn r822) Use a struct instead of pairs of bytes for the string colormap.
While here give the string colormap a more canonical name.
gfx.c
table/palettes.h
--- a/gfx.c	Fri Nov 26 14:00:57 2004 +0000
+++ b/gfx.c	Fri Nov 26 16:55:35 2004 +0000
@@ -487,8 +487,8 @@
 
 		if (color != 0xFF) {
 switch_color:;
-			_string_colorremap[1] = StringColormap[color][0];
-			_string_colorremap[2] = StringColormap[color][1];
+			_string_colorremap[1] = _string_colormap[color].text;
+			_string_colorremap[2] = _string_colormap[color].shadow;
 			_color_remap_ptr = _string_colorremap;
 		}
 	}
--- a/table/palettes.h	Fri Nov 26 14:00:57 2004 +0000
+++ b/table/palettes.h	Fri Nov 26 16:55:35 2004 +0000
@@ -95,9 +95,12 @@
 };
 
 // Color table for colors in lang files (e.g. {BLACK})
-// 1st color: text
-// 2nd color: shadow
-static const byte StringColormap[17][2] = {
+typedef struct StringColor {
+	byte text;
+	byte shadow;
+} StringColor;
+
+static const StringColor _string_colormap[] = {
 	{ 150, 215 }, // BLUE
 	{  12, 215 }, // SILVER
 	{ 189, 215 }, // GOLD