//
// PlayerObject::rotateGameplay from 0x346778 to 0x3469be (582 bytes)
//
// 3 xrefs:
// > PlayerObject::resetObject @ 0x347a76
// > GJBaseGameLayer::rotateGameplay @ 0x481472
// > GJBaseGameLayer::rotateGameplay @ 0x4814a2
//
// 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::rotateGameplay(PlayerObject *a1, int a2, int a3, bool a4, float a5, float a6, bool a7, bool a8)
{
_BOOL4 v8; // r10
double m_yVelocity; // d9
double CurrentXVelocity; // r0
_BOOL4 m_isUpsideDown; // r9
_BOOL4 v15; // r3
int v16; // r7
double v17; // d10
bool v18; // r1
_BOOL4 m_isGoingLeft; // r5
bool v20; // r1
float v21; // s15
float v22; // r1
float v23; // s15
float x; // s15
float y; // s14
bool v26; // r3
float m_dashX; // s14
double *p_m_dashAngle; // r3
double v29; // d7
double v30; // d7
double v31; // d7
double v32; // d7
cocos2d::CCPoint v33; // [sp+4h] [bp-14h] BYREF
cocos2d::CCPoint v34; // [sp+Ch] [bp-Ch] BYREF
v8 = a4;
m_yVelocity = a1->m_yVelocity;
CurrentXVelocity = PlayerObject::getCurrentXVelocity(a1);
m_isUpsideDown = a1->m_isUpsideDown;
v15 = (unsigned int)(a2 - 3) <= 1;
v16 = a1->m_isSideways ^ v15;
a1->m_isSideways = v15;
v17 = CurrentXVelocity;
v18 = a2 == 1 || a2 == 4;
PlayerObject::flipGravity(a1, v18, 1);
m_isGoingLeft = a1->m_isGoingLeft;
if ( a1->m_isPlatformer )
v20 = a1->m_isGoingLeft;
else
v20 = (unsigned int)(a3 - 2) <= 1;
PlayerObject::doReversePlayer(a1, v20);
PlayerObject::updatePlayerArt(a1);
if ( v16 )
{
if ( a1->m_isGoingLeft == m_isGoingLeft && a1->m_isDart )
{
PlayerObject::createFadeOutDartStreak(a1);
if ( a1->m_fadeOutStreak )
{
HardStreak::reset(a1->m_waveTrail);
PlayerObject::placeStreakPoint(a1);
}
}
if ( ((int (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_vehicleGroundParticles->isActive)(a1->m_vehicleGroundParticles) )
cocos2d::CCParticleSystem::resetSystem(a1->m_vehicleGroundParticles);
PlayerObject::resetCollisionLog(a1, 1);
v21 = v17;
v22 = v21;
v23 = m_yVelocity;
cocos2d::CCPoint::CCPoint(&v33, v22, v23);
x = v33.x;
y = v33.y;
v33.y = v33.x;
v33.x = y;
if ( v8 )
{
if ( a7 )
{
v33.x = a5;
v33.y = a6;
}
else
{
v33.x = y * a5;
v33.y = x * a6;
}
}
cocos2d::CCPoint::CCPoint(&v34, &v33);
PlayerObject::updatePlayerForce(a1, (cocos2d::CCPoint)(unsigned int)&v34, v26);
a1->m_maybeIsBoosted = 1;
PlayerObject::playerTeleported(a1);
if ( a8 )
PlayerObject::handlePlayerCommand(a1, 543);
if ( PlayerObject::isInNormalMode(a1) && !a1->m_isRotating )
PlayerObject::runRotateAction(a1, 0, 4);
if ( a1->m_isDashing )
{
m_dashX = a1->m_dashX;
a1->m_dashX = a1->m_dashY;
a1->m_dashY = m_dashX;
}
LABEL_27:
if ( !a1->m_isDashing )
return;
p_m_dashAngle = &a1->m_dashAngle;
if ( a1->m_isGoingLeft != m_isGoingLeft )
{
if ( v16 )
*p_m_dashAngle = *p_m_dashAngle + 180.0;
v29 = *p_m_dashAngle;
if ( *p_m_dashAngle <= 0.0 )
v30 = -180.0 - v29;
else
v30 = 180.0 - v29;
*p_m_dashAngle = v30;
}
v31 = *p_m_dashAngle;
if ( *p_m_dashAngle <= 180.0 )
{
if ( v31 >= -180.0 )
{
LABEL_40:
PlayerObject::updateDashArt(a1);
return;
}
v32 = v31 + 360.0;
}
else
{
v32 = v31 - 360.0;
}
*p_m_dashAngle = v32;
goto LABEL_40;
}
if ( a1->m_isUpsideDown != m_isUpsideDown || a1->m_isGoingLeft != m_isGoingLeft )
goto LABEL_27;
}