//
// PlayerObject::updateRotation_1 from 0x1002242b0 to 0x10022445c (428 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::update @ 0x1001fed48
// > GJBaseGameLayer::update @ 0x1001fed60
// > MenuGameLayer::update @ 0x10039b500
//
// 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 __fastcall PlayerObject::updateRotation_1(PlayerObject *a1, float a2)
{
PlayerObject *v2; // x19
float m_rotateSpeed; // s9
float v5; // s0
double m_yVelocity; // d0
float v7; // s0
float v8; // s1
if ( a1->m_isLocked )
return;
v2 = a1;
if ( a1->m_isDashing )
return;
if ( a1->m_isBall )
goto LABEL_11;
if ( a1->m_isOnSlope )
{
PlayerObject::updateSlopeRotation(a1, a2);
goto LABEL_11;
}
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing )
{
PlayerObject::updateShipRotation(a1, a2);
goto LABEL_11;
}
if ( !a1->m_isOnGround2 )
goto LABEL_23;
m_yVelocity = a1->m_yVelocity;
if ( a1->m_isUpsideDown )
{
if ( m_yVelocity > 0.25 )
{
LABEL_23:
if ( (a1->m_isRobot || a1->m_isSpider) && !a1->m_wasOnSlope )
{
v7 = a2 * 0.5;
v8 = 0.0;
LABEL_30:
PlayerObject::updateRotation(a1, v7, v8);
goto LABEL_11;
}
goto LABEL_11;
}
}
else if ( m_yVelocity < -0.25 )
{
goto LABEL_23;
}
if ( a1->m_wasOnSlope )
goto LABEL_23;
if ( !a1->m_isPlatformer || !a1->m_isRotating )
{
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
v8 = PlayerObject::convertToClosestRotation(a1, 0.0);
a1 = v2;
v7 = a2;
goto LABEL_30;
}
LABEL_11:
if ( v2->m_rotationSpeed != 0.0 )
{
m_rotateSpeed = 1.0;
if ( v2->m_isBallRotating && v2->m_isBall )
m_rotateSpeed = v2->m_rotateSpeed;
v5 = ((float (__fastcall *)(PlayerObject *))v2->getRotation)(v2)
+ (float)((float)((float)(a2 / 60.0) * v2->m_rotationSpeed) * m_rotateSpeed);
((void (__fastcall *)(PlayerObject *, float))v2->setRotation)(v2, v5);
}
}