//
// GJBaseGameLayer::getCameraEdgeValue from 0x1001fd2c8 to 0x1001fd3a8 (224 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::updateCamera @ 0x1001ff8a8
// > GJBaseGameLayer::updateCamera @ 0x1001ff8c4
// > GJBaseGameLayer::updateCamera @ 0x1001ff8e8
// > GJBaseGameLayer::updateCamera @ 0x1001ff90c
// > GJBaseGameLayer::updateCamera @ 0x1001ff924
//
// 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 __fastcall GJBaseGameLayer::getCameraEdgeValue(GJBaseGameLayer *a1, int a2)
{
int m_cameraEdgeValue2; // w21
GameObject *MainObject; // x0
__int64 v7; // [xsp+0h] [xbp-30h] BYREF
__int64 v8; // [xsp+8h] [xbp-28h] BYREF
m_cameraEdgeValue2 = 0;
if ( a2 > 2 )
{
if ( a2 == 3 )
{
m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue2;
}
else if ( a2 == 4 )
{
m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue3;
}
}
else if ( a2 == 1 )
{
m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue0;
}
else if ( a2 == 2 )
{
m_cameraEdgeValue2 = a1->m_gameState.m_cameraEdgeValue1;
}
sub_1000229B8(&v8, &qword_10086C9A0);
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_cameraEdgeValue2);
if ( MainObject )
{
((void (__fastcall *)(__int64 *__return_ptr))MainObject->getRealPosition)(&v7);
sub_1000229D0(&v8, (double *)&v7);
}
if ( (unsigned int)(a2 - 3) < 2 )
return *((float *)&v8 + 1);
if ( (unsigned int)(a2 - 1) > 1 )
return 0.0;
return *(float *)&v8;
}