//
// cocos2d::CCFollow::initWithTarget from 0x7b672c to 0x7b6878 (332 bytes)
//
// 1 xrefs:
// > cocos2d::CCFollow::create @ 0x7b68c8
//
// 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 12:00:11 +0000
//
int __fastcall cocos2d::CCFollow::initWithTarget(
cocos2d::CCFollow *this,
cocos2d::CCNode *a2,
const cocos2d::CCRect *a3)
{
unsigned int v6; // r0
float v7; // s15
float v8; // s11
float v9; // s10
bool v10; // nf
float v11; // s14
float v12; // s13
float v13; // s12
bool v14; // fnf
float v15; // s14
float v17[2]; // [sp+4h] [bp-14h] BYREF
_BYTE v18[8]; // [sp+Ch] [bp-Ch] BYREF
cocos2d::CCObject::retain(a2);
*((_DWORD *)this + 17) = a2;
v6 = cocos2d::CCRect::equals(a3, (const cocos2d::CCRect *)&unk_D2ED00);
*((_BYTE *)this + 73) = 0;
v6 ^= 1u;
*((_BYTE *)this + 72) = v6;
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v6);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, v17[0], v17[1]);
cocos2d::CCPoint::operator=((char *)this + 84, v18);
cocos2d::CCPoint::operator*(v18, (char *)this + 84, 1056964608);
cocos2d::CCPoint::operator=((char *)this + 76, v18);
if ( *((_BYTE *)this + 72) )
{
v7 = -(float)((float)(*(float *)a3 + *((float *)a3 + 2)) - *((float *)this + 21));
*((float *)this + 23) = v7;
v8 = *(float *)a3;
v9 = -*(float *)a3;
*((float *)this + 24) = v9;
v10 = v9 < v7;
if ( v9 < v7 )
v7 = v7 - v8;
v11 = -*((float *)a3 + 1);
*((float *)this + 25) = v11;
if ( v10 )
v8 = 0.5;
v12 = (float)(*((float *)a3 + 1) + *((float *)a3 + 3)) - *((float *)this + 22);
if ( v10 )
v7 = v7 * v8;
v13 = -v12;
if ( v10 )
*((float *)this + 23) = v7;
v14 = v11 < v13;
if ( v10 )
*((float *)this + 24) = v7;
if ( v11 < v13 )
v11 = v11 - v12;
*((float *)this + 26) = v13;
if ( v14 )
{
v15 = v11 * 0.5;
*((float *)this + 26) = v15;
*((float *)this + 25) = v15;
}
if ( *((float *)this + 25) == *((float *)this + 26) && *((float *)this + 23) == *((float *)this + 24) )
*((_BYTE *)this + 73) = 1;
}
return 1;
}