X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fdraw_wins.c;h=b6d13c21e5e14d54fef8f49e85d9f9601f43d706;hb=93bc319c3b6790f580c6fb17bf08f80713ce16c5;hp=81cc26138efe8406727215bbf98e48506d5c3167;hpb=56bd66b2302f09e9b8f39e9c059c1eb0d105b9fa;p=plomrogue diff --git a/src/draw_wins.c b/src/draw_wins.c index 81cc261..b6d13c2 100644 --- a/src/draw_wins.c +++ b/src/draw_wins.c @@ -247,20 +247,20 @@ extern void draw_keys_win(struct Win * win) static void draw_map_objects(struct World * world, struct MapObj * start, struct Map * map, struct Win * win) { - struct MapObj * o; - struct MapObjDef * d; - char c; - for (o = start; o != 0; o = o->next) - { - if ( o->pos.y >= map->offset.y - && o->pos.y < map->offset.y + win->frame.size.y - && o->pos.x >= map->offset.x - && o->pos.x < map->offset.x + win->frame.size.x) + struct MapObj * o; + struct MapObjDef * d; + char c; + for (o = start; o != 0; o = o->next) { - d = get_map_obj_def (world, o->type); - c = d->mapchar; - mvwaddch(win->frame.curses_win, - o->pos.y - map->offset.y, o->pos.x - map->offset.x, c); + if ( o->pos.y >= map->offset.y + && o->pos.y < map->offset.y + win->frame.size.y + && o->pos.x >= map->offset.x + && o->pos.x < map->offset.x + win->frame.size.x) + { + d = get_map_obj_def (world, o->type); + c = d->mapchar; + mvwaddch(win->frame.curses_win, + o->pos.y - map->offset.y, o->pos.x - map->offset.x, c); + } } - } }