//
// GJBaseGameLayer::getCameraEdgeValue from 0x476840 to 0x4768d4 (148 bytes)
//
// 5 xrefs:
// > GJBaseGameLayer::updateCamera @ 0x486102
// > GJBaseGameLayer::updateCamera @ 0x486120
// > GJBaseGameLayer::updateCamera @ 0x48613a
// > GJBaseGameLayer::updateCamera @ 0x486160
// > GJBaseGameLayer::updateCamera @ 0x48617a
//
// 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 GJBaseGameLayer::getCameraEdgeValue(GJBaseGameLayer *a1, int a2)
{
int v2; // r6
int m_cameraEdgeValue0; // r4
GameObject *MainObject; // r0
int v6; // r2
bool v7; // r3
float result; // r0
cocos2d::CCPoint v9; // [sp+4h] [bp-14h] BYREF
cocos2d::CCPoint v10; // [sp+Ch] [bp-Ch] BYREF
v2 = a2 - 1;
switch ( a2 )
{
case 1:
m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue0;
break;
case 2:
m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue1;
break;
case 3:
m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue2;
break;
case 4:
m_cameraEdgeValue0 = a1->m_gameState.m_cameraEdgeValue3;
break;
default:
m_cameraEdgeValue0 = 0;
break;
}
cocos2d::CCPoint::CCPoint(&v9, &stru_AC68C0);
MainObject = GJBaseGameLayer::tryGetMainObject(a1, m_cameraEdgeValue0);
if ( MainObject )
{
MainObject->getRealPosition(&v10, MainObject);
cocos2d::CCPoint::operator=((PlayerObject *)&v9, COERCE_FLOAT(&v10), v6, v7);
}
switch ( v2 )
{
case 0:
case 1:
result = v9.x;
break;
case 2:
case 3:
result = v9.y;
break;
default:
result = 0.0;
break;
}
return result;
}