//
// PlayerObject::toggleVisibility from 0x4393a0 to 0x439450 (176 bytes)
//
// 4 xrefs:
// > PlayerObject::spawnFromPlayer @ 0x43fa68
// > PlayerObject::resetObject @ 0x4402d0
// > PlayerObject::loadFromCheckpoint @ 0x44b09c
// > GJBaseGameLayer::togglePlayerVisibility @ 0x595c1c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:48:20 +0000
//
GameManager *__fastcall PlayerObject::toggleVisibility(GameManager *this, int a2)
{
char v2; // r6
int v3; // r4
int v5; // r3
int v6; // r0
int v7; // r1
int v8; // r2
v2 = a2 ^ 1;
v3 = (int)this;
if ( *((unsigned __int8 *)this + 1483) != (a2 ^ 1) )
{
if ( !a2 )
cocos2d::CCNode::stopActionByTag(this, 11);
v5 = *(_DWORD *)v3;
*(_BYTE *)(v3 + 1483) = v2;
(*(void (__fastcall **)(int, int))(v5 + 172))(v3, a2);
if ( a2 )
{
this = (GameManager *)PlayerObject::isFlying((PlayerObject *)v3);
if ( this )
{
PlayerObject::resetStreak((cocos2d::CCMotionStreak **)v3);
PlayerObject::activateStreak((cocos2d::CCNode **)v3);
this = (GameManager *)cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v3 + 1748));
if ( *(_BYTE *)(v3 + 1956) )
{
return PlayerObject::placeStreakPoint((PlayerObject *)v3, v7, v8, *(unsigned __int8 *)(v3 + 1956));
}
else if ( *(_BYTE *)(v3 + 1953) )
{
if ( !*(_BYTE *)(v3 + 2320) )
{
this = *(GameManager **)(v3 + 1548);
if ( this )
return (GameManager *)(*(int (__fastcall **)(GameManager *, int))(*(_DWORD *)this + 172))(this, 1);
}
}
}
else if ( *(_BYTE *)(v3 + 1809) )
{
PlayerObject::resetStreak((cocos2d::CCMotionStreak **)v3);
return PlayerObject::activateStreak((cocos2d::CCNode **)v3);
}
}
else
{
PlayerObject::deactivateStreak(v3, 1);
v6 = *(_DWORD *)(v3 + 1548);
if ( v6 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v6 + 172))(v6, 0);
return (GameManager *)PlayerObject::resetAllParticles((cocos2d::CCArray **)v3);
}
}
return this;
}