MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / updateVisibility

Method updateVisibility

Source/PlayLayer.cpp:972–1182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

970}
971
972void PlayLayer::updateVisibility()
973{
974 auto winSize = ax::Director::getInstance()->getWinSize();
975
976 float unk = 70.0f;
977
978 int prevSection = floorf(this->m_obCamPos.x / 100) - 1.0f;
979 int nextSection = ceilf((this->m_obCamPos.x + winSize.width) / 100) + 1.0f;
980
981 for (int i = prevSection; i < nextSection; i++)
982 {
983 if (i >= 0)
984 {
985 if (i < _sectionObjects.size())
986 {
987 auto section = _sectionObjects[i];
988 for (size_t j = 0; j < section.size(); j++)
989 {
990 GameObject* obj = section[j];
991 if (!obj)
992 continue;
993
994 if (obj->getParent() == nullptr)
995 {
996 if (obj->_particle)
997 {
998 addChild(obj->_particle);
999 AX_SAFE_RELEASE(obj->_particle);
1000 }
1001 if (obj->_glowSprite)
1002 {
1003 _glowBatchNode->addChild(obj->_glowSprite);
1004 AX_SAFE_RELEASE(obj->_glowSprite);
1005 }
1006
1007 if (isObjectBlending(obj))
1008 {
1009 switch (obj->_zLayer)
1010 {
1011 case -3:
1012 _blendingBatchNodeB4->addChild(obj);
1013 break;
1014 case -1:
1015 _blendingBatchNodeB3->addChild(obj);
1016 break;
1017 case 1:
1018 _blendingBatchNodeB2->addChild(obj);
1019 break;
1020 case 3:
1021 _blendingBatchNodeB1->addChild(obj);
1022 break;
1023 default:
1024 case 5:
1025 _blendingBatchNodeT1->addChild(obj);
1026 break;
1027 case 7:
1028 _blendingBatchNodeT2->addChild(obj);
1029 break;

Callers 1

updateMethod · 0.95

Calls 6

applyEnterEffectMethod · 0.95
sizeMethod · 0.80
setActiveMethod · 0.80
getGameObjectTypeMethod · 0.80
getDontTransformMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected