//
// PlayerObject::collidedWithObjectInternal from 0x1004089c0 to 0x10040b36c (10668 bytes)
//
// 6 xrefs:
// > PlayerObject::postCollision @ 0x100405d3b
// > PlayerObject::collidedWithObject @ 0x100406856
// > PlayerObject::handleRotatedCollisionInternal @ 0x100406b16
// > PlayerObject::preSlopeCollision @ 0x10040b8b5
// > PlayerObject::preSlopeCollision @ 0x10040bb15
// > PlayerObject::collidedWithObject_1 @ 0x10040ce00
//
// 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
//
// local variable allocation has failed, the output may be wrong!
bool __fastcall PlayerObject::collidedWithObjectInternal(
PlayerObject *a1,
float a2,
GameObject *a3,
cocos2d::CCRect a4,
bool a5)
{
int v5; // ecx
__m128 *v6; // r14
PlayerObject *v8; // r15
int m_holdingRight; // edx
_BOOL4 m_holdingLeft; // esi
bool m_isDart; // zf
GameObject *v12; // r12
unsigned __int64 *v13; // rsi
double v14; // xmm0_8
__m128 *v15; // rsi
bool m_isPlatformer; // al
__m128d v17; // xmm2
int m_isPassable; // ecx
double v19; // xmm0_8
__m128d v20; // xmm3
double *LastPosition; // rax
double v22; // xmm0_8
_BOOL4 m_isSideways; // ebx
__m128 *v24; // rax
unsigned int *v25; // rax
int v26; // eax
int v27; // ecx
__m128 v28; // xmm0
__int128 v29; // xmm1
unsigned int v30; // eax
int v31; // ebx
float *v32; // rax
float v33; // xmm0_4
__int64 v34; // rax
float v35; // xmm0_4
__int64 v36; // rax
__m128d v37; // xmm1
int v38; // ecx
double v39; // xmm0_8
double v40; // xmm0_8
double v41; // xmm0_8
double v42; // xmm0_8
double v43; // xmm4_8
double v44; // xmm5_8
__m128d v45; // xmm0
double v46; // xmm0_8
bool m_wasOnSlope; // al
_QWORD *p_next; // r15
__m128 v49; // xmm4
float v50; // xmm1_4
GameObject *v51; // r14
unsigned int *v52; // rax
double v53; // xmm0_8
float *v54; // rax
float *v55; // rax
double v56; // xmm0_8
float *v57; // rax
float v58; // eax
float v59; // ecx
double v60; // xmm1_8
double v61; // xmm0_8
int v62; // eax
__m128 v63; // xmm2
__int64 v64; // rdx
int m_isSpider; // r14d
char v66; // r13
_BOOL4 m_isUpsideDown; // eax
float v68; // xmm0_4
bool v69; // cf
double v70; // xmm0_8
double v71; // xmm1_8
_BOOL8 v72; // rdx
bool m_maybeUpsideDownSlope; // al
bool v74; // al
double v75; // xmm6_8
double v76; // xmm7_8
bool v77; // al
bool v78; // al
int v79; // ecx
char v80; // r12
GJBaseGameLayer *v81; // rdi
float *v82; // rax
GameObject *v83; // r13
char m_isSwing; // al
GameObject *v85; // r13
unsigned __int8 v86; // r13
GJBaseGameLayer *v87; // rdi
float *v88; // rax
char v89; // r14
GameObject *v90; // r13
char v91; // al
float *v92; // rax
char v93; // al
float *v94; // rax
int m_uniqueID; // ebx
char v96; // al
GameObject *v97; // r14
GameObject *v98; // r13
double m_collidedBottomMaxY; // xmm0_8
double v100; // xmm1_8
GameObject *v101; // r12
float *v102; // rax
int v103; // ebx
char v104; // al
double v105; // xmm0_8
double v106; // xmm1_8
GJBaseGameLayer *m_gameLayer; // rdi
float *v108; // rax
char v109; // al
__m128 v110; // xmm0
int v111; // r13d
bool m_isOnGround; // bl
bool m_isOnGround2; // r14
GameObject *v114; // r12
char v115; // cl
float v116; // xmm0_4
char v117; // bl
bool v118; // al
__m128d v119; // xmm0
double v120; // xmm1_8
__m128d v121; // xmm3
__m128d v122; // xmm0
char v123; // r12
bool v124; // bl
bool v125; // r14
char v126; // r12
float v127; // xmm0_4
char v128; // bl
GameObject *v129; // rax
bool v130; // al
__m128d v131; // xmm0
double v132; // xmm1_8
__m128d v133; // xmm3
GJBaseGameLayer *v134; // rdi
GameObject *v135; // rdi
double v136; // xmm1_8
__m128d v137; // xmm3
GJBaseGameLayer *v138; // rdi
bool v139; // bl
bool v140; // r14
double v141; // xmm1_8
bool v142; // bl
bool v143; // r14
double v144; // xmm0_8
GJBaseGameLayer *v145; // rdi
cocos2d::CCDictionary *m_collisionLogBottom; // rdi
double v147; // xmm0_8
cocos2d::CCDictionary *v148; // rdi
double v149; // xmm0_8
double *v150; // rsi
double v151; // xmm0_8
__int64 v152; // rax
float v153; // xmm3_4
GameObject *v154; // r12
double *v155; // rax
double v156; // xmm0_8
_BOOL4 v157; // ebx
bool v158; // al
__m128 *v159; // rcx
float *v160; // rcx
__m128 v161; // xmm0
bool v162; // r15
bool v163; // bl
double v164; // xmm2_8
PlayerObject *v165; // r14
__m128 v166; // xmm2
__int64 v167; // rax
float v168; // xmm1_4
bool v169; // r13
bool v170; // r14
float v171; // xmm3_4
bool v172; // r12
PlayerObject *v173; // r15
float *v174; // rax
__int64 v175; // rax
DashRingObject *v176; // rax
int v177; // eax
PlayerObject *v178; // rbx
__m128d v179; // xmm0
__m128d v180; // xmm3
cocos2d::CCDictionary *m_collisionLogLeft; // rdi
__int64 v182; // rax
PlayerObject *v183; // rbx
DashRingObject *m_dashRing; // rax
double m_lastFlipTime; // xmm0_8
GameObject *v186; // rbx
float v187; // xmm0_4
float v188; // xmm2_4
float v189; // xmm1_4
GameObject *v190; // rbx
double v191; // xmm0_8
double v192; // xmm0_8
double m_lastSpiderFlipTime; // xmm0_8
GJBaseGameLayer *v194; // rdi
GameManager *v196; // rax
GJBaseGameLayer *v197; // rdi
double v198; // [rsp+8h] [rbp-198h]
__int128 v199; // [rsp+10h] [rbp-190h]
_DWORD v200[2]; // [rsp+2Ch] [rbp-174h] BYREF
float v201; // [rsp+34h] [rbp-16Ch]
double m_lastLandTime; // [rsp+38h] [rbp-168h]
__m128 v203; // [rsp+40h] [rbp-160h]
__m128 v204; // [rsp+5Ch] [rbp-144h] BYREF
float v205; // [rsp+6Ch] [rbp-134h]
__m128 v206; // [rsp+70h] [rbp-130h] BYREF
unsigned int v207; // [rsp+80h] [rbp-120h] BYREF
unsigned int v208; // [rsp+84h] [rbp-11Ch] BYREF
_QWORD v209[2]; // [rsp+88h] [rbp-118h] BYREF
float v210; // [rsp+98h] [rbp-108h]
float v211; // [rsp+9Ch] [rbp-104h]
_BOOL4 v212; // [rsp+A0h] [rbp-100h]
int v213; // [rsp+A4h] [rbp-FCh]
double v214; // [rsp+A8h] [rbp-F8h]
GameObject *v215; // [rsp+B0h] [rbp-F0h]
float v216; // [rsp+B8h] [rbp-E8h]
unsigned int v217; // [rsp+BCh] [rbp-E4h]
int v218; // [rsp+C0h] [rbp-E0h]
int v219; // [rsp+C4h] [rbp-DCh]
double v220; // [rsp+C8h] [rbp-D8h]
__m128 v221; // [rsp+D0h] [rbp-D0h]
__m128 v222; // [rsp+E0h] [rbp-C0h] BYREF
__m128 v223; // [rsp+F0h] [rbp-B0h]
bool v224; // [rsp+10Fh] [rbp-91h]
double v225; // [rsp+110h] [rbp-90h]
double v226; // [rsp+118h] [rbp-88h]
int v227; // [rsp+124h] [rbp-7Ch]
double v228; // [rsp+128h] [rbp-78h]
__m128d v229; // [rsp+130h] [rbp-70h]
float v230; // [rsp+14Ch] [rbp-54h]
PlayerObject *v231; // [rsp+150h] [rbp-50h]
unsigned int v232; // [rsp+158h] [rbp-48h]
int v233; // [rsp+15Ch] [rbp-44h]
float v234; // [rsp+160h] [rbp-40h]
float v235; // [rsp+164h] [rbp-3Ch]
GameObject *v236; // [rsp+168h] [rbp-38h]
float v237; // [rsp+174h] [rbp-2Ch]
cocos2d::CCRect v238; // 0:xmm0_8.8,8:xmm1_8.8
v6 = (__m128 *)a5;
v211 = a2;
v8 = a1;
m_holdingRight = a1->m_holdingRight;
m_holdingLeft = a1->m_holdingLeft;
LODWORD(m_lastLandTime) = v5;
if ( m_holdingLeft && (_BYTE)m_holdingRight )
{
m_holdingRight = (unsigned __int8)m_holdingRight;
m_isDart = !a1->m_leftPressedFirst;
if ( a1->m_leftPressedFirst )
m_holdingRight = 0;
v213 = m_holdingRight;
m_holdingLeft = !m_isDart;
}
else
{
v213 = m_holdingRight;
}
v212 = m_holdingLeft;
v12 = nullptr;
if ( sub_10028D1C0(v6->f32, flt_1009A1568) )
v12 = a3;
v13 = (unsigned __int64 *)((__int64 (__fastcall *)(PlayerObject *, double, double, double))a1->getObjectRect)(
a1,
*(double *)&a2,
*(double *)&a4.origin,
*(double *)&a4.size);
v14 = sub_10028D180(&v222, v13);
if ( v12 )
v6 = (__m128 *)((__int64 (__fastcall *)(GameObject *, double))v12->getObjectRect)(v12, v14);
v15 = v6;
sub_10028D180(&v204, (unsigned __int64 *)v6);
m_isPlatformer = a1->m_isPlatformer;
v17.f64[0] = 10.0;
if ( m_isPlatformer && !a1->m_wasOnSlope )
{
if ( a1->m_isOnSlope )
{
v17.f64[0] = 10.0;
if ( a1->m_stateScale <= 0 )
goto LABEL_17;
goto LABEL_16;
}
v17.f64[0] = 5.0;
}
if ( a1->m_stateScale > 0 )
LABEL_16:
v17.f64[0] = 15.0;
LABEL_17:
m_isPassable = a1->m_isUpsideDown ? -1 : 1;
v19 = (double)m_isPassable;
*(double *)v221.i64 = v17.f64[0] * (double)m_isPassable;
if ( a1->m_isShip || a1->m_isBird || a1->m_isDart )
{
if ( m_isPlatformer )
goto LABEL_22;
goto LABEL_21;
}
if ( !m_isPlatformer && a1->m_isSwing )
{
LABEL_21:
m_isPassable *= 6;
*(double *)v221.i64 = (float)m_isPassable;
}
LABEL_22:
if ( a1->m_wasOnSlope )
*(double *)v221.i64 = *(double *)v221.i64 + v19 * a1->unk_584;
if ( v12 )
{
m_isPassable = v12->m_isPassable;
v232 = m_isPassable;
}
else
{
v232 = 0;
}
v20.f64[0] = 0.0;
v210 = 0.0;
v224 = a3 != nullptr && v211 > 0.0;
v231 = a1;
v198 = v17.f64[0];
if ( !v224 )
{
LOBYTE(m_isPassable) = 1;
v219 = m_isPassable;
v29 = 0;
v218 = 0;
LOBYTE(m_isPassable) = 1;
v227 = m_isPassable;
if ( !m_isPlatformer )
goto LABEL_36;
LABEL_35:
v210 = 5.0;
goto LABEL_36;
}
LastPosition = (double *)GameObject::getLastPosition(a3);
v22 = sub_10028CC60(&v206, LastPosition);
((void (__fastcall *)(_QWORD *, GameObject *, double))a3->getRealPosition)(v209, a3, v22);
m_isSideways = v231->m_isSideways;
v24 = (__m128 *)&v206.i32[1];
if ( v231->m_isSideways )
v24 = &v206;
LODWORD(v225) = v24->i32[0];
v25 = (unsigned int *)v209 + 1;
if ( m_isSideways )
v25 = (unsigned int *)v209;
v8 = v231;
v229 = (__m128d)*v25;
v223 = (__m128)*(unsigned int *)(((__int64 (__fastcall *)(PlayerObject *))v231->getPosition)(v231)
+ 4LL * !m_isSideways);
v15 = (__m128 *)a3;
if ( v8->m_isSideways )
{
GameObject::getScalePosDelta((GameObject *)&v207);
v28 = (__m128)v207;
}
else
{
GameObject::getScalePosDelta((GameObject *)&v207);
v28 = (__m128)v208;
}
v20.f64[0] = v229.f64[0];
if ( v28.f32[0] == 0.0 )
{
v50 = *(float *)&v225;
if ( *(float *)v209 != v206.f32[0] )
goto LABEL_116;
}
else
{
v49 = _mm_cmplt_ss(v223, (__m128)v20);
v50 = *(float *)&v225
+ COERCE_FLOAT(_mm_andnot_ps(v49, _mm_xor_ps((__m128)xmmword_1008150B0, v28)).u32[0] | v28.i32[0] & v49.i32[0]);
if ( *(float *)v209 != v206.f32[0] )
goto LABEL_116;
}
if ( *((float *)v209 + 1) == v206.f32[1] )
{
LOBYTE(v26) = 1;
v219 = v26;
v29 = 0;
v218 = 0;
LOBYTE(v26) = 1;
v227 = v26;
m_isPlatformer = v8->m_isPlatformer;
if ( !m_isPlatformer )
goto LABEL_36;
goto LABEL_35;
}
LABEL_116:
m_isUpsideDown = v8->m_isUpsideDown;
if ( !m_isUpsideDown && *(float *)v229.f64 > v50 || m_isUpsideDown && v50 > *(float *)v229.f64 )
{
*(float *)v20.f64 = (float)(*(float *)v229.f64 - v50) / v211;
v68 = fabs(*(float *)v20.f64);
v69 = v68 < 5.0;
m_isDart = v68 == 5.0;
v70 = v68;
LOBYTE(v27) = !v69 && !m_isDart;
v218 = v27;
if ( m_isUpsideDown )
v71 = -1.0;
else
v71 = 1.0;
*(double *)v221.i64 = *(double *)v221.i64 + v70 * v71;
v29 = 0;
*(double *)&v29 = *(float *)v20.f64;
LOBYTE(m_isUpsideDown) = 1;
v219 = m_isUpsideDown;
if ( v8->m_isPlatformer )
{
v227 = 0;
m_isPlatformer = v8->m_isPlatformer;
if ( !m_isPlatformer )
goto LABEL_36;
}
else
{
*(_QWORD *)&v8->m_groundYVelocity = v29;
v227 = 0;
m_isPlatformer = v8->m_isPlatformer;
if ( !m_isPlatformer )
goto LABEL_36;
}
goto LABEL_35;
}
v72 = v50 > *(float *)v229.f64;
if ( m_isUpsideDown )
LODWORD(v72) = *(float *)v229.f64 > v50;
LOBYTE(v72) = !v72;
v219 = v72;
LOBYTE(m_isUpsideDown) = 1;
v227 = m_isUpsideDown;
v29 = 0;
v218 = 0;
m_isPlatformer = v8->m_isPlatformer;
if ( m_isPlatformer )
goto LABEL_35;
LABEL_36:
v199 = v29;
if ( m_isPlatformer || v8->m_stateHitHead > 0 || v8->m_stateFlipGravity > 0 )
{
v30 = v232;
LOBYTE(v30) = v232 ^ 1;
v217 = v30;
}
else
{
v217 = 0;
}
v31 = v8->m_isSideways;
v32 = (float *)((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
if ( (_BYTE)v31 == 1 )
v33 = *v32 - v8->m_lastPosition.x;
else
v33 = v32[1] - v8->m_lastPosition.y;
v235 = v33;
((void (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v34 = ((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v35 = -1.0;
if ( !v8->m_isUpsideDown )
v35 = 1.0;
*(float *)v229.f64 = (float)((float)(v222.f32[3] * -0.5) * v35) + *(float *)(v34 + 4);
v36 = ((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
*(_QWORD *)&v37.f64[0] = 1065353216;
if ( !v8->m_isUpsideDown )
*(_QWORD *)&v37.f64[0] = 3212836864LL;
v203.f32[0] = (float)((float)(-0.5 * v222.f32[3]) * *(float *)v37.f64) + *(float *)(v36 + 4);
((void (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v38 = v8->m_isUpsideDown;
if ( (_BYTE)v38 || (*(_QWORD *)&v37.f64[0] = LODWORD(v235), v235 <= 0.0) )
{
LOBYTE(v38) = (v235 >= 0.0) | v38 ^ 1;
v233 = v38;
}
else
{
v233 = 0;
}
v39 = sub_10028D270((unsigned int *)&v204);
v205 = *(float *)&v39;
v40 = sub_10028D230(v204.f32);
v216 = *(float *)&v40;
v41 = sub_10028D280((__int64)&v204);
v234 = *(float *)&v41;
v214 = *(float *)&v41;
v42 = sub_10028D2C0((__int64)&v204);
v230 = *(float *)&v42;
v226 = *(float *)&v42;
*(_QWORD *)&v45.f64[0] = v204.u32[2];
*(float *)v45.f64 = (float)(v204.f32[2] * 0.5) + v204.f32[0];
v201 = *(float *)v45.f64;
m_isDart = v8->m_isDart;
v236 = v12;
v215 = a3;
if ( m_isDart && v8->m_stateDartSlide <= 0 )
{
LOBYTE(v15) = 1;
v31 = 0;
goto LABEL_408;
}
v46 = *(float *)v229.f64;
LOBYTE(v31) = 1;
if ( v8->m_isOnSlope )
{
LABEL_56:
p_next = &v8->m_potentialSlopeMap.__table_.__p1_.__value_.__next_->__next_;
if ( !p_next )
{
LODWORD(v225) = 0;
LODWORD(v229.f64[0]) = 0;
v237 = 0.0;
v8 = v231;
goto LABEL_90;
}
v228 = *(float *)v229.f64;
LODWORD(v229.f64[0]) = 0;
LODWORD(v225) = 0;
v237 = 0.0;
LOBYTE(v220) = v31;
while ( 1 )
{
v51 = (GameObject *)p_next[3];
if ( !(_BYTE)v31 && v51 != v231->m_currentSlope )
{
v52 = (unsigned int *)((__int64 (__fastcall *)(_QWORD))v51->getObjectRect)(p_next[3]);
v53 = sub_10028D270(v52);
v223.i32[0] = LODWORD(v53);
v54 = (float *)((__int64 (__fastcall *)(GameObject *))v236->getPosition)(v236);
if ( *v54 <= v223.f32[0] )
goto LABEL_84;
v55 = (float *)((__int64 (__fastcall *)(GameObject *))v51->getObjectRect)(v51);
v56 = sub_10028D230(v55);
v223.i32[0] = LODWORD(v56);
v57 = (float *)((__int64 (__fastcall *)(GameObject *))v236->getPosition)(v236);
if ( v223.f32[0] <= *v57 )
goto LABEL_84;
}
((void (__fastcall *)(__m128 *, GameObject *, float, float))v51->getObjectRect_0)(&v206, v51, 1.2, 1.1);
v15 = &v206;
if ( !sub_10028D320(v204.f32, v206.f32) )
{
LABEL_84:
if ( (LOBYTE(v229.f64[0]) & 1) != 0 )
goto LABEL_64;
goto LABEL_65;
}
v238.size = (cocos2d::CCSize)1066192077LL;
((void (__fastcall *)(_QWORD *, GameObject *, float, float))v51->getObjectRect_0)(v209, v51, 1.2, 1.1);
v15 = (__m128 *)v209;
if ( !sub_10028D320(v222.f32, (float *)v209) )
{
v31 = LOBYTE(v220);
if ( (LOBYTE(v229.f64[0]) & 1) != 0 )
goto LABEL_64;
goto LABEL_65;
}
*(double *)&v238.origin = sub_10028D180(&v206, (unsigned __int64 *)&v204);
v15 = &v206;
v223.i64[0] = GameObject::slopeYPos_1(v51, v238);
LOBYTE(v58) = GameObject::slopeFloorTop(v51);
if ( *(double *)v223.i64 + 2.0 >= v214 )
{
v31 = LOBYTE(v220);
if ( LOBYTE(v58) )
{
v60 = *(double *)v223.i64 + -2.0;
v58 = *(float *)&v231;
if ( v231->m_currentSlope == v51 )
{
LOBYTE(v58) = 1;
*(float *)v229.f64 = v58;
LOBYTE(v58) = 1;
v237 = v58;
if ( v226 < v60 )
goto LABEL_64;
}
else
{
LOBYTE(v58) = 1;
v237 = v58;
if ( v226 < v60 )
goto LABEL_84;
}
goto LABEL_87;
}
LOBYTE(v58) = 1;
*(float *)v229.f64 = v58;
if ( v226 < *(double *)v223.i64 + -2.0 )
{
LOBYTE(v58) = 1;
v237 = v58;
LABEL_64:
if ( (LOBYTE(v225) & 1) != 0 )
goto LABEL_89;
goto LABEL_65;
}
}
else
{
LOBYTE(v59) = 1;
v237 = v59;
v31 = LOBYTE(v220);
if ( v226 < *(double *)v223.i64 + -2.0 )
goto LABEL_84;
if ( LOBYTE(v58) )
goto LABEL_87;
}
LOBYTE(v58) = 1;
v237 = v58;
v58 = *(float *)&v231;
if ( v231->m_currentSlope != v51 )
goto LABEL_84;
LABEL_87:
LOBYTE(v58) = 1;
v237 = v58;
LOBYTE(v58) = 1;
*(float *)&v225 = v58;
if ( (LOBYTE(v229.f64[0]) & 1) != 0 )
goto LABEL_64;
LABEL_65:
p_next = (_QWORD *)*p_next;
if ( !p_next )
{
LABEL_89:
v8 = v231;
v12 = v236;
v46 = v228;
goto LABEL_90;
}
}
}
m_wasOnSlope = v8->m_wasOnSlope;
if ( m_wasOnSlope || v8->m_potentialSlopeMap.__table_.__p2_.__value_ )
{
LOBYTE(v31) = m_wasOnSlope || v12 == nullptr;
goto LABEL_56;
}
LODWORD(v225) = 0;
LODWORD(v229.f64[0]) = 0;
v237 = 0.0;
LABEL_90:
*(double *)v223.i64 = v235;
v61 = v46 + *(double *)v221.i64;
v228 = v61;
if ( v12 )
{
v62 = ((__int64 (__fastcall *)(GameObject *))v12->getType)(v12);
v61 = v228;
LOBYTE(v12) = v62 == 21;
}
else
{
LODWORD(v12) = 0;
}
v220 = v61 - *(double *)v223.i64;
HIDWORD(v45.f64[0]) = 0;
*(float *)v45.f64 = (float)(0.5 * v210) + v222.f32[0];
*(_QWORD *)&v37.f64[0] = v222.u32[1];
v63 = (__m128)v222.u32[2];
v63.f32[0] = v222.f32[2] - v210;
*(_QWORD *)&v20.f64[0] = v222.u32[3];
sub_10028CC00((__int64)&v206, *(float *)v45.f64, v222.f32[1], v63, (__m128)v222.u32[3]);
if ( v8->m_isShip )
{
m_isSpider = 0;
v17.f64[0] = v214;
v43 = v226;
v44 = v228;
if ( v8->m_isUpsideDown )
goto LABEL_107;
}
else
{
v17.f64[0] = v214;
v43 = v226;
if ( !v8->m_isBird )
{
v44 = v228;
if ( v8->m_isDart || v8->m_isSwing || v8->m_isBall || v8->m_isRobot )
{
m_isSpider = 0;
if ( !v8->m_isUpsideDown )
goto LABEL_139;
}
else
{
m_isSpider = v8->m_isSpider;
LOBYTE(m_isSpider) = m_isSpider ^ 1;
if ( !v8->m_isUpsideDown )
goto LABEL_139;
}
if ( !v8->m_isDart && !v8->m_isSwing && !v8->m_isBall )
{
v66 = 0;
if ( v228 >= v214 )
goto LABEL_144;
LABEL_108:
v45.f64[0] = v220;
if ( v220 >= v17.f64[0] )
goto LABEL_144;
LABEL_141:
v31 = 0;
v235 = 0.0;
if ( !v8->m_isPlatformer )
goto LABEL_157;
goto LABEL_148;
}
LABEL_107:
v66 = v232 ^ 1;
if ( v44 >= v17.f64[0] )
goto LABEL_144;
goto LABEL_108;
}
m_isSpider = 0;
v44 = v228;
if ( v8->m_isUpsideDown )
goto LABEL_107;
}
LABEL_139:
v66 = 1;
if ( v43 < v44 && v43 < v220 )
goto LABEL_141;
LABEL_144:
LOBYTE(v31) = 1;
if ( v233 & 1 | (((unsigned __int8)v12 & v8->m_isPlatformer & 1) == 0) )
{
v235 = 0.0;
if ( !v8->m_isPlatformer )
goto LABEL_157;
}
else
{
LODWORD(v235) = !v8->m_maybeTouchedBreakableBlock;
if ( !v8->m_isPlatformer )
goto LABEL_157;
}
LABEL_148:
if ( v8->m_isOnSlope || v8->m_wasOnSlope )
{
m_maybeUpsideDownSlope = v8->m_maybeUpsideDownSlope;
if ( (_BYTE)v31 )
{
if ( m_maybeUpsideDownSlope )
goto LABEL_155;
goto LABEL_154;
}
if ( m_maybeUpsideDownSlope )
LABEL_154:
v237 = 0.0;
}
LABEL_155:
if ( !LOBYTE(m_lastLandTime) )
{
v15 = &v204;
v74 = sub_10028D320(v206.f32, v204.f32);
v44 = v228;
v43 = v226;
v17.f64[0] = v214;
LOBYTE(v15) = 1;
if ( !v74 )
goto LABEL_408;
}
LABEL_157:
*(_QWORD *)&v45.f64[0] = v203.u32[0];
v75 = v203.f32[0] - *(double *)v221.i64;
v76 = v75 - *(double *)v223.i64;
LOBYTE(v64) = 1;
LOBYTE(v15) = 1;
if ( (((unsigned __int8)v217 | (unsigned __int8)v66) & 1) == 0 )
goto LABEL_162;
v77 = v8->m_isUpsideDown;
v45.f64[0] = v75 - *(double *)v223.i64;
v37.f64[0] = v203.f32[0] - *(double *)v221.i64;
if ( !v77 )
{
v45.f64[0] = v220;
v37.f64[0] = v44;
}
if ( v37.f64[0] < v17.f64[0] )
{
LOBYTE(v15) = 1;
if ( v45.f64[0] < v17.f64[0] )
goto LABEL_162;
}
if ( v77 && ((unsigned __int8)v12 & v8->m_isBird) == 1 && !v8->m_isPlatformer )
{
*(double *)v221.i64 = v75 - *(double *)v223.i64;
*(double *)v223.i64 = v75;
*(_QWORD *)&v45.f64[0] = 1050253722;
*(_QWORD *)&v37.f64[0] = 1050253722;
((void (__fastcall *)(_QWORD *, PlayerObject *, __int64, float, float, double, double, double, double))v8->getObjectRect_0)(
v209,
v8,
v64,
0.30000001,
0.30000001,
v17.f64[0],
v20.f64[0],
v43,
v44);
if ( sub_10028D320(v204.f32, (float *)v209) )
{
m_gameLayer = v8->m_gameLayer;
if ( !m_gameLayer )
{
v135 = v236;
goto LABEL_499;
}
goto LABEL_257;
}
LODWORD(v15) = 0;
v43 = v226;
goto LABEL_503;
}
v37.f64[0] = v8->m_yVelocity;
v45.f64[0] = 0.0;
if ( (v37.f64[0] <= 0.0 || (((unsigned __int8)v218 | v8->m_wasOnSlope) & 1) != 0)
&& (LOBYTE(v237) & LOBYTE(v229.f64[0]) & 1) == 0 )
{
LODWORD(v231) = (_DWORD)v12;
v80 = m_isSpider;
if ( (_BYTE)v31 )
{
if ( v77 )
v37.f64[0] = -v37.f64[0];
if ( v37.f64[0] > 0.0 )
{
v81 = v8->m_gameLayer;
if ( v81 )
{
v15 = (__m128 *)6;
GJBaseGameLayer::gameEventTriggered(v81, HitHead, 0, v8->m_uniqueID);
}
}
}
v82 = (float *)((__int64 (__fastcall *)(PlayerObject *, __m128 *, __int64, double, double, double, double, double, double))v8->getPosition)(
v8,
v15,
v64,
0.0,
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44);
sub_10028CBE0((float *)v209, *v82, v234 + (float)(v222.f32[3] * 0.5));
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
if ( (_BYTE)m_isSpider )
PlayerObject::checkSnapJumpToObject(v8, v236);
if ( v66 & 1 | ((v217 & 1) == 0) )
{
v83 = v215;
if ( v8->m_isUpsideDown )
{
m_isSwing = 1;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
m_isSwing = v8->m_isSwing;
}
else
{
m_isSwing = 0;
}
if ( !(_BYTE)v31 )
{
v114 = v236;
PlayerObject::hitGround(v8, v236, m_isSwing);
LABEL_271:
v115 = v31 ^ 1 | v232 | (unsigned __int8)v231;
if ( v8->m_isUpsideDown )
{
v116 = v234;
if ( (v115 & 1) != 0 )
{
v234 = v230;
goto LABEL_275;
}
}
else
{
v116 = v230;
if ( (v115 & 1) != 0 )
{
LABEL_275:
if ( !(_BYTE)v31 )
{
PlayerObject::updateCollideBottom(v8, v234, v114);
LABEL_280:
if ( v83 )
{
v8->m_lastGroundObject = v83;
if ( v83->m_isDontBoostY )
v8->m_stateBoostX = 2;
if ( v83->m_isDontBoostX )
v8->m_stateBoostY = 2;
}
*(_QWORD *)&v8->m_groundYVelocity = v199;
v117 = 0;
LABEL_286:
if ( (_BYTE)m_isSpider && v8->m_stateNoAutoJump > 0 && v8->m_padRingRelated )
v8->m_jumpBuffered = 0;
v118 = !v8->m_isShip && !v8->m_isBird && !v8->m_isDart && !v8->m_isSwing;
if ( !((unsigned __int8)v117 ^ 1 | (unsigned __int8)(v118 | v227)) )
{
v119 = (__m128d)*(unsigned __int64 *)&v8->m_groundYVelocity;
v120 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v119)).f64[0];
if ( v119.f64[0] != v120 )
{
v119.f64[0] = (v119.f64[0] - v120) * 1000.0;
v121 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v119), (__m128d)xmmword_100816960);
v121.f64[0] = v121.f64[0] + v119.f64[0];
v119.f64[0] = _mm_round_sd((__m128d)0LL, v121, 11).f64[0] / 1000.0 + v120;
}
v8->m_yVelocity = v119.f64[0];
}
if ( v117 && v8->m_stateFlipGravity > 0 )
{
PlayerObject::flipGravity(v8, !v8->m_isUpsideDown, 1);
if ( v8->m_isUpsideDown )
v122 = (__m128d)0x4000000000000000uLL;
else
v122 = (__m128d)0xC000000000000000LL;
v136 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v122)).f64[0];
if ( v122.f64[0] != v136 )
{
v122.f64[0] = (v122.f64[0] - v136) * 1000.0;
v137 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v122), (__m128d)xmmword_100816960);
v137.f64[0] = v137.f64[0] + v122.f64[0];
v122.f64[0] = _mm_round_sd((__m128d)0LL, v137, 11).f64[0] / 1000.0 + v136;
}
v8->m_yVelocity = v122.f64[0];
v8->m_maybeIsBoosted = 1;
v8->m_isOnGround2 = 0;
if ( v8->m_stateNoAutoJump > 0 )
{
v8->m_isOnGround = 0;
*(_WORD *)&v8->m_jumpBuffered = 0;
}
}
if ( !LOBYTE(v235) )
return 1;
v8->m_maybeTouchedBreakableBlock = 1;
v138 = v8->m_gameLayer;
if ( !v138 )
{
v135 = v114;
goto LABEL_499;
}
GJBaseGameLayer::destroyObject(v138, v114);
return 1;
}
LABEL_278:
v117 = 1;
if ( v8->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(v8);
goto LABEL_286;
}
}
PlayerObject::updateCollideTop(v8, v116, v114);
if ( !(_BYTE)v31 )
goto LABEL_280;
goto LABEL_278;
}
v233 = v31;
m_isOnGround = v8->m_isOnGround;
m_isOnGround2 = v8->m_isOnGround2;
v229.f64[0] = v8->m_lastLandTime;
PlayerObject::hitGround(v8, nullptr, m_isSwing);
v8->m_isOnGround = m_isOnGround;
LOBYTE(v31) = v233;
v8->m_isOnGround2 = m_isOnGround2;
LOBYTE(m_isSpider) = v80;
v8->m_lastLandTime = v229.f64[0];
}
else
{
v8->m_yVelocity = 0.0;
v83 = v215;
}
v114 = v236;
goto LABEL_271;
}
if ( !((unsigned __int8)v227 | (unsigned __int8)(v77 | v31)) )
{
v203 = (__m128)*(unsigned __int64 *)&v8->m_yVelocity;
*(double *)v221.i64 = v75 - *(double *)v223.i64;
*(double *)v223.i64 = v75;
LODWORD(v229.f64[0]) = m_isSpider;
v233 = v31;
v94 = (float *)((__int64 (__fastcall *)(PlayerObject *, __m128 *, __int64, double, double, double, double, double, double))v8->getPosition)(
v8,
v15,
v64,
0.0,
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44);
sub_10028CBE0((float *)v209, *v94, (float)(v222.f32[3] * 0.5) + v234);
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
m_uniqueID = 0;
v96 = 0;
v97 = v215;
if ( v8->m_isUpsideDown )
{
v96 = 1;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
v96 = v8->m_isSwing;
}
v98 = v236;
PlayerObject::hitGround(v8, v236, v96);
if ( v98 )
m_uniqueID = v98->m_uniqueID;
m_collidedBottomMaxY = v8->m_collidedBottomMaxY;
v100 = v214;
v43 = v226;
v44 = v228;
v75 = *(double *)v223.i64;
v76 = *(double *)v221.i64;
if ( m_collidedBottomMaxY != 0.0 )
{
if ( v8->m_isUpsideDown )
v100 = fmin(v214, m_collidedBottomMaxY);
else
v100 = fmax(v214, m_collidedBottomMaxY);
}
v8->m_collidedBottomMaxY = v100;
if ( m_uniqueID )
{
if ( v8->m_lastCollisionBottom != m_uniqueID )
{
v8->m_lastCollisionBottom = m_uniqueID;
m_collisionLogBottom = v8->m_collisionLogBottom;
if ( m_collisionLogBottom )
{
cocos2d::CCDictionary::setObject(m_collisionLogBottom, v8->m_maybeLastGroundObject, m_uniqueID);
v76 = *(double *)v221.i64;
v75 = *(double *)v223.i64;
v44 = v228;
v43 = v226;
}
}
}
v37 = (__m128d)v199;
v31 = v233;
LOBYTE(v64) = 1;
v17 = (__m128d)v203;
if ( v97 )
{
v8->m_lastGroundObject = v97;
if ( v97->m_isDontBoostY )
v8->m_stateBoostX = 2;
if ( v97->m_isDontBoostX )
v8->m_stateBoostY = 2;
}
*(_QWORD *)&v8->m_groundYVelocity = v199;
v147 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v17)).f64[0];
if ( v17.f64[0] != v147 )
{
v17.f64[0] = (v17.f64[0] - v147) * 1000.0;
v20.f64[0] = v17.f64[0];
v17 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v17), (__m128d)xmmword_100816960);
v17.f64[0] = v17.f64[0] + v20.f64[0];
v37 = (__m128d)v199;
v17.f64[0] = _mm_round_sd(v17, v17, 11).f64[0] / 1000.0 + v147;
}
m_isSpider = LODWORD(v229.f64[0]);
v45.f64[1] = v37.f64[1];
v45.f64[0] = fmax(v37.f64[0], v17.f64[0]);
v37.f64[0] = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v45)).f64[0];
if ( v45.f64[0] != v37.f64[0] )
{
v17.f64[0] = 1000.0;
v45.f64[0] = (v45.f64[0] - v37.f64[0]) * 1000.0;
v20 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v45), (__m128d)xmmword_100816960);
v20.f64[0] = v20.f64[0] + v45.f64[0];
v45.f64[0] = _mm_round_sd((__m128d)0LL, v20, 11).f64[0] / 1000.0 + v37.f64[0];
}
v8->m_yVelocity = v45.f64[0];
LODWORD(v15) = 0;
goto LABEL_162;
}
if ( !((unsigned __int8)v219 | (unsigned __int8)v31 & v77 ^ 1) )
{
v203 = (__m128)*(unsigned __int64 *)&v8->m_yVelocity;
*(double *)v221.i64 = v75 - *(double *)v223.i64;
*(double *)v223.i64 = v75;
LODWORD(v229.f64[0]) = m_isSpider;
v108 = (float *)((__int64 (__fastcall *)(PlayerObject *, __m128 *, __int64, double, double, double, double, double, double))v8->getPosition)(
v8,
v15,
v64,
0.0,
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44);
sub_10028CBE0((float *)v209, *v108, (float)(v222.f32[3] * 0.5) + v234);
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
if ( v8->m_isUpsideDown )
{
v109 = 1;
v110 = v203;
v111 = v31;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
v109 = v8->m_isSwing;
}
else
{
v111 = v31;
v109 = 0;
v110 = v203;
}
v110.f32[0] = *(double *)v110.i64;
v203 = v110;
v139 = v8->m_isOnGround;
v140 = v8->m_isOnGround2;
m_lastLandTime = v8->m_lastLandTime;
PlayerObject::hitGround(v8, nullptr, v109);
v8->m_isOnGround = v139;
v8->m_isOnGround2 = v140;
v8->m_lastLandTime = m_lastLandTime;
if ( (((unsigned __int8)v232 | (unsigned __int8)v12) & 1) == 0 )
PlayerObject::updateCollideTop(v8, v234, v236);
v45 = 0;
v45.f64[0] = v203.f32[0];
v141 = _mm_cvtepi32_pd(_mm_cvttps_epi32(v203)).f64[0];
m_isSpider = LODWORD(v229.f64[0]);
if ( v141 != v203.f32[0] )
{
v17.f64[0] = 1000.0;
v45.f64[0] = (v45.f64[0] - v141) * 1000.0;
v20 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v45), (__m128d)xmmword_100816960);
v20.f64[0] = v20.f64[0] + v45.f64[0];
v45.f64[0] = _mm_round_sd((__m128d)0LL, v20, 11).f64[0] / 1000.0 + v141;
}
v43 = v226;
v31 = v111;
v44 = v228;
v75 = *(double *)v223.i64;
v76 = *(double *)v221.i64;
v37 = (__m128d)*(unsigned __int64 *)&v8->m_groundYVelocity;
v37.f64[0] = fmax(v37.f64[0] + 1.0, v45.f64[0]);
v45.f64[0] = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v37)).f64[0];
if ( v37.f64[0] != v45.f64[0] )
{
v17.f64[0] = 1000.0;
v37.f64[0] = (v37.f64[0] - v45.f64[0]) * 1000.0;
v20 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v37), (__m128d)xmmword_100816960);
v20.f64[0] = v20.f64[0] + v37.f64[0];
v37.f64[0] = _mm_round_sd((__m128d)0LL, v20, 11).f64[0] / 1000.0 + v45.f64[0];
}
v8->m_yVelocity = v37.f64[0];
if ( v8->m_stateFlipGravity > 0 )
{
PlayerObject::flipGravity(v8, !v8->m_isUpsideDown, 1);
if ( v8->m_isUpsideDown )
v45 = (__m128d)0x4000000000000000uLL;
else
v45 = (__m128d)0xC000000000000000LL;
v37.f64[0] = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v45)).f64[0];
v43 = v226;
v44 = v228;
v75 = *(double *)v223.i64;
v76 = *(double *)v221.i64;
if ( v45.f64[0] != v37.f64[0] )
{
v17.f64[0] = 1000.0;
v45.f64[0] = (v45.f64[0] - v37.f64[0]) * 1000.0;
v20 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v45), (__m128d)xmmword_100816960);
v20.f64[0] = v20.f64[0] + v45.f64[0];
v45.f64[0] = _mm_round_sd((__m128d)0LL, v20, 11).f64[0] / 1000.0 + v37.f64[0];
}
v8->m_yVelocity = v45.f64[0];
v8->m_maybeIsBoosted = 1;
v8->m_isOnGround2 = 0;
if ( v8->m_stateNoAutoJump > 0 )
{
v8->m_isOnGround = 0;
*(_WORD *)&v8->m_jumpBuffered = 0;
}
}
if ( !LOBYTE(v235) )
{
LODWORD(v15) = 0;
LOBYTE(v64) = 1;
goto LABEL_162;
}
v8->m_maybeTouchedBreakableBlock = 1;
v197 = v8->m_gameLayer;
if ( v197 )
GJBaseGameLayer::destroyObject(v197, v236);
else
GameObject::destroyObject(v236);
LODWORD(v15) = 0;
v43 = v226;
LABEL_503:
v44 = v228;
LOBYTE(v64) = 1;
v75 = *(double *)v223.i64;
v76 = *(double *)v221.i64;
goto LABEL_162;
}
LODWORD(v15) = 0;
LABEL_162:
v78 = v8->m_isUpsideDown;
if ( !v78 )
{
if ( v8->m_isShip || v8->m_isBird || v8->m_isDart || v8->m_isSwing || v8->m_isBall )
{
v64 = v232;
LOBYTE(v64) = v232 ^ 1;
if ( (((unsigned __int8)v217 | (unsigned __int8)v232 ^ 1) & 1) == 0 )
goto LABEL_408;
}
else
{
v64 = 0;
if ( (v217 & 1) == 0 )
goto LABEL_408;
}
}
if ( !(_BYTE)v15 )
goto LABEL_408;
if ( !v78 )
{
v220 = v76;
v44 = v75;
}
if ( v236 )
{
v79 = v236->m_uniqueID;
if ( v43 >= v44 )
{
LABEL_200:
if ( v78 )
goto LABEL_208;
goto LABEL_206;
}
}
else
{
v79 = 0;
if ( v43 >= v44 )
goto LABEL_200;
}
if ( v43 >= v220 )
goto LABEL_200;
if ( !v78 )
{
if ( v79 != v8->m_unk510 )
goto LABEL_408;
LABEL_206:
if ( ((unsigned __int8)v12 & v8->m_isBird) != 1 || v8->m_isPlatformer )
{
LABEL_208:
v17.f64[0] = v8->m_yVelocity;
v45.f64[0] = 0.0;
if ( v17.f64[0] >= 0.0
|| v8->m_isPlatformer && (v45.f64[0] = v8->m_yVelocityRelated, v37.f64[0] = 0.0, v45.f64[0] > 0.0) )
{
v85 = v236;
if ( (LOBYTE(v225) & LOBYTE(v237) & 1) != 0 )
goto LABEL_226;
}
else
{
v85 = v236;
if ( ((v8->m_wasOnSlope | (unsigned __int8)v218) & 1) == 0 || (LOBYTE(v225) & LOBYTE(v237) & 1) != 0 )
{
LABEL_226:
if ( !v78 | (unsigned __int8)(v31 | v227) )
{
if ( !(v78 | (unsigned __int8)v31 ^ 1 | (unsigned __int8)v219) )
{
v229 = (__m128d)*(unsigned __int64 *)&v8->m_yVelocity;
v92 = (float *)((__int64 (__fastcall *)(PlayerObject *, double, double, double, double, double, double, double, double))v8->getPosition)(
v8,
v45.f64[0],
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44,
v75,
v76);
sub_10028CBE0((float *)v209, *v92, (float)(v222.f32[3] * -0.5) + v230);
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
m_isDart = v8->m_isUpsideDown;
v233 = v31;
if ( m_isDart )
{
v93 = 1;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
v93 = v8->m_isSwing;
}
else
{
v93 = 0;
}
v142 = v8->m_isOnGround;
v143 = v8->m_isOnGround2;
v225 = v8->m_lastLandTime;
PlayerObject::hitGround(v8, nullptr, v93);
v8->m_isOnGround = v142;
v8->m_isOnGround2 = v143;
v8->m_lastLandTime = v225;
if ( (((unsigned __int8)v232 | (unsigned __int8)v12) & 1) == 0 )
PlayerObject::updateCollideTop(v8, v230, v85);
v20 = v229;
v144 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v229)).f64[0];
if ( v229.f64[0] != v144 )
{
v20.f64[0] = (v229.f64[0] - v144) * 1000.0;
v17 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v20), (__m128d)xmmword_100816960);
v17.f64[0] = v17.f64[0] + v20.f64[0];
v20.f64[0] = _mm_round_sd((__m128d)0LL, v17, 11).f64[0] / 1000.0 + v144;
}
v31 = v233;
v45 = (__m128d)*(unsigned __int64 *)&v8->m_groundYVelocity;
v45.f64[0] = fmin(v45.f64[0] + -1.0, v20.f64[0]);
v37.f64[0] = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v45)).f64[0];
if ( v45.f64[0] != v37.f64[0] )
{
v17.f64[0] = 1000.0;
v45.f64[0] = (v45.f64[0] - v37.f64[0]) * 1000.0;
v20 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v45), (__m128d)xmmword_100816960);
v20.f64[0] = v20.f64[0] + v45.f64[0];
v45.f64[0] = _mm_round_sd((__m128d)0LL, v20, 11).f64[0] / 1000.0 + v37.f64[0];
}
v8->m_yVelocity = v45.f64[0];
PlayerObject::didHitHead(v8);
if ( LOBYTE(v235) )
{
v8->m_maybeTouchedBreakableBlock = 1;
v145 = v8->m_gameLayer;
if ( v145 )
GJBaseGameLayer::destroyObject(v145, v85);
else
GameObject::destroyObject(v85);
}
}
}
else
{
v229 = (__m128d)*(unsigned __int64 *)&v8->m_yVelocity;
v101 = v215;
v102 = (float *)((__int64 (__fastcall *)(PlayerObject *, double, double, double, double, double, double, double, double))v8->getPosition)(
v8,
v45.f64[0],
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44,
v75,
v76);
sub_10028CBE0((float *)v209, *v102, (float)(v222.f32[3] * -0.5) + v230);
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
v103 = 0;
v104 = 0;
if ( v8->m_isUpsideDown )
{
v104 = 1;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
v104 = v8->m_isSwing;
}
PlayerObject::hitGround(v8, v85, v104);
if ( v85 )
v103 = v85->m_uniqueID;
v105 = v8->m_collidedBottomMaxY;
v17.f64[0] = v226;
v106 = v226;
v20 = v229;
if ( v105 != 0.0 )
{
if ( v8->m_isUpsideDown )
v106 = fmin(v226, v105);
else
v106 = fmax(v226, v105);
}
v8->m_collidedBottomMaxY = v106;
if ( v103 )
{
if ( v8->m_lastCollisionBottom != v103 )
{
v8->m_lastCollisionBottom = v103;
v148 = v8->m_collisionLogBottom;
if ( v148 )
{
cocos2d::CCDictionary::setObject(v148, v8->m_maybeLastGroundObject, v103);
v20 = v229;
}
}
}
v37 = (__m128d)v199;
if ( v101 )
{
v8->m_lastGroundObject = v101;
if ( v101->m_isDontBoostY )
v8->m_stateBoostX = 2;
if ( v101->m_isDontBoostX )
v8->m_stateBoostY = 2;
}
*(_QWORD *)&v8->m_groundYVelocity = v199;
v149 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v20)).f64[0];
if ( v20.f64[0] != v149 )
{
v20.f64[0] = (v20.f64[0] - v149) * 1000.0;
v17 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v20), (__m128d)xmmword_100816960);
v17.f64[0] = v17.f64[0] + v20.f64[0];
v37 = (__m128d)v199;
v20.f64[0] = _mm_round_sd((__m128d)0LL, v17, 11).f64[0] / 1000.0 + v149;
}
v37.f64[0] = fmin(v37.f64[0], v20.f64[0]);
v45.f64[0] = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v37)).f64[0];
if ( v37.f64[0] != v45.f64[0] )
{
v20.f64[1] = v37.f64[1];
v20.f64[0] = (v37.f64[0] - v45.f64[0]) * 1000.0;
v17 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v20), (__m128d)xmmword_100816960);
v17.f64[0] = v17.f64[0] + v20.f64[0];
v17.f64[0] = _mm_round_sd(v17, v17, 11).f64[0] / 1000.0;
v37.f64[0] = v17.f64[0] + v45.f64[0];
}
v8->m_yVelocity = v37.f64[0];
v31 = 0;
}
goto LABEL_407;
}
}
v86 = v64;
LODWORD(v229.f64[0]) = m_isSpider;
if ( (_BYTE)v31 )
{
if ( v78 )
v17.f64[0] = -v17.f64[0];
v45.f64[0] = 0.0;
if ( v17.f64[0] > 0.0 )
{
v87 = v8->m_gameLayer;
if ( v87 )
GJBaseGameLayer::gameEventTriggered(v87, HitHead, 0, v8->m_uniqueID);
}
}
v88 = (float *)((__int64 (__fastcall *)(PlayerObject *, double, double, double, double, double, double, double, double))v8->getPosition)(
v8,
v45.f64[0],
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44,
v75,
v76);
sub_10028CBE0((float *)v209, *v88, v230 + (float)(v222.f32[3] * -0.5));
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
v89 = LOBYTE(v229.f64[0]);
if ( LOBYTE(v229.f64[0]) )
PlayerObject::checkSnapJumpToObject(v8, v236);
if ( ((unsigned __int8)v217 ^ 1 | v86) == 1 )
{
v90 = v236;
if ( v8->m_isUpsideDown )
{
v91 = 0;
}
else
{
v91 = 1;
if ( !v8->m_isShip && !v8->m_isBird && !v8->m_isDart )
v91 = v8->m_isSwing;
}
if ( (_BYTE)v31 )
{
LODWORD(v231) = (_DWORD)v12;
v123 = v31;
v124 = v8->m_isOnGround;
v125 = v8->m_isOnGround2;
v225 = v8->m_lastLandTime;
PlayerObject::hitGround(v8, nullptr, v91);
v8->m_isOnGround = v124;
LOBYTE(v31) = v123;
LOBYTE(v12) = (_BYTE)v231;
v8->m_isOnGround2 = v125;
v89 = LOBYTE(v229.f64[0]);
v8->m_lastLandTime = v225;
}
else
{
PlayerObject::hitGround(v8, v236, v91);
}
}
else
{
v8->m_yVelocity = 0.0;
v90 = v236;
}
v126 = v31 ^ 1 | v232 | (unsigned __int8)v12;
if ( v8->m_isUpsideDown )
{
v127 = v234;
if ( (v126 & 1) != 0 )
{
v234 = v230;
goto LABEL_313;
}
}
else
{
v127 = v230;
if ( (v126 & 1) != 0 )
{
LABEL_313:
if ( !(_BYTE)v31 )
{
PlayerObject::updateCollideBottom(v8, v234, v90);
LABEL_318:
v129 = v215;
if ( v215 )
{
v8->m_lastGroundObject = v215;
if ( v129->m_isDontBoostY )
v8->m_stateBoostX = 2;
if ( v129->m_isDontBoostX )
v8->m_stateBoostY = 2;
}
*(_QWORD *)&v8->m_groundYVelocity = v199;
v128 = 0;
goto LABEL_324;
}
LABEL_316:
v128 = 1;
if ( v8->m_isPlatformer )
PlayerObject::exitPlatformerAnimateJump(v8);
LABEL_324:
if ( v89 && v8->m_stateNoAutoJump > 0 && v8->m_padRingRelated )
v8->m_jumpBuffered = 0;
v130 = !v8->m_isShip && !v8->m_isBird && !v8->m_isDart && !v8->m_isSwing;
if ( (unsigned __int8)v128 ^ 1 | (unsigned __int8)(v130 | v227) )
{
if ( v128 )
goto LABEL_334;
}
else
{
v131 = (__m128d)*(unsigned __int64 *)&v8->m_groundYVelocity;
v132 = _mm_cvtepi32_pd(_mm_cvttpd_epi32(v131)).f64[0];
if ( v131.f64[0] != v132 )
{
v131.f64[0] = (v131.f64[0] - v132) * 1000.0;
v133 = _mm_or_pd(_mm_and_pd((__m128d)xmmword_100816590, v131), (__m128d)xmmword_100816960);
v133.f64[0] = v133.f64[0] + v131.f64[0];
v131.f64[0] = _mm_round_sd((__m128d)0LL, v133, 11).f64[0] / 1000.0 + v132;
}
v8->m_yVelocity = v131.f64[0];
if ( v128 )
{
LABEL_334:
PlayerObject::didHitHead(v8);
if ( !LOBYTE(v235) )
return 1;
goto LABEL_340;
}
}
if ( !LOBYTE(v235) )
return 1;
LABEL_340:
v8->m_maybeTouchedBreakableBlock = 1;
v134 = v8->m_gameLayer;
if ( !v134 )
{
v135 = v90;
goto LABEL_499;
}
GJBaseGameLayer::destroyObject(v134, v90);
return 1;
}
}
PlayerObject::updateCollideTop(v8, v127, v90);
if ( !(_BYTE)v31 )
goto LABEL_318;
goto LABEL_316;
}
*(_QWORD *)&v45.f64[0] = 1050253722;
*(_QWORD *)&v37.f64[0] = 1050253722;
((void (__fastcall *)(_QWORD *, PlayerObject *, __int64, float, float, double, double, double, double, double, double))v8->getObjectRect_0)(
v209,
v8,
v64,
0.30000001,
0.30000001,
v17.f64[0],
v20.f64[0],
v43,
v44,
v75,
v76);
if ( !sub_10028D320(v204.f32, (float *)v209) )
{
LABEL_407:
LODWORD(v15) = 0;
goto LABEL_408;
}
m_gameLayer = v8->m_gameLayer;
if ( !m_gameLayer )
{
v135 = v236;
goto LABEL_499;
}
LABEL_257:
GJBaseGameLayer::destroyObject(m_gameLayer, v236);
return 1;
}
if ( v79 == v8->m_unk50C )
goto LABEL_208;
LABEL_408:
if ( !v8->m_isPlatformer )
goto LABEL_464;
LODWORD(v225) = (_DWORD)v15;
v233 = v31;
v150 = (double *)((__int64 (__fastcall *)(PlayerObject *, double, double, double, double, double, double))v8->getPosition)(
v8,
v45.f64[0],
v37.f64[0],
v17.f64[0],
v20.f64[0],
v43,
v44);
v151 = sub_10028CC60(v209, v150);
((void (__fastcall *)(PlayerObject *, double))v8->getPosition)(v8, v151);
((void (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v152 = ((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
LODWORD(v229.f64[0]) = 1056964608;
v223.f32[0] = (float)(v222.f32[3] * 0.5) + *(float *)(v152 + 4);
v153 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8) + 4);
*(float *)v229.f64 = *(float *)v229.f64 * v222.f32[3];
if ( !v224 )
{
v221.i64[0] = 0;
v162 = 1;
v163 = 1;
v154 = v215;
v164 = v198;
v165 = v231;
if ( !v231->m_isOnSlope )
goto LABEL_420;
LABEL_422:
v167 = ((__int64 (__fastcall *)(PlayerObject *))v165->getPosition)(v165);
if ( v165->m_isUpsideDown )
v168 = -1.0;
else
v168 = 1.0;
v229.f64[0] = (float)((float)((float)(v222.f32[3] * 0.5) * v168) + *(float *)(v167 + 4));
*(double *)v223.i64 = *(float *)(((__int64 (__fastcall *)(PlayerObject *))v231->getPosition)(v231) + 4);
if ( v154 )
goto LABEL_426;
goto LABEL_428;
}
*(float *)&v220 = v153;
v154 = v215;
v155 = (double *)GameObject::getLastPosition(v215);
v156 = sub_10028CC60(&v206, v155);
((void (__fastcall *)(unsigned int *, GameObject *, double))v154->getRealPosition)(&v207, v154, v156);
v157 = v8->m_isSideways;
v221 = (__m128)*(unsigned int *)(((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8) + 4LL * !v157);
v158 = v8->m_isSideways;
v159 = (__m128 *)&v206.i32[1];
if ( !v158 )
v159 = &v206;
LODWORD(v228) = v159->i32[0];
v160 = (float *)&v208;
if ( !v158 )
v160 = (float *)&v207;
v237 = *v160;
if ( v158 )
{
GameObject::getScalePosDelta((GameObject *)v200);
v161 = (__m128)v200[1];
}
else
{
GameObject::getScalePosDelta((GameObject *)v200);
v161 = (__m128)v200[0];
}
v162 = (float)((float)(v237 - *(float *)&v228) + v161.f32[0]) >= 0.0;
v163 = (float)(v237 - *(float *)&v228) <= v161.f32[0];
v166 = _mm_cmplt_ss(v221, (__m128)LODWORD(v237));
*(double *)v221.i64 = (float)((float)(v237
- (float)(COERCE_FLOAT(
COERCE_UNSIGNED_INT(_mm_andnot_ps(
v166,
_mm_xor_ps((__m128)xmmword_1008150B0, v161)).f32[0])
| v161.i32[0] & v166.i32[0])
+ *(float *)&v228))
/ v211);
v164 = v198;
v153 = *(float *)&v220;
v165 = v231;
if ( v231->m_isOnSlope )
goto LABEL_422;
LABEL_420:
if ( v165->m_wasOnSlope || v165->m_totalTime - v165->m_slopeEndTime < 0.2000000029802322 )
goto LABEL_422;
v171 = v153 - *(float *)v229.f64;
v229.f64[0] = v223.f32[0] - v164;
*(double *)v223.i64 = v171 + v164;
if ( v154 )
{
LABEL_426:
v169 = v231->m_collidingWithLeft == v154;
v170 = v231->m_collidingWithRight == v154;
goto LABEL_429;
}
LABEL_428:
v169 = 0;
v170 = 0;
LABEL_429:
*(_QWORD *)&v17.f64[0] = v222.u32[2];
v20 = (__m128d)v222.u32[3];
*(float *)v20.f64 = v222.f32[3] - v210;
sub_10028CC00((__int64)&v206, v222.f32[0], (float)(0.5 * v210) + v222.f32[1], (__m128)v222.u32[2], (__m128)v20);
if ( !(_BYTE)v232
&& (sub_10028D320(v206.f32, v204.f32) || v170 || v169)
&& (v214 > v229.f64[0] && v229.f64[0] > v226 || v214 > *(double *)v223.i64 && *(double *)v223.i64 > v226) )
{
v172 = v162;
v173 = v231;
*(_QWORD *)&v231->m_scaleXRelated4 = v221.i64[0];
if ( v169
|| (v174 = (float *)((__int64 (__fastcall *)(PlayerObject *))v173->getPosition)(v173), !v170 && v201 < *v174) )
{
if ( v236 )
v177 = v236->m_uniqueID;
else
v177 = 0;
v178 = v231;
v179 = (__m128d)*(unsigned __int64 *)&v231->m_collidedLeftMaxX;
v17.f64[0] = fmax(v216, v179.f64[0]);
v180.f64[0] = 0.0;
v179.f64[0] = _mm_cmpeq_sd(v179, v180).f64[0];
*(_QWORD *)&v20.f64[0] = ~*(_QWORD *)&v179.f64[0] & *(_QWORD *)&v17.f64[0];
*(_QWORD *)&v231->m_collidedLeftMaxX = *(_QWORD *)&v179.f64[0] & COERCE_UNSIGNED_INT64(v216)
| *(_QWORD *)&v20.f64[0];
if ( v177 )
{
if ( v178->m_lastCollisionLeft != v177 )
{
v178->m_lastCollisionLeft = v177;
m_collisionLogLeft = v178->m_collisionLogLeft;
if ( m_collisionLogLeft )
cocos2d::CCDictionary::setObject(m_collisionLogLeft, v178->m_maybeLastGroundObject, v177);
}
v178->m_collidingWithLeft = v236;
v178->m_collidingWithRight = nullptr;
}
v216 = v216 + (float)(v222.f32[2] * 0.5);
v182 = ((__int64 (__fastcall *)(PlayerObject *))v178->getPosition)(v178);
sub_10028CBE0((float *)&v207, v216, *(float *)(v182 + 4));
((void (__fastcall *)(PlayerObject *, unsigned int *))v178->setPosition)(v178, &v207);
if ( v178->m_platformerXVelocity < 0.0 && (v172 || !v212) )
v231->m_platformerXVelocity = 0.0;
v183 = v231;
if ( v231->m_isDashing )
{
m_dashRing = v231->m_dashRing;
if ( !m_dashRing || !m_dashRing->m_allowCollide )
{
PlayerObject::stopDashing(v231);
v183->m_jumpBuffered = 0;
}
}
if ( !v183->m_platformerMovingLeft )
goto LABEL_463;
}
else
{
PlayerObject::updateCollideRight(v173, v205, v236);
*(float *)v229.f64 = (float)(v222.f32[2] * -0.5) + v205;
v175 = ((__int64 (__fastcall *)(PlayerObject *))v173->getPosition)(v173);
sub_10028CBE0((float *)&v207, *(float *)v229.f64, *(float *)(v175 + 4));
((void (__fastcall *)(PlayerObject *, unsigned int *))v173->setPosition)(v173, &v207);
if ( v173->m_platformerXVelocity > 0.0 && ((v163 | (unsigned __int8)v213 ^ 1) & 1) != 0 )
v173->m_platformerXVelocity = 0.0;
if ( v173->m_isDashing )
{
v176 = v173->m_dashRing;
if ( !v176 || !v176->m_allowCollide )
{
PlayerObject::stopDashing(v173);
v173->m_jumpBuffered = 0;
}
}
if ( !v173->m_platformerMovingRight )
goto LABEL_463;
}
v231->m_maybeSlidingTime = 0;
}
LABEL_463:
v8 = v231;
LOBYTE(v31) = v233;
LOBYTE(v15) = LOBYTE(v225);
LABEL_464:
if ( !(_BYTE)v15 )
return 0;
if ( ((v8->m_isPlatformer | (unsigned __int8)v232) & 1) != 0 )
return 0;
((void (__fastcall *)(__m128 *, PlayerObject *, float, float, double, double, double, double))v8->getObjectRect_0)(
&v206,
v8,
0.30000001,
0.30000001,
v17.f64[0],
v20.f64[0],
v43,
v44);
if ( !sub_10028D320(v204.f32, v206.f32) )
return 0;
if ( (_BYTE)v31 )
{
m_lastFlipTime = v8->m_lastFlipTime;
if ( m_lastFlipTime != 0.0 && v8->m_totalTime - m_lastFlipTime < 0.1000000014901161 )
{
v186 = v236;
if ( v8->m_isUpsideDown )
{
v187 = *(float *)((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v188 = v222.f32[3] * 0.5;
v189 = v234;
}
else
{
v187 = *(float *)((__int64 (__fastcall *)(PlayerObject *))v8->getPosition)(v8);
v188 = v222.f32[3] * -0.5;
v189 = v230;
}
sub_10028CBE0((float *)v209, v187, v189 + v188);
((void (__fastcall *)(PlayerObject *, _QWORD *))v8->setPosition)(v8, v209);
PlayerObject::hitGround(v8, v186, 1);
v8->m_isOnGround2 = 0;
return 1;
}
}
v190 = v236;
if ( !v8->m_isSpider
|| (v191 = sub_10028D230(v204.f32),
LODWORD(v229.f64[0]) = LODWORD(v191),
v192 = sub_10028D230(v206.f32),
*(float *)&v192 <= *(float *)v229.f64)
|| (m_lastSpiderFlipTime = v8->m_lastSpiderFlipTime, m_lastSpiderFlipTime == 0.0)
|| v8->m_totalTime - m_lastSpiderFlipTime >= 0.03999999910593033 )
{
if ( v190 && ((unsigned int (__fastcall *)(GameObject *))v190->getType)(v190) == 21 )
{
v194 = v8->m_gameLayer;
if ( v194 )
{
GJBaseGameLayer::destroyObject(v194, v190);
return 1;
}
v135 = v190;
LABEL_499:
GameObject::destroyObject(v135);
return 1;
}
if ( !v8->m_maybeCanRunIntoBlocks )
{
v196 = GameManager::sharedState();
((void (__fastcall *)(PlayLayer *, PlayerObject *, _QWORD))v196->m_playLayer->destroyPlayer)(
v196->m_playLayer,
v8,
0);
return 1;
}
if ( !v8->m_ignoreDamage )
{
v8->m_maybeIsColliding = 1;
return 1;
}
return 0;
}
return 1;
}