don't use lazy sorting, reordering the particle systems quads afterwards would be too complex FIXME: research whether lazy sorting + freeing current quads and calloc a new block with size of capacity would be faster FIXME: or possibly using vertexZ for reordering, that would be fastest this helper is almost equivalent to Node's addChild, but doesn't make use of the lazy sorting
| 231 | // FIXME: or possibly using vertexZ for reordering, that would be fastest |
| 232 | // this helper is almost equivalent to Node's addChild, but doesn't make use of the lazy sorting |
| 233 | int ParticleBatchNode::addChildHelper(ParticleSystem* child, int z, int aTag, std::string_view name, bool setTag) |
| 234 | { |
| 235 | AXASSERT(child != nullptr, "Argument must be non-nil"); |
| 236 | AXASSERT(child->getParent() == nullptr, "child already added. It can't be added again"); |
| 237 | |
| 238 | _children.reserve(4); |
| 239 | |
| 240 | // don't use a lazy insert |
| 241 | auto pos = searchNewPositionInChildrenForZ(z); |
| 242 | |
| 243 | _children.insert(pos, child); |
| 244 | |
| 245 | if (setTag) |
| 246 | child->setTag(aTag); |
| 247 | else |
| 248 | child->setName(name); |
| 249 | |
| 250 | child->setLocalZOrder(z); |
| 251 | |
| 252 | child->setParent(this); |
| 253 | |
| 254 | if (_running) |
| 255 | { |
| 256 | child->onEnter(); |
| 257 | child->onEnterTransitionDidFinish(); |
| 258 | } |
| 259 | return pos; |
| 260 | } |
| 261 | |
| 262 | // Reorder will be done in this function, no "lazy" reorder to particles |
| 263 | void ParticleBatchNode::reorderChild(Node* aChild, int zOrder) |
nothing calls this directly
no test coverage detected