//
// cocos2d::CCTextureCache::reloadTexture from 0x1800aced0 to 0x1800ad02a (346 bytes)
//
// 2 xrefs:
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2184
//
// This function is hookable on this platform (idp: pc, 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:22:18 +0000
//
// Hidden C++ exception states: #wind=2
__int64 __fastcall cocos2d::CCTextureCache::reloadTexture(cocos2d::CCTextureCache *this, const char *a2)
{
struct cocos2d::CCFileUtils *v4; // rax
unsigned __int8 v5; // di
cocos2d::CCTexture2D *v6; // rsi
void **v7; // rdx
cocos2d::CCImage *v8; // rax
struct cocos2d::CCImage *v9; // rbx
void **v10; // rdx
void *v11; // rcx
void *Block[3]; // [rsp+38h] [rbp-40h] BYREF
unsigned __int64 v14; // [rsp+50h] [rbp-28h]
v4 = cocos2d::CCFileUtils::sharedFileUtils();
(*(void (__fastcall **)(struct cocos2d::CCFileUtils *, void **, const char *, _QWORD))(*(_QWORD *)v4 + 40LL))(
v4,
Block,
a2,
0);
if ( Block[2] )
{
v6 = (cocos2d::CCTexture2D *)cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), (__int64)Block);
v5 = 0;
if ( v6 )
{
v8 = (cocos2d::CCImage *)sub_1800E4AC0(0x50u);
if ( v8 )
v9 = cocos2d::CCImage::CCImage(v8);
else
v9 = nullptr;
if ( v9 )
{
v10 = Block;
if ( v14 > 0xF )
v10 = (void **)Block[0];
if ( (unsigned __int8)cocos2d::CCImage::initWithImageFile(v9, (__int64)v10, 1) )
v5 = cocos2d::CCTexture2D::initWithImage(v6, v9);
}
}
else
{
v7 = Block;
if ( v14 > 0xF )
v7 = (void **)Block[0];
v5 = cocos2d::CCTextureCache::addImage(this, (const char *)v7, 0) != nullptr;
}
}
else
{
v5 = 0;
}
if ( v14 > 0xF )
{
v11 = Block[0];
if ( v14 + 1 >= 0x1000 )
{
v11 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v11);
}
return v5;
}