//
// GJBaseGameLayer::getFollowSpeedVal from 0x594cb8 to 0x594dce (278 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::modifyObjectPhysics @ 0x594eaa
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x5bbb90
//
// 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:08 +0000
//
GJBaseGameLayer *__fastcall GJBaseGameLayer::getFollowSpeedVal(
GJBaseGameLayer *this,
cocos2d::CCDictionary **a2,
int a3,
int a4,
int a5,
float a6,
int a7)
{
float v11; // s16
GameObject *Object; // r0
GameObject *v13; // r11
char *LastPosition; // r5
int v15; // r10
float v16; // s14
float v18; // [sp+4h] [bp-18h] BYREF
float y; // [sp+8h] [bp-14h]
_BYTE v20[8]; // [sp+Ch] [bp-10h] BYREF
_BYTE v21[8]; // [sp+14h] [bp-8h] BYREF
_BYTE v22[8]; // [sp+1Ch] [bp+0h] BYREF
v11 = (float)(90.0 - a6) * 0.017453;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v18, (const cocos2d::CCPoint *)&unk_D2C400);
if ( a4 > 0 )
{
Object = (GameObject *)GJBaseGameLayer::tryGetObject(a2, a4);
v13 = Object;
if ( Object )
{
LastPosition = GameObject::getLastPosition(Object);
(*(void (__fastcall **)(_BYTE *, GameObject *))(*(_DWORD *)v13 + 680))(v21, v13);
LABEL_7:
cocos2d::CCPoint::operator-(v22, LastPosition, v21);
cocos2d::CCPoint::operator=(&v18, v22);
goto LABEL_8;
}
}
if ( a5 > 0 )
{
v15 = GJBaseGameLayer::tryGetObject(a2, a5);
if ( v15 )
{
LastPosition = v20;
(*(void (__fastcall **)(_BYTE *, int))(*(_DWORD *)a3 + 680))(v20, a3);
(*(void (__fastcall **)(_BYTE *, int))(*(_DWORD *)v15 + 680))(v21, v15);
goto LABEL_7;
}
}
LABEL_8:
if ( v18 != 0.0 || y != 0.0 )
{
v16 = atan2f(y, v18) + 1.57079633;
v11 = v11 + v16;
}
cocos2d::ccpForAngle((cocos2d *)v22, v11);
cocos2d::CCPoint::operator*(this, v22, a7);
return this;
}