From 650dd2d80facdb008ba679cbd1988178f686d765 Mon Sep 17 00:00:00 2001 From: Martin Read Date: Tue, 12 Nov 2013 15:31:50 +0000 Subject: [PATCH] Use the terrain properties array to get symbols and colours for terrain --- display-nc.cc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/display-nc.cc b/display-nc.cc index faa6524..6bef344 100644 --- a/display-nc.cc +++ b/display-nc.cc @@ -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) { -- 2.11.0