//
// EnhancedGameObject::deactivateObject from 0x1005cf790 to 0x1005cf8c1 (305 bytes)
//
// 42 xrefs:
// > ParticleGameObject::deactivateObject @ 0x1001b2ba2
// > AnimatedGameObject::deactivateObject @ 0x1001b72e6
// > ??> @ 0x1008c4db0
// > ??> @ 0x1008c55a8
// > ??> @ 0x1008c5da0
// > ??> @ 0x1008c6598
// > ??> @ 0x1008c6d90
// > ??> @ 0x1008c7588
// > ??> @ 0x1008c8d78
// > ??> @ 0x1008c95f0
// > ??> @ 0x1008c9e00
// > ??> @ 0x1008ca610
// > ??> @ 0x1008cae20
// > ??> @ 0x1008cb630
// > ??> @ 0x1008cbe40
// > ??> @ 0x1008cc650
// > ??> @ 0x1008cce60
// > ??> @ 0x1008cd670
// > ??> @ 0x1008cde80
// > ??> @ 0x1008ce6a8
// > ??> @ 0x1008cef00
// > ??> @ 0x1008cf728
// > ??> @ 0x1008cff50
// > ??> @ 0x1008d0778
// > ??> @ 0x1008d0fa0
// > ??> @ 0x1008d17b0
// > ??> @ 0x1008d1fc0
// > ??> @ 0x1008d27d0
// > ??> @ 0x1008d2fe0
// > ??> @ 0x1008d37f0
// > ??> @ 0x1008d4000
// > ??> @ 0x1008d4810
// > ??> @ 0x1008d5020
// > ??> @ 0x1008d5830
// > ??> @ 0x1008d6040
// > ??> @ 0x1008d6850
// > ??> @ 0x1008d7060
// > ??> @ 0x1008d7870
// > ??> @ 0x1008d8080
// > ??> @ 0x1008d8890
// > ??> @ 0x1008d90a0
// > ??> @ 0x1009720e0
//
// 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 EnhancedGameObject::deactivateObject(EnhancedGameObject *a1, bool a2)
{
bool m_isActivated; // al
cocos2d::CCSprite *m_glowSprite; // rdi
cocos2d::CCSprite *m_colorSprite; // rdi
m_isActivated = a1->m_isActivated;
if ( a2 )
{
a1->m_unk3ee = 1;
}
else if ( !a1->m_unk3ee )
{
a1->m_unk3ee = 1;
if ( !m_isActivated )
return;
goto LABEL_14;
}
if ( !m_isActivated )
return;
a1->m_isActivated = 0;
((void (__fastcall *)(EnhancedGameObject *, _QWORD))a1->setVisible)(a1, 0);
((void (__fastcall *)(EnhancedGameObject *, _QWORD))a1->removeFromParentAndCleanup)(a1, 0);
a1->m_baseOrDetailBlending = 0;
if ( a1->m_enterType != -1 || a1->m_exitType != -1 )
{
*(_DWORD *)&a1->m_enterType = -1;
a1->m_unk3E8 = 1;
((void (__fastcall *)(EnhancedGameObject *, float))a1->setRScaleX)(a1, 1.0);
((void (__fastcall *)(EnhancedGameObject *, float))a1->setRScaleY)(a1, 1.0);
}
m_glowSprite = a1->m_glowSprite;
if ( m_glowSprite )
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))m_glowSprite->removeFromParentAndCleanup)(m_glowSprite, 0);
m_colorSprite = a1->m_colorSprite;
if ( m_colorSprite && !a1->m_unk28c )
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))m_colorSprite->removeFromParentAndCleanup)(m_colorSprite, 0);
LABEL_14:
if ( !a1->m_isActivated && a1->m_animateOnTrigger && a1->m_hasCustomAnimation )
{
((void (__fastcall *)(EnhancedGameObject *, __int64, double))a1->updateSyncedAnimation)(a1, 0xFFFFFFFFLL, 0.0);
EnhancedGameObject::waitForAnimationTrigger(a1);
}
}