<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39795 >

Daniel Markstedt wrote:
> AFAIK these are the colors used to represent the terrain on the minimap.
> 
Not in GTK2, it uses the "overview_*" colors.  Perhaps somewhere else.

Anyway, it was a trivial fix to point at the [tile_*] tags, and it
eliminated the log errors.  Otherwise, saw no change in operation.

However, colors.tilespec is included by the other tilespecs; all of them
require an update to the capability: tilespec4+2007.Oct.26

Committed S2_2 revision 13897.
Committed trunk revision 13898.

Index: data/trident.tilespec
===================================================================
--- data/trident.tilespec       (revision 13896)
+++ data/trident.tilespec       (working copy)
@@ -2,7 +2,7 @@
 [tilespec]
 
 ; Format and options of this tilespec file:
-options = "+tilespec4.2007.Jul.13"
+options = "+tilespec4+2007.Oct.26"
 
 ; A simple name for the tileset specified by this file:
 name = "Trident"
Index: data/isophex.tilespec
===================================================================
--- data/isophex.tilespec       (revision 13896)
+++ data/isophex.tilespec       (working copy)
@@ -2,7 +2,7 @@
 [tilespec]
 
 ; Format and options of this tilespec file:
-options = "+tilespec4.2007.Jul.13"
+options = "+tilespec4+2007.Oct.26"
 
 ; A simple name for the tileset specified by this file:
 name = "isophex"
Index: data/amplio.tilespec
===================================================================
--- data/amplio.tilespec        (revision 13896)
+++ data/amplio.tilespec        (working copy)
@@ -2,7 +2,7 @@
 [tilespec]
 
 ; Format and options of this tilespec file:
-options = "+tilespec4.2007.Jul.13"
+options = "+tilespec4+2007.Oct.26"
 
 ; A simple name for the tileset specified by this file:
 name = "amplio"
Index: data/misc/colors.tilespec
===================================================================
--- data/misc/colors.tilespec   (revision 13896)
+++ data/misc/colors.tilespec   (working copy)
@@ -18,31 +18,61 @@
   198, 198, 198  ; race13
 }
 
-terrains = {"r", "g", "b", "terrain"
-  255, 255, 255, "Glacier"
-  255, 255, 255, "Arctic"      ; for civ1 ruleset
-   10, 123,   2, "Grassland"
-  138, 168,  60, "Plains"
-   74,  74,  74, "Tundra"
-   44,  64,  44, "Swamp"
-  212, 179, 101, "Desert"
-   54, 162,  38, "Jungle"
-   43, 107,  19, "Forest"
-  142, 121,  63, "Hills"
-  167,  77,  38, "Mountains"
+; Tile tags should match [tile_*] sections in *.tilespec(s)
+; corresponding to graphic tag in terrain.ruleset(s)
+tiles = {"r", "g", "b", "tag"
+    0,   0, 220, "coast"
+    0,   0, 200, "shelf"
 
-    0,   0, 220, "Ocean"
-    0,   0, 220, "Coast"
-    0,   0, 220, "Lake"
-    0,   0, 220, "Sea"
-    0,   0, 200, "Shelf"
+    0,   0, 170, "floor"
+    0,   0, 170, "trench"
+    0,   0, 170, "ridge"
+    0,   0, 170, "vent"
 
-    0,   0, 170, "Deep Ocean"
-    0,   0, 170, "Briny Deep"
-    0,   0, 170, "Abyss"
-    0,   0, 170, "Oceanic Ridge"
-    0,   0, 170, "Oceanic Vent"
-    0,   0, 170, "Water"
+  255, 255, 255, "arctic"
+  255, 255, 255, "icy_plain"
+  255, 255, 255, "icy_hills"
+
+  212, 179, 101, "desert"
+  212, 179, 101, "desert_plain"
+  212, 179, 101, "desert_hills"
+
+   43, 107,  19, "forest"
+   43, 107,  19, "brown_coniferous"
+   43, 107,  19, "brown_deciduous"
+   43, 107,  19, "brown_hills_coniferous"
+   43, 107,  19, "brown_hills_deciduous"
+   43, 107,  19, "green_coniferous"
+   43, 107,  19, "green_deciduous"
+   43, 107,  19, "green_hills_coniferous"
+   43, 107,  19, "green_hills_deciduous"
+   43, 107,  19, "swamp_coniferous"
+   43, 107,  19, "swamp_deciduous"
+
+   10, 123,   2, "grassland"
+   10, 123,   2, "green_hills"
+
+  142, 121,  63, "hills"
+  142, 121,  63, "brown_hills"
+
+   54, 162,  38, "jungle"
+   54, 162,  38, "brown_jungle"
+   54, 162,  38, "brown_hills_jungle"
+   54, 162,  38, "green_jungle"
+   54, 162,  38, "green_hills_jungle"
+   54, 162,  38, "swamp_jungle"
+
+  138, 168,  60, "plains"
+
+  167,  77,  38, "mountains"
+  167,  77,  38, "icy_peaks"
+  167,  77,  38, "volcano"
+  167,  77,  38, "icy_volcano"
+
+   44,  64,  44, "swamp"
+
+   74,  74,  74, "tundra"
+   74,  74,  74, "tundra_hills"
 }
 
 ; Mapview
@@ -90,7 +120,7 @@
     255,   0,   0
 }
 overview_ocean = {"r", "g", "b"
-; Generic ocean, not the same as the Ocean terrain (see "terrains" above)
+; Generic ocean, not the same as the Ocean terrain (see "tiles" above)
     0,     0, 200
 }
 overview_ground = {"r", "g", "b"
Index: data/isotrident.tilespec
===================================================================
--- data/isotrident.tilespec    (revision 13896)
+++ data/isotrident.tilespec    (working copy)
@@ -2,7 +2,7 @@
 [tilespec]
 
 ; Format and options of this tilespec file:
-options = "+tilespec4.2007.Jul.13"
+options = "+tilespec4+2007.Oct.26"
 
 ; A simple name for the tileset specified by this file:
 name = "MacroIsoTrident"
Index: data/hex2t.tilespec
===================================================================
--- data/hex2t.tilespec (revision 13896)
+++ data/hex2t.tilespec (working copy)
@@ -2,7 +2,7 @@
 [tilespec]
 
 ; Format and options of this tilespec file:
-options = "+tilespec4.2007.Jul.13"
+options = "+tilespec4+2007.Oct.26"
 
 ; A simple name for the tileset specified by this file:
 name = "hex-2 tileset"
Index: client/colors_common.c
===================================================================
--- client/colors_common.c      (revision 13896)
+++ client/colors_common.c      (working copy)
@@ -148,15 +148,15 @@
     struct rgbcolor *rgb;
     char *key;
 
-    if (!section_file_lookup(file, "colors.terrains%d.r", i)) {
+    if (!section_file_lookup(file, "colors.tiles%d.r", i)) {
       break;
     }
     rgb = fc_malloc(sizeof(*rgb));
-    rgb->r = secfile_lookup_int(file, "colors.terrains%d.r", i);
-    rgb->g = secfile_lookup_int(file, "colors.terrains%d.g", i);
-    rgb->b = secfile_lookup_int(file, "colors.terrains%d.b", i);
+    rgb->r = secfile_lookup_int(file, "colors.tiles%d.r", i);
+    rgb->g = secfile_lookup_int(file, "colors.tiles%d.g", i);
+    rgb->b = secfile_lookup_int(file, "colors.tiles%d.b", i);
     rgb->color = NULL;
-    key = secfile_lookup_str(file, "colors.terrains%d.terrain", i);
+    key = secfile_lookup_str(file, "colors.tiles%d.tag", i);
 
     if (!hash_insert(colors->terrain_hash, mystrdup(key), rgb)) {
       freelog(LOG_ERROR, "warning: already have a color for %s", key);
@@ -170,15 +170,17 @@
   Called when terrain info is received from the server.
 ****************************************************************************/
 void color_system_setup_terrain(struct color_system *colors,
-                               const struct terrain *pterrain)
+                               const struct terrain *pterrain,
+                               const char *tag)
 {
   struct rgbcolor *rgb
-    = hash_lookup_data(colors->terrain_hash, terrain_rule_name(pterrain));
+    = hash_lookup_data(colors->terrain_hash, tag);
 
   if (rgb) {
     colors->terrain_colors[terrain_index(pterrain)] = *rgb;
   } else {
-    freelog(LOG_ERROR, "No color for terrain '%s'", 
terrain_rule_name(pterrain));
+    freelog(LOG_ERROR, "[colors] missing [tile_%s] for \"%s\".",
+            tag, terrain_rule_name(pterrain));
     /* Fallback: the color remains black. */
   }
 }
Index: client/colors_common.h
===================================================================
--- client/colors_common.h      (revision 13896)
+++ client/colors_common.h      (working copy)
@@ -74,7 +74,8 @@
 /* Functions used by the tileset to allocate the color system. */
 struct color_system *color_system_read(struct section_file *file);
 void color_system_setup_terrain(struct color_system *colors,
-                               const struct terrain *pterrain);
+                               const struct terrain *pterrain,
+                               const char *tag);
 void color_system_free(struct color_system *colors);
 
 #endif /* FC__COLORS_COMMON_H */
Index: client/tilespec.c
===================================================================
--- client/tilespec.c   (revision 13896)
+++ client/tilespec.c   (working copy)
@@ -59,7 +59,7 @@
 
 #include "tilespec.h"
 
-#define TILESPEC_CAPSTR "+tilespec4.2007.Jul.13 duplicates_ok"
+#define TILESPEC_CAPSTR "+tilespec4+2007.Oct.26 duplicates_ok"
 /*
  * Tilespec capabilities acceptable to this program:
  *
@@ -1281,6 +1281,7 @@
   char *file_capstr;
   bool duplicates_ok, is_hex;
   enum direction8 dir;
+  const int spl = strlen(TILE_SECTION_PREFIX);
   struct tileset *t = tileset_new();
 
   fname = tilespec_fullname(tileset_name);
@@ -1477,7 +1478,7 @@
     char *sprite_type;
     int l;
 
-    draw->name = mystrdup(sections[i] + strlen(TILE_SECTION_PREFIX));
+    draw->name = mystrdup(sections[i] + spl);
     draw->blending = secfile_lookup_int_default(file, 0,
                                                "%s.is_blended",
                                                sections[i]);
@@ -3016,7 +3017,7 @@
 
   t->sprites.drawing[terrain_index(pterrain)] = draw;
 
-  color_system_setup_terrain(t->color_system, pterrain);
+  color_system_setup_terrain(t->color_system, pterrain, draw->name);
 }
 
 /**********************************************************************
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to