MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / reorganizeLayers

Method reorganizeLayers

src/Core/Scene/Scene.cpp:588–601  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586 }
587
588 void Scene::reorganizeLayers()
589 {
590 std::sort(
591 m_spriteArray.begin(), m_spriteArray.end(), [](auto& sprite1, auto& sprite2) {
592 if (sprite1->getLayer() == sprite2->getLayer())
593 {
594 return sprite1->getZDepth() > sprite2->getZDepth();
595 }
596 else
597 {
598 return sprite1->getLayer() > sprite2->getLayer();
599 }
600 });
601 }
602
603 std::size_t Scene::getSpriteAmount() const
604 {

Callers 4

loadMethod · 0.95
drawMethod · 0.95
loadGameObjectMethod · 0.80
Scene.cppFile · 0.80

Calls 5

sortFunction · 0.85
getLayerMethod · 0.80
getZDepthMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected