//
// GJBaseGameLayer::updateDualGround from 0x14031a4a0 to 0x14031a684 (484 bytes)
//
// 8 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x140319c9d
// > GJBaseGameLayer::playerWillSwitchMode @ 0x14031a2ca
// > GJBaseGameLayer::toggleDualMode @ 0x14031e38c
// > GJBaseGameLayer::updateZoom @ 0x14033ec19
// > GJBaseGameLayer::exitStaticCamera @ 0x1403496fe
// > PlayLayer::loadFromCheckpoint @ 0x14051707c
// > CameraTriggerGameObject::triggerObject @ 0x14065e971
// > ??> @ 0x14091ebd8
//
// 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:30:19 +0000
//
__int64 __fastcall GJBaseGameLayer::updateDualGround(__int64 a1, __int64 a2, int a3)
{
char v3; // bl
__int64 v6; // rcx
__int64 v7; // r10
int v8; // r11d
float GroundHeightForMode; // xmm0_4
float v10; // xmm2_4
__int64 v11; // rcx
int v12; // edx
int v14; // xmm1_4
int v15; // [rsp+70h] [rbp+18h] BYREF
v3 = *(_BYTE *)(a1 + 1058);
if ( (unsigned int)(a3 - 23) > 1 )
*(_DWORD *)(a1 + 1344) = a3;
GroundHeightForMode = GJBaseGameLayer::getGroundHeightForMode(a1, a3);
v10 = GroundHeightForMode;
if ( v3 )
{
if ( GroundHeightForMode == 240.0 )
v10 = 270.0;
v11 = *(_QWORD *)(v6 + 3512);
if ( *(_DWORD *)(a2 + 924) == *(_DWORD *)(v11 + 924) )
v11 = *(_QWORD *)(a1 + 3520);
if ( *(_BYTE *)(v11 + 2497) || *(_BYTE *)(v11 + 2498) || *(_BYTE *)(v11 + 2500) || *(_BYTE *)(v11 + 2508) )
{
v12 = 5;
}
else
{
v12 = 6;
if ( *(_BYTE *)(v11 + 2499) )
v12 = 16;
}
v10 = fmaxf(v10, GJBaseGameLayer::getGroundHeightForMode(a1, v12));
}
if ( !*(_BYTE *)(a1 + 785) && (v10 != 270.0 || v8 == 33 || v3) )
return GJBaseGameLayer::animateInDualGroundNew(a1, v7);
*(_BYTE *)(a1 + 784) = 0;
if ( *(_BYTE *)(a1 + 672) )
{
v15 = 11;
sub_140355080(a1 + 1064, &v15);
v15 = 13;
sub_140355080(a1 + 1064, &v15);
*(_DWORD *)(a1 + 484) = 0;
*(_DWORD *)(a1 + 500) = 0;
*(_DWORD *)(a1 + 572) = 0;
*(_DWORD *)(a1 + 580) = 0;
*(_DWORD *)(a1 + 612) = 0;
}
v14 = 1053609165;
if ( *(_BYTE *)(a1 + 1058) )
v14 = 1050924811;
return GJGameState::tweenValue(a1 + 424, *(float *)(a1 + 1060), 0.0, 25, v14, 1, 1069547520, -1, -1);
}