X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Fclient%2Fmap.c;h=48a9b5830de67de3cb60342b8e85277fb6700726;hb=6b1d36c9e673fd8f8595119080dca63a39ba483b;hp=5e4e9c6f769d7cc640a2fbd450ae2414a6bae9bd;hpb=f9c94db47aa883149aa762fa128ac1ff1b3f92e1;p=plomrogue diff --git a/src/client/map.c b/src/client/map.c index 5e4e9c6..48a9b58 100644 --- a/src/client/map.c +++ b/src/client/map.c @@ -2,8 +2,7 @@ #include "map.h" #include /* uint8_t */ -#include "misc.h" /* center_offset() */ -#include "windows.h" /* struct Win, get_win_by_id() */ +#include "windows.h" /* struct Win, center_offset(), get_win_by_id() */ #include "world.h" /* for global world */ @@ -24,12 +23,12 @@ extern void map_scroll(char d) } 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.size.x*2) > win->frame_size.x) { offset = center_offset(win->center.x, - world.map.size.x, win->frame_size.x); + world.map.size.x*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.size.x * 2) - 1) { win->center.x++; return; @@ -44,5 +43,5 @@ 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; }