//
// GJBaseGameLayer::getFollowSpeedVal from 0x475208 to 0x475324 (284 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::modifyObjectPhysics @ 0x475402
// > GJBaseGameLayer::processAdvancedFollowAction @ 0x48a3d2
//
// 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
//
cocos2d::CCPoint *GJBaseGameLayer::getFollowSpeedVal(
cocos2d::CCPoint *__return_ptr retstr,
GJBaseGameLayer *a2,
GameObject *a3,
int a4,
int a5,
float a6,
float a7)
{
float v11; // s16
GameObject *Object; // r0
GameObject *v13; // r11
const cocos2d::CCPoint *LastPosition; // r5
GameObject *v15; // r10
int v16; // r2
bool v17; // r3
float v18; // s14
cocos2d::CCPoint v20; // [sp+4h] [bp-18h] BYREF
_BYTE v21[8]; // [sp+Ch] [bp-10h] BYREF
cocos2d::CCPoint v22; // [sp+14h] [bp-8h] BYREF
cocos2d::CCPoint v23; // [sp+1Ch] [bp+0h] BYREF
v11 = (float)(90.0 - a6) * 0.017453;
cocos2d::CCPoint::CCPoint(&v20, &stru_AC68C0);
if ( a4 > 0 )
{
Object = GJBaseGameLayer::tryGetObject(a2, a4);
v13 = Object;
if ( Object )
{
LastPosition = GameObject::getLastPosition(Object);
v13->getRealPosition(&v22, v13);
LABEL_7:
cocos2d::CCPoint::operator-(&v23, LastPosition, &v22);
cocos2d::CCPoint::operator=((PlayerObject *)&v20, COERCE_FLOAT(&v23), v16, v17);
goto LABEL_8;
}
}
if ( a5 > 0 )
{
v15 = GJBaseGameLayer::tryGetObject(a2, a5);
if ( v15 )
{
LastPosition = (const cocos2d::CCPoint *)v21;
a3->getRealPosition((cocos2d::CCPoint *)v21, a3);
v15->getRealPosition(&v22, v15);
goto LABEL_7;
}
}
LABEL_8:
if ( v20.x != 0.0 || v20.y != 0.0 )
{
v18 = atan2(v20.y, v20.x) + 1.57079633;
v11 = v11 + v18;
}
cocos2d::ccpForAngle(&v23, v11);
cocos2d::CCPoint::operator*(retstr, &v23, LODWORD(a7));
return retstr;
}