// // PlayerObject::preSlopeCollision from 0x100223278 to 0x100223704 (1164 bytes) // // 1 xrefs: // > PlayerObject::collidedWithSlopeInternal @ 0x100220744 // // 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 // bool __fastcall PlayerObject::preSlopeCollision(PlayerObject *a1, float a2, GameObject *a3) { __int64 v3; // x29 __int64 v4; // x30 __int64 v5; // d8 __int64 v6; // d9 __int64 v7; // d10 __int64 v8; // d11 __int64 v13; // x0 double v14; // d0 __int64 v15; // x0 _BOOL4 v16; // w22 _BOOL4 v17; // w21 float v18; // s10 float32x2_t *LastPosition; // x0 __n128 v20; // q0 __n128 v21; // q1 float32x2_t *v22; // x8 float *v23; // x0 float v24; // s0 float v25; // s9 float v26; // s1 float v27; // s3 float v28; // s9 char v29; // w22 double v30; // d0 __int64 v31; // x0 double v32; // d0 __int64 v33; // x0 char v34; // w21 GameObject *m_currentPotentialSlope; // x0 float v36; // s8 GameObject *v37; // x0 float v38; // s8 int m_uniqueID; // [xsp+Ch] [xbp-B4h] BYREF float v40[5]; // [xsp+10h] [xbp-B0h] BYREF float32x2_t v41; // [xsp+24h] [xbp-9Ch] BYREF float v42; // [xsp+30h] [xbp-90h] float32x2_t v43; // [xsp+34h] [xbp-8Ch] BYREF float v44[4]; // [xsp+3Ch] [xbp-84h] BYREF __int64 v45; // [xsp+4Ch] [xbp-74h] BYREF float v46; // [xsp+54h] [xbp-6Ch] float v47; // [xsp+58h] [xbp-68h] __int64 v48; // [xsp+60h] [xbp-60h] __int64 v49; // [xsp+68h] [xbp-58h] __int64 v50; // [xsp+70h] [xbp-50h] __int64 v51; // [xsp+78h] [xbp-48h] __int64 v52; // [xsp+B0h] [xbp-10h] __int64 v53; // [xsp+B8h] [xbp-8h] cocos2d::CCRect v54; // 0:s1.4,4:s2.4,8:s3.4,12:s4.4 cocos2d::CCRect v55; // 0:s1.4,4:s2.4,8:s3.4,12:s4.4 if ( a3->m_uniqueID == a1->m_collidingWithSlopeId ) return 0; v48 = v8; v49 = v7; v50 = v6; v51 = v5; v52 = v3; v53 = v4; v13 = ((__int64 (__fastcall *)(GameObject *))a3->getObjectRect)(a3); v14 = sub_100022B98(&v45, v13); v15 = ((__int64 (__fastcall *)(PlayerObject *, double))a1->getObjectRect)(a1, v14); sub_100022B98(v44, v15); v16 = GameObject::slopeWallLeft(a3); v17 = GameObject::slopeFloorTop(a3); v18 = 0.0; if ( a1->m_isPlatformer ) { v18 = 5.0; if ( !a1->m_isOnSlope ) { if ( a1->m_wasOnSlope ) v18 = 5.0; else v18 = 0.0; } } ((void (__fastcall *)(float32x2_t *__return_ptr, GameObject *))a3->getRealPosition)(&v41, a3); LastPosition = (float32x2_t *)GameObject::getLastPosition(a3); v20.n128_f32[1] = sub_1000229F0(&v41, LastPosition, &v43).f32[1]; if ( a1->m_isSideways ) v22 = (float32x2_t *)((char *)&v43 + 4); else v22 = &v43; v20.n128_u32[0] = v22->i32[0]; v21.n128_f64[0] = a1->m_speedMultiplier * a1->m_playerSpeed * a2; v21.n128_f32[0] = v21.n128_f64[0]; if ( !v16 ) { if ( a1->m_isGoingLeft || a1->m_isPlatformer || v20.n128_f32[0] > v21.n128_f32[0] ) { v28 = *(float *)((__int64 (__fastcall *)(PlayerObject *, __n128, __n128))a1->getPosition)(a1, v20, v21); if ( v28 > sub_100022C30((float *)&v45) ) { v25 = 0.0; if ( !a1->m_isGoingLeft ) v25 = (float)!a1->m_isPlatformer; v24 = (float)(*(float *)&v45 + v46) + -1.0; v26 = (float)(v18 + v25) + *((float *)&v45 + 1); v27 = v47 + (float)((float)(v18 + v25) * -2.0); goto LABEL_24; } } LABEL_29: v29 = 0; v25 = 0.0; goto LABEL_30; } if ( a1->m_isGoingLeft && !a1->m_isPlatformer && v20.n128_f32[0] >= v21.n128_f32[0] ) goto LABEL_29; v23 = (float *)((__int64 (__fastcall *)(PlayerObject *, __n128, __n128))a1->getPosition)(a1, v20, v21); v24 = *(float *)&v45; if ( *v23 >= *(float *)&v45 ) goto LABEL_29; v25 = 0.0; if ( a1->m_isGoingLeft ) v25 = (float)!a1->m_isPlatformer; v26 = (float)(v18 + v25) + *((float *)&v45 + 1); v27 = v47 + (float)((float)(v18 + v25) * -2.0); LABEL_24: sub_100022990((float *)&v41, v24, v26, 1.0, v27); if ( sub_100022CB0(v44, (float *)&v41) ) { sub_100022B98(v40, (__int64)&v41); PlayerObject::collidedWithObjectInternal(a1, a2, a3, v54, (bool)v40); } v29 = 1; LABEL_30: sub_100022B90(&v41); if ( v17 ) { sub_100022990(v40, v25 + *(float *)&v45, (float)(*((float *)&v45 + 1) + v47) + -1.0, v46 + (float)(v25 * -2.0), 1.0); v30 = sub_100022BB0(&v41, (__int64)v40); v31 = ((__int64 (__fastcall *)(PlayerObject *, double))a1->getPosition)(a1, v30); if ( *(float *)(v31 + 4) >= (float)(v41.f32[1] + v42) ) goto LABEL_32; } else { sub_100022990(v40, v25 + *(float *)&v45, *((float *)&v45 + 1), v46 + (float)(v25 * -2.0), 1.0); v32 = sub_100022BB0(&v41, (__int64)v40); v33 = ((__int64 (__fastcall *)(PlayerObject *, double))a1->getPosition)(a1, v32); if ( *(float *)(v33 + 4) <= (float)(v41.f32[1] + v42) ) { LABEL_32: if ( sub_100022CB0(v44, (float *)&v41) ) { sub_100022B98(v40, (__int64)&v41); PlayerObject::collidedWithObjectInternal(a1, a2, a3, v55, (bool)v40); } goto LABEL_36; } } if ( (v29 & 1) == 0 ) { a1->m_unk669 = 0; if ( a1->m_isOnSlope || (m_uniqueID = a3->m_uniqueID, *(_QWORD *)v40 = &m_uniqueID, sub_100019F24( (unsigned __int64)&a1->m_potentialSlopeMap, &m_uniqueID, (__int64)&unk_10063A946, (_DWORD **)v40)[3] = a3, (m_currentPotentialSlope = a1->m_currentPotentialSlope) != nullptr) && (m_currentPotentialSlope->m_slopeUphill && !GameObject::slopeFloorTop(m_currentPotentialSlope) || a3->m_slopeUphill && !GameObject::slopeFloorTop(a3) || (v36 = *(float *)((__int64 (__fastcall *)(GameObject *))a1->m_currentPotentialSlope->getPosition)(a1->m_currentPotentialSlope), v36 <= *(float *)((__int64 (__fastcall *)(GameObject *))a3->getPosition)(a3))) && ((v37 = a1->m_currentPotentialSlope, !v37->m_slopeUphill) || GameObject::slopeFloorTop(v37) || (v38 = *(float *)((__int64 (__fastcall *)(GameObject *))a1->m_currentPotentialSlope->getPosition)(a1->m_currentPotentialSlope), v38 >= *(float *)((__int64 (__fastcall *)(GameObject *))a3->getPosition)(a3))) ) { v34 = 0; } else { v34 = 0; a1->m_currentPotentialSlope = a3; } return v34 | !sub_100022CB0((float *)&v45, v44); } LABEL_36: v34 = 1; return v34 | !sub_100022CB0((float *)&v45, v44); }
GD Web Decomp Icon

GD Web Decomp

Raw Source