//
// GJBaseGameLayer::getFollowSpeedVal from 0x100147c10 to 0x100147d7f (367 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::modifyObjectPhysics @ 0x1001487d6
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x100149635
//
// 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
//
// local variable allocation has failed, the output may be wrong!
cocos2d::CCPoint __fastcall GJBaseGameLayer::getFollowSpeedVal(
GJBaseGameLayer *a1,
GameObject *a2,
int a3,
int a4,
float a5,
float a6)
{
int v6; // r8d
int v7; // r15d
__int64 v9; // r14
double v10; // xmm0_8
GameObject *Object; // rax
GameObject *v12; // r14
const cocos2d::CCPoint *LastPosition; // r15
GameObject *v14; // rax
GameObject *v15; // r15
float v16; // xmm3_4
float v17; // xmm0_4
_BYTE v19[8]; // [rsp+0h] [rbp-50h] BYREF
_BYTE v20[8]; // [rsp+8h] [rbp-48h] BYREF
_BYTE v21[8]; // [rsp+10h] [rbp-40h] BYREF
float v22; // [rsp+18h] [rbp-38h]
float v23; // [rsp+1Ch] [rbp-34h] BYREF
float v24; // [rsp+20h] [rbp-30h]
float v25; // [rsp+24h] [rbp-2Ch]
cocos2d::CCPoint result; // 0:xmm0_8.8
v22 = a6;
v7 = v6;
v9 = *(_QWORD *)&a3;
v25 = 90.0 - a5;
v10 = sub_10028CC60(&v23);
if ( a4 > 0 )
{
Object = GJBaseGameLayer::tryGetObject((GJBaseGameLayer *)a2, a4);
if ( Object )
{
v12 = Object;
LastPosition = GameObject::getLastPosition(Object);
((void (__fastcall *)(_BYTE *, GameObject *, double))v12->getRealPosition)(v20, v12, v10);
sub_10028CD00(v21, LastPosition, v20);
LABEL_7:
sub_10028CC90();
goto LABEL_8;
}
}
if ( v7 > 0 )
{
v14 = GJBaseGameLayer::tryGetObject((GJBaseGameLayer *)a2, v7);
if ( v14 )
{
v15 = v14;
(*(void (__fastcall **)(_BYTE *, __int64, double))(*(_QWORD *)v9 + 1344LL))(v20, v9, v10);
((void (__fastcall *)(_BYTE *, GameObject *))v15->getRealPosition)(v19, v15);
sub_10028CD00(v21, v20, v19);
goto LABEL_7;
}
}
LABEL_8:
v16 = v25 * 0.017453292;
if ( v23 != 0.0 || v24 != 0.0 )
{
v25 = v25 * 0.017453292;
v17 = atan2f(v24, v23) + 1.570796326794897;
v16 = v25 + v17;
}
cocos2d::ccpForAngle(v16);
result = (cocos2d::CCPoint)LODWORD(v22);
sub_10028CD40(a1, v21, v22);
return result;
}