//
// cocos2d::CCSprite::setTextureCoords from 0x5e64bc to 0x5e665c (416 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
//
void cocos2d::CCSprite::setTextureCoords(cocos2d::CCSprite *a1, const cocos2d::CCRect *a2)
{
float x; // s18
cocos2d::CCDirector *v5; // r0
float v6; // r0
float y; // s17
float v8; // s18
cocos2d::CCDirector *v9; // r0
float v10; // r0
float width; // s16
float v12; // s17
cocos2d::CCDirector *v13; // r0
float v14; // r0
float height; // s19
float v16; // s16
cocos2d::CCDirector *v17; // r0
float v18; // r0
cocos2d::CCTexture2D *m_pobTexture; // r5
float v20; // s16
unsigned int v21; // r0
float v22; // s12
float v23; // s11
float v24; // s13
float v25; // s14
float v26; // s15
cocos2d::CCRect v27; // [sp+Ch] [bp-14h] BYREF
x = a2->origin.x;
v5 = cocos2d::CCDirector::sharedDirector();
v6 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v5));
y = a2->origin.y;
v8 = x * v6;
v9 = cocos2d::CCDirector::sharedDirector();
v10 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v9));
width = a2->size.width;
v12 = y * v10;
v13 = cocos2d::CCDirector::sharedDirector();
v14 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v13));
height = a2->size.height;
v16 = width * v14;
v17 = cocos2d::CCDirector::sharedDirector();
v18 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v17));
cocos2d::CCRect::CCRect(&v27, v8, v12, v16, height * v18);
if ( a1->m_pobBatchNode )
m_pobTexture = a1->m_pobTextureAtlas->getTexture(a1->m_pobTextureAtlas);
else
m_pobTexture = a1->m_pobTexture;
if ( m_pobTexture )
{
v20 = (float)m_pobTexture->getPixelsWide(m_pobTexture);
v21 = m_pobTexture->getPixelsHigh(m_pobTexture);
v22 = v27.origin.x / v20;
v23 = (float)v21;
if ( a1->m_bRectRotated )
{
v24 = v27.origin.y / v23;
v25 = (float)(v27.origin.x + v27.size.height) / v20;
v26 = (float)(v27.origin.y + v27.size.width) / v23;
if ( a1->m_bFlipX )
{
v24 = (float)(v27.origin.y + v27.size.width) / v23;
v26 = v27.origin.y / v23;
}
if ( a1->m_bFlipY )
{
v22 = (float)(v27.origin.x + v27.size.height) / v20;
v25 = v27.origin.x / v20;
}
a1->m_sQuad.bl.texCoords.u = v22;
a1->m_sQuad.bl.texCoords.v = v24;
a1->m_sQuad.br.texCoords.u = v22;
a1->m_sQuad.br.texCoords.v = v26;
a1->m_sQuad.tl.texCoords.u = v25;
a1->m_sQuad.tl.texCoords.v = v24;
a1->m_sQuad.tr.texCoords.u = v25;
a1->m_sQuad.tr.texCoords.v = v26;
}
else
{
v24 = v27.origin.y / v23;
v25 = (float)(v27.origin.x + v27.size.width) / v20;
v26 = (float)(v27.origin.y + v27.size.height) / v23;
if ( a1->m_bFlipX )
{
v22 = (float)(v27.origin.x + v27.size.width) / v20;
v25 = v27.origin.x / v20;
}
if ( a1->m_bFlipY )
{
v24 = (float)(v27.origin.y + v27.size.height) / v23;
v26 = v27.origin.y / v23;
}
a1->m_sQuad.bl.texCoords.u = v22;
a1->m_sQuad.bl.texCoords.v = v26;
a1->m_sQuad.br.texCoords.u = v25;
a1->m_sQuad.br.texCoords.v = v26;
a1->m_sQuad.tl.texCoords.u = v22;
a1->m_sQuad.tl.texCoords.v = v24;
a1->m_sQuad.tr.texCoords.u = v25;
a1->m_sQuad.tr.texCoords.v = v24;
}
a1->m_fTextureLeft = v22;
a1->m_fTextureRight = v25;
a1->m_fTextureBottom = v26;
a1->m_fTextureTop = v24;
}
}