//
// GJBaseGameLayer::updateDualGround from 0x140213180 to 0x140213367 (487 bytes)
//
// 8 xrefs:
// > GJBaseGameLayer::setupLevelStart @ 0x140212a3b
// > GJBaseGameLayer::playerWillSwitchMode @ 0x140212faa
// > GJBaseGameLayer::toggleDualMode @ 0x140216df8
// > GJBaseGameLayer::updateZoom @ 0x140235e4c
// > GJBaseGameLayer::exitStaticCamera @ 0x14023fabb
// > PlayLayer::loadFromCheckpoint @ 0x1403b7eab
// > CameraTriggerGameObject::triggerObject @ 0x1404bdafe
// > ??> @ 0x1406cd068
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void GJBaseGameLayer::updateDualGround(GJBaseGameLayer *a1, PlayerObject *a2, int a3, bool a4, float a5)
{
bool m_isDualMode; // bl
__int64 v8; // rcx
bool v9; // r9
GameObject *v10; // r10
int v11; // r11d
float GroundHeightForMode; // xmm0_4
float v13; // xmm2_4
PlayerObject *m_player2; // rcx
int v15; // edx
float v16; // xmm1_4
float v17; // [rsp+20h] [rbp-38h]
int v18; // [rsp+70h] [rbp+18h] BYREF
m_isDualMode = a1->m_gameState.m_isDualMode;
if ( (unsigned int)(a3 - 23) > 1 )
a1->m_gameState.m_dualRelated = a3;
GroundHeightForMode = GJBaseGameLayer::getGroundHeightForMode(a1, a3);
v13 = GroundHeightForMode;
if ( m_isDualMode )
{
if ( GroundHeightForMode == 240.0 )
v13 = 270.0;
m_player2 = *(PlayerObject **)(v8 + 3488);
if ( a2->m_uniqueID == m_player2->m_uniqueID )
m_player2 = a1->m_player2;
if ( m_player2->m_isShip || m_player2->m_isBird || m_player2->m_isDart || m_player2->m_isSwing )
{
v15 = 5;
}
else
{
v15 = 6;
if ( m_player2->m_isBall )
v15 = 16;
}
v13 = fmaxf(GJBaseGameLayer::getGroundHeightForMode(a1, v15), v13);
}
if ( a1->m_gameState.m_isFreeMode || v13 == 270.0 && v11 != 33 && !m_isDualMode )
{
a1->m_gameState.m_unkBool7 = 0;
if ( a1->m_gameState.m_unkBool1 )
{
v18 = 11;
sub_14024AC30(&a1->m_gameState.m_tweenActions, &v18);
v18 = 13;
sub_14024AC30(&a1->m_gameState.m_tweenActions, &v18);
a1->m_gameState.m_unkPoint6.y = 0.0;
a1->m_gameState.m_unkPoint8.y = 0.0;
a1->m_gameState.m_unkPoint17.y = 0.0;
a1->m_gameState.m_unkPoint18.y = 0.0;
a1->m_gameState.m_unkPoint22.y = 0.0;
}
v16 = 0.40000001;
if ( a1->m_gameState.m_isDualMode )
v16 = 0.32000002;
GJGameState::tweenValue(&a1->m_gameState, a1->m_gameState.m_unkFloat9, 0.0, 25, v16, 1, 1.5, -1, -1);
}
else
{
GJBaseGameLayer::animateInDualGroundNew(a1, v10, v13, v9, v17);
}
}