//
// GJBaseGameLayer::speedForShaderTarget from 0x14032b2a0 to 0x14032b3aa (266 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::updateShaderLayer @ 0x14032a432
// > GJBaseGameLayer::updateShaderLayer @ 0x14032a459
// > ??> @ 0x14091f154
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:30:29 +0000
//
cocos2d::CCPoint *__fastcall GJBaseGameLayer::speedForShaderTarget(__int64 a1, cocos2d::CCPoint *a2, int a3)
{
__int64 v6; // rbx
__int64 MainObject; // rax
__int64 v8; // rbx
__int64 v9; // rax
char *v10; // rdx
char *v11; // rax
char *v12; // rax
__int64 v13; // rax
_BYTE v15[24]; // [rsp+20h] [rbp-18h] BYREF
char v16; // [rsp+48h] [rbp+10h] BYREF
char v17; // [rsp+58h] [rbp+20h] BYREF
cocos2d::CCPoint::CCPoint(a2);
if ( a3 == -1 )
goto LABEL_10;
if ( a3 == -2 )
{
if ( *(_BYTE *)(a1 + 1058) )
{
v6 = *(_QWORD *)(a1 + 3520);
LABEL_11:
v13 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 200LL))(v6);
cocos2d::CCPoint::operator-(v13, &v16, v6 + 1232);
v10 = &v16;
goto LABEL_12;
}
LABEL_10:
v6 = *(_QWORD *)(a1 + 3512);
goto LABEL_11;
}
if ( a3 < 1 )
{
cocos2d::CCPoint::operator-(a1 + 1244, &v16);
v10 = v12;
}
else
{
MainObject = GJBaseGameLayer::tryGetMainObject(a1, (unsigned int)a3);
v8 = MainObject;
if ( MainObject )
{
v9 = (*(__int64 (__fastcall **)(__int64, char *))(*(_QWORD *)MainObject + 1208LL))(MainObject, &v17);
cocos2d::CCPoint::operator-(v9, &v16, v8 + 1232);
v10 = &v16;
}
else
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v15, (const struct cocos2d::CCPoint *)&dword_14090AA70);
v10 = v11;
}
}
LABEL_12:
cocos2d::CCPoint::operator=(a2, v10);
return a2;
}