//
// GameObject::getObjectTextureRect from 0x1401978f0 to 0x140197b1e (558 bytes)
//
// 49 xrefs:
// > ??> @ 0x140556850
// > ??> @ 0x140556fc0
// > ??> @ 0x14055dff8
// > ??> @ 0x14055e678
// > ??> @ 0x1405c8710
// > ??> @ 0x14060d8a0
// > ??> @ 0x14060e1f0
// > ??> @ 0x14060e910
// > ??> @ 0x14060f148
// > ??> @ 0x14060f7f0
// > ??> @ 0x14060fec0
// > ??> @ 0x140610578
// > ??> @ 0x140610cc0
// > ??> @ 0x140611520
// > ??> @ 0x140611c58
// > ??> @ 0x140612440
// > ??> @ 0x140612ae8
// > ??> @ 0x140613190
// > ??> @ 0x140613900
// > ??> @ 0x140613fa8
// > ??> @ 0x140614790
// > ??> @ 0x140614fc8
// > ??> @ 0x140615710
// > ??> @ 0x140615db8
// > ??> @ 0x140616500
// > ??> @ 0x140616cc0
// > ??> @ 0x140617368
// > ??> @ 0x140617a10
// > ??> @ 0x140618180
// > ??> @ 0x140618828
// > ??> @ 0x140618f70
// > ??> @ 0x140619a10
// > ??> @ 0x14061a0b8
// > ??> @ 0x14061a760
// > ??> @ 0x14061ae80
// > ??> @ 0x14061b528
// > ??> @ 0x14061bc70
// > ??> @ 0x14061c408
// > ??> @ 0x14061cab0
// > ??> @ 0x14061d158
// > ??> @ 0x14061d800
// > ??> @ 0x14061dea8
// > ??> @ 0x14061e550
// > ??> @ 0x14061ebf8
// > ??> @ 0x14061f408
// > ??> @ 0x14061fba0
// > ??> @ 0x140678d48
// > ??> @ 0x140678d58
// > ??> @ 0x1406cba78
//
// 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)
{
const cocos2d::CCRect *result; // rax
double v3; // xmm1_8
float v4; // xmm0_4
float v5; // xmm2_4
float v6; // xmm0_4
double v7; // xmm1_8
bool v8; // zf
GameObject_vtbl *v9; // rdx
__int64 v10; // rax
cocos2d::CCSize *p_m_lastSize; // rax
float m_scaleX; // xmm0_4
float width; // xmm4_4
float m_scaleY; // xmm0_4
float height; // xmm3_4
float v16; // xmm0_4
float m_fRotationX; // xmm1_4
float v18; // xmm3_4
double m_positionX; // xmm0_8
double m_positionY; // xmm2_8
cocos2d::CCSize v21; // [rsp+30h] [rbp+8h] BYREF
if ( a1->m_isDirty )
{
v8 = !a1->m_updateCustomContentSize;
*(_WORD *)&a1->m_isDirty = 0;
if ( v8 )
{
if ( a1->m_hasContentSize )
p_m_lastSize = &a1->m_lastSize;
else
p_m_lastSize = (cocos2d::CCSize *)a1->getContentSize(a1);
cocos2d::CCSize::CCSize(&v21, p_m_lastSize);
m_scaleX = a1->m_scaleX;
width = v21.width;
if ( m_scaleX != 1.0 )
width = v21.width * fabs(m_scaleX);
m_scaleY = a1->m_scaleY;
height = v21.height;
if ( m_scaleY != 1.0 )
height = v21.height * fabs(m_scaleY);
if ( a1->m_isRotationAligned )
{
v16 = width;
width = height;
height = v16;
}
else
{
m_fRotationX = a1->m_fRotationX;
if ( m_fRotationX != 0.0 && fabs(m_fRotationX) != 180.0 )
{
v18 = (float)(height * height) + (float)(width * width);
if ( v18 < 0.0 )
width = sqrtf(v18);
else
width = fsqrt(v18);
height = width;
}
}
result = &a1->m_textureRect;
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);
a1->m_textureRect.origin.x = *(float *)&m_positionX;
a1->m_textureRect.origin.y = m_positionY - (float)(height * 0.5);
if ( width > 30.0 )
a1->m_fadeMargin = (float)(width * 0.5) - 15.0;
}
else
{
v9 = a1->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_isObjectRectDirty = 1;
v10 = ((__int64 (*)(void))v9->getObjectRect_0)();
cocos2d::CCRect::operator=(&a1->m_textureRect, v10);
return &a1->m_textureRect;
}
}
else
{
result = &a1->m_textureRect;
if ( a1->m_isObjectPosDirty )
{
v3 = a1->m_positionX;
v4 = a1->m_textureRect.size.width * 0.5;
a1->m_isObjectPosDirty = 0;
v5 = a1->m_textureRect.size.height * 0.5;
v6 = v3 - v4;
v7 = a1->m_positionY;
result->origin.x = v6;
a1->m_textureRect.origin.y = v7 - v5;
}
}
return result;
}