//
// PlayerObject::updateRotation from 0x33f670 to 0x33f7b0 (320 bytes)
//
// 3 xrefs:
// > MenuGameLayer::update @ 0x3a9d70
// > GJBaseGameLayer::update @ 0x4979dc
// > GJBaseGameLayer::update @ 0x4979ee
//
// 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 PlayerObject::updateRotation(PlayerObject *a1, float a2)
{
float m_rotateSpeed; // s17
void (__fastcall *setRotation)(PlayerObject *__hidden, float); // r6
float v6; // r0
float v7; // r0
float v8; // r1
float v9; // r2
PlayerObject *v10; // r0
if ( a1->m_isLocked || a1->m_isDashing )
return;
if ( !a1->m_isBall )
{
if ( a1->m_isOnSlope )
{
PlayerObject::updateSlopeRotation(a1, a2);
goto LABEL_16;
}
if ( PlayerObject::isFlying(a1) )
{
PlayerObject::updateShipRotation(a1, a2);
goto LABEL_16;
}
if ( !PlayerObject::isFlying(a1)
&& !a1->m_isBall
&& a1->m_isOnGround2
&& !PlayerObject::playerIsFalling(a1, -0.25)
&& !a1->m_isOnSlope
&& !a1->m_wasOnSlope )
{
if ( a1->m_isPlatformer && a1->m_isRotating )
goto LABEL_16;
PlayerObject::stopRotation(a1, 0, 2);
v7 = PlayerObject::convertToClosestRotation(a1, 0.0);
v8 = a2;
v9 = v7;
v10 = a1;
LABEL_28:
PlayerObject::updateRotation(v10, v8, v9);
goto LABEL_16;
}
if ( (a1->m_isRobot || a1->m_isSpider) && !a1->m_isOnSlope && !a1->m_wasOnSlope )
{
v10 = a1;
v9 = 0.0;
v8 = a2 * 0.5;
goto LABEL_28;
}
}
LABEL_16:
if ( a1->m_rotationSpeed != 0.0 )
{
if ( a1->m_isBallRotating && a1->m_isBall )
m_rotateSpeed = a1->m_rotateSpeed;
else
m_rotateSpeed = 1.0;
setRotation = a1->setRotation;
v6 = COERCE_FLOAT(((int (__fastcall *)(PlayerObject *))a1->getRotation)(a1));
((void (__fastcall *)(PlayerObject *, _DWORD))setRotation)(
a1,
v6 + (float)((float)((float)(a2 / 60.0) * a1->m_rotationSpeed) * m_rotateSpeed));
}
}