changeset 33:ac2d809a3dda

Preparation for ANSI support
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 11 Dec 2006 05:34:18 +0000
parents c41ec03eac99
children 0a64a6b521cf
files maputils.c maputils.h
diffstat 2 files changed, 20 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/maputils.c	Mon Dec 11 05:33:47 2006 +0000
+++ b/maputils.c	Mon Dec 11 05:34:18 2006 +0000
@@ -7,25 +7,23 @@
 #include "th_util.h"
 
 color_t mapColors[] = {
-{ "#000000" },
-{ "#0000bb" },
-{ "#bb0000" },
-{ "#bbbb00" },
-
-{ "#00bb00" },
-{ "#bbbbbb" },
-{ "#00ffff" },
-{ "#770077" },
+{ "#000000", 0 },
+{ "#0000bb", 1 },
+{ "#bb0000", 2 },
+{ "#bbbb00", 3 },
+{ "#00bb00", 4 },
+{ "#bbbbbb", 5 },
+{ "#00ffff", 6 },
+{ "#770077", 7 },
 
-{ "#777777" },
-{ "#0000ff" },
-{ "#ff0000" },
-{ "#ffff00" },
-
-{ "#00ff00" },
-{ "#ffffff" },
-{ "#00ffff" },
-{ "#ff00ff" },
+{ "#777777", 8 },
+{ "#0000ff", 9 },
+{ "#ff0000", 10 },
+{ "#ffff00", 11 },
+{ "#00ff00", 12 },
+{ "#ffffff", 13 },
+{ "#00ffff", 14 },
+{ "#ff00ff", 15 },
 };
 
 const DINT nmapColors = (sizeof(mapColors) / sizeof(color_t));
@@ -40,7 +38,7 @@
 { '|', "Road",			col_light_black },
 { '/', "Road",			col_light_black },
 { '\\',"Road",			col_light_black },
-{ '.', "Plains",		col_green },
+{ '.', "Plains",		col_light_green },
 { '=', "Bridge",		col_light_black },
 { '?', "Scenic Location",	col_light_white },
 { '@', "Flowing Lava",		col_light_red },
@@ -99,8 +97,8 @@
 	
 	for (n = 0; n < nmapColors; n++) {
 		fprintf(o,
-		"  span.c%d { color: %s; }\n",
-		n, mapColors[n].css);
+		"  span.%c { color: %s; }\n",
+		'a'+n, mapColors[n].css);
 	}
 	
 }
--- a/maputils.h	Mon Dec 11 05:33:47 2006 +0000
+++ b/maputils.h	Mon Dec 11 05:34:18 2006 +0000
@@ -22,6 +22,7 @@
 
 typedef struct {
 	DCHAR *css;
+	DINT ansi;
 } color_t;