//
// PlayerObject::rotateGameplay from 0x100226c2c to 0x100226f44 (792 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::rotateGameplay @ 0x1001ea98c
// > GJBaseGameLayer::rotateGameplay @ 0x1001ea9bc
// > PlayerObject::resetObject @ 0x1002269b8
//
// 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::rotateGameplay(
PlayerObject *a1,
int a2,
int a3,
bool a4,
float a5,
float a6,
bool a7,
bool a8)
{
_BOOL4 v8; // w20
_BOOL4 v9; // w21
_BOOL4 v12; // w22
double m_platformerXVelocity; // d10
double m_yVelocity; // d11
int v17; // w24
int m_isSideways; // w25
_BOOL4 m_isUpsideDown; // w27
bool v21; // w1
_BOOL4 m_isGoingLeft; // w26
bool v23; // w1
__n128 v24; // q0
__n128 v25; // q1
unsigned __int64 v26; // kr00_8
int v27; // w2
float m_dashX; // s0
double m_dashAngle; // d0
double v30; // d1
__int64 v31; // [xsp+0h] [xbp-80h] BYREF
unsigned __int64 v32; // [xsp+8h] [xbp-78h] BYREF
v8 = a8;
v9 = a7;
v12 = a4;
if ( a1->m_isPlatformer )
m_platformerXVelocity = a1->m_platformerXVelocity;
else
m_platformerXVelocity = a1->m_speedMultiplier * a1->m_playerSpeed;
m_yVelocity = a1->m_yVelocity;
v17 = (unsigned int)(a2 - 3) < 2;
m_isSideways = a1->m_isSideways;
a1->m_isSideways = v17;
m_isUpsideDown = a1->m_isUpsideDown;
v21 = a2 == 1 || a2 == 4;
PlayerObject::flipGravity(a1, v21, 1);
m_isGoingLeft = a1->m_isGoingLeft;
if ( a1->m_isPlatformer )
v23 = a1->m_isGoingLeft;
else
v23 = (a3 & 0xFFFFFFFE) == 2;
PlayerObject::doReversePlayer(a1, v23);
PlayerObject::updatePlayerArt(a1);
if ( m_isSideways != v17 )
{
if ( m_isGoingLeft == a1->m_isGoingLeft && a1->m_isDart )
{
PlayerObject::createFadeOutDartStreak(a1);
if ( a1->m_fadeOutStreak )
{
HardStreak::reset(a1->m_waveTrail);
PlayerObject::placeStreakPoint(a1);
}
}
if ( ((unsigned int (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_vehicleGroundParticles->isActive)(a1->m_vehicleGroundParticles) )
cocos2d::CCParticleSystem::resetSystem(a1->m_vehicleGroundParticles);
PlayerObject::resetCollisionLog(a1, 1);
v24.n128_f32[0] = m_platformerXVelocity;
v25.n128_f32[0] = m_yVelocity;
sub_100022980(v24, v25, &v32);
v26 = v32;
v32 = __PAIR64__(v32, HIDWORD(v32));
if ( v12 )
{
if ( v9 )
{
*(float *)&v32 = a5;
}
else
{
*(float *)&v32 = *((float *)&v26 + 1) * a5;
a6 = *(float *)&v26 * a6;
}
*((float *)&v32 + 1) = a6;
}
sub_1000229B8(&v31, (__int64 *)&v32);
a1->m_isAccelerating = 1;
a1->m_yVelocity = *((float *)&v31 + 1);
if ( a1->m_isPlatformer )
{
a1->m_platformerXVelocity = *(float *)&v31;
a1->m_affectedByForces = 1;
}
a1->m_maybeIsBoosted = 1;
a1->m_isOnGround2 = 0;
sub_1000229D0(&a1->m_lastGroundedPos, (double *)&stru_10086CBF0);
PlayerObject::placeStreakPoint(a1);
if ( v8 )
{
a1->m_isAccelerating = 0;
a1->m_affectedByForces = 0;
}
if ( !a1->m_isShip
&& !a1->m_isBird
&& !a1->m_isDart
&& !a1->m_isSwing
&& !a1->m_isBall
&& !a1->m_isRobot
&& !a1->m_isSpider
&& !a1->m_isRotating )
{
PlayerObject::runRotateAction(a1, 0, v27);
}
if ( a1->m_isDashing )
{
m_dashX = a1->m_dashX;
a1->m_dashX = a1->m_dashY;
a1->m_dashY = m_dashX;
}
LABEL_43:
if ( !a1->m_isDashing )
return;
m_dashAngle = a1->m_dashAngle;
if ( m_isGoingLeft != a1->m_isGoingLeft )
{
if ( m_isSideways != v17 )
m_dashAngle = m_dashAngle + 180.0;
m_dashAngle = dbl_10063A7B0[m_dashAngle > 0.0] - m_dashAngle;
a1->m_dashAngle = m_dashAngle;
}
if ( m_dashAngle <= 180.0 )
{
if ( m_dashAngle >= -180.0 )
{
LABEL_53:
PlayerObject::updateDashArt(a1);
return;
}
v30 = 360.0;
}
else
{
v30 = -360.0;
}
a1->m_dashAngle = m_dashAngle + v30;
goto LABEL_53;
}
if ( m_isUpsideDown != a1->m_isUpsideDown || m_isGoingLeft != a1->m_isGoingLeft )
goto LABEL_43;
}