//
// GameObject::getObjectTextureRect from 0x3533cc to 0x353572 (422 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
//
const cocos2d::CCRect *GameObject::getObjectTextureRect(GameObject *a1)
{
cocos2d::CCRect *p_m_textureRect; // r6
float v3; // s14
float v4; // s12
float v5; // s14
const cocos2d::CCRect *v6; // r0
cocos2d::CCSize *p_m_lastSize; // r1
float m_scaleX; // s15
_BOOL4 m_isRotationAligned; // r3
float m_scaleY; // s15
float width; // s13
float m_fRotationX; // s14
float v13; // s10
double m_positionX; // d6
float height; // s9
float v16; // s14
cocos2d::CCSize v18; // [sp+4h] [bp-Ch] BYREF
p_m_textureRect = &a1->m_textureRect;
if ( a1->m_isDirty )
{
a1->m_isDirty = 0;
a1->m_isObjectPosDirty = 0;
if ( a1->m_updateCustomContentSize )
{
a1->m_isObjectRectDirty = 1;
v6 = a1->getObjectRect(a1);
cocos2d::CCRect::operator=(p_m_textureRect, v6);
}
else
{
if ( a1->m_hasContentSize )
p_m_lastSize = &a1->m_lastSize;
else
p_m_lastSize = (cocos2d::CCSize *)a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v18, p_m_lastSize);
m_scaleX = a1->m_scaleX;
m_isRotationAligned = a1->m_isRotationAligned;
if ( m_scaleX != 1.0 )
v18.width = v18.width * fabsf(m_scaleX);
m_scaleY = a1->m_scaleY;
width = v18.width;
if ( m_scaleY != 1.0 )
v18.height = v18.height * fabsf(m_scaleY);
if ( m_isRotationAligned )
{
v18.width = v18.height;
v18.height = width;
}
else
{
m_fRotationX = a1->m_fRotationX;
if ( m_fRotationX != 0.0 && fabsf(m_fRotationX) != 180.0 )
{
v18.width = sqrtf((float)(v18.height * v18.height) + (float)(v18.width * v18.width));
v18.height = v18.width;
}
}
v13 = v18.width;
m_positionX = a1->m_positionX;
a1->m_textureRect.size.width = v18.width;
height = v18.height;
a1->m_textureRect.size.height = v18.height;
*(float *)&m_positionX = m_positionX - (float)(v13 * 0.5);
a1->m_textureRect.origin.x = *(float *)&m_positionX;
v16 = a1->m_positionY - (float)(height * 0.5);
a1->m_textureRect.origin.y = v16;
if ( v13 > 30.0 )
a1->m_fadeMargin = (float)(v13 * 0.5) - 15.0;
}
}
else if ( a1->m_isObjectPosDirty )
{
a1->m_isObjectPosDirty = a1->m_isDirty;
v3 = a1->m_positionX - (float)(a1->m_textureRect.size.width * 0.5);
v4 = a1->m_textureRect.size.height * 0.5;
a1->m_textureRect.origin.x = v3;
v5 = a1->m_positionY - v4;
a1->m_textureRect.origin.y = v5;
}
return p_m_textureRect;
}