//
// PlayerObject::toggleSwingMode from 0x759eb0 to 0x75a0e8 (568 bytes)
//
// 6 xrefs:
// > PlayerObject::switchedToMode @ 0x759574
// > PlayerObject::switchedToMode @ 0x75963c
// > PlayerObject::copyAttributes @ 0x75d490
// > MenuGameLayer::resetPlayer @ 0x7da79c
// > GJBaseGameLayer::switchToFlyMode @ 0x99dd10
// > ??> @ 0xacc18
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:52:59 +0000
//
__int64 __fastcall PlayerObject::toggleSwingMode(__int64 this, unsigned __int8 a2, unsigned __int8 a3)
{
int v3; // w20
__int64 v4; // x19
int v5; // w21
__int64 v6; // x1
__int64 v7; // x1
__int64 v8; // x0
long double v9; // q0
int v10; // [xsp+38h] [xbp+38h]
v3 = a2;
v4 = this;
v5 = a3;
if ( *(unsigned __int8 *)(this + 2428) != a2 )
{
v6 = *(_QWORD *)(this + 2624);
*(_BYTE *)(this + 2428) = v3;
*(_QWORD *)(this + 1960) = v6;
if ( v3 )
PlayerObject::switchedToMode((PlayerObject *)this, 41);
PlayerObject::stopRotation((PlayerObject *)v4);
v7 = *(_QWORD *)v4;
*(double *)(v4 + 2392) = *(double *)(v4 + 2392) * 0.5;
(*(void (__fastcall **)(__int64, float))(v7 + 360))(v4, 0.0);
*(_BYTE *)(v4 + 2500) = 0;
*(_BYTE *)(v4 + 2425) = 0;
*(_BYTE *)(v4 + 1971) = 0;
PlayerObject::removePendingCheckpoint(v4);
if ( !*(_BYTE *)(v4 + 2428) )
{
PlayerObject::resetPlayerIcon((cocos2d::CCParticleSystem **)v4);
PlayerObject::updatePlayerFrame((PlayerObject *)v4, *(_DWORD *)(v4 + 1560));
LODWORD(v9) = 0;
if ( *(_BYTE *)(v4 + 2423) )
LODWORD(v9) = 1127481344;
(*(void (__fastcall **)(__int64, long double))(*(_QWORD *)v4 + 360LL))(v4, v9);
this = PlayerObject::disableSwingFire((PlayerObject *)v4);
goto LABEL_8;
}
v8 = GameManager::sharedState((GameManager *)*(unsigned __int8 *)(v4 + 2428));
PlayerObject::updatePlayerSwingFrame((PlayerObject *)v4, *(_DWORD *)(v8 + 800) - *(_DWORD *)(v8 + 804));
if ( v5 )
{
if ( *(_BYTE *)(v4 + 1787) )
{
LABEL_7:
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v4 + 2176));
*(_BYTE *)(v4 + 1975) = 0;
PlayerObject::deactivateParticle((cocos2d::CCParticleSystem **)v4);
PlayerObject::activateStreak((cocos2d::CCNode **)v4);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v4 + 1872) + 344LL))(*(_QWORD *)(v4 + 1872), 1);
PlayerFireBoostSprite::loopFireAnimation(*(PlayerFireBoostSprite **)(v4 + 1872));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(v4 + 1880) + 160LL))(*(_QWORD *)(v4 + 1880), 0.01);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(v4 + 1888) + 160LL))(*(_QWORD *)(v4 + 1888), 0.01);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v4 + 1880) + 344LL))(*(_QWORD *)(v4 + 1880), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(v4 + 1888) + 344LL))(*(_QWORD *)(v4 + 1888), 1);
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v4 + 2216));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v4 + 2224));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v4 + 2216));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(v4 + 2224));
this = PlayerObject::updateSwingFire((PlayerObject *)v4);
LABEL_8:
if ( v3 )
return PlayerObject::modeDidChange((PlayerObject *)v4);
return this;
}
}
else
{
LOWORD(v10) = -14081;
BYTE2(v10) = 0;
PlayerObject::spawnPortalCircle(v4, v10, 50.0);
if ( *(_BYTE *)(v4 + 1787) )
goto LABEL_7;
}
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v4 + 2168));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(v4 + 2176));
goto LABEL_7;
}
return this;
}