Making all_green example map to honor his name.

This commit is contained in:
sergiotarxz 2021-12-08 13:05:52 +01:00
parent 98fe29c9aa
commit 1b01682f7c

View File

@ -24,6 +24,7 @@ l3tde_game_init (void) {
L3TDEGamePtr game = l3tde_game_create_default_game ();
initscr ();
start_color ();
raw ();;
keypad (stdscr, TRUE);
noecho ();
@ -68,7 +69,10 @@ l3tde_game_render_game (L3TDEGamePtr game) {
L3TDEMapNodePtr node = current_map->nodes[i][j];
L3TDEMapTerrainPtr terrain = node->terrain;
char symbol = terrain->symbol;
init_pair(1, terrain->foreground, terrain->background);
attron (COLOR_PAIR (1));
mvprintw (printing_y, printing_x, "%c", symbol);
attroff (COLOR_PAIR (1));
}
}
}
@ -147,7 +151,7 @@ l3tde_game_create_default_map (void) {
header_description, header_descrition_len);
terrain = l3tde_map_terrain_create (
terrain_name, terrain_name_len, '.', 0, 0);
terrain_name, terrain_name_len, '.', COLOR_GREEN, 0);
for (int i = 0; i < nodes_len; i++) {
nodes[i] = malloc (sizeof **nodes * nodes_len);