//
// PlayLayer::getRelativeMod from 0x3123d4 to 0x312446 (114 bytes)
//
// 1 xrefs:
// > PlayLayer::updateInvisibleBlock @ 0x3124be
//
// 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
//
float PlayLayer::getRelativeMod(PlayLayer *a1, cocos2d::CCPoint a2, float a3, float a4, float a5)
{
float y; // s15
float v6; // s11
float x; // s13
float m_halfCameraWidth; // s14
float v9; // s12
bool v10; // cc
float v11; // s13
float v12; // s15
y = a2.y;
v6 = *(float *)LODWORD(a2.x);
x = a1->m_gameState.m_cameraPosition2.x;
m_halfCameraWidth = a1->m_halfCameraWidth;
v9 = x + m_halfCameraWidth;
v10 = *(float *)LODWORD(a2.x) <= (float)(x + m_halfCameraWidth);
if ( *(float *)LODWORD(a2.x) <= (float)(x + m_halfCameraWidth) )
y = a3;
else
v6 = v6 - a4;
if ( *(float *)LODWORD(a2.x) <= v9 )
v9 = v9 - v6;
else
x = v6 - x;
if ( v10 )
v11 = v9 - a4;
else
v11 = x - m_halfCameraWidth;
v12 = (float)(m_halfCameraWidth - v11) * y;
if ( v12 < 0.0 )
return 0.0;
if ( v12 > 1.0 )
return 1.0;
return v12;
}