//
// cocos2d::CCSprite::setTextureRect from 0xd86290 to 0xd86554 (708 bytes)
//
// 82 xrefs:
// > ??> @ 0x54748
// > ??> @ 0x1413a58
// > ??> @ 0x1414018
// > ??> @ 0x1414dc8
// > ??> @ 0x1417638
// > ??> @ 0x1417bd8
// > ??> @ 0x141b4f8
// > ??> @ 0x141bb28
// > ??> @ 0x141cfa8
// > ??> @ 0x1421bd8
// > ??> @ 0x1422188
// > ??> @ 0x1423b48
// > ??> @ 0x14240f8
// > ??> @ 0x14246c8
// > ??> @ 0x14290a8
// > ??> @ 0x1433718
// > ??> @ 0x1433f18
// > ??> @ 0x1434508
// > ??> @ 0x1434ce8
// > ??> @ 0x14354f8
// > ??> @ 0x143a488
// > ??> @ 0x1443858
// > ??> @ 0x1444068
// > ??> @ 0x1444878
// > ??> @ 0x1445088
// > ??> @ 0x1445898
// > ??> @ 0x14460a8
// > ??> @ 0x14468b8
// > ??> @ 0x14470c8
// > ??> @ 0x14478a8
// > ??> @ 0x14480b8
// > ??> @ 0x14488c8
// > ??> @ 0x14490d8
// > ??> @ 0x14498e8
// > ??> @ 0x144a138
// > ??> @ 0x144a948
// > ??> @ 0x144b158
// > ??> @ 0x144b968
// > ??> @ 0x144c178
// > ??> @ 0x144c998
// > ??> @ 0x144d1a8
// > ??> @ 0x144d9b8
// > ??> @ 0x144e1c8
// > ??> @ 0x144e9d8
// > ??> @ 0x144f1e8
// > ??> @ 0x144f9f8
// > ??> @ 0x1450208
// > ??> @ 0x1450a18
// > ??> @ 0x1451228
// > ??> @ 0x1451a38
// > ??> @ 0x1452248
// > ??> @ 0x1452a58
// > ??> @ 0x1453268
// > ??> @ 0x1453a78
// > ??> @ 0x1454288
// > ??> @ 0x1454a98
// > ??> @ 0x14552a8
// > ??> @ 0x1455ab8
// > ??> @ 0x14562c8
// > ??> @ 0x1456ad8
// > ??> @ 0x14572e8
// > ??> @ 0x1457af8
// > ??> @ 0x1458308
// > ??> @ 0x1458b18
// > ??> @ 0x1459348
// > ??> @ 0x145b238
// > ??> @ 0x145b7d8
// > ??> @ 0x14778c8
// > ??> @ 0x1479978
// > ??> @ 0x1486dd8
// > ??> @ 0x1487388
// > ??> @ 0x1491cb8
// > ??> @ 0x14970f8
// > ??> @ 0x1499648
// > ??> @ 0x14c1f78
// > ??> @ 0x14d9978
// > ??> @ 0x150cd98
// > ??> @ 0x1517c58
// > ??> @ 0x15181f8
// > ??> @ 0x1518d78
// > ??> @ 0x152e7d8
// > ??> @ 0x152ffd8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:08:13 +0000
//
__int64 __fastcall cocos2d::CCSprite::setTextureRect(
cocos2d::CCSprite *this,
const cocos2d::CCRect *a2,
char a3,
const cocos2d::CCSize *a4)
{
__int64 v5; // x4
float v7; // s1
float v8; // s5
float v9; // s4
__int64 v10; // x0
float v11; // s3
float v12; // s1
float v13; // s0
float v15; // s6
float v16; // s2
float v17; // s0
float v18; // s4
float v19; // s3
float v20; // s16
float v21; // s7
float v22; // s5
float v23; // s16
float v24; // s7
float v25; // s5
float v26; // s1
float v27; // s5
float v28; // s2
float v29; // [xsp+30h] [xbp+30h] BYREF
float v30; // [xsp+34h] [xbp+34h]
v5 = *(_QWORD *)this;
*((_BYTE *)this + 440) = a3;
(*(void (__fastcall **)(cocos2d::CCSprite *, const cocos2d::CCSize *))(v5 + 320))(this, a4);
(*(void (__fastcall **)(cocos2d::CCSprite *, const cocos2d::CCRect *))(*(_QWORD *)this + 1152LL))(this, a2);
(*(void (__fastcall **)(cocos2d::CCSprite *, const cocos2d::CCRect *))(*(_QWORD *)this + 1208LL))(this, a2);
cocos2d::CCPoint::CCPoint(&v29, (cocos2d::CCSprite *)((char *)this + 452));
v7 = v29;
if ( *((_BYTE *)this + 557) )
{
v7 = -v29;
v29 = -v29;
}
v8 = v30;
if ( *((_BYTE *)this + 558) )
{
v8 = -v30;
v30 = -v30;
}
v9 = *((float *)this + 108);
v10 = *((_QWORD *)this + 46);
v11 = *((float *)this + 109);
v12 = v7 + (float)((float)(*((float *)this + 27) - v9) * 0.5);
v13 = v8 + (float)((float)(*((float *)this + 28) - v11) * 0.5);
*((float *)this + 111) = v12;
*((float *)this + 112) = v13;
if ( v10 )
{
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)this + 1200LL))(this, 1);
return _stack_chk_guard;
}
v15 = *((float *)this + 143);
v16 = v12 + 0.0;
v17 = v13 + 0.0;
v18 = v9 + (float)(v12 + 0.0);
v19 = v11 + v17;
if ( v15 == 0.0 )
{
*((_DWORD *)this + 123) = 0;
v22 = *((float *)this + 144);
*((float *)this + 121) = v16;
*((float *)this + 122) = v17;
if ( v22 != 0.0 )
goto LABEL_10;
}
else
{
v20 = *((float *)this + 148);
v21 = *((float *)this + 147);
*((_DWORD *)this + 123) = 0;
v22 = *((float *)this + 144);
*((float *)this + 121) = v16;
*((float *)this + 122) = v19 - (float)((float)(v19 - v17) * (float)(1.0 - v15));
*((float *)this + 126) = v20 - (float)((float)(1.0 - v15) * (float)(v20 - v21));
if ( v22 != 0.0 )
{
LABEL_10:
v23 = *((float *)this + 148);
v24 = v23 - *((float *)this + 147);
*((float *)this + 133) = v18;
*((_DWORD *)this + 135) = 0;
*((float *)this + 134) = v19 - (float)((float)(v19 - v17) * (float)(1.0 - v22));
*((float *)this + 138) = v23 - (float)((float)(1.0 - v22) * v24);
goto LABEL_11;
}
}
*((float *)this + 133) = v18;
*((float *)this + 134) = v17;
*((_DWORD *)this + 135) = 0;
LABEL_11:
v25 = *((float *)this + 141);
if ( v25 != 0.0 )
{
v26 = 1.0 - v25;
*((float *)this + 115) = v16;
*((_DWORD *)this + 117) = 0;
*((float *)this + 116) = v17 + (float)((float)(v19 - v17) * (float)(1.0 - v25));
if ( v25 >= 0.0 )
{
if ( *((_BYTE *)this + 440) )
*((float *)this + 119) = *((float *)this + 145)
+ (float)(v26 * (float)(*((float *)this + 146) - *((float *)this + 145)));
else
*((float *)this + 120) = *((float *)this + 147)
+ (float)(v26 * (float)(*((float *)this + 148) - *((float *)this + 147)));
}
v27 = *((float *)this + 142);
if ( v27 != 0.0 )
goto LABEL_16;
LABEL_20:
*((float *)this + 127) = v18;
*((float *)this + 128) = v19;
*((_DWORD *)this + 129) = 0;
return _stack_chk_guard;
}
v27 = *((float *)this + 142);
*((float *)this + 115) = v16;
*((float *)this + 116) = v19;
*((_DWORD *)this + 117) = 0;
if ( v27 == 0.0 )
goto LABEL_20;
LABEL_16:
v28 = 1.0 - v27;
*((float *)this + 127) = v18;
*((_DWORD *)this + 129) = 0;
*((float *)this + 128) = v17 + (float)((float)(v19 - v17) * (float)(1.0 - v27));
if ( v27 >= 0.0 )
{
if ( *((_BYTE *)this + 440) )
*((float *)this + 131) = *((float *)this + 145)
+ (float)(v28 * (float)(*((float *)this + 146) - *((float *)this + 145)));
else
*((float *)this + 132) = *((float *)this + 147)
+ (float)(v28 * (float)(*((float *)this + 148) - *((float *)this + 147)));
}
return _stack_chk_guard;
}