//
// GameObject::getObjectTextureRect from 0x10025ae80 to 0x10025b01c (412 bytes)
//
// 47 xrefs:
// > ??> @ 0x1007c40f0
// > ??> @ 0x1007cfdc0
// > ??> @ 0x1007d05a8
// > ??> @ 0x1007d0db8
// > ??> @ 0x1007f5628
// > ??> @ 0x1007f5e60
// > ??> @ 0x1007f6658
// > ??> @ 0x1007f6e50
// > ??> @ 0x1007f7648
// > ??> @ 0x1007f7e40
// > ??> @ 0x1007f8638
// > ??> @ 0x1007f8e30
// > ??> @ 0x1007f9618
// > ??> @ 0x1007f9e28
// > ??> @ 0x1007fa690
// > ??> @ 0x1007faea0
// > ??> @ 0x1007fb6b0
// > ??> @ 0x1007fbec0
// > ??> @ 0x1007fc6d0
// > ??> @ 0x1007fcee0
// > ??> @ 0x1007fd6f0
// > ??> @ 0x1007fdf00
// > ??> @ 0x1007fe710
// > ??> @ 0x1007fef20
// > ??> @ 0x1007ff748
// > ??> @ 0x1007fffa0
// > ??> @ 0x1008007c8
// > ??> @ 0x100800ff0
// > ??> @ 0x100801818
// > ??> @ 0x100802040
// > ??> @ 0x100802850
// > ??> @ 0x100803060
// > ??> @ 0x100803870
// > ??> @ 0x100804080
// > ??> @ 0x100804890
// > ??> @ 0x1008050a0
// > ??> @ 0x1008058b0
// > ??> @ 0x1008060c0
// > ??> @ 0x1008068d0
// > ??> @ 0x1008070e0
// > ??> @ 0x1008078f0
// > ??> @ 0x100808100
// > ??> @ 0x100808910
// > ??> @ 0x100809120
// > ??> @ 0x100809930
// > ??> @ 0x10080a140
// > ??> @ 0x100816460
//
// 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 *__fastcall GameObject::getObjectTextureRect(GameObject *a1)
{
__int64 v2; // x0
cocos2d::CCRect *p_m_textureRect; // x20
double *p_m_lastSize; // x1
float m_scaleX; // s1
float m_scaleY; // s1
int32x2_t v8; // d0
float m_fRotationX; // s1
int32x2_t v10; // [xsp+8h] [xbp-18h] BYREF
if ( a1->m_isDirty )
{
*(_WORD *)&a1->m_isDirty = 0;
if ( a1->m_updateCustomContentSize )
{
a1->m_isObjectRectDirty = 1;
v2 = ((__int64 (__fastcall *)(GameObject *))a1->getObjectRect)(a1);
p_m_textureRect = &a1->m_textureRect;
sub_100022BB0(&a1->m_textureRect.origin, v2);
}
else
{
if ( a1->m_hasContentSize )
p_m_lastSize = (double *)&a1->m_lastSize;
else
p_m_lastSize = (double *)((__int64 (__fastcall *)(GameObject *))a1->getContentSize)(a1);
sub_100022AFC(&v10, p_m_lastSize);
m_scaleX = a1->m_scaleX;
if ( m_scaleX != 1.0 )
*(float *)v10.i32 = fabsf(m_scaleX) * *(float *)v10.i32;
m_scaleY = a1->m_scaleY;
if ( m_scaleY != 1.0 )
*(float *)&v10.i32[1] = fabsf(m_scaleY) * *(float *)&v10.i32[1];
if ( a1->m_isRotationAligned )
{
v8 = vrev64_s32(v10);
}
else
{
m_fRotationX = a1->m_fRotationX;
v8 = v10;
if ( m_fRotationX != 0.0 && fabsf(m_fRotationX) != 180.0 )
{
*(float *)v8.i32 = sqrtf(
COERCE_FLOAT(vmul_f32((float32x2_t)v10, (float32x2_t)v10).i32[1])
+ (float)(*(float *)v10.i32 * *(float *)v10.i32));
v8 = vdup_lane_s32(v8, 0);
}
}
p_m_textureRect = &a1->m_textureRect;
a1->m_textureRect.origin = (cocos2d::CCPoint)vcvt_f32_f64(
vaddq_f64(
*(float64x2_t *)&a1->m_positionX,
vcvtq_f64_f32(vmul_f32((float32x2_t)v8, (float32x2_t)0xBF000000BF000000LL))));
a1->m_textureRect.size = (cocos2d::CCSize)v8;
if ( *(float *)v8.i32 > 30.0 )
a1->m_fadeMargin = (float)(*(float *)v8.i32 * 0.5) + -15.0;
}
}
else
{
if ( a1->m_isObjectPosDirty )
{
a1->m_isObjectPosDirty = 0;
a1->m_textureRect.origin = (cocos2d::CCPoint)vcvt_f32_f64(
vaddq_f64(
*(float64x2_t *)&a1->m_positionX,
vcvtq_f64_f32(
vmul_f32(
(float32x2_t)a1->m_textureRect.size,
(float32x2_t)0xBF000000BF000000LL))));
}
return &a1->m_textureRect;
}
return p_m_textureRect;
}