+ struct World * world = (struct World *) win->data;
+ struct MapObj * player = get_player(world);
+ if (NULL == player->owns)
+ {
+ mvwaddstr(win->frame.curses_win, 0, 0, "(empty)");
+ return;
+ }
+ char * f_name = "draw_win_inventory()";
+ struct MapObj * owned = player->owns;
+ uint8_t n_owned;
+ for (n_owned = 0; NULL != owned->next; owned = owned->next, n_owned++);
+ uint8_t offset = center_offset(world->inventory_select, n_owned,
+ win->frame.size.y - 1);
+ uint8_t i;
+ for (i = 0, owned = player->owns; i < offset + (offset > 0);
+ i++, owned = owned->next);
+ uint8_t y;
+ for (y = 0; NULL != owned && y < win->frame.size.y; y++)
+ {
+ if (scroll_hint_helper(world, 0, y, offset, n_owned, &win->frame,
+ f_name))
+ {
+ continue;
+ }
+ attr_t attri = 0;
+ if (y == world->inventory_select - offset)
+ {
+ attri = A_REVERSE;
+ }
+ struct MapObjDef * mod = get_map_object_def(world, owned->type);
+ draw_line(win, y, mod->name, attri, 0);
+ owned = owned->next;
+ }