//
// cocos2d::CCSprite::setTexture from 0x1002d6250 to 0x1002d6374 (292 bytes)
//
// 78 xrefs:
// > sub_1002D6388 @ 0x1002d638c
// > ??> @ 0x1008aec98
// > ??> @ 0x1008c0198
// > ??> @ 0x1008c0af0
// > ??> @ 0x1008c1d00
// > ??> @ 0x1008c42c8
// > ??> @ 0x1008c7d18
// > ??> @ 0x1008c82c8
// > ??> @ 0x1008d4588
// > ??> @ 0x1008e0090
// > ??> @ 0x1008eee00
// > ??> @ 0x100904178
// > ??> @ 0x100904740
// > ??> @ 0x10090ab38
// > ??> @ 0x100910968
// > ??> @ 0x100911b78
// > ??> @ 0x10091c4f0
// > ??> @ 0x10091cd38
// > ??> @ 0x10091fd40
// > ??> @ 0x100920840
// > ??> @ 0x1009220c0
// > ??> @ 0x100922688
// > ??> @ 0x100928770
// > ??> @ 0x100928f68
// > ??> @ 0x100929788
// > ??> @ 0x10093cd68
// > ??> @ 0x1009425b0
// > ??> @ 0x100942b78
// > ??> @ 0x1009448a8
// > ??> @ 0x100944e40
// > ??> @ 0x100947db0
// > ??> @ 0x10094d748
// > ??> @ 0x10094df90
// > ??> @ 0x10094e798
// > ??> @ 0x10094efa0
// > ??> @ 0x10094f7a8
// > ??> @ 0x10094ffb0
// > ??> @ 0x1009507b8
// > ??> @ 0x100950fc0
// > ??> @ 0x1009517b8
// > ??> @ 0x100951fd8
// > ??> @ 0x100952850
// > ??> @ 0x100953070
// > ??> @ 0x100953890
// > ??> @ 0x1009540b0
// > ??> @ 0x1009548d0
// > ??> @ 0x1009550f0
// > ??> @ 0x100955910
// > ??> @ 0x100956130
// > ??> @ 0x100956950
// > ??> @ 0x100957170
// > ??> @ 0x1009579a8
// > ??> @ 0x100958210
// > ??> @ 0x100958a48
// > ??> @ 0x100959280
// > ??> @ 0x100959ab8
// > ??> @ 0x10095a2f0
// > ??> @ 0x10095ab10
// > ??> @ 0x10095b330
// > ??> @ 0x10095bb50
// > ??> @ 0x10095c370
// > ??> @ 0x10095cb90
// > ??> @ 0x10095d3b0
// > ??> @ 0x10095dbd0
// > ??> @ 0x10095e3f0
// > ??> @ 0x10095ec10
// > ??> @ 0x10095f430
// > ??> @ 0x10095fc50
// > ??> @ 0x100960470
// > ??> @ 0x100960c90
// > ??> @ 0x1009614b0
// > ??> @ 0x100961cd0
// > ??> @ 0x1009624f0
// > ??> @ 0x100962d10
// > ??> @ 0x100963cc8
// > ??> @ 0x10096a0e0
// > ??> @ 0x10096e110
// > ??> @ 0x10098cac8
//
// 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 11:02:41 +0000
//
_DWORD *__fastcall cocos2d::CCSprite::setTexture(__int64 a1, __int64 a2)
{
__int64 v2; // x20
__int64 v4; // x0
_DWORD *result; // x0
void *v6; // x0
_DWORD *v7; // x21
void *v8; // x0
v2 = a2;
if ( *(_QWORD *)(a1 + 368) )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 104LL))(a2);
v4 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 368) + 896LL))(*(_QWORD *)(a1 + 368));
result = (_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 104LL))(v4);
goto LABEL_3;
}
if ( !a2 )
{
v6 = cocos2d::CCTextureCache::sharedTextureCache();
result = (_DWORD *)cocos2d::CCTextureCache::textureForKey((__int64)v6, "cc_2x2_white_image");
v2 = (__int64)result;
if ( !result )
{
v7 = operator new(0x50u);
cocos2d::CCImage::CCImage();
cocos2d::CCImage::initWithImageData((__int64)v7, &unk_1009D4150, 16, 4, 2, 2, 8, 0);
v8 = cocos2d::CCTextureCache::sharedTextureCache();
v2 = cocos2d::CCTextureCache::addUIImage((__int64)v8, (__int64)v7, (__int64)"cc_2x2_white_image");
result = cocos2d::CCObject::release(v7);
}
LABEL_3:
if ( *(_QWORD *)(a1 + 368) )
return result;
}
result = *(_DWORD **)(a1 + 416);
if ( result != (_DWORD *)v2 )
{
if ( v2 )
{
cocos2d::CCObject::retain(v2);
result = *(_DWORD **)(a1 + 416);
}
if ( result )
cocos2d::CCObject::release(result);
*(_QWORD *)(a1 + 416) = v2;
return (_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 1216LL))(a1);
}
return result;
}