//
// cocos2d::CCFollow::initWithTarget from 0xab4244 to 0xab43d0 (396 bytes)
//
// 2 xrefs:
// > cocos2d::CCFollow::create @ 0xab4440
// > ??> @ 0x5eb30
//
// 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
//
bool cocos2d::CCFollow::initWithTarget(cocos2d::CCFollow *a1, cocos2d::CCNode *a2, const cocos2d::CCRect *a3)
{
char v5; // w0
cocos2d::CCDirector *v6; // x0
float v7; // s0
float v8; // s1
float v9; // s0
float v10; // s1
float x; // s4
float y; // s1
int v13; // s5
float v14; // s3
float v15; // s0
int v16; // s1
int v17; // s2
__int32 v18; // s0
float v21; // [xsp+58h] [xbp+58h]
float v22; // [xsp+5Ch] [xbp+5Ch]
cocos2d::CCPoint v23; // [xsp+60h] [xbp+60h] BYREF
cocos2d::CCObject::retain(a2);
a1[1].__vftable = (cocos2d::CCFollow_vtbl *)a2;
v5 = cocos2d::CCRect::equals((cocos2d::CCRect *)a3, &stru_1244CD8);
BYTE1(a1[1].m_uID) = 0;
LOBYTE(a1[1].m_uID) = v5 ^ 1;
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
cocos2d::CCPoint::CCPoint(&v23, v21, v22);
cocos2d::CCPoint::operator=(&a1[1].m_uReference, v7, v8);
LODWORD(v9) = cocos2d::CCPoint::operator*(&a1[1].m_uReference, 0.5).n128_u32[0];
cocos2d::CCPoint::operator=(&a1[1].m_nLuaID, v9, v10);
if ( LOBYTE(a1[1].m_uID) )
{
x = a3->origin.x;
y = a3->origin.y;
*(float *)&v13 = -a3->origin.x;
v14 = (float)(y + a3->size.height) - *(float *)&a1[1].m_uAutoReleaseCount;
v15 = -(float)((float)(a3->origin.x + a3->size.width) - *(float *)&a1[1].m_uReference);
*(float *)&v16 = -y;
a1[1].m_uIndexInArray = v13;
*(float *)&v17 = -v14;
*(float *)&a1[1].m_eObjType = v15;
a1[1].m_uUnknown = v16;
*(float *)&a1[1].m_unknown2 = -v14;
if ( v15 > *(float *)&v13 )
{
*(float *)&v18 = (float)(v15 - x) * 0.5;
a1[1].m_eObjType = (cocos2d::CCObjectType)v18;
a1[1].m_uIndexInArray = v18;
}
if ( *(float *)&v16 < *(float *)&v17 )
{
*(float *)&v17 = (float)(*(float *)&v16 - v14) * 0.5;
v16 = v17;
a1[1].m_unknown2 = v17;
a1[1].m_uUnknown = v17;
}
if ( *(float *)&v17 == *(float *)&v16 && *(float *)&a1[1].m_eObjType == *(float *)&a1[1].m_uIndexInArray )
BYTE1(a1[1].m_uID) = 1;
}
return 1;
}