//
// MenuGameLayer::update from 0x3a9c44 to 0x3a9e82 (574 bytes)
//
// 0 xrefs:
//
// 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 MenuGameLayer::update(MenuGameLayer *a1, float a2)
{
cocos2d::CCDirector *v4; // r0
float v5; // s17
PlayerObject *m_playerObject; // r7
const cocos2d::CCPoint *v7; // r0
int v8; // r2
bool v9; // r3
PlayerObject *v10; // r3
float m_unkAngle1; // s20
float v12; // s16
cocos2d::CCDirector *v13; // r0
float v14; // s16
PlayerObject *v15; // r7
void (__fastcall *setPosition)(PlayerObject *__hidden, const cocos2d::CCPoint *); // r8
float *v17; // r0
const cocos2d::CCPoint *v18; // r0
int v19; // r2
bool v20; // r3
float m_backgroundWrapPosition; // s14
float i; // s15
cocos2d::CCSprite *m_backgroundSprite; // r0
GJGroundLayer *m_groundLayer; // r7
float x; // s15
float j; // s14
cocos2d::CCPoint v27; // r1
cocos2d::CCSize v28; // [sp+4h] [bp-24h] BYREF
cocos2d::CCPoint v29; // [sp+Ch] [bp-1Ch] BYREF
cocos2d::CCPoint v30; // [sp+14h] [bp-14h] BYREF
cocos2d::CCPoint v31; // [sp+1Ch] [bp-Ch] BYREF
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v28, v4);
v5 = a2 * 60.0;
a1->m_deltaCount = a1->m_deltaCount + a2;
MenuGameLayer::updateColors(a1);
m_playerObject = a1->m_playerObject;
v7 = m_playerObject->getPosition(m_playerObject);
cocos2d::CCPoint::CCPoint(&v31, v7);
cocos2d::CCPoint::operator=((PlayerObject *)&m_playerObject->m_shipRotation, COERCE_FLOAT(&v31), v8, v9);
PlayerObject::updateInternalActions(a1->m_playerObject, a2);
((void (__fastcall *)(PlayerObject *, _DWORD))a1->m_playerObject->update)(a1->m_playerObject, a2 * 60.0);
v10 = a1->m_playerObject;
v10->m_totalTime = a1->m_deltaCount;
m_unkAngle1 = v10->m_unkAngle1;
if ( v10->m_vehicleSize == 1.0 )
v12 = 0.0;
else
v12 = 1.0 - v10->m_vehicleSize;
if ( v10->m_vehicleSize != 1.0 )
v12 = (float)(m_unkAngle1 * v12) * 0.5;
v13 = cocos2d::CCDirector::sharedDirector();
v14 = (float)((float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenBottom(v13)) + 90.0) + (float)(m_unkAngle1 * 0.5))
- v12;
if ( a1->m_playerObject->getPosition(a1->m_playerObject)->y < v14 )
{
v15 = a1->m_playerObject;
setPosition = v15->setPosition;
v17 = (float *)v15->getPosition(v15);
cocos2d::CCPoint::CCPoint(&v31, *v17, v14);
setPosition(v15, &v31);
PlayerObject::hitGround(a1->m_playerObject, nullptr, 0);
}
PlayerObject::updateRotation(a1->m_playerObject, v5);
v18 = a1->m_playerObject->getPosition(a1->m_playerObject);
if ( v18->x > (float)(v28.width + 100.0) )
MenuGameLayer::resetPlayer(a1);
cocos2d::CCPoint::CCPoint(&v31, a1->m_realBackgroundPosition.x + (float)((float)(v5 * 5.77) * 0.9), 0.0);
cocos2d::CCPoint::operator=((PlayerObject *)&a1->m_realBackgroundPosition, COERCE_FLOAT(&v31), v19, v20);
cocos2d::CCPoint::CCPoint(
&v29,
-(float)(a1->m_realBackgroundPosition.x * 0.1),
-(float)(a1->m_realBackgroundPosition.y * 0.1));
m_backgroundWrapPosition = a1->m_backgroundWrapPosition;
for ( i = v29.x; i < (float)-m_backgroundWrapPosition; i = i + m_backgroundWrapPosition )
;
m_backgroundSprite = a1->m_backgroundSprite;
v29.x = i;
m_backgroundSprite->setPosition(m_backgroundSprite, &v29);
cocos2d::CCPoint::CCPoint(&v30, COERCE_FLOAT(LODWORD(a1->m_realBackgroundPosition.x) ^ 0x80000000), 0.0);
m_groundLayer = a1->m_groundLayer;
x = v30.x;
for ( j = m_groundLayer->m_textureWidth; x < (float)-j; x = x + j )
;
v30.x = x;
cocos2d::CCPoint::CCPoint(&v31, &v30);
LODWORD(v27.x) = &v31;
GJGroundLayer::updateGroundPos(m_groundLayer, v27);
PlayerObject::updateEffects(a1->m_playerObject, a2);
}