| 155 | } |
| 156 | |
| 157 | void MonsterRegion::pack_buffers() |
| 158 | { |
| 159 | update(); |
| 160 | const int num_floor = tile_dngn_count(tile_env.default_flavour.floor); |
| 161 | |
| 162 | unsigned int i = 0; |
| 163 | for (int y = 0; y < my; y++) |
| 164 | { |
| 165 | for (int x = 0; x < mx; x++) |
| 166 | { |
| 167 | bool cursor = (i < m_items.size()) ? |
| 168 | (m_items[i].flag & TILEI_FLAG_CURSOR) : false; |
| 169 | |
| 170 | const monster_info* mon = get_monster(i++); |
| 171 | if (mon) |
| 172 | { |
| 173 | const coord_def gc = mon->pos; |
| 174 | |
| 175 | if (crawl_view.in_los_bounds_g(gc)) |
| 176 | { |
| 177 | packed_cell cell; |
| 178 | cell.fg = tile_env.bk_fg(gc); |
| 179 | cell.bg = tile_env.bk_bg(gc); |
| 180 | cell.flv = tile_env.flv(gc); |
| 181 | if (set<tileidx_t>* icons = map_find(tile_env.icons, gc)) |
| 182 | cell.icons = *icons; |
| 183 | tile_apply_properties(gc, cell); |
| 184 | |
| 185 | m_buf.add(cell, x, y); |
| 186 | |
| 187 | if (cursor) |
| 188 | m_buf.add_icons_tile(TILEI_CURSOR, x, y); |
| 189 | continue; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | // Fill the rest of the space with out of sight floor tiles. |
| 194 | if (!tiles.is_using_small_layout()) |
| 195 | { |
| 196 | int tileidx = tile_env.default_flavour.floor + i % num_floor; |
| 197 | m_buf.add_dngn_tile(tileidx, x, y); |
| 198 | m_buf.add_icons_tile(TILEI_MESH, x, y); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | void MonsterRegion::draw_tag() |
| 205 | { |
nothing calls this directly
no test coverage detected