diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-06-06 11:49:25 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-06-06 11:49:25 +0800 |
commit | d7ac8dcb88a5cd93f505f1f00b1daec8ac6cceaf (patch) | |
tree | 31cd7a7425e26e64c3c1e23605da8097a949f9e4 /ui.c | |
parent | fc9ae26aacede490d32f0b31d314f2c8286d158a (diff) |
Flatten map to array of size H*W
Diffstat (limited to 'ui.c')
-rw-r--r-- | ui.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -25,10 +25,10 @@ void printrect(int y, int x, int h, int w) { refresh(); } -void printmap(char** map, int y, int x, int mapH, int mapW) { +void printmap(char* map, int y, int x, int mapH, int mapW) { for (int r = 0; r < mapH; r++) { for (int c = 0; c < mapW; c++) { - if (map[r][c] == '+') { + if (map[r * mapW + c] == '+') { mvaddch(y + r, x + 2 * c, (' ' | A_REVERSE)); addch(' ' | A_REVERSE); } else { |