| 218 | } |
| 219 | |
| 220 | void 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 | |
| 242 | void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, ssize_t index, ssize_t amount) |
| 243 | { |
no outgoing calls
no test coverage detected