MCPcopy Create free account
hub / github.com/crawl/crawl / pack_buffers

Method pack_buffers

crawl-ref/source/tilereg-mon.cc:157–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157void 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
204void MonsterRegion::draw_tag()
205{

Callers

nothing calls this directly

Calls 9

map_findFunction · 0.85
tile_apply_propertiesFunction · 0.85
in_los_bounds_gMethod · 0.80
add_icons_tileMethod · 0.80
is_using_small_layoutMethod · 0.80
add_dngn_tileMethod · 0.80
updateFunction · 0.50
sizeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected