//
// GJBaseGameLayer::playerWillSwitchMode from 0x100102490 to 0x1001026bd (557 bytes)
//
// 9 xrefs:
// > GJBaseGameLayer::toggleDualMode @ 0x100101b12
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104c0e
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104c54
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104c8e
// > GJBaseGameLayer::collisionCheckObjects @ 0x100104e71
// > GJBaseGameLayer::collisionCheckObjects @ 0x10010507c
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001051f5
// > GJBaseGameLayer::collisionCheckObjects @ 0x100105393
// > GJBaseGameLayer::collisionCheckObjects @ 0x1001053cf
//
// 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 12:21:21 +0000
//
void __fastcall GJBaseGameLayer::playerWillSwitchMode(__int64 a1, __int64 a2, __int64 a3)
{
unsigned int v4; // eax
signed int v5; // r12d
unsigned int v6; // eax
unsigned int v7; // eax
__int64 v8; // rcx
_BYTE *v9; // r12
char v10; // al
if ( a3 )
{
*(_QWORD *)(a1 + 976) = a3;
if ( *(_DWORD *)(a3 + 1248) == 1 )
{
*(_BYTE *)(a1 + 785) = *(_BYTE *)(a3 + 1748);
*(_BYTE *)(a1 + 786) = *(_BYTE *)(a3 + 1760);
if ( *(_BYTE *)(a3 + 1749) == 1 )
_mm_storel_ps(
(double *)(a1 + 716),
_mm_min_ps(
(__m128)0x422000003F800000uLL,
_mm_max_ps(
(__m128)0x3F80000000000000uLL,
_mm_shuffle_ps((__m128)*(unsigned __int64 *)(a3 + 1752), (__m128)*(unsigned __int64 *)(a3 + 1752), 225))));
}
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1800LL))(a3);
v5 = 0;
GJBaseGameLayer::updateDualGround(a1, a2, v4, 0);
v6 = (*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)a3 + 1800LL))(a3, 0.0) - 3;
if ( v6 <= 0x2B )
v5 = dword_100A04FB4[v6];
GJBaseGameLayer::gameEventTriggered(a1, v5, 0, 0, 0.0);
v7 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 1800LL))(a3);
if ( v7 <= 0x29 && (v8 = 0x20004080020LL, _bittest64(&v8, v7)) )
{
if ( *(_BYTE *)(a1 + 1010) != 1 )
return;
}
else
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1288LL))(a1, 0);
if ( *(_BYTE *)(a1 + 1010) != 1 )
return;
}
if ( !*(_BYTE *)(*(_QWORD *)(a1 + 3272) + 340LL) )
{
v9 = *(_BYTE **)(a1 + 8LL * (*(_DWORD *)(a2 + 916) == *(_DWORD *)(*(_QWORD *)(a1 + 3256) + 916LL)) + 3256);
switch ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a3 + 1800LL))(a3) )
{
case 5u:
v10 = v9[2417];
goto LABEL_24;
case 6u:
if ( (unsigned __int8)PlayerObject::isFlying(v9) || v9[2419] || v9[2421] )
return;
v10 = v9[2422] ^ 1;
LABEL_24:
if ( !*(_BYTE *)(a1 + 1912) )
{
if ( v10 )
PlayerObject::flipGravity(a2, (unsigned __int8)v9[2423] ^ 1u, 1);
}
break;
case 0x10u:
v10 = v9[2419];
goto LABEL_24;
case 0x13u:
v10 = v9[2418];
goto LABEL_24;
case 0x1Bu:
v10 = v9[2421];
goto LABEL_24;
case 0x21u:
v10 = v9[2422];
goto LABEL_24;
case 0x29u:
v10 = v9[2428];
goto LABEL_24;
default:
return;
}
}
}
}