//
// GJBaseGameLayer::getFollowSpeedVal from 0x9a6c58 to 0x9a6e14 (444 bytes)
//
// 3 xrefs:
// > GJBaseGameLayer::modifyObjectPhysics @ 0x9a6f0c
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x9eaec4
// > ??> @ 0x97558
//
// This function is hookable on this platform (idp: arm, 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 12:58:10 +0000
//
__int64 __usercall GJBaseGameLayer::getFollowSpeedVal@(
cocos2d::CCDictionary **this@,
GameObject *a2@,
float a3@,
float a4@,
int a5@,
int a6@,
__int64 a7@)
{
float v11; // s8
GameObject *Object; // x0
GameObject *v14; // x24
__int64 LastPosition; // x23
long double v16; // q0
__int64 *v17; // x0
float v18; // s0
GameObject *v20; // x24
float v22; // [xsp+78h] [xbp+78h] BYREF
float v23; // [xsp+7Ch] [xbp+7Ch]
__int64 v24; // [xsp+80h] [xbp+80h] BYREF
__int64 v25; // [xsp+88h] [xbp+88h] BYREF
__int64 v26; // [xsp+90h] [xbp+90h] BYREF
v11 = (float)(90.0 - a3) * 0.017453;
Object = (GameObject *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v22, (const cocos2d::CCPoint *)&unk_155D2C8);
if ( a5 > 0 )
{
Object = (GameObject *)GJBaseGameLayer::tryGetObject(this, a5);
v14 = Object;
if ( Object )
{
LastPosition = GameObject::getLastPosition(Object);
(*(void (__fastcall **)(__int64 *__return_ptr, GameObject *))(*(_QWORD *)v14 + 1360LL))(&v25, v14);
v17 = (__int64 *)LastPosition;
LABEL_4:
cocos2d::CCPoint::operator-(&v26, v17, &v25, v16);
cocos2d::CCPoint::operator=(&v22, &v26);
goto LABEL_5;
}
}
if ( a6 > 0 )
{
Object = (GameObject *)GJBaseGameLayer::tryGetObject(this, a6);
v20 = Object;
if ( Object )
{
(*(void (__fastcall **)(__int64 *__return_ptr, GameObject *))(*(_QWORD *)a2 + 1360LL))(&v24, a2);
(*(void (__fastcall **)(__int64 *__return_ptr, GameObject *))(*(_QWORD *)v20 + 1360LL))(&v25, v20);
v17 = &v24;
goto LABEL_4;
}
}
LABEL_5:
if ( v22 != 0.0 || v23 != 0.0 )
{
v18 = atan2f(v23, v22) + 1.57079633;
v11 = v11 + v18;
}
cocos2d::ccpForAngle(&v26, Object, v11);
cocos2d::CCPoint::operator*(&v26, a4);
return a7;
}