//
// cocos2d::CCTMXLayer::calculateLayerOffset from 0x1800abfd0 to 0x1800ac0bf (239 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXLayer::initWithTilesetInfo @ 0x1800ac2d8
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b80d0
//
// 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
//
struct cocos2d::CCPoint __fastcall cocos2d::CCTMXLayer::calculateLayerOffset(
const struct cocos2d::CCPoint *a1,
_DWORD *a2,
cocos2d::CCSize *a3)
{
float x; // r9d
int v7; // r9d
float v8; // xmm2_4
float v9; // xmm1_4
float *v11; // rax
float v12; // [rsp+30h] [rbp+8h] BYREF
cocos2d::cc_timeval::operator=(a2, &unk_1801A9AC8);
x = a1[49].x;
if ( x == 0.0 )
{
v8 = (float)-a3->height * a1[46].y;
v9 = a1[46].x * a3->width;
goto LABEL_7;
}
v7 = LODWORD(x) - 1;
if ( !v7 )
{
cocos2d::CCSize::equals(a3, &unk_1801A9AC8);
return (struct cocos2d::CCPoint)a2;
}
if ( v7 == 1 )
{
v8 = (float)((float)-a3->width - a3->height) * (float)(a1[46].y * 0.5);
v9 = (float)(a3->width - a3->height) * (float)(a1[46].x * 0.5);
LABEL_7:
v11 = kmVec2Fill(&v12, v9, v8);
cocos2d::CCSize::operator=(a2, v11);
}
return (struct cocos2d::CCPoint)a2;
}