//
// PlayerObject::toggleSwingMode from 0x1404f8dd0 to 0x1404f9077 (679 bytes)
//
// 23 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x14031966b
// > GJBaseGameLayer::setupLevelStart @ 0x140319718
// > GJBaseGameLayer::setupLevelStart @ 0x140319895
// > GJBaseGameLayer::setupLevelStart @ 0x1403198f0
// > GJBaseGameLayer::setupLevelStart @ 0x140319a27
// > GJBaseGameLayer::setupLevelStart @ 0x140319ad4
// > GJBaseGameLayer::setupLevelStart @ 0x140319b76
// > GJBaseGameLayer::setupLevelStart @ 0x140319c23
// > sub_140319F40 @ 0x140319fa1
// > sub_14031A030 @ 0x14031a091
// > sub_14031A120 @ 0x14031a181
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c2b7
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c505
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c58a
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c749
// > GJBaseGameLayer::collisionCheckObjects @ 0x14031c843
// > MenuGameLayer::resetPlayer @ 0x140471429
// > MenuGameLayer::resetPlayer @ 0x1404714bf
// > PlayerObject::resetObject @ 0x1404f5635
// > PlayerObject::switchedToMode @ 0x1404fa1d5
// > PlayerObject::copyAttributes @ 0x1404feb57
// > PlayerObject::loadFromCheckpoint @ 0x14050149f
// > ??> @ 0x14092a26c
//
// This function is hookable on this platform (idp: pc, 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:33:21 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall PlayerObject::toggleSwingMode(__int64 a1, char a2, char a3)
{
__int64 v6; // rax
__int64 v7; // rdx
__int64 v8; // rdx
__int64 v9; // rdx
void *v10; // [rsp+30h] [rbp+8h] BYREF
__int16 v11; // [rsp+38h] [rbp+10h]
if ( *(_BYTE *)(a1 + 2508) != a2 )
{
*(_QWORD *)(a1 + 2016) = *(_QWORD *)(a1 + 2728);
*(_BYTE *)(a1 + 2508) = a2;
if ( a2 )
PlayerObject::switchedToMode(a1, 41);
*(_WORD *)(a1 + 1840) = 0;
*(_BYTE *)(a1 + 1648) = 0;
*(_DWORD *)(a1 + 1832) = 0;
*(double *)(a1 + 2472) = *(double *)(a1 + 2472) * 0.5;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 352LL))(a1);
*(_BYTE *)(a1 + 2580) = 0;
*(_BYTE *)(a1 + 2505) = 0;
*(_BYTE *)(a1 + 2027) = 0;
PlayerObject::removePendingCheckpoint(a1);
if ( *(_BYTE *)(a1 + 2508) )
{
v6 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v10 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager((__int64)v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v6 = qword_14090BFD0;
}
PlayerObject::updatePlayerSwingFrame(a1, (unsigned int)(*(_DWORD *)(v6 + 832) - *(_DWORD *)(v6 + 836)));
if ( !a3 )
{
v11 = -14081;
LOWORD(v10) = -14081;
BYTE2(v10) = 0;
PlayerObject::spawnPortalCircle(a1, (__int64)&v10);
}
if ( !*(_BYTE *)(a1 + 1843) )
{
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(a1 + 2248));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(a1 + 2256));
}
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(a1 + 2256));
*(_BYTE *)(a1 + 2031) = 0;
if ( *(_BYTE *)(a1 + 2030) )
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(a1 + 2240));
*(_BYTE *)(a1 + 2030) = 0;
PlayerObject::activateStreak(a1);
LOBYTE(v7) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1928) + 336LL))(*(_QWORD *)(a1 + 1928), v7);
PlayerFireBoostSprite::loopFireAnimation(*(_QWORD *)(a1 + 1928));
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1936) + 160LL))(*(_QWORD *)(a1 + 1936));
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1944) + 160LL))(*(_QWORD *)(a1 + 1944));
LOBYTE(v8) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1936) + 336LL))(*(_QWORD *)(a1 + 1936), v8);
LOBYTE(v9) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1944) + 336LL))(*(_QWORD *)(a1 + 1944), v9);
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(a1 + 2296));
cocos2d::CCParticleSystem::resetSystem(*(cocos2d::CCParticleSystem **)(a1 + 2304));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(a1 + 2296));
cocos2d::CCParticleSystem::stopSystem(*(cocos2d::CCParticleSystem **)(a1 + 2304));
PlayerObject::updateSwingFire(a1);
}
else
{
PlayerObject::resetPlayerIcon(a1);
PlayerObject::updatePlayerFrame(a1, *(unsigned int *)(a1 + 1568));
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 352LL))(a1);
PlayerObject::disableSwingFire(a1);
}
if ( a2 )
{
PlayerObject::updatePlayerArt(a1);
PlayerObject::updateDashArt(a1);
}
}
}