//
// cocos2d::CCTMXLayer::tileAt from 0x5f7d74 to 0x5f7f06 (402 bytes)
//
// 0 xrefs:
//
// 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::CCSprite *cocos2d::CCTMXLayer::tileAt(cocos2d::CCTMXLayer *a1, const cocos2d::CCPoint *a2)
{
unsigned int v4; // r6
cocos2d::CCSprite *v5; // r4
float x; // s18
cocos2d::CCDirector *v7; // r0
float v8; // r0
float y; // s17
float v10; // s18
cocos2d::CCDirector *v11; // r0
float v12; // r0
float width; // s16
float v14; // s17
cocos2d::CCDirector *v15; // r0
float v16; // r0
float height; // s19
float v18; // s16
cocos2d::CCDirector *v19; // r0
float v20; // r0
bool (__fastcall *initWithTexture_0)(cocos2d::CCSprite *__hidden, cocos2d::CCTexture2D *, const cocos2d::CCRect *); // r10
cocos2d::CCTexture2D *v22; // r0
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *setVertexZ)(cocos2d::CCSprite *__hidden, float); // r6
int v25; // r0
unsigned int v26; // r0
int v28; // [sp+Ch] [bp-2Ch]
cocos2d::CCRect v29; // [sp+14h] [bp-24h] BYREF
cocos2d::CCRect v30; // [sp+24h] [bp-14h] BYREF
v4 = cocos2d::CCTMXLayer::tileGIDAt(a1, a2);
if ( !v4 )
return nullptr;
v28 = (int)(float)(a2->x
+ (float)(a2->y
* *(float *)&a1[1].cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable));
v5 = (cocos2d::CCSprite *)a1->getChildByTag(a1, v28);
if ( !v5 )
{
cocos2d::CCTMXTilesetInfo::rectForGID(&v29, (cocos2d::CCTMXTilesetInfo *)a1[1].m_uAutoReleaseCount, v4);
x = v29.origin.x;
v7 = cocos2d::CCDirector::sharedDirector();
v8 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v7));
y = v29.origin.y;
v10 = x / v8;
v11 = cocos2d::CCDirector::sharedDirector();
v12 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v11));
width = v29.size.width;
v14 = y / v12;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v15));
height = v29.size.height;
v18 = width / v16;
v19 = cocos2d::CCDirector::sharedDirector();
v20 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v19));
cocos2d::CCRect::CCRect(&v30, v10, v14, v18, height / v20);
cocos2d::CCRect::operator=(&v29, &v30.origin.x);
v5 = (cocos2d::CCSprite *)operator new(0x1FCu);
cocos2d::CCSprite::CCSprite(v5);
initWithTexture_0 = v5->initWithTexture_0;
v22 = a1->getTexture(a1);
initWithTexture_0(v5, v22, &v29);
v5->setBatchNode(v5, a1);
setPosition = v5->setPosition;
cocos2d::CCTMXLayer::positionAt(&v30.origin, a1, a2);
setPosition(v5, &v30.origin);
setVertexZ = v5->setVertexZ;
v25 = cocos2d::CCTMXLayer::vertexZForPos(a1, a2);
((void (__fastcall *)(_DWORD, _DWORD))setVertexZ)(v5, (float)v25);
v5->setAnchorPoint(v5, &stru_ACAB2C);
v5->setOpacity(v5, a1[1].m_unknown2);
v26 = cocos2d::CCTMXLayer::atlasIndexForExistantZ(a1, v28);
cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(a1, v5, v26, v28);
cocos2d::CCObject::release(v5);
}
return v5;
}