X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=src%2Fclient%2Fmap.c;h=af2f57c9621d4eb20fd8721c40d4425ac5662a95;hb=891ba8fbca53d920f6b3704827fa6b8aee737de4;hp=7292c89151a8ecb62a0a0b6c7c3d53e7f67c4e79;hpb=539f4419afa0966d67b341dc6b30a6174bd3f844;p=plomrogue diff --git a/src/client/map.c b/src/client/map.c index 7292c89..af2f57c 100644 --- a/src/client/map.c +++ b/src/client/map.c @@ -10,25 +10,25 @@ extern void map_scroll(char d) { struct Win * win = get_win_by_id('m'); - uint8_t offset; - if (('8' == d || '2' == d) && world.map.size.y > win->frame_size.y) + uint16_t offset; + if (('8' == d || '2' == d) && world.map.length > win->frame_size.y) { offset = center_offset(win->center.y, - world.map.size.y, win->frame_size.y); + world.map.length, win->frame_size.y); win->center.y = offset + (win->frame_size.y / 2); - if ('2' == d && win->center.y < world.map.size.y - 1) + if ('2' == d && win->center.y < world.map.length - 1) { win->center.y++; return; } win->center.y = win->center.y - ('8' == d && win->center.y > 0); } - else if (('4' == d || '6' == d) && world.map.size.x > win->frame_size.x) + else if (('4' == d || '6' == d) && (world.map.length*2) > win->frame_size.x) { offset = center_offset(win->center.x, - world.map.size.x, win->frame_size.x); + world.map.length*2, win->frame_size.x); win->center.x = offset + (win->frame_size.x / 2); - if ('6' == d && win->center.x < world.map.size.x - 1) + if ('6' == d && win->center.x < (world.map.length * 2) - 1) { win->center.x++; return; @@ -43,5 +43,12 @@ extern void map_center() { struct Win * win_map = get_win_by_id('m'); win_map->center.y = world.player_pos.y; - win_map->center.x = world.player_pos.x; + win_map->center.x = world.player_pos.x * 2 + (world.player_pos.y % 2); +} + + + +extern void toggle_autofocus() +{ + world.focus_each_turn = world.focus_each_turn ? 0 : 1; }