X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fdraw_wins.c;h=1a0d128744fc67b4c77dfbfecebf95236cf9dfc7;hb=2b514e7114696bca61891f4a6d6576d002f47c0b;hp=5b876462837ed398b40c5fc329387ef82e393f31;hpb=6dbb8b2dc9c4e33081e5e1d21880f1d7968987a6;p=plomrogue diff --git a/src/client/draw_wins.c b/src/client/draw_wins.c index 5b87646..1a0d128 100644 --- a/src/client/draw_wins.c +++ b/src/client/draw_wins.c @@ -349,43 +349,43 @@ extern void draw_win_log(struct Win * win) extern void draw_win_map(struct Win * win) { + uint16_t x, y; init_pair(1, COLOR_WHITE, COLOR_BLUE); init_pair(2, COLOR_BLUE, COLOR_BLACK); - attr_t attr_fov = 0; attr_t attr_mem = COLOR_PAIR(2); attr_t attr_sha = COLOR_PAIR(1); - try_resize_winmap(win, world.map.length, world.map.length * 2); - uint16_t x, y, z; - for (y = 0, z = 0; y < world.map.length; y++) + try_resize_winmap(win, world.map.length, world.map.length * 2 + 1); + for (y = 0; y < world.map.length; y++) { for (x = 0; x < world.map.length; x++) { - attr_t attr_c = ' ' == world.mem_map[z] ? attr_sha : attr_mem; - chtype c = world.mem_map[z] | attr_c; - set_ch_on_yx(win, y, x * 2 + (y % 2), c); - if (x + (y % 2) < world.map.length) - { - set_ch_on_yx(win, y, x * 2 + (y % 2) + 1, ' ' | attr_c); - } - z++; + attr_t a=' '==world.mem_map[y*world.map.length+x]?attr_sha:attr_mem; + char c = world.mem_map[y*world.map.length + x]; + set_ch_on_yx(win, y, x * 2 + (y % 2), c | a); + set_ch_on_yx(win, y, x * 2 + (y % 2) + 1, ' ' | a); } } - for (y = 0, z = 0; y < world.map.length; y++) + for (y = 0; y < world.map.length; y++) { for (x = 0; x < world.map.length; x++) { - if (' ' != world.map.cells[z]) + if (' ' != world.map.cells[y*world.map.length + x]) { - chtype c = world.map.cells[z] | attr_fov; - set_ch_on_yx(win, y, x * 2 + (y % 2), c); - if (x + (y % 2) < world.map.length) - { - set_ch_on_yx(win, y, x * 2 + (y % 2) + 1, ' ' | attr_fov); - } + char c = world.map.cells[y*world.map.length + x]; + set_ch_on_yx(win, y, x * 2 + (y % 2), c); + set_ch_on_yx(win, y, x * 2 + (y % 2) + 1, ' '); } - z++; } } + if (world.look) + { + y = world.look_pos.y; + x = world.look_pos.x; + char c = world.map.cells[y * world.map.length + x]; + c = ' ' == c ? world.mem_map[y * world.map.length + x] : c; + set_ch_on_yx(win, y, x * 2 + (y % 2), c | A_REVERSE); + set_ch_on_yx(win, y, x * 2 + (y % 2) + 1, ' ' | A_REVERSE); + } } @@ -434,6 +434,15 @@ extern void draw_win_inventory(struct Win * win) +extern void draw_win_terrain_stack(struct Win * win) +{ + char * wait_response = "(polling)"; + char * text = world.things_here ? world.things_here : wait_response; + add_text_with_linebreaks(win, text); +} + + + extern void draw_win_keybindings_global(struct Win * win) { win->center.y = world.kb_global.select;