//
// PlayerObject::preSlopeCollision from 0x75ecac to 0x75f190 (1252 bytes)
//
// 2 xrefs:
// > PlayerObject::collidedWithSlopeInternal @ 0x75fdac
// > ??> @ 0x6dc78
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:53:02 +0000
//
__int64 __fastcall PlayerObject::preSlopeCollision(PlayerObject *this, float a2, GameObject *a3)
{
__int64 result; // x0
float v7; // s9
const cocos2d::CCRect *v8; // x0
const cocos2d::CCRect *v9; // x0
int v10; // w26
int v11; // w25
__int64 LastPosition; // x0
long double v13; // q0
long double v14; // q0
float v15; // s3
float *v16; // x0
float v17; // s0
float v18; // s8
float v19; // s3
float v20; // s1
float v21; // s2
unsigned int v22; // w26
__int64 v23; // x0
int v24; // w0
__int64 v25; // x0
float v26; // s8
float v27; // s0
GameObject *v28; // x0
float v29; // s8
GameObject *v30; // x0
float v31; // s8
__int64 v32; // [xsp+70h] [xbp+70h] BYREF
float v33; // [xsp+78h] [xbp+78h] BYREF
float v34; // [xsp+7Ch] [xbp+7Ch]
float v35; // [xsp+80h] [xbp+80h]
float v36; // [xsp+84h] [xbp+84h]
_BYTE v37[16]; // [xsp+88h] [xbp+88h] BYREF
_BYTE v38[4]; // [xsp+98h] [xbp+98h] BYREF
float v39; // [xsp+9Ch] [xbp+9Ch]
float v40; // [xsp+A4h] [xbp+A4h]
_QWORD v41[2]; // [xsp+A8h] [xbp+A8h] BYREF
result = 0;
if ( *((_DWORD *)a3 + 229) != *((_DWORD *)this + 418) )
{
v7 = 0.0;
v8 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 1328LL))(a3);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v33, v8);
v9 = (const cocos2d::CCRect *)(*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 1328LL))(this);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v37, v9);
v10 = (unsigned __int8)GameObject::slopeWallLeft(a3);
v11 = (unsigned __int8)GameObject::slopeFloorTop(a3);
if ( *((_BYTE *)this + 2832) )
{
if ( *((_BYTE *)this + 2408) )
{
v7 = 5.0;
}
else if ( *((_BYTE *)this + 2409) )
{
v7 = 5.0;
}
}
(*(void (__fastcall **)(_QWORD *__return_ptr, GameObject *))(*(_QWORD *)a3 + 1360LL))(v41, a3);
LastPosition = GameObject::getLastPosition(a3);
cocos2d::CCPoint::operator-(&v32, v41, LastPosition, v13);
if ( *((_BYTE *)this + 2427) )
v15 = *((float *)&v32 + 1);
else
v15 = *(float *)&v32;
*(double *)&v14 = *((float *)this + 619) * *((double *)this + 241) * a2;
*(float *)&v14 = *(double *)&v14;
if ( v10 )
{
if ( !*((_BYTE *)this + 2426) || *((_BYTE *)this + 2832) || *(float *)&v14 > v15 )
{
v16 = (float *)(*(__int64 (__fastcall **)(PlayerObject *, long double))(*(_QWORD *)this + 192LL))(this, v14);
v17 = v33;
if ( *v16 < v33 )
{
v18 = 0.0;
if ( *((_BYTE *)this + 2426) )
{
v18 = 0.0;
if ( !*((_BYTE *)this + 2832) )
v18 = 1.0;
}
v19 = v36 - (float)((float)(v7 + v18) * 2.0);
v20 = (float)(v7 + v18) + v34;
v21 = 1.0;
LABEL_13:
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v38, v17, v20, v21, v19);
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v37, (const cocos2d::CCRect *)v38) )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v41, (const cocos2d::CCRect *)v38);
PlayerObject::collidedWithObjectInternal((__int64)this, a3, (cocos2d::CCRect *)v41, 0, a2);
}
v22 = 1;
LABEL_16:
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v38);
if ( v11 )
{
cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)v41,
v18 + v33,
(float)(v34 + v36) - 1.0,
v35 - (float)(v18 * 2.0),
1.0);
cocos2d::CCRect::operator=(v38, v41);
v23 = (*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 192LL))(this);
if ( *(float *)(v23 + 4) < (float)(v39 + v40) )
goto LABEL_18;
}
else
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v41, v18 + v33, v34, v35 - (float)(v18 * 2.0), 1.0);
cocos2d::CCRect::operator=(v38, v41);
v25 = (*(__int64 (__fastcall **)(PlayerObject *))(*(_QWORD *)this + 192LL))(this);
if ( *(float *)(v25 + 4) > (float)(v39 + v40) )
{
LABEL_18:
if ( !v22 )
{
v24 = *((unsigned __int8 *)this + 2408);
*((_BYTE *)this + 1641) = 0;
if ( !v24 )
{
if ( (LODWORD(v41[0]) = *((_DWORD *)a3 + 229),
*(_QWORD *)std::unordered_map::operator[]((__int64)this + 1736, (int *)v41) = a3,
(v28 = *((GameObject **)this + 206)) == nullptr)
|| (!*((_BYTE *)v28 + 1080) || (unsigned __int8)GameObject::slopeFloorTop(v28))
&& (!*((_BYTE *)a3 + 1080) || (unsigned __int8)GameObject::slopeFloorTop(a3))
&& (v29 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 206) + 192LL))(*((_QWORD *)this + 206)),
v29 > *(float *)(*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 192LL))(a3))
|| (v30 = *((GameObject **)this + 206), *((_BYTE *)v30 + 1080))
&& !(unsigned __int8)GameObject::slopeFloorTop(v30)
&& (v31 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**((_QWORD **)this + 206) + 192LL))(*((_QWORD *)this + 206)),
v31 < *(float *)(*(__int64 (__fastcall **)(GameObject *))(*(_QWORD *)a3 + 192LL))(a3)) )
{
*((_QWORD *)this + 206) = a3;
}
}
}
LABEL_20:
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect(
(cocos2d::CCRect *)&v33,
(const cocos2d::CCRect *)v37) )
return v22;
else
return 1;
}
}
v22 = 1;
if ( (unsigned __int8)cocos2d::CCRect::intersectsRect((cocos2d::CCRect *)v37, (const cocos2d::CCRect *)v38) )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v41, (const cocos2d::CCRect *)v38);
PlayerObject::collidedWithObjectInternal((__int64)this, a3, (cocos2d::CCRect *)v41, 0, a2);
}
goto LABEL_20;
}
}
}
else if ( *((_BYTE *)this + 2426) || *((_BYTE *)this + 2832) || *(float *)&v14 < v15 )
{
v26 = *(float *)(*(__int64 (__fastcall **)(PlayerObject *, long double))(*(_QWORD *)this + 192LL))(this, v14);
cocos2d::CCRect::getMaxX((cocos2d::CCRect *)&v33);
if ( v26 > v27 )
{
v18 = 0.0;
if ( !*((_BYTE *)this + 2426) && !*((_BYTE *)this + 2832) )
v18 = 1.0;
v19 = v36 - (float)((float)(v7 + v18) * 2.0);
v21 = 1.0;
v20 = (float)(v7 + v18) + v34;
v17 = (float)(v33 + v35) - 1.0;
goto LABEL_13;
}
}
v22 = 0;
v18 = 0.0;
goto LABEL_16;
}
return result;
}