//
// cocos2d::CCTMXLayer::calculateLayerOffset from 0xb38ad8 to 0xb38c04 (300 bytes)
//
// 2 xrefs:
// > cocos2d::CCTMXLayer::initWithTilesetInfo @ 0xb38d74
// > ??> @ 0xc0468
//
// 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 cocos2d::CCTMXLayer::calculateLayerOffset(cocos2d::CCTMXLayer *a1, const cocos2d::CCPoint *a2)
{
cocos2d::CCPoint *v2; // x8
cocos2d::CCPoint *v5; // x21
int m_uIndexInArray; // w0
float v9; // s0
float v10; // s1
float v11; // s0
float v12; // s1
cocos2d::CCPoint v13; // [xsp+50h] [xbp+50h] BYREF
cocos2d::CCPoint result; // 0:s0.4,4:s1.4
v5 = v2;
cocos2d::CCPoint::CCPoint(v2, &stru_1247458);
m_uIndexInArray = a1[1].m_uIndexInArray;
if ( m_uIndexInArray == 1 )
{
cocos2d::CCPoint::equals((cocos2d::CCPoint *)a2, &stru_1247458);
}
else if ( m_uIndexInArray )
{
if ( m_uIndexInArray == 2 )
{
cocos2d::CCPoint::CCPoint(
&v13,
(float)(*((float *)&a1[1].cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable
+ 1)
* 0.5)
* (float)(a2->x - a2->y),
(float)(*(float *)&a1[1].m_uID * 0.5) * (float)((float)-a2->x - a2->y));
cocos2d::CCPoint::operator=(v5, v9, v10, (float *)&v13);
}
}
else
{
cocos2d::CCPoint::CCPoint(
&v13,
a2->x
* *((float *)&a1[1].cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable + 1),
(float)-a2->y * *(float *)&a1[1].m_uID);
cocos2d::CCPoint::operator=(v5, v11, v12, (float *)&v13);
}
return result;
}