//
// GameObject::getObjectTextureRect from 0x641718 to 0x641940 (552 bytes)
//
// 48 xrefs:
// > ??> @ 0x2b350
// > ??> @ 0x1152c18
// > ??> @ 0x11539e8
// > ??> @ 0x11541b8
// > ??> @ 0x11549b8
// > ??> @ 0x1162368
// > ??> @ 0x1162b68
// > ??> @ 0x1163368
// > ??> @ 0x1163b68
// > ??> @ 0x1164368
// > ??> @ 0x1164b68
// > ??> @ 0x1165368
// > ??> @ 0x1165b68
// > ??> @ 0x1166338
// > ??> @ 0x1166b38
// > ??> @ 0x1167338
// > ??> @ 0x1167b38
// > ??> @ 0x1168338
// > ??> @ 0x1168b78
// > ??> @ 0x1169378
// > ??> @ 0x1169b78
// > ??> @ 0x116a378
// > ??> @ 0x116ab78
// > ??> @ 0x116b388
// > ??> @ 0x116bb88
// > ??> @ 0x116c388
// > ??> @ 0x116cb88
// > ??> @ 0x116d388
// > ??> @ 0x116db88
// > ??> @ 0x116e388
// > ??> @ 0x116eb88
// > ??> @ 0x116f388
// > ??> @ 0x116fb88
// > ??> @ 0x1170388
// > ??> @ 0x1170b88
// > ??> @ 0x1171388
// > ??> @ 0x1171b88
// > ??> @ 0x1172388
// > ??> @ 0x1172b88
// > ??> @ 0x1173388
// > ??> @ 0x1173b88
// > ??> @ 0x1174388
// > ??> @ 0x1174b88
// > ??> @ 0x1175388
// > ??> @ 0x1175b88
// > ??> @ 0x1176388
// > ??> @ 0x1176b88
// > ??> @ 0x11773a8
//
// 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)
{
float v2; // s1
float v3; // s0
cocos2d::CCRect *p_m_textureRect; // x21
_BOOL4 m_updateCustomContentSize; // w1
cocos2d::CCSize *p_m_lastSize; // x1
float m_scaleX; // s0
float m_scaleY; // s1
float width; // s0
float height; // s1
float v12; // s2
double m_positionX; // d4
double m_positionY; // d3
float v15; // s2
_BOOL4 m_isRotationAligned; // w0
float m_fRotationX; // s2
GameObject_vtbl *v18; // x1
__int64 v19; // x0
cocos2d::CCSize v20; // [xsp+30h] [xbp+30h] BYREF
if ( a1->m_isDirty )
{
m_updateCustomContentSize = a1->m_updateCustomContentSize;
a1->m_isDirty = 0;
a1->m_isObjectPosDirty = 0;
if ( m_updateCustomContentSize )
{
v18 = a1->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_isObjectRectDirty = 1;
p_m_textureRect = &a1->m_textureRect;
v19 = ((__int64 (*)(void))v18->getObjectRect)();
cocos2d::CCRect::operator=(p_m_textureRect, v19);
return p_m_textureRect;
}
if ( a1->m_hasContentSize )
p_m_lastSize = &a1->m_lastSize;
else
p_m_lastSize = (cocos2d::CCSize *)a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v20, p_m_lastSize);
m_scaleX = a1->m_scaleX;
if ( m_scaleX == 1.0 )
{
m_scaleY = a1->m_scaleY;
width = v20.width;
if ( m_scaleY == 1.0 )
goto LABEL_11;
}
else
{
width = fabsf(m_scaleX) * v20.width;
m_scaleY = a1->m_scaleY;
v20.width = width;
if ( m_scaleY == 1.0 )
{
LABEL_11:
height = v20.height;
if ( a1->m_isRotationAligned )
{
LABEL_12:
v12 = width;
v20.width = height;
v20.height = width;
width = height;
height = v12;
LABEL_13:
m_positionX = a1->m_positionX;
m_positionY = a1->m_positionY;
a1->m_textureRect.size.width = width;
a1->m_textureRect.size.height = height;
*(float *)&m_positionX = m_positionX - (float)(width * 0.5);
v15 = m_positionY - (float)(height * 0.5);
a1->m_textureRect.origin.x = *(float *)&m_positionX;
a1->m_textureRect.origin.y = v15;
if ( width > 30.0 )
a1->m_fadeMargin = (float)(width * 0.5) - 15.0;
return &a1->m_textureRect;
}
LABEL_17:
m_fRotationX = a1->m_fRotationX;
if ( m_fRotationX != 0.0 && fabsf(m_fRotationX) != 180.0 )
{
height = sqrtf((float)(height * height) + (float)(width * width));
v20.width = height;
v20.height = height;
width = height;
}
goto LABEL_13;
}
}
m_isRotationAligned = a1->m_isRotationAligned;
height = fabsf(m_scaleY) * v20.height;
v20.height = height;
if ( m_isRotationAligned )
goto LABEL_12;
goto LABEL_17;
}
if ( a1->m_isObjectPosDirty )
{
a1->m_isObjectPosDirty = 0;
v2 = a1->m_positionX - (float)(a1->m_textureRect.size.width * 0.5);
v3 = a1->m_positionY - (float)(a1->m_textureRect.size.height * 0.5);
a1->m_textureRect.origin.x = v2;
a1->m_textureRect.origin.y = v3;
}
return &a1->m_textureRect;
}