//
// GameObject::setVisible from 0x1005bca00 to 0x1005bcb57 (343 bytes)
//
// 47 xrefs:
// > EndPortalObject::setVisible @ 0x10039ca42
// > PlayerObject::setVisible @ 0x10041d5b4
// > ??> @ 0x1008c41b0
// > ??> @ 0x1008c49e8
// > ??> @ 0x1008c51e0
// > ??> @ 0x1008c59d8
// > ??> @ 0x1008c61d0
// > ??> @ 0x1008c69c8
// > ??> @ 0x1008c71c0
// > ??> @ 0x1008c79b8
// > ??> @ 0x1008c81a0
// > ??> @ 0x1008c89b0
// > ??> @ 0x1008c9228
// > ??> @ 0x1008c9a38
// > ??> @ 0x1008ca248
// > ??> @ 0x1008caa58
// > ??> @ 0x1008cb268
// > ??> @ 0x1008cba78
// > ??> @ 0x1008cc288
// > ??> @ 0x1008cca98
// > ??> @ 0x1008cd2a8
// > ??> @ 0x1008cdab8
// > ??> @ 0x1008ce2e0
// > ??> @ 0x1008ceb38
// > ??> @ 0x1008cf360
// > ??> @ 0x1008cfb88
// > ??> @ 0x1008d03b0
// > ??> @ 0x1008d0bd8
// > ??> @ 0x1008d13e8
// > ??> @ 0x1008d1bf8
// > ??> @ 0x1008d2408
// > ??> @ 0x1008d2c18
// > ??> @ 0x1008d3428
// > ??> @ 0x1008d3c38
// > ??> @ 0x1008d4448
// > ??> @ 0x1008d4c58
// > ??> @ 0x1008d5468
// > ??> @ 0x1008d5c78
// > ??> @ 0x1008d6488
// > ??> @ 0x1008d6c98
// > ??> @ 0x1008d74a8
// > ??> @ 0x1008d7cb8
// > ??> @ 0x1008d84c8
// > ??> @ 0x1008d8cd8
// > ??> @ 0x100971530
// > ??> @ 0x100971d18
// > ??> @ 0x100972528
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall GameObject::setVisible(GameObject *a1, bool a2)
{
__int64 v3; // rax
cocos2d::CCParticleSystemQuad *m_particle; // rdi
cocos2d::CCSprite *m_glowSprite; // rdi
bool v6; // r15
cocos2d::CCSprite *m_colorSprite; // rdi
if ( !a1->m_hasParticles || ((unsigned __int8 (__fastcall *)(GameObject *))a1->isVisible)(a1) == a2 )
{
LABEL_14:
cocos2d::CCSprite::setVisible(a1, a2);
m_glowSprite = a1->m_glowSprite;
if ( !m_glowSprite )
goto LABEL_19;
if ( !a2 )
{
v6 = 0;
goto LABEL_18;
}
goto LABEL_16;
}
v3 = 1392;
if ( a2 )
{
if ( a1->m_particle )
goto LABEL_7;
v3 = 1384;
}
(*(void (__fastcall **)(GameObject *))((char *)&a1->copyWithZone + v3))(a1);
LABEL_7:
m_particle = a1->m_particle;
if ( !m_particle )
goto LABEL_14;
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, bool))m_particle->setVisible)(m_particle, a2);
if ( !a2 )
{
cocos2d::CCParticleSystem::stopSystem(a1->m_particle);
v6 = 0;
cocos2d::CCSprite::setVisible(a1, 0);
m_glowSprite = a1->m_glowSprite;
if ( !m_glowSprite )
goto LABEL_19;
LABEL_18:
((void (__fastcall *)(cocos2d::CCSprite *, bool))m_glowSprite->setVisible)(m_glowSprite, v6);
goto LABEL_19;
}
if ( a1->m_objectID != 2065 || !((unsigned __int8 (__fastcall *)(GameObject *))a1->getHasSyncedAnimation)(a1) )
cocos2d::CCParticleSystem::resetSystem(a1->m_particle);
((void (__fastcall *)(GameObject *))a1->particleWasActivated)(a1);
cocos2d::CCSprite::setVisible(a1, 1);
m_glowSprite = a1->m_glowSprite;
if ( m_glowSprite )
{
LABEL_16:
v6 = !a1->m_hasNoGlow;
goto LABEL_18;
}
LABEL_19:
m_colorSprite = a1->m_colorSprite;
if ( m_colorSprite )
((void (__fastcall *)(cocos2d::CCSprite *, bool))m_colorSprite->setVisible)(m_colorSprite, a2);
}