//
// PlayerObject::toggleRollMode from 0x63173c to 0x631890 (340 bytes)
//
// 7 xrefs:
// > PlayerObject::switchedToMode @ 0x630aa8
// > PlayerObject::switchedToMode @ 0x630b50
// > PlayerObject::copyAttributes @ 0x631d94
// > MenuGameLayer::resetPlayer @ 0x6c9470
// > GJBaseGameLayer::switchToRollMode @ 0x859e7c
// > GJBaseGameLayer::switchToRollMode @ 0x859e94
// > ??> @ 0x9e040
//
// 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::toggleRollMode(PlayerObject *a1, bool a2, bool a3)
{
_BOOL4 v3; // w20
_BOOL4 v5; // w21
double m_totalTime; // x1
long double v7; // q0
GameManager *v8; // x0
cocos2d::ccColor3B v9; // [xsp+38h] [xbp+38h]
v3 = a2;
v5 = a3;
if ( a1->m_isBall != a2 )
{
m_totalTime = a1->m_totalTime;
a1->m_isBall = v3;
a1->m_gameModeChangedTime = m_totalTime;
if ( v3 )
{
PlayerObject::switchedToMode(a1, BallPortal);
if ( a1->m_isBall )
{
if ( a1->m_vehicleSize != 1.0 && a1->m_defaultMiniIcon )
{
PlayerObject::updatePlayerRollFrame(a1, 0);
}
else
{
v8 = GameManager::sharedState();
PlayerObject::updatePlayerRollFrame(a1, v8->m_playerBall.random - v8->m_playerBall.seed);
}
if ( !v5 )
{
*(_WORD *)&v9.r = 13055;
v9.b = 50;
PlayerObject::spawnPortalCircle(a1, v9, 50.0);
}
PlayerObject::stopRotation(a1, 1, 11);
LABEL_17:
PlayerObject::modeDidChange(a1);
return;
}
}
if ( a1->m_vehicleSize != 1.0 && a1->m_defaultMiniIcon )
PlayerObject::updatePlayerFrame(a1, 0);
else
PlayerObject::updatePlayerFrame(a1, a1->m_maybeSavedPlayerFrame);
LODWORD(v7) = 0;
if ( a1->m_isUpsideDown )
LODWORD(v7) = 1127481344;
a1->setRotation(a1, v7);
PlayerObject::stopRotation(a1, 1, 11);
if ( v3 )
goto LABEL_17;
}
}