//
// PlayerObject::setPosition from 0x14039c640 to 0x14039d30b (3275 bytes)
//
// 4 xrefs:
// > ??> @ 0x1405c8328
// > ??> @ 0x1406983f8
// > ??> @ 0x1406984a8
// > ??> @ 0x1406d6698
//
// 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::setPosition(PlayerObject *a1, const cocos2d::CCPoint *a2)
{
double v4; // xmm0_8
const struct cocos2d::CCPoint *v5; // rdx
float v6; // xmm1_4
struct cocos2d::CCPoint v7; // rax
double v8; // xmm0_8
cocos2d::CCParticleSystemQuad *m_trailingParticles; // rcx
cocos2d::CCParticleSystemQuad_vtbl *v10; // rbx
cocos2d::CCNode *v11; // rax
struct cocos2d::CCPoint v12; // rax
cocos2d::CCParticleSystemQuad_vtbl *v13; // rbx
const cocos2d::CCPoint *v14; // rax
cocos2d::CCParticleSystemQuad_vtbl *v15; // rbx
const cocos2d::CCPoint *v16; // rax
cocos2d::CCParticleSystemQuad_vtbl *v17; // rbx
const cocos2d::CCPoint *v18; // rax
CCSpritePart *m_footSprite; // r14
PlayerFireBoostSprite_vtbl *v20; // rsi
float *v21; // rax
PlayerFireBoostSprite *m_robotFire; // rdi
cocos2d::CCNode *v23; // rax
struct cocos2d::CCPoint v24; // rax
CCPartAnimSprite *m_paSprite; // rbx
PlayerFireBoostSprite_vtbl *v26; // rdi
double v27; // xmm0_8
float v28; // xmm6_4
double v29; // xmm0_8
float v30; // xmm7_4
double v31; // xmm0_8
cocos2d::CCParticleSystemQuad *m_robotBurstParticles; // rsi
cocos2d::CCParticleSystemQuad_vtbl *v33; // r14
PlayerFireBoostSprite *v34; // rdi
cocos2d::CCNode *v35; // rax
cocos2d::CCNode *v36; // rax
struct cocos2d::CCPoint v37; // rax
cocos2d::CCParticleSystemQuad *m_swingBurstParticles1; // rsi
cocos2d::CCParticleSystemQuad_vtbl *v39; // r14
PlayerFireBoostSprite *m_swingFireBottom; // rdi
cocos2d::CCNode *v41; // rax
cocos2d::CCNode *v42; // rax
struct cocos2d::CCPoint v43; // rax
cocos2d::CCParticleSystemQuad *m_swingBurstParticles2; // rsi
cocos2d::CCParticleSystemQuad_vtbl *v45; // r14
PlayerFireBoostSprite *m_swingFireTop; // rdi
cocos2d::CCNode *v47; // rax
cocos2d::CCNode *v48; // rax
struct cocos2d::CCPoint v49; // rax
int v50; // esi
double v51; // xmm0_8
__int64 v52; // rax
int v53; // eax
double v54; // xmm0_8
char m_slopeSlidingMaybeRotated; // bl
int v56; // eax
float v57; // xmm7_4
float v58; // xmm8_4
float v59; // xmm9_4
float v60; // xmm1_4
float v61; // xmm0_4
double m_slopeAngleRadians; // xmm6_8
double v63; // xmm12_8
float v64; // xmm0_4
char m_isGoingLeft; // cl
bool v66; // al
double v67; // xmm0_8
double v68; // xmm6_8
float v69; // xmm7_4
int v70; // eax
double v71; // xmm8_8
float v72; // xmm0_4
float x; // xmm1_4
const cocos2d::CCPoint *v74; // rdx
int v75; // eax
float v76; // xmm1_4
double v77; // xmm0_8
cocos2d::CCParticleSystemQuad *m_vehicleGroundParticles; // rbx
cocos2d::CCParticleSystemQuad_vtbl *v79; // rdi
__int64 v80; // rax
int v81; // eax
double v82; // xmm0_8
float v83; // xmm2_4
float y; // xmm1_4
const cocos2d::CCPoint *v85; // rax
double v86; // xmm0_8
float v87; // xmm1_4
double v88; // xmm0_8
const cocos2d::CCPoint *v89; // rax
cocos2d::CCMotionStreak *m_regularTrail; // rdi
cocos2d::CCMotionStreak_vtbl *v91; // rsi
cocos2d::CCNode *v92; // rax
struct cocos2d::CCPoint v93; // rax
cocos2d::CCMotionStreak *v94; // rdi
cocos2d::CCMotionStreak_vtbl *v95; // rsi
cocos2d::CCNode *v96; // rax
const struct cocos2d::CCPoint *v97; // rdx
const cocos2d::CCPoint *v98; // rax
cocos2d::CCMotionStreak *v99; // rdi
struct cocos2d::CCPoint v100; // rax
cocos2d::CCMotionStreak_vtbl *v101; // rbx
const cocos2d::CCPoint *v102; // rax
double v103; // xmm0_8
__int64 v104; // rax
const cocos2d::CCPoint *v105; // rax
__int64 v106; // rax
HardStreak_vtbl *v107; // rbx
const cocos2d::CCPoint *v108; // rax
cocos2d::CCPoint v109; // [rsp+30h] [rbp-61h] BYREF
float v110; // [rsp+38h] [rbp-59h] BYREF
struct cocos2d::CCPoint v111; // [rsp+40h] [rbp-51h] BYREF
struct cocos2d::CCPoint v112; // [rsp+50h] [rbp-41h] BYREF
struct cocos2d::CCPoint v113; // [rsp+58h] [rbp-39h] BYREF
cocos2d::CCPoint v114; // [rsp+F8h] [rbp+67h] BYREF
struct cocos2d::CCPoint v115; // [rsp+108h] [rbp+77h] BYREF
cocos2d::CCPoint v116; // [rsp+110h] [rbp+7Fh] BYREF
*(_WORD *)&a1->m_isObjectRectDirty = 257;
GameObject::setPosition(a1, a2);
cocos2d::CCPoint::CCPoint(&v116);
a1->m_vehicleSprite->getPosition_0(a1->m_vehicleSprite);
v4 = cocos2d::CCPoint::CCPoint(&v109);
if ( a1->m_isSwing )
{
cocos2d::CCPoint::CCPoint(*(float *)&v4, a1->m_vehicleSize * -10.0);
v5 = &v115;
}
else
{
if ( a1->m_isPlatformer && a1->m_isShip )
{
v6 = a1->m_vehicleSize * -10.0;
}
else if ( a1->m_isBird )
{
v6 = 0.0;
}
else
{
v6 = a1->m_vehicleSize * -12.0;
}
cocos2d::CCPoint::CCPoint(*(float *)&v4, v6);
cocos2d::CCPoint::operator+(&v109, &v114);
v5 = &v111;
}
v7 = cocos2d::CCNode::convertToWorldSpace(a1->m_mainLayer, v5);
v8 = ((double (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v116, v7);
if ( a1->m_trailingParticles->getParent(a1->m_trailingParticles) )
{
m_trailingParticles = a1->m_trailingParticles;
v10 = m_trailingParticles->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v11 = m_trailingParticles->getParent(m_trailingParticles);
v12 = cocos2d::CCNode::convertToNodeSpace(v11, &v114);
v8 = ((double (__fastcall *)(cocos2d::CCParticleSystemQuad *, struct cocos2d::CCPoint))v10->setPosition_0)(
a1->m_trailingParticles,
v12);
}
v13 = a1->m_shipClickParticles->__vftable;
v14 = a1->m_trailingParticles->getPosition_0(a1->m_trailingParticles);
v13->setPosition_0(a1->m_shipClickParticles, v14);
v15 = a1->m_ufoClickParticles->__vftable;
v16 = a1->m_trailingParticles->getPosition_0(a1->m_trailingParticles);
v15->setPosition_0(a1->m_ufoClickParticles, v16);
v17 = a1->m_dashParticles->__vftable;
v18 = a1->m_trailingParticles->getPosition_0(a1->m_trailingParticles);
v17->setPosition_0(a1->m_dashParticles, v18);
m_footSprite = a1->m_robotSprite->m_footSprite;
v20 = a1->m_robotFire->__vftable;
v21 = (float *)m_footSprite->getContentSize(m_footSprite);
m_robotFire = a1->m_robotFire;
cocos2d::CCPoint::CCPoint(*(float *)&v8, *v21 * 0.5);
cocos2d::CCNode::convertToWorldSpace(m_footSprite, &v115);
v23 = m_robotFire->getParent(m_robotFire);
v24 = cocos2d::CCNode::convertToNodeSpace(v23, &v111);
((void (__fastcall *)(PlayerFireBoostSprite *, struct cocos2d::CCPoint))v20->setPosition_0)(a1->m_robotFire, v24);
m_paSprite = a1->m_robotSprite->m_paSprite;
v26 = a1->m_robotFire->__vftable;
v27 = ((double (__fastcall *)(CCPartAnimSprite *))m_paSprite->getScaleX)(m_paSprite);
v28 = *(float *)&v27;
v29 = ((double (__fastcall *)(CCSpritePart *))m_footSprite->getRotation)(m_footSprite);
v30 = *(float *)&v29 * v28;
v31 = ((double (__fastcall *)(CCPartAnimSprite *))m_paSprite->getRotation)(m_paSprite);
*(float *)&v31 = *(float *)&v31 + v30;
((void (__fastcall *)(PlayerFireBoostSprite *))v26->setRotation)(a1->m_robotFire);
if ( a1->m_robotBurstParticles->getParent(a1->m_robotBurstParticles) )
{
m_robotBurstParticles = a1->m_robotBurstParticles;
v33 = m_robotBurstParticles->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v34 = a1->m_robotFire;
v34->getPosition_0(v34);
v35 = v34->getParent(v34);
cocos2d::CCNode::convertToWorldSpace(v35, &v114);
v36 = m_robotBurstParticles->getParent(m_robotBurstParticles);
v37 = cocos2d::CCNode::convertToNodeSpace(v36, &v115);
v31 = ((double (__fastcall *)(cocos2d::CCParticleSystemQuad *, struct cocos2d::CCPoint))v33->setPosition_0)(
a1->m_robotBurstParticles,
v37);
}
if ( a1->m_swingBurstParticles1->getParent(a1->m_swingBurstParticles1) )
{
m_swingBurstParticles1 = a1->m_swingBurstParticles1;
v39 = m_swingBurstParticles1->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_swingFireBottom = a1->m_swingFireBottom;
m_swingFireBottom->getPosition_0(m_swingFireBottom);
v41 = m_swingFireBottom->getParent(m_swingFireBottom);
cocos2d::CCNode::convertToWorldSpace(v41, &v114);
v42 = m_swingBurstParticles1->getParent(m_swingBurstParticles1);
v43 = cocos2d::CCNode::convertToNodeSpace(v42, &v115);
v31 = ((double (__fastcall *)(cocos2d::CCParticleSystemQuad *, struct cocos2d::CCPoint))v39->setPosition_0)(
a1->m_swingBurstParticles1,
v43);
}
if ( a1->m_swingBurstParticles2->getParent(a1->m_swingBurstParticles2) )
{
m_swingBurstParticles2 = a1->m_swingBurstParticles2;
v45 = m_swingBurstParticles2->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
m_swingFireTop = a1->m_swingFireTop;
m_swingFireTop->getPosition_0(m_swingFireTop);
v47 = m_swingFireTop->getParent(m_swingFireTop);
cocos2d::CCNode::convertToWorldSpace(v47, &v114);
v48 = m_swingBurstParticles2->getParent(m_swingBurstParticles2);
v49 = cocos2d::CCNode::convertToNodeSpace(v48, &v115);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, struct cocos2d::CCPoint))v45->setPosition_0)(
a1->m_swingBurstParticles2,
v49);
}
v50 = -1;
v51 = cocos2d::CCPoint::CCPoint(*(float *)&v31, 0.0);
if ( a1->m_isRobot )
{
cocos2d::CCPoint::CCPoint(*(float *)&v51, 0.0);
cocos2d::CCPoint::operator=(&v110, v52);
}
v53 = -1;
if ( !a1->m_isGoingLeft )
v53 = 1;
v54 = cocos2d::CCPoint::CCPoint(
(float)(v110 - 10.0) * a1->m_vehicleSize,
(float)v53 * (float)((float)(v110 - 10.0) * a1->m_vehicleSize));
if ( a1->m_isOnSlope )
{
m_slopeSlidingMaybeRotated = a1->m_slopeSlidingMaybeRotated;
v56 = 1;
v57 = a1->m_vehicleSize * a1->m_height;
if ( !m_slopeSlidingMaybeRotated )
v56 = -1;
v58 = a1->m_vehicleSize * 20.0;
v59 = (float)v56;
v60 = (float)(v58 * v58) + (float)(v57 * v57);
if ( v60 < 0.0 )
v61 = sqrtf(v60);
else
v61 = fsqrt(v60);
m_slopeAngleRadians = a1->m_slopeAngleRadians;
v63 = (float)(v61 * 0.5);
if ( v59 == -1.0 )
m_slopeAngleRadians = -m_slopeAngleRadians;
v64 = atanf(v57 / v58);
m_isGoingLeft = a1->m_isGoingLeft;
v66 = m_isGoingLeft != m_slopeSlidingMaybeRotated;
if ( a1->m_isUpsideDown )
v66 = m_isGoingLeft == m_slopeSlidingMaybeRotated;
v67 = v59 * v64;
if ( v66 )
v68 = m_slopeAngleRadians + v67;
else
v68 = m_slopeAngleRadians - v67;
v69 = v68;
v70 = -1;
if ( !m_isGoingLeft )
v70 = 1;
v71 = (double)v70;
sinf(v69);
v72 = cosf(v69);
cocos2d::CCPoint::CCPoint(v72, v72 * v63 * v71);
if ( a1->m_isSideways )
{
x = v114.x;
v114.x = v114.y;
v114.y = x;
}
v54 = cocos2d::CCPoint::operator-(a2, &v115, &v114);
v74 = &v115;
}
else
{
if ( !a1->m_isOnGround2 )
goto LABEL_43;
v54 = cocos2d::CCPoint::operator+(a2, &v114);
v74 = &v114;
}
a1->m_playerGroundParticles->setPosition_0(a1->m_playerGroundParticles, v74);
LABEL_43:
if ( a1->m_unkA29 )
{
v75 = -1;
if ( !a1->m_isGoingLeft )
v75 = 1;
cocos2d::CCPoint::CCPoint(a1->m_vehicleSize * -15.0, (float)v75 * a1->m_vehicleSize);
if ( a1->m_isSideways )
{
v76 = v114.x;
v114.x = v114.y;
v114.y = v76;
}
v77 = cocos2d::CCPoint::operator+(a2, &v115);
a1->m_vehicleGroundParticles->setPosition_0(a1->m_vehicleGroundParticles, &v115);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_vehicleGroundParticles->setAngle)(a1->m_vehicleGroundParticles);
m_vehicleGroundParticles = a1->m_vehicleGroundParticles;
v79 = m_vehicleGroundParticles->cocos2d::CCParticleSystem::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v77, -350.0);
v54 = ((double (__fastcall *)(cocos2d::CCParticleSystemQuad *, __int64))v79->setGravity)(
m_vehicleGroundParticles,
v80);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *))a1->m_vehicleGroundParticles->setRotation)(a1->m_vehicleGroundParticles);
}
if ( a1->m_isShip )
{
if ( !a1->m_isPlatformer )
{
v81 = -4;
if ( !a1->m_isGoingLeft )
v81 = 4;
v82 = cocos2d::CCPoint::CCPoint(*(float *)&v54, (float)v81);
if ( a1->m_isSideways )
{
v83 = v114.x;
y = v114.y;
v114.x = v114.y;
v114.y = v83;
}
else
{
y = v114.x;
}
cocos2d::CCPoint::CCPoint(*(float *)&v82, y);
v85 = a1->m_trailingParticles->getPosition_0(a1->m_trailingParticles);
v86 = cocos2d::CCPoint::operator+(v85, &v115);
a1->m_regularTrail->setPosition_0(a1->m_regularTrail, &v115);
if ( a1->m_shipStreak )
{
switch ( a1->m_shipStreakType )
{
case ShipFire2:
v87 = -8.0;
break;
case ShipFire3:
v87 = -8.0;
break;
case ShipFire4:
case ShipFire5:
v87 = -14.0;
break;
case ShipFire6:
v87 = -14.0;
break;
default:
v87 = 0.0;
break;
}
v88 = cocos2d::CCPoint::CCPoint(*(float *)&v86, v87);
if ( !a1->m_isGoingLeft )
v50 = 1;
cocos2d::CCPoint::CCPoint(*(float *)&v88, (float)v50 * v115.x);
v89 = a1->m_vehicleSprite->getPosition_0(a1->m_vehicleSprite);
cocos2d::CCPoint::operator+(v89, &v111);
m_regularTrail = a1->m_regularTrail;
v91 = a1->m_shipStreak->__vftable;
cocos2d::CCNode::convertToWorldSpace(a1->m_mainLayer, &v112);
v92 = m_regularTrail->getParent(m_regularTrail);
v93 = cocos2d::CCNode::convertToNodeSpace(v92, &v113);
((void (__fastcall *)(cocos2d::CCMotionStreak *, struct cocos2d::CCPoint))v91->setPosition_0)(
a1->m_shipStreak,
v93);
}
goto LABEL_82;
}
v94 = a1->m_regularTrail;
v95 = v94->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v54, a1->m_vehicleSize * -10.0);
cocos2d::CCNode::convertToWorldSpace(a1->m_mainLayer, &v115);
v96 = v94->getParent(v94);
v97 = &v113;
LABEL_74:
v100 = cocos2d::CCNode::convertToNodeSpace(v96, v97);
((void (__fastcall *)(cocos2d::CCMotionStreak *, struct cocos2d::CCPoint))v95->setPosition_0)(
a1->m_regularTrail,
v100);
goto LABEL_82;
}
if ( a1->m_isBird )
{
if ( !a1->m_regularTrail->getParent(a1->m_regularTrail) )
goto LABEL_82;
cocos2d::CCPoint::CCPoint(*(float *)&v54, 0.0);
v98 = a1->m_vehicleSprite->getPosition_0(a1->m_vehicleSprite);
cocos2d::CCPoint::operator+(v98, &v114);
v99 = a1->m_regularTrail;
v95 = v99->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCNode::convertToWorldSpace(a1->m_mainLayer, &v113);
v96 = v99->getParent(v99);
v97 = &v112;
goto LABEL_74;
}
if ( a1->m_isSwing )
{
v101 = a1->m_regularTrail->__vftable;
v102 = a1->m_trailingParticles->getPosition_0(a1->m_trailingParticles);
v101->setPosition_0(a1->m_regularTrail, v102);
}
else
{
if ( !a1->m_isGoingLeft )
v50 = 1;
v103 = cocos2d::CCPoint::CCPoint(a1->m_vehicleSize * -2.0, (float)v50 * (float)(a1->m_vehicleSize * -2.0));
if ( a1->m_isSideways )
{
cocos2d::CCPoint::CCPoint(*(float *)&v103, v114.y);
cocos2d::CCPoint::operator=(&v114, v104);
}
v105 = a1->getPosition_0(a1);
cocos2d::CCPoint::operator+(v105, &v115);
a1->m_regularTrail->setPosition_0(a1->m_regularTrail, &v115);
}
LABEL_82:
if ( a1->m_fadeOutStreak && a1->m_isDart )
{
a1->getPosition_0(a1);
cocos2d::CCPoint::CCPoint(&v114);
cocos2d::CCPoint::operator=(&a1->m_waveTrail->m_currentPoint, v106);
}
v107 = a1->m_waveTrail->__vftable;
v108 = a1->getPosition_0(a1);
v107->setPosition_0(a1->m_waveTrail, v108);
}