X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=src%2Fdraw_wins.c;h=6287b20587039729aa4c6fd9fdd219063fc496c7;hb=e11aa749989942b66dfc4fd7ccb72c2c8e767332;hp=81cc26138efe8406727215bbf98e48506d5c3167;hpb=56bd66b2302f09e9b8f39e9c059c1eb0d105b9fa;p=plomrogue diff --git a/src/draw_wins.c b/src/draw_wins.c index 81cc261..6287b20 100644 --- a/src/draw_wins.c +++ b/src/draw_wins.c @@ -1,3 +1,5 @@ +/* draw_wins.c */ + #include "draw_wins.h" #include /* for malloc(), free() */ #include /* for uint16_t */ @@ -247,20 +249,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); + } } - } }