// // PlayerObject::loadFromCheckpoint from 0x10041c670 to 0x10041d21d (2989 bytes) // // 2 xrefs: // > PlayLayer::loadFromCheckpoint @ 0x1000bd561 // > PlayLayer::loadFromCheckpoint @ 0x1000bd597 // // 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::loadFromCheckpoint(PlayerObject *a1, PlayerCheckpoint *a2) { std::unordered_set *p_m_ringRelatedSet; // rdi cocos2d::CCArray *m_touchingRings; // rax cocos2d::ccArray *data; // rax cocos2d::CCObject **arr; // r15 unsigned __int64 v7; // r12 double v8; // xmm0_8 double v9; // xmm0_8 PlayLayer *m_playLayer; // r15 GameManager *v11; // rax PlayLayer *v12; // r15 GameManager *v13; // rax PlayLayer *v14; // r15 GameManager *v15; // rax PlayLayer *v16; // r15 GameManager *v17; // rax PlayLayer *v18; // r15 GameManager *v19; // rax PlayLayer *v20; // r15 GameManager *v21; // rax PlayLayer *v22; // r15 GameManager *v23; // rax bool m_jumpBuffered; // al __m128d v25; // xmm0 double v26; // xmm1_8 __m128d v27; // xmm3 double v28[5]; // [rsp+8h] [rbp-28h] BYREF a1->m_maybeReducedEffects = 1; ((void (__fastcall *)(PlayerObject *, float))a1->setRotation)(a1, a2->m_rotation); a1->m_wasTeleported = a2->m_wasTeleported; a1->m_fixGravityBug = a2->m_fixGravityBug; a1->m_reverseSync = a2->m_reverseSync; a1->m_yVelocityBeforeSlope = a2->m_yVelocityBeforeSlope; a1->m_slopeStartTime = a2->m_slopeStartTime; a1->m_justPlacedStreak = a2->m_justPlacedStreak; *(_OWORD *)&a1->m_lastCollisionBottom = *(_OWORD *)&a2->m_lastCollisionBottom; *(_QWORD *)&a1->m_unk50C = *(_QWORD *)&a2->m_unk50C; *(_OWORD *)&a1->m_currentSlope2 = *(_OWORD *)&a2->m_currentSlope2; a1->m_slopeAngle = a2->m_slopeAngle; a1->m_slopeSlidingMaybeRotated = a2->m_slopeSlidingMaybeRotated; a1->m_quickCheckpointMode = a2->m_quickCheckpointMode; *(_OWORD *)&a1->m_collidedObject = *(_OWORD *)&a2->m_collidedObject; *(_OWORD *)&a1->m_collidingWithLeft = *(_OWORD *)&a2->m_collidingWithLeft; *(_OWORD *)&a1->m_scaleXRelated2 = *(_OWORD *)&a2->m_scaleXRelated2; *(_OWORD *)&a1->m_yVelocityRelated = *(_OWORD *)&a2->m_yVelocityRelated; *(_OWORD *)&a1->m_scaleXRelated4 = *(_OWORD *)&a2->m_scaleXRelated4; a1->m_isCollidingWithSlope = a2->m_isCollidingWithSlope; a1->m_isBallRotating = a2->m_isBallRotating; a1->m_unk669 = a2->m_unk669; *(_OWORD *)&a1->m_currentPotentialSlope = *(_OWORD *)&a2->m_currentPotentialSlope; a1->unk_584 = a2->unk_584; a1->m_collidingWithSlopeId = a2->m_collidingWithSlopeId; a1->m_slopeFlipGravityRelated = a2->m_slopeFlipGravityRelated; a1->m_slopeAngleRadians = a2->m_slopeAngleRadians; *(_QWORD *)&a1->m_rotationSpeed = *(_QWORD *)&a2->m_rotationSpeed; a1->m_isRotating = a2->m_isRotating; a1->m_isBallRotating2 = a2->m_isBallRotating2; *(_OWORD *)&a1->m_speedMultiplier = *(_OWORD *)&a2->m_speedMultiplier; a1->m_gravity = a2->m_gravity; a1->m_trailingParticleLife = a2->m_trailingParticleLife; a1->m_gameModeChangedTime = a2->m_gameModeChangedTime; a1->m_padRingRelated = a2->m_padRingRelated; a1->m_maybeIsFalling = a2->m_maybeIsFalling; a1->m_shouldTryPlacingCheckpoint = a2->m_shouldTryPlacingCheckpoint; a1->m_playEffects = a2->m_playEffects; a1->m_isOnGround3 = a2->m_isOnGround3; a1->m_lastSpiderFlipTime = a2->m_lastSpiderFlipTime; a1->m_unkBool5 = a2->m_unkBool5; a1->m_ringJumpRelated = a2->m_ringJumpRelated; p_m_ringRelatedSet = &a1->m_ringRelatedSet; if ( &a1->m_ringRelatedSet != &a2->m_ringRelatedSet ) { a1->m_ringRelatedSet.__table_.__p3_.__value_ = a2->m_ringRelatedSet.__table_.__p3_.__value_; sub_1000C5AA0(p_m_ringRelatedSet, (__int64 *)a2->m_ringRelatedSet.__table_.__p1_.__value_.__next_, nullptr); } a1->m_maybeSpriteRelated = a2->m_maybeSpriteRelated; *(_QWORD *)&a1->m_landParticlesAngle = *(_QWORD *)&a2->m_landParticlesAngle; *(_OWORD *)&a1->m_slopeRotation = *(_OWORD *)&a2->m_slopeRotation; *(_OWORD *)&a1->m_unk3d0 = *(_OWORD *)&a2->m_unk3d0; *(_DWORD *)&a1->m_unk3e0 = *(_DWORD *)&a2->m_unk3e0; *(_OWORD *)&a1->m_collidedTopMinY = *(_OWORD *)&a2->m_collidedTopMinY; *(_OWORD *)&a1->m_collidedLeftMaxX = *(_OWORD *)&a2->m_collidedLeftMaxX; *(_QWORD *)&a1->m_wasJumpBuffered = *(_QWORD *)&a2->m_wasJumpBuffered; a1->m_touchedPad = a2->m_touchedPad; *(_OWORD *)&a1->m_yVelocity = *(_OWORD *)&a2->m_yVelocity; a1->m_maybeUpsideDownSlope = a2->m_maybeUpsideDownSlope; a1->m_reverseRelated = a2->m_reverseRelated; a1->m_maybeReverseAcceleration = a2->m_maybeReverseAcceleration; a1->m_xVelocityRelated2 = a2->m_xVelocityRelated2; sub_10028CC90(&a1->m_shipRotation, (double *)&a2->m_shipRotation); sub_10028CC90(&a1->m_lastPortalPos, (double *)&a2->m_lastPortalPos); a1->m_unkUnused3 = a2->m_unkUnused3; a1->m_isOnGround2 = a2->m_isOnGround2; a1->m_lastLandTime = a2->m_lastLandTime; a1->m_platformerVelocityRelated = a2->m_platformerVelocityRelated; a1->m_maybeIsBoosted = a2->m_maybeIsBoosted; a1->m_scaleXRelatedTime = a2->m_scaleXRelatedTime; a1->m_isLocked = a2->m_isLocked; a1->m_controlsDisabled = a2->m_controlsDisabled; sub_10028CC90(&a1->m_lastGroundedPos, (double *)&a2->m_lastGroundedPos); sub_100720270(a1->m_touchingRings); m_touchingRings = a2->m_touchingRings; if ( m_touchingRings ) { data = m_touchingRings->data; if ( data->num ) { arr = data->arr; v7 = (unsigned __int64)&arr[data->num - 1]; do { if ( !*arr ) break; sub_10071FCD0(a1->m_touchingRings, *arr++); } while ( (unsigned __int64)arr <= v7 ); } } if ( &a1->m_touchedRings != &a2->m_touchedRings ) { a1->m_touchedRings.__table_.__p3_.__value_ = a2->m_touchedRings.__table_.__p3_.__value_; sub_1000C5AA0( &a1->m_touchedRings.__table_.__bucket_list_.__ptr_.__value_, (__int64 *)a2->m_touchedRings.__table_.__p1_.__value_.__next_, nullptr); } a1->m_lastActivatedPortal = a2->m_lastActivatedPortal; a1->m_totalTime = a2->m_totalTime; a1->m_yVelocityRelated3 = a2->m_yVelocityRelated3; a1->m_defaultMiniIcon = a2->m_defaultMiniIcon; a1->m_swapColors = a2->m_swapColors; a1->m_switchDashFireColor = a2->m_switchDashFireColor; a1->m_stateOnGround = a2->m_stateOnGround; *(_DWORD *)&a1->m_stateUnk = *(_DWORD *)&a2->m_stateUnk; *(_OWORD *)&a1->m_stateBoostX = *(_OWORD *)&a2->m_stateBoostX; a1->m_platformerXVelocity = a2->m_platformerXVelocity; a1->m_holdingRight = a2->m_holdingRight; a1->m_holdingLeft = a2->m_holdingLeft; a1->m_leftPressedFirst = a2->m_leftPressedFirst; a1->m_scaleXRelated = a2->m_scaleXRelated; a1->m_maybeHasStopped = a2->m_maybeHasStopped; a1->m_xVelocityRelated = a2->m_xVelocityRelated; a1->m_maybeGoingCorrectSlopeDirection = a2->m_maybeGoingCorrectSlopeDirection; a1->m_isSliding = a2->m_isSliding; a1->m_maybeSlopeForce = a2->m_maybeSlopeForce; a1->m_isOnIce = a2->m_isOnIce; a1->m_physDeltaRelated = a2->m_physDeltaRelated; a1->m_isOnGround4 = a2->m_isOnGround4; a1->m_maybeSlidingTime = a2->m_maybeSlidingTime; *(_OWORD *)&a1->m_maybeSlidingStartTime = *(_OWORD *)&a2->m_maybeSlidingStartTime; a1->m_slopeEndTime = a2->m_slopeEndTime; *(_DWORD *)&a1->m_isMoving = *(_DWORD *)&a2->m_isMoving; *(_OWORD *)&a1->m_maybeChangedDirectionAngle = *(_OWORD *)&a2->m_maybeChangedDirectionAngle; *(_OWORD *)&a1->m_stateNoAutoJump = *(_OWORD *)&a2->m_stateNoAutoJump; a1->m_stateForce = a2->m_stateForce; v8 = sub_10028CC90(&a1->m_stateForceVector, (double *)&a2->m_stateForceVector); a1->m_affectedByForces = a2->m_affectedByForces; if ( &a1->m_jumpPadRelated != &a2->m_jumpPadRelated ) sub_10041F220( &a1->m_jumpPadRelated, a2->m_jumpPadRelated.__tree_.__begin_node_, &a2->m_jumpPadRelated.__tree_.__pair1_, v8); a1->m_fallStartY = a2->m_fallStartY; PlayerObject::toggleVisibility(a1, !a2->m_isHidden); v9 = sub_10028CC60(v28, (double *)&a2->m_position); ((void (__fastcall *)(PlayerObject *, double *, double))a1->setPosition)(a1, v28, v9); PlayerObject::flipGravity(a1, a2->m_isUpsideDown, 0); a1->m_isSideways = a2->m_isSideways; PlayerObject::updatePlayerArt(a1); a1->m_gravityMod = a2->m_gravityMod; PlayerObject::toggleGhostEffect(a1, a2->m_ghostType); PlayerObject::togglePlayerScale(a1, a2->m_isMini, 0); a1->m_maybeReverseSpeed = a2->m_maybeReverseSpeed; sub_10028CC60(v28, (double *)&a2->m_lastPosition); sub_10028CC90(&a1->m_lastPosition, v28); a1->m_objectSnappedTo = a2->m_objectSnappedTo; *(__m128 *)&a1->m_accelerationOrSpeed = _mm_shuffle_ps( *(__m128 *)&a2->m_snapDistance, *(__m128 *)&a2->m_snapDistance, 78); a1->m_unk838 = a2->m_unk838; a1->m_followRelated = a2->m_followRelated; if ( &a1->m_playerFollowFloats != &a2->m_playerFollowFloats ) sub_1000C2D70( (char **)&a1->m_playerFollowFloats, (char *)a2->m_playerFollowFloats.__begin_, (__int64)a2->m_playerFollowFloats.__end_, a2->m_playerFollowFloats.__end_ - a2->m_playerFollowFloats.__begin_); a1->m_wasOnSlope = a2->m_wasOnSlope; a1->m_isOnSlope = a2->m_isOnSlope; a1->m_slopeVelocity = a2->m_slopeVelocity; if ( a2->m_isGoingLeft ) PlayerObject::doReversePlayer(a1, 1); PlayerObject::updateTimeMod(a1, a2->m_playerSpeed, 0); if ( a2->m_isShip ) { m_playLayer = GameManager::sharedState()->m_playLayer; v11 = GameManager::sharedState(); GJBaseGameLayer::switchToFlyMode(m_playLayer, a1, v11->m_playLayer->m_gameState.m_lastActivatedPortal1, 1, 5); } else if ( a2->m_isBall ) { v12 = GameManager::sharedState()->m_playLayer; v13 = GameManager::sharedState(); GJBaseGameLayer::switchToRollMode(v12, a1, v13->m_playLayer->m_gameState.m_lastActivatedPortal1, 1); } else if ( a2->m_isBird ) { v14 = GameManager::sharedState()->m_playLayer; v15 = GameManager::sharedState(); GJBaseGameLayer::switchToFlyMode(v14, a1, v15->m_playLayer->m_gameState.m_lastActivatedPortal1, 1, 19); } else if ( a2->m_isSwing ) { v16 = GameManager::sharedState()->m_playLayer; v17 = GameManager::sharedState(); GJBaseGameLayer::switchToFlyMode(v16, a1, v17->m_playLayer->m_gameState.m_lastActivatedPortal1, 1, 41); } else if ( a2->m_isDart ) { v18 = GameManager::sharedState()->m_playLayer; v19 = GameManager::sharedState(); GJBaseGameLayer::switchToFlyMode(v18, a1, v19->m_playLayer->m_gameState.m_lastActivatedPortal1, 1, 26); } else if ( a2->m_isRobot ) { v20 = GameManager::sharedState()->m_playLayer; v21 = GameManager::sharedState(); GJBaseGameLayer::switchToRobotMode(v20, a1, v21->m_playLayer->m_gameState.m_lastActivatedPortal1, 1); } else if ( a2->m_isSpider ) { v22 = GameManager::sharedState()->m_playLayer; v23 = GameManager::sharedState(); GJBaseGameLayer::switchToSpiderMode(v22, a1, v23->m_playLayer->m_gameState.m_lastActivatedPortal1, 1); } PlayerObject::resetStreak(a1); m_jumpBuffered = a2->m_jumpBuffered; a1->m_jumpBuffered = m_jumpBuffered; if ( __PAIR16__(a2->m_isDashing, m_jumpBuffered) == 257 ) { *(_OWORD *)&a1->m_dashX = *(_OWORD *)&a2->m_dashX; a1->m_dashRing = a2->m_dashRing; *(_OWORD *)&a1->m_dashAngle = *(_OWORD *)&a2->m_dashAngle; PlayerObject::startDashing(a1, nullptr); } v25 = (__m128d)*(unsigned __int64 *)&a2->m_yVelocityUnrounded; v26 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v25)).f64[0]; if ( v25.f64[0] != v26 ) { v25.f64[0] = (v25.f64[0] - v26) * 1000.0; v27 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v25), (__m128d)xmmword_100816960); v27.f64[0] = v27.f64[0] + v25.f64[0]; v25.f64[0] = _mm_round_sd((__m128d)0LL, v27, 11).f64[0] / 1000.0 + v26; } a1->m_yVelocity = v25.f64[0]; a1->m_isOnGround = a2->m_isOnGround; a1->m_lastFlipTime = a2->m_lastFlipTime; a1->m_decreaseBoostSlide = a2->m_decreaseBoostSlide; if ( a2->m_platformerCheckpoint ) { PlayerObject::releaseButton(a1, Jump); PlayerObject::releaseButton(a1, (PlayerButton)2); PlayerObject::releaseButton(a1, (PlayerButton)3); PlayerObject::releaseButton(a1, (PlayerButton)5); a1->m_yVelocity = 0.0; a1->m_platformerXVelocity = 0.0; a1->m_isOnGround = 0; } ((void (__fastcall *)(PlayerObject *, float))a1->setRotation)(a1, a2->m_rotation); a1->m_maybeReducedEffects = 0; if ( a1->m_isPlatformer ) { PlayerObject::releaseButton(a1, Jump); PlayerObject::releaseButton(a1, (PlayerButton)2); PlayerObject::releaseButton(a1, (PlayerButton)3); PlayerObject::releaseButton(a1, (PlayerButton)5); } }
GD Web Decomp Icon

GD Web Decomp

Raw Source