Use the terrain properties array to get symbols and colours for terrain
authorMartin Read <martin@blackswordsonics.com>
Tue, 12 Nov 2013 15:31:50 +0000 (15:31 +0000)
committerMartin Read <martin@blackswordsonics.com>
Tue, 12 Nov 2013 15:31:50 +0000 (15:31 +0000)
display-nc.cc

index faa6524..6bef344 100644 (file)
@@ -103,17 +103,6 @@ short colour_cpairs[1 + LAST_COLOUR] =
     Gcol_l_grey // Silver = white
 };
 
-wchar_t terrain_wchars[NUM_TERRAINS] = 
-{
-    L'█', L'█', L'+', L'·', L'_', L'>', L'{', L'{'
-};
-
-short terrain_cpairs[NUM_TERRAINS] =
-{
-    Gcol_brown, 0, 0, 0,
-    0, 0, Gcol_red, Gcol_blue
-};
-
 attr_t terrain_attrs[NUM_TERRAINS] =
 {
     0, 0, 0, 0,
@@ -339,9 +328,11 @@ int display_init(void)
     for (i = 0; i < NUM_TERRAINS; ++i)
     {
         wchar_t wch[2];
-        wch[0] = terrain_wchars[i];
+        /* policy decision: for now we don't support use of combining
+         * characters for terrain. */
+        mbtowc(wch, terrain_props[i].unicode, 4);
         wch[1] = 0;
-        setcchar(terrain_tiles + i, wch, terrain_attrs[i], terrain_cpairs[i], NULL);
+        setcchar(terrain_tiles + i, wch, terrain_attrs[i], colour_cpairs[terrain_props[i].colour], NULL);
     }
     for (i = 0; i < NUM_OF_PERMOBJS; ++i)
     {