//
// PlayerObject::updateRotation_1 from 0x10040cbb0 to 0x10040cd6f (447 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::update @ 0x10015252f
// > GJBaseGameLayer::update @ 0x100152549
// > MenuGameLayer::update @ 0x1004fadc3
//
// 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; // rbx
float m_rotateSpeed; // xmm1_4
float v4; // xmm0_4
float v5; // xmm2_4
double m_yVelocity; // xmm0_8
bool v7; // cc
float v8; // xmm0_4
float v9; // xmm1_4
float v10; // [rsp+4h] [rbp-Ch]
if ( a1->m_isLocked || a1->m_isDashing )
return;
v10 = a2;
if ( !a1->m_isBall )
{
if ( a1->m_isOnSlope )
{
v2 = a1;
PlayerObject::updateSlopeRotation(a1, a2);
LABEL_11:
a1 = v2;
goto LABEL_12;
}
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart || a1->m_isSwing )
{
v2 = a1;
PlayerObject::updateShipRotation(a1, a2);
goto LABEL_11;
}
if ( a1->m_isOnGround2
&& ((v5 = a2, m_yVelocity = a1->m_yVelocity, !a1->m_isUpsideDown)
? (v7 = m_yVelocity >= -0.25)
: (v7 = m_yVelocity <= 0.25),
(a2 = v5, v7) && !a1->m_wasOnSlope) )
{
if ( !a1->m_isPlatformer || !a1->m_isRotating )
{
*(_WORD *)&a1->m_isRotating = 0;
a1->m_isBallRotating = 0;
a1->m_rotationSpeed = 0.0;
v2 = a1;
v9 = PlayerObject::convertToClosestRotation(a1, 0.0);
v8 = v10;
goto LABEL_31;
}
}
else if ( (a1->m_isRobot || a1->m_isSpider) && !a1->m_wasOnSlope )
{
v8 = 0.5 * a2;
v9 = 0.0;
v2 = a1;
LABEL_31:
PlayerObject::updateRotation(a1, v8, v9);
goto LABEL_11;
}
}
LABEL_12:
if ( a1->m_rotationSpeed != 0.0 )
{
m_rotateSpeed = 1.0;
if ( a1->m_isBallRotating && a1->m_isBall )
m_rotateSpeed = a1->m_rotateSpeed;
v4 = ((float (*)(void))a1->getRotation)();
((void (__fastcall *)(PlayerObject *, float))a1->setRotation)(
a1,
v4 + (float)((float)((float)(v10 / 60.0) * a1->m_rotationSpeed) * m_rotateSpeed));
}
}