//
// GJBaseGameLayer::positionForShaderTarget from 0x591d5c to 0x591dd8 (124 bytes)
//
// 7 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x591fc4
// > GJBaseGameLayer::updateShaderLayer @ 0x591fe2
// > GJBaseGameLayer::updateShaderLayer @ 0x592000
// > GJBaseGameLayer::updateShaderLayer @ 0x592020
// > GJBaseGameLayer::updateShaderLayer @ 0x59243c
// > GJBaseGameLayer::updateShaderLayer @ 0x592450
// > GJBaseGameLayer::updateShaderLayer @ 0x592460
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:53:06 +0000
//
GJBaseGameLayer *__fastcall GJBaseGameLayer::positionForShaderTarget(GJBaseGameLayer *this, int a2, int a3)
{
int v6; // r0
_BYTE *v7; // r1
GJBaseGameLayer *v8; // r0
int MainObject; // r0
_BYTE v11[8]; // [sp+4h] [bp-10h] BYREF
cocos2d::CCPoint::CCPoint(this);
if ( a3 == -1 )
goto LABEL_4;
if ( a3 == -2 )
{
if ( *(_BYTE *)(a2 + 866) )
{
v6 = *(_DWORD *)(a2 + 2080);
goto LABEL_6;
}
LABEL_4:
v6 = *(_DWORD *)(a2 + 2076);
LABEL_6:
v7 = (_BYTE *)(*(int (__fastcall **)(int))(*(_DWORD *)v6 + 96))(v6);
v8 = this;
goto LABEL_11;
}
MainObject = GJBaseGameLayer::tryGetMainObject((cocos2d::CCDictionary **)a2, a3);
if ( MainObject )
(*(void (__fastcall **)(_BYTE *, int))(*(_DWORD *)MainObject + 680))(v11, MainObject);
else
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v11, (const cocos2d::CCPoint *)&unk_D2C400);
v8 = this;
v7 = v11;
LABEL_11:
cocos2d::CCPoint::operator=(v8, v7);
return this;
}