//
// PlayerObject::toggleSwingMode from 0x43ed48 to 0x43eedc (404 bytes)
//
// 4 xrefs:
// > PlayerObject::switchedToMode @ 0x43e728
// > PlayerObject::copyAttributes @ 0x43f980
// > MenuGameLayer::resetPlayer @ 0x4929ba
// > GJBaseGameLayer::switchToFlyMode @ 0x58ee3e
//
// 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:25 +0000
//
int __fastcall PlayerObject::toggleSwingMode(int this, int a2, int a3)
{
int v3; // r4
GameManager *v6; // r0
int v7; // r0
int v8; // r1
int v9; // [sp+4h] [bp-4h]
HIBYTE(v9) = HIBYTE(a2);
v3 = this;
if ( *(unsigned __int8 *)(this + 1964) != a2 )
{
*(_QWORD *)(this + 1592) = *(_QWORD *)(this + 2128);
*(_BYTE *)(this + 1964) = a2;
if ( a2 )
PlayerObject::switchedToMode((char *)this, 41);
PlayerObject::stopRotation((PlayerObject *)v3, 0, 9);
*(double *)(v3 + 1928) = *(double *)(v3 + 1928) * 0.5;
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v3 + 180))(v3, 0);
*(_BYTE *)(v3 + 2036) = 0;
*(_BYTE *)(v3 + 1961) = 0;
*(_BYTE *)(v3 + 1603) = 0;
v6 = PlayerObject::removePendingCheckpoint((PlayerObject *)v3);
if ( *(_BYTE *)(v3 + 1964) )
{
v7 = GameManager::sharedState(v6);
PlayerObject::updatePlayerSwingFrame(
(PlayerObject *)v3,
(const char *)(*(_DWORD *)(v7 + 600) - *(_DWORD *)(v7 + 604)));
if ( !a3 )
{
BYTE2(v9) = 0;
LOWORD(v9) = -14081;
PlayerObject::spawnPortalCircle(v3, v9, (CCCircleWave *)0x42480000);
}
if ( !*(_BYTE *)(v3 + 1483) )
{
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v3 + 1748));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v3 + 1752));
}
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v3 + 1752));
*(_BYTE *)(v3 + 1607) = 0;
PlayerObject::deactivateParticle(v3);
PlayerObject::activateStreak((cocos2d::CCNode **)v3);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v3 + 1528) + 172))(*(_DWORD *)(v3 + 1528), 1);
PlayerFireBoostSprite::loopFireAnimation(*(PlayerFireBoostSprite **)(v3 + 1528));
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v3 + 1532) + 80))(*(_DWORD *)(v3 + 1532), 1008981770);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v3 + 1536) + 80))(*(_DWORD *)(v3 + 1536), 1008981770);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v3 + 1532) + 172))(*(_DWORD *)(v3 + 1532), 1);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(v3 + 1536) + 172))(*(_DWORD *)(v3 + 1536), 1);
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v3 + 1772));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v3 + 1776));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v3 + 1772));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v3 + 1776));
this = PlayerObject::updateSwingFire((PlayerObject *)v3);
}
else
{
PlayerObject::resetPlayerIcon((PlayerObject *)v3);
PlayerObject::updatePlayerFrame((PlayerObject *)v3, *(const char **)(v3 + 1320));
if ( *(_BYTE *)(v3 + 1959) )
v8 = 1127481344;
else
v8 = 0;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v3 + 180))(v3, v8);
this = PlayerObject::disableSwingFire((PlayerObject *)v3);
}
if ( a2 )
return PlayerObject::modeDidChange((PlayerObject *)v3);
}
return this;
}