diff options
Diffstat (limited to 'src/display.c')
-rw-r--r-- | src/display.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/display.c b/src/display.c index 28bd823..e79ed2c 100644 --- a/src/display.c +++ b/src/display.c @@ -14,6 +14,7 @@ received a copy of the GNU General Public License along with urlg. If not, see #include <curses.h> #include <locale.h> #include <stdlib.h> +#include <string.h> #include "entity.h" @@ -135,19 +136,13 @@ void display_map(display_t *disp, struct map *map, ht_t *entities) case WALL : if (map_i > 0 && map->map[(map_i - 1) * map->width + map_j] != WALL) { - mvwprintw(disp->main, i, j, "█"); - } else if (map_i < map->width - 1 && - map->map[(map_i + 1) * map->width + map_j] != - WALL) { - mvwprintw(disp->main, i, j, "█"); - } else if (map_j > 0 && - map->map[map_i * map->width + map_j - 1] != - WALL) { - mvwprintw(disp->main, i, j, "█"); - } else if (map_j < map->width - 1 && - map->map[map_i * map->width + map_j + 1] != - WALL) { - mvwprintw(disp->main, i, j, "█"); + mvwaddch(disp->main, i, j, ACS_BLOCK); + } else if (map_i < map->width - 1 && map->map[(map_i + 1) * map->width + map_j] != WALL) { + mvwaddch(disp->main, i, j, ACS_BLOCK); + } else if (map_j > 0 && map->map[map_i * map->width + map_j - 1] != WALL) { + mvwaddch(disp->main, i, j, ACS_BLOCK); + } else if (map_j < map->width - 1 && map->map[map_i * map->width + map_j + 1] != WALL) { + mvwaddch(disp->main, i, j, ACS_BLOCK); } else { mvwaddch(disp->main, i, j, ' '); } @@ -164,9 +159,9 @@ void display_map(display_t *disp, struct map *map, ht_t *entities) while (kvp.key) { struct entity *e = kvp.val; if (e->visible) { - mvwprintw( + mvwaddch( disp->main, e->p.y - camera->p.y + 1, e->p.x - camera->p.x + 1, - e->disp_ch + e->disp_ch[0] ); } |