| 438 | } |
| 439 | |
| 440 | void SpriteBatchNode::increaseAtlasCapacity() |
| 441 | { |
| 442 | // if we're going beyond the current TextureAtlas's capacity, |
| 443 | // all the previously initialized sprites will need to redo their texture coords |
| 444 | // this is likely computationally expensive |
| 445 | ssize_t quantity = (_textureAtlas->getCapacity() + 1) * 4 / 3; |
| 446 | |
| 447 | AXLOGD("SpriteBatchNode: resizing TextureAtlas capacity from [{}] to [{}].", |
| 448 | static_cast<int>(_textureAtlas->getCapacity()), static_cast<int>(quantity)); |
| 449 | |
| 450 | if (!_textureAtlas->resizeCapacity(quantity)) |
| 451 | { |
| 452 | // serious problems |
| 453 | AXLOGW("WARNING: Not enough memory to resize the atlas"); |
| 454 | AXASSERT(false, "Not enough memory to resize the atlas"); |
| 455 | } |
| 456 | } |
| 457 | |
| 458 | void SpriteBatchNode::reserveCapacity(ssize_t newCapacity) |
| 459 | { |
no test coverage detected