MCPcopy Create free account
hub / github.com/axmolengine/axmol / insertQuad

Method insertQuad

core/renderer/TextureAtlas.cpp:220–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void TextureAtlas::insertQuad(const V3F_C4B_T2F_Quad& quad, ssize_t index)
221{
222 AXASSERT(index >= 0 && index < _capacity, "insertQuadWithTexture: Invalid index");
223
224 _totalQuads++;
225 AXASSERT(_totalQuads <= _capacity, "invalid totalQuads");
226
227 // issue #575. index can be > totalQuads
228 auto remaining = (_totalQuads - 1) - index;
229
230 // last object doesn't need to be moved
231 if (remaining > 0)
232 {
233 // texture coordinates
234 memmove(&_quads[index + 1], &_quads[index], sizeof(_quads[0]) * remaining);
235 }
236
237 _quads[index] = quad;
238
239 _dirty = true;
240}
241
242void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t amount)
243{

Callers 2

appendChildMethod · 0.80
insertQuadFromSpriteMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected