//
// cocos2d::CCTMXLayer::positionAt from 0x1800ac720 to 0x1800ac8d6 (438 bytes)
//
// 6 xrefs:
// > cocos2d::CCTMXLayer::setupTileSprite @ 0x1800ad023
// > cocos2d::CCTMXLayer::setupTileSprite @ 0x1800ad11c
// > cocos2d::CCTMXLayer::setupTileSprite @ 0x1800ad147
// > cocos2d::CCTMXLayer::tileAt @ 0x1800ad539
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b813c
//
// 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::positionAt(
cocos2d::CCTMXLayer *this,
struct cocos2d::CCPoint *a2,
float *a3)
{
int v6; // ecx
int v7; // ecx
float v8; // xmm2_4
float v9; // xmm1_4
float v10; // xmm0_4
cocos2d::CCDirector *v11; // rax
float v12; // xmm6_4
cocos2d::CCDirector *v13; // rax
float ContentScaleFactor; // xmm0_4
float *v15; // rax
int v17; // [rsp+40h] [rbp+8h] BYREF
cocos2d::cc_timeval::operator=(a2, &unk_1801A9AC8);
v6 = *((_DWORD *)this + 98);
if ( !v6 )
{
v9 = *((float *)this + 92) * *a3;
v8 = (float)((float)(*((float *)this + 91) - a3[1]) - 1.0) * *((float *)this + 93);
goto LABEL_9;
}
v7 = v6 - 1;
if ( !v7 )
{
v10 = 0.0;
if ( (int)*a3 % 2 == 1 )
v10 = (float)-*((float *)this + 93) * 0.5;
v9 = (float)((float)(*a3 * *((float *)this + 92)) * 3.0) * 0.25;
v8 = (float)((float)((float)(*((float *)this + 91) - a3[1]) - 1.0) * *((float *)this + 93)) + v10;
goto LABEL_9;
}
if ( v7 == 1 )
{
v8 = (float)((float)((float)((float)(*((float *)this + 91) + *((float *)this + 91)) - *a3) - a3[1]) - 2.0)
* (float)(*((float *)this + 93) * 0.5);
v9 = (float)((float)((float)(*a3 + *((float *)this + 90)) - a3[1]) - 1.0) * (float)(*((float *)this + 92) * 0.5);
LABEL_9:
kmVec2Fill((float *)&v17, v9, v8);
cocos2d::CCSize::operator=(a2, &v17);
}
v11 = cocos2d::CCDirector::sharedDirector();
v12 = a2->y / cocos2d::CCDirector::getContentScaleFactor(v11);
v13 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v13);
v15 = kmVec2Fill((float *)&v17, a2->x / ContentScaleFactor, v12);
cocos2d::CCSize::operator=(a2, v15);
return a2;
}