//
// PlayerObject::saveToCheckpoint from 0x34fb18 to 0x350274 (1884 bytes)
//
// 2 xrefs:
// > PlayLayer::createCheckpoint @ 0x31ee86
// > PlayLayer::createCheckpoint @ 0x31eeb8
//
// 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::saveToCheckpoint(PlayerObject *a1, PlayerCheckpoint *a2)
{
const cocos2d::CCPoint *v4; // r0
int v5; // r2
bool v6; // r3
int v7; // r2
bool v8; // r3
float v9; // r0
int m_lastCollisionTop; // r3
double m_maybeReverseAcceleration; // r2
int v12; // r2
bool v13; // r3
double m_scaleXRelatedTime; // r2
cocos2d::CCArray *m_touchingRings; // r3
float m_xVelocityRelated; // r2
double m_maybeSlopeForce; // r0
double m_physDeltaRelated; // r0
double m_maybeSlidingStartTime; // r0
double m_maybeChangedDirectionAngle; // r0
int m_stateForce; // r3
std::map *p_m_jumpPadRelated; // r0
float *p_m_fallStartY; // r4
cocos2d::ccArray *data; // r2
cocos2d::CCObject **arr; // r7
cocos2d::CCObject **v26; // r6
cocos2d::CCObject *v27; // r1
cocos2d::CCObject *v28; // t1
cocos2d::CCPoint v29; // [sp+4h] [bp-Ch] BYREF
LODWORD(v29.x) = a2;
v4 = a1->getPosition(a1);
cocos2d::CCPoint::CCPoint(&v29, v4);
cocos2d::CCPoint::operator=((PlayerObject *)&a2->m_position, COERCE_FLOAT(&v29), v5, v6);
cocos2d::CCPoint::CCPoint(&v29, &a1->m_lastPosition);
cocos2d::CCPoint::operator=((PlayerObject *)&a2->m_lastPosition, COERCE_FLOAT(&v29), v7, v8);
a2->m_yVelocityUnrounded = a1->m_yVelocity;
a2->m_isUpsideDown = a1->m_isUpsideDown;
a2->m_isSideways = a1->m_isSideways;
a2->m_isShip = a1->m_isShip;
a2->m_isBall = a1->m_isBall;
a2->m_isBird = a1->m_isBird;
a2->m_isDart = a1->m_isDart;
a2->m_isRobot = a1->m_isRobot;
a2->m_isSpider = a1->m_isSpider;
a2->m_isSwing = a1->m_isSwing;
a2->m_isOnGround = a1->m_isOnGround;
a2->m_ghostType = a1->m_ghostType;
a2->m_isMini = a1->m_vehicleSize != 1.0;
a2->m_playerSpeed = a1->m_playerSpeed;
a2->m_isHidden = a1->m_isHidden;
a2->m_isGoingLeft = a1->m_isGoingLeft;
a2->m_maybeReverseSpeed = a1->m_maybeReverseSpeed;
a2->m_lastFlipTime = a1->m_lastFlipTime;
a2->m_gravityMod = a1->m_gravityMod;
a2->m_decreaseBoostSlide = a1->m_decreaseBoostSlide;
a2->m_unk838 = a1->m_unk838;
a2->m_followRelated = a1->m_followRelated;
std::vector::operator=((void **)&a2->m_playerFollowFloats.m_start, (void **)&a1->m_playerFollowFloats.m_start);
a2->m_objectSnappedTo = a1->m_objectSnappedTo;
a2->m_snapDistance = a1->m_snapDistance;
a2->m_accelerationOrSpeed = a1->m_accelerationOrSpeed;
a2->m_wasOnSlope = a1->m_wasOnSlope;
a2->m_isOnSlope = a1->m_isOnSlope;
a2->m_slopeVelocity = a1->m_slopeVelocity;
if ( a1->m_isDashing )
{
a2->m_isDashing = 1;
a2->m_dashAngle = a1->m_dashAngle;
a2->m_dashX = a1->m_dashX;
a2->m_dashY = a1->m_dashY;
a2->m_dashRing = a1->m_dashRing;
a2->m_dashStartTime = a1->m_dashStartTime;
}
v9 = COERCE_FLOAT(((int (__fastcall *)(PlayerObject *))a1->getRotation)(a1));
a2->m_wasTeleported = a1->m_wasTeleported;
a2->m_fixGravityBug = a1->m_fixGravityBug;
a2->m_reverseSync = a1->m_reverseSync;
a2->m_yVelocityBeforeSlope = a1->m_yVelocityBeforeSlope;
a2->m_slopeStartTime = a1->m_slopeStartTime;
a2->m_justPlacedStreak = a1->m_justPlacedStreak;
a2->m_lastCollisionBottom = a1->m_lastCollisionBottom;
m_lastCollisionTop = a1->m_lastCollisionTop;
a2->m_rotation = v9;
a2->m_lastCollisionTop = m_lastCollisionTop;
a2->m_lastCollisionLeft = a1->m_lastCollisionLeft;
a2->m_lastCollisionRight = a1->m_lastCollisionRight;
a2->m_unk50C = a1->m_unk50C;
a2->m_unk510 = a1->m_unk510;
a2->m_currentSlope2 = a1->m_currentSlope2;
a2->m_preLastGroundObject = a1->m_preLastGroundObject;
a2->m_slopeAngle = a1->m_slopeAngle;
a2->m_slopeSlidingMaybeRotated = a1->m_slopeSlidingMaybeRotated;
a2->m_quickCheckpointMode = a1->m_quickCheckpointMode;
a2->m_collidedObject = a1->m_collidedObject;
a2->m_lastGroundObject = a1->m_lastGroundObject;
a2->m_collidingWithLeft = a1->m_collidingWithLeft;
a2->m_collidingWithRight = a1->m_collidingWithRight;
a2->m_scaleXRelated2 = a1->m_scaleXRelated2;
a2->m_groundYVelocity = a1->m_groundYVelocity;
a2->m_yVelocityRelated = a1->m_yVelocityRelated;
a2->m_scaleXRelated3 = a1->m_scaleXRelated3;
a2->m_collidingBetweenSteps = a1->m_collidingBetweenSteps;
a2->m_scaleXRelated4 = a1->m_scaleXRelated4;
a2->m_scaleXRelated5 = a1->m_scaleXRelated5;
a2->m_isCollidingWithSlope = a1->m_isCollidingWithSlope;
a2->m_isBallRotating = a1->m_isBallRotating;
a2->m_unk669 = a1->m_unk669;
a2->m_currentPotentialSlope = a1->m_currentPotentialSlope;
a2->m_currentSlope = a1->m_currentSlope;
a2->unk_584 = a1->unk_584;
a2->m_collidingWithSlopeId = a1->m_collidingWithSlopeId;
a2->m_slopeFlipGravityRelated = a1->m_slopeFlipGravityRelated;
a2->m_slopeAngleRadians = a1->m_slopeAngleRadians;
a2->m_rotationSpeed = a1->m_rotationSpeed;
a2->m_rotateSpeed = a1->m_rotateSpeed;
a2->m_isRotating = a1->m_isRotating;
a2->m_isBallRotating2 = a1->m_isBallRotating2;
a2->m_speedMultiplier = a1->m_speedMultiplier;
a2->m_yStart = a1->m_yStart;
a2->m_gravity = a1->m_gravity;
a2->m_trailingParticleLife = a1->m_trailingParticleLife;
a2->m_gameModeChangedTime = a1->m_gameModeChangedTime;
a2->m_padRingRelated = a1->m_padRingRelated;
a2->m_maybeIsFalling = a1->m_maybeIsFalling;
a2->m_shouldTryPlacingCheckpoint = a1->m_shouldTryPlacingCheckpoint;
a2->m_playEffects = a1->m_playEffects;
a2->m_isOnGround3 = a1->m_isOnGround3;
a2->m_lastSpiderFlipTime = a1->m_lastSpiderFlipTime;
a2->m_unkBool5 = a1->m_unkBool5;
a2->m_ringJumpRelated = a1->m_ringJumpRelated;
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::operator=(
(int)&a2->m_ringRelatedSet,
&a1->m_ringRelatedSet._M_h._M_buckets);
a2->m_maybeSpriteRelated = a1->m_maybeSpriteRelated;
a2->m_landParticlesAngle = a1->m_landParticlesAngle;
a2->m_landParticleRelatedY = a1->m_landParticleRelatedY;
a2->m_slopeRotation = a1->m_slopeRotation;
a2->m_currentSlopeYVelocity = a1->m_currentSlopeYVelocity;
a2->m_unk3d0 = a1->m_unk3d0;
a2->m_blackOrbRelated = a1->m_blackOrbRelated;
a2->m_unk3e0 = a1->m_unk3e0;
a2->m_unk3e1 = a1->m_unk3e1;
a2->m_isAccelerating = a1->m_isAccelerating;
a2->m_isCurrentSlopeTop = a1->m_isCurrentSlopeTop;
a2->m_collidedTopMinY = a1->m_collidedTopMinY;
a2->m_collidedBottomMaxY = a1->m_collidedBottomMaxY;
a2->m_collidedLeftMaxX = a1->m_collidedLeftMaxX;
a2->m_collidedRightMinX = a1->m_collidedRightMinX;
a2->m_wasJumpBuffered = a1->m_wasJumpBuffered;
a2->m_wasRobotJump = a1->m_wasRobotJump;
a2->m_stateJumpBuffered = a1->m_stateJumpBuffered;
a2->m_stateRingJump2 = a1->m_stateRingJump2;
a2->m_touchedRing = a1->m_touchedRing;
a2->m_touchedCustomRing = a1->m_touchedCustomRing;
a2->m_touchedGravityPortal = a1->m_touchedGravityPortal;
a2->m_maybeTouchedBreakableBlock = a1->m_maybeTouchedBreakableBlock;
a2->m_touchedPad = a1->m_touchedPad;
a2->m_yVelocity = a1->m_yVelocity;
a2->m_fallSpeed = a1->m_fallSpeed;
a2->m_maybeUpsideDownSlope = a1->m_maybeUpsideDownSlope;
a2->m_reverseRelated = a1->m_reverseRelated;
m_maybeReverseAcceleration = a1->m_maybeReverseAcceleration;
a2->m_maybeReverseAcceleration = m_maybeReverseAcceleration;
HIDWORD(m_maybeReverseAcceleration) = LODWORD(a1->m_xVelocityRelated2);
a2->m_xVelocityRelated2 = *((float *)&m_maybeReverseAcceleration + 1);
cocos2d::CCPoint::operator=(
(PlayerObject *)&a2->m_shipRotation,
COERCE_FLOAT((PlayerObject *)&a1->m_shipRotation),
SLODWORD(m_maybeReverseAcceleration),
SBYTE4(m_maybeReverseAcceleration));
cocos2d::CCPoint::operator=(
(PlayerObject *)&a2->m_lastPortalPos,
COERCE_FLOAT((PlayerObject *)&a1->m_lastPortalPos),
v12,
v13);
a2->m_unkUnused3 = a1->m_unkUnused3;
a2->m_isOnGround2 = a1->m_isOnGround2;
a2->m_lastLandTime = a1->m_lastLandTime;
a2->m_platformerVelocityRelated = a1->m_platformerVelocityRelated;
a2->m_maybeIsBoosted = a1->m_maybeIsBoosted;
m_scaleXRelatedTime = a1->m_scaleXRelatedTime;
a2->m_scaleXRelatedTime = m_scaleXRelatedTime;
a2->m_isLocked = a1->m_isLocked;
BYTE4(m_scaleXRelatedTime) = a1->m_controlsDisabled;
a2->m_controlsDisabled = BYTE4(m_scaleXRelatedTime);
cocos2d::CCPoint::operator=(
(PlayerObject *)&a2->m_lastGroundedPos,
COERCE_FLOAT((PlayerObject *)&a1->m_lastGroundedPos),
SLODWORD(m_scaleXRelatedTime),
SBYTE4(m_scaleXRelatedTime));
cocos2d::CCArray::removeAllObjects(a2->m_touchingRings);
m_touchingRings = a1->m_touchingRings;
if ( m_touchingRings )
{
data = m_touchingRings->data;
if ( data->num )
{
arr = data->arr;
v26 = &arr[data->num] + 0x3FFFFFFF;
while ( arr <= v26 )
{
v28 = *arr++;
v27 = v28;
if ( !v28 )
break;
cocos2d::CCArray::addObject(a2->m_touchingRings, v27);
}
}
}
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::operator=(
(int)&a2->m_touchedRings,
&a1->m_touchedRings._M_h._M_buckets);
a2->m_lastActivatedPortal = a1->m_lastActivatedPortal;
a2->m_totalTime = a1->m_totalTime;
a2->m_yVelocityRelated3 = a1->m_yVelocityRelated3;
a2->m_defaultMiniIcon = a1->m_defaultMiniIcon;
a2->m_swapColors = a1->m_swapColors;
a2->m_switchDashFireColor = a1->m_switchDashFireColor;
a2->m_stateOnGround = a1->m_stateOnGround;
*(_DWORD *)&a2->m_stateUnk = *(_DWORD *)&a1->m_stateUnk;
a2->m_stateBoostX = a1->m_stateBoostX;
a2->m_stateBoostY = a1->m_stateBoostY;
a2->m_maybeStateForce2 = a1->m_maybeStateForce2;
a2->m_stateScale = a1->m_stateScale;
a2->m_platformerXVelocity = a1->m_platformerXVelocity;
a2->m_holdingRight = a1->m_holdingRight;
a2->m_holdingLeft = a1->m_holdingLeft;
a2->m_leftPressedFirst = a1->m_leftPressedFirst;
a2->m_scaleXRelated = a1->m_scaleXRelated;
m_xVelocityRelated = a1->m_xVelocityRelated;
a2->m_maybeHasStopped = a1->m_maybeHasStopped;
a2->m_xVelocityRelated = m_xVelocityRelated;
m_maybeSlopeForce = a1->m_maybeSlopeForce;
a2->m_maybeGoingCorrectSlopeDirection = a1->m_maybeGoingCorrectSlopeDirection;
a2->m_isSliding = a1->m_isSliding;
a2->m_maybeSlopeForce = m_maybeSlopeForce;
m_physDeltaRelated = a1->m_physDeltaRelated;
a2->m_isOnIce = a1->m_isOnIce;
a2->m_physDeltaRelated = m_physDeltaRelated;
m_maybeSlidingStartTime = a1->m_maybeSlidingStartTime;
a2->m_isOnGround4 = a1->m_isOnGround4;
a2->m_maybeSlidingTime = a1->m_maybeSlidingTime;
a2->m_maybeSlidingStartTime = m_maybeSlidingStartTime;
a2->m_changedDirectionsTime = a1->m_changedDirectionsTime;
a2->m_slopeEndTime = a1->m_slopeEndTime;
m_maybeChangedDirectionAngle = a1->m_maybeChangedDirectionAngle;
a2->m_isMoving = a1->m_isMoving;
a2->m_platformerMovingLeft = a1->m_platformerMovingLeft;
a2->m_platformerMovingRight = a1->m_platformerMovingRight;
a2->m_isSlidingRight = a1->m_isSlidingRight;
a2->m_maybeChangedDirectionAngle = m_maybeChangedDirectionAngle;
a2->m_unkUnused2 = a1->m_unkUnused2;
a2->m_stateNoAutoJump = a1->m_stateNoAutoJump;
a2->m_stateDartSlide = a1->m_stateDartSlide;
a2->m_stateHitHead = a1->m_stateHitHead;
a2->m_stateFlipGravity = a1->m_stateFlipGravity;
m_stateForce = a1->m_stateForce;
a2->m_stateForce = m_stateForce;
cocos2d::CCPoint::operator=(
(PlayerObject *)&a2->m_stateForceVector,
COERCE_FLOAT((PlayerObject *)&a1->m_stateForceVector),
(int)&a1->m_unkUnused2,
m_stateForce);
p_m_jumpPadRelated = &a2->m_jumpPadRelated;
p_m_fallStartY = &a2->m_fallStartY;
*((_BYTE *)p_m_fallStartY - 28) = a1->m_affectedByForces;
std::_Rb_tree,std::_Select1st>,std::less,std::allocator>>::operator=(
(int)p_m_jumpPadRelated,
(int)&a1->m_jumpPadRelated);
*p_m_fallStartY = a1->m_fallStartY;
}