//
// GameObject::determineSlopeDirection from 0x355bc4 to 0x355cfa (310 bytes)
//
// 11 xrefs:
// > PlayLayer::addObject @ 0x310d2c
// > PlayerObject::rotateGameplayObject @ 0x34887e
// > PlayerObject::unrotateGameplayObject @ 0x348a32
// > GameObject::getObjectDirection @ 0x355d5c
// > LevelEditorLayer::rotationForSlopeNearObject @ 0x367090
// > LevelEditorLayer::onPlaytest @ 0x36ed8e
// > LevelEditorLayer::addSpecial @ 0x370bf0
// > EditorUI::addObjectsToSmartTemplate @ 0x39c4ba
// > EditorUI::createSmartObjectsFromTemplate @ 0x3a5346
// > RotateGameplayGameObject::updateGameplayRotation @ 0x3eccb0
// > GJBaseGameLayer::updateDebugDraw @ 0x46bacc
//
// 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 GameObject::determineSlopeDirection(GameObject *a1)
{
int v2; // r6
int v3; // r5
float v4; // s15
_BOOL4 v5; // r1
_BOOL4 v6; // r2
_BOOL4 v7; // r3
int v8; // r3
v2 = ((int (__fastcall *)(GameObject *))a1->isFlipX)(a1);
v3 = ((int (__fastcall *)(GameObject *))a1->isFlipY)(a1);
v4 = (float)((int)a1->getObjectRotation(a1) % 360);
v5 = fabsf(v4) == 180.0;
if ( v4 == 90.0 )
{
v6 = 1;
LABEL_5:
v7 = v4 == 270.0;
goto LABEL_7;
}
v6 = v4 == -270.0;
if ( v4 != -90.0 )
goto LABEL_5;
v7 = 1;
LABEL_7:
a1->m_slopeUphill = 0;
if ( v2 )
{
if ( v3 )
{
if ( v5 )
{
LABEL_13:
a1->m_slopeUphill = 1;
v8 = 0;
LABEL_42:
a1->m_slopeDirection = v8;
return;
}
if ( v4 == 0.0 )
{
LABEL_25:
a1->m_slopeUphill = 1;
v8 = 3;
goto LABEL_42;
}
if ( v7 )
{
LABEL_29:
v8 = 4;
goto LABEL_42;
}
if ( !v6 )
return;
LABEL_33:
v8 = 5;
goto LABEL_42;
}
if ( v5 )
{
LABEL_17:
v8 = 1;
goto LABEL_42;
}
if ( v4 == 0.0 )
{
LABEL_21:
v8 = 2;
goto LABEL_42;
}
if ( v6 )
{
LABEL_37:
a1->m_slopeUphill = 1;
v8 = 6;
goto LABEL_42;
}
if ( !v7 )
return;
LABEL_41:
a1->m_slopeUphill = 1;
v8 = 7;
goto LABEL_42;
}
if ( !v3 )
{
if ( v4 == 0.0 )
goto LABEL_13;
if ( v5 )
goto LABEL_25;
if ( v6 )
goto LABEL_29;
if ( !v7 )
return;
goto LABEL_33;
}
if ( v4 == 0.0 )
goto LABEL_17;
if ( v5 )
goto LABEL_21;
if ( v7 )
goto LABEL_37;
if ( v6 )
goto LABEL_41;
}