//
// GameObject::slopeYPos from 0x1401a13b0 to 0x1401a14e1 (305 bytes)
//
// 4 xrefs:
// > PlayerObject::collidedWithSlopeInternal @ 0x14038fd4b
// > PlayerObject::collidedWithObjectInternal @ 0x1403921f1
// > PlayerObject::spiderTestJumpInternal @ 0x140394b41
// > ??> @ 0x1406cbf4c
//
// 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
//
double GameObject::slopeYPos(GameObject *a1, float a2)
{
const struct cocos2d::CCRect *v3; // rax
double MinX; // xmm8_8
double MaxX; // xmm9_8
double MinY; // xmm7_8
float MaxY; // xmm0_4
bool m_slopeUphill; // al
double v9; // xmm2_8
double v10; // xmm0_8
double v11; // xmm3_8
double v12; // xmm8_8
double v13; // xmm7_8
double v14; // xmm0_8
unsigned int m_slopeDirection; // eax
int v16; // ecx
cocos2d::CCRect v18; // [rsp+20h] [rbp-58h] BYREF
v3 = a1->getObjectRect_0(a1);
cocos2d::CCRect::CCRect(&v18, v3);
MinX = cocos2d::CCRect::getMinX(&v18);
MaxX = cocos2d::CCRect::getMaxX(&v18);
MinY = cocos2d::CCRect::getMinY(&v18);
MaxY = cocos2d::CCRect::getMaxY(&v18);
m_slopeUphill = a1->m_slopeUphill;
v9 = MaxY;
v10 = a2;
v11 = (float)(v18.size.height / v18.size.width);
if ( MinX < a2 )
{
v14 = (v10 - MaxX) * v11;
if ( m_slopeUphill )
v13 = v14 + v9;
else
v13 = MinY - v14;
}
else
{
v12 = (MinX - v10) * v11;
if ( m_slopeUphill )
v13 = MinY - v12;
else
v13 = v12 + v9;
}
if ( a1->m_slopeIsHazard )
{
m_slopeDirection = a1->m_slopeDirection;
if ( m_slopeDirection <= 6 && (v16 = 106, _bittest(&v16, m_slopeDirection)) )
return v13 + -4.0;
else
return v13 + 4.0;
}
return v13;
}