//
// GameManager::loadIcon from 0x41d66c to 0x41d7dc (368 bytes)
//
// 14 xrefs:
// > GameManager::finishedLoadingIconAsync @ 0x41d82a
// > PlayerObject::updatePlayerFrame @ 0x43ac62
// > PlayerObject::updatePlayerRollFrame @ 0x43adbc
// > PlayerObject::updatePlayerSwingFrame @ 0x43af20
// > PlayerObject::updatePlayerDartFrame @ 0x43b084
// > PlayerObject::updatePlayerShipFrame @ 0x43b1e8
// > PlayerObject::updatePlayerJetpackFrame @ 0x43b34c
// > PlayerObject::updatePlayerBirdFrame @ 0x43b4b0
// > PlayerObject::init @ 0x447174
// > PlayerObject::init @ 0x447184
// > SimplePlayer::updatePlayerFrame @ 0x50c838
// > SimplePlayer::init @ 0x50d14e
// > GJRobotSprite::updateFrame @ 0x5e675a
// > GJRobotSprite::init @ 0x5e6b00
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:47:59 +0000
//
int __fastcall GameManager::loadIcon(int **this, int a2, int a3, int a4)
{
int v6; // r4
cocos2d::CCTextureCache *v7; // r0
cocos2d::CCTextureCache *v8; // r0
cocos2d::CCTextureCache *v9; // r0
char *v10; // r1
cocos2d::CCSpriteFrameCache *v11; // r0
const char *v12; // r1
cocos2d::CCTextureCache *v13; // r0
char *v14; // r1
int **v15; // r0
int v16; // r9
_DWORD *v17; // r0
int **v18; // r0
int v20; // [sp+10h] [bp-3Ch] BYREF
int v21[2]; // [sp+14h] [bp-38h] BYREF
int v22; // [sp+1Ch] [bp-30h] BYREF
_BYTE v23[4]; // [sp+20h] [bp-2Ch] BYREF
int v24; // [sp+24h] [bp-28h]
int v25[2]; // [sp+2Ch] [bp-20h] BYREF
char *v26; // [sp+34h] [bp-18h]
int v27[3]; // [sp+38h] [bp-14h] BYREF
v20 = a4;
v21[0] = a3;
GameManager::sheetNameForIcon((GameManager *)v23, (int)this, a2, a3);
if ( (v23[0] & 1) != 0 )
v6 = v24;
else
v6 = (int)v23[0] >> 1;
if ( v6 )
{
v22 = GameManager::keyForIcon((GameManager *)this, a2, v21[0]);
std::string::basic_string(v25, (int)v23);
std::string::append(v25, ".png");
v7 = (cocos2d::CCTextureCache *)std::map::operator[](this + 231, &v22);
if ( *(int *)v7 > 0 )
{
v13 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v7);
if ( (v25[0] & 1) != 0 )
v14 = v26;
else
v14 = (char *)v25 + 1;
v6 = cocos2d::CCTextureCache::textureForKey(v13, v14);
}
else
{
std::string::basic_string(v27, (int)v23);
v8 = (cocos2d::CCTextureCache *)std::string::append(v27, ".plist");
v9 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache(v8);
if ( (v25[0] & 1) != 0 )
v10 = v26;
else
v10 = (char *)v25 + 1;
v6 = cocos2d::CCTextureCache::addImage(v9, v10, 0);
v11 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache((cocos2d::CCSpriteFrameCache *)v6);
if ( (v27[0] & 1) != 0 )
v12 = (const char *)v27[2];
else
v12 = (char *)v27 + 1;
cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile(v11, v12);
std::string::~string((int)v27);
}
v15 = (int **)std::map>::operator[](this + 234, &v20);
v16 = *std::map::operator[](v15, v21);
if ( v16 != a2 )
{
v17 = std::map::operator[](this + 231, &v22);
++*v17;
if ( v16 > 0 )
GameManager::unloadIcon((GameManager *)this, v16, v21[0], v20);
v18 = (int **)std::map>::operator[](this + 234, &v20);
*std::map::operator[](v18, v21) = a2;
}
std::string::~string((int)v25);
}
std::string::~string((int)v23);
return v6;
}