//
// PlayerObject::toggleSwingMode from 0x1002c6fa0 to 0x1002c71c8 (552 bytes)
//
// 4 xrefs:
// > GJBaseGameLayer::switchToFlyMode @ 0x100281da4
// > PlayerObject::switchedToMode @ 0x1002c3d58
// > PlayerObject::copyAttributes @ 0x1002ca0c8
// > MenuGameLayer::resetPlayer @ 0x1004428d8
//
// 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 11:02:33 +0000
//
void __fastcall PlayerObject::toggleSwingMode(__int64 a1, int a2, char a3)
{
_DWORD *v6; // x0
__int64 v7; // x0
__n128 v8; // q0
__n128 v9; // q0
if ( *(unsigned __int8 *)(a1 + 2428) == a2 )
return;
*(_QWORD *)(a1 + 1960) = *(_QWORD *)(a1 + 2624);
*(_BYTE *)(a1 + 2428) = a2;
if ( a2 )
PlayerObject::switchedToMode(a1, 41);
*(_WORD *)(a1 + 1784) = 0;
*(_BYTE *)(a1 + 1640) = 0;
*(_DWORD *)(a1 + 1776) = 0;
*(double *)(a1 + 2392) = *(double *)(a1 + 2392) * 0.5;
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 360LL))(a1, 0.0);
*(_BYTE *)(a1 + 2500) = 0;
*(_BYTE *)(a1 + 2425) = 0;
*(_BYTE *)(a1 + 1971) = 0;
v6 = sub_1002C3C70(a1);
if ( *(_BYTE *)(a1 + 2428) == 1 )
{
v7 = GameManager::sharedState(v6);
PlayerObject::updatePlayerSwingFrame(a1, (unsigned int)(*(_DWORD *)(v7 + 800) - *(_DWORD *)(v7 + 804)));
if ( (a3 & 1) == 0 )
PlayerObject::spawnPortalCircle(a1, 51455);
if ( (*(_BYTE *)(a1 + 1787) & 1) == 0 )
{
cocos2d::CCParticleSystem::resetSystem(*(_QWORD *)(a1 + 2168));
cocos2d::CCParticleSystem::resetSystem(*(_QWORD *)(a1 + 2176));
}
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2176));
*(_BYTE *)(a1 + 1975) = 0;
if ( *(_BYTE *)(a1 + 1974) == 1 )
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2160));
*(_BYTE *)(a1 + 1974) = 0;
PlayerObject::activateStreak(a1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1872) + 344LL))(*(_QWORD *)(a1 + 1872), 1);
sub_1002C737C(*(_QWORD *)(a1 + 1872));
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 1880) + 160LL))(*(_QWORD *)(a1 + 1880), 0.01);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 1888) + 160LL))(*(_QWORD *)(a1 + 1888), 0.01);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1880) + 344LL))(*(_QWORD *)(a1 + 1880), 1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1888) + 344LL))(*(_QWORD *)(a1 + 1888), 1);
cocos2d::CCParticleSystem::resetSystem(*(_QWORD *)(a1 + 2216));
cocos2d::CCParticleSystem::resetSystem(*(_QWORD *)(a1 + 2224));
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2216));
cocos2d::CCParticleSystem::stopSystem(*(_QWORD *)(a1 + 2224));
v8.n128_f32[0] = PlayerObject::updateSwingFire(a1);
if ( !a2 )
return;
LABEL_16:
PlayerObject::updatePlayerArt(a1, v8);
sub_1002C28E0(a1);
return;
}
PlayerObject::resetPlayerIcon(a1);
PlayerObject::updatePlayerFrame(a1, *(unsigned int *)(a1 + 1560));
v9.n128_u32[0] = 1127481344;
if ( !*(_BYTE *)(a1 + 2423) )
v9.n128_f32[0] = 0.0;
(*(void (__fastcall **)(__int64, __n128))(*(_QWORD *)a1 + 360LL))(a1, v9);
v8.n128_f32[0] = sub_1002C495C(a1);
if ( a2 )
goto LABEL_16;
}