//
// PlayerObject::updatePlayerFrame from 0x14039dc50 to 0x14039de7a (554 bytes)
//
// 8 xrefs:
// > MenuGameLayer::resetPlayer @ 0x14033321f
// > PlayerObject::toggleSwingMode @ 0x14039ad6e
// > PlayerObject::toggleDartMode @ 0x14039b277
// > PlayerObject::toggleRollMode @ 0x14039b686
// > PlayerObject::toggleRobotMode @ 0x14039ba0d
// > PlayerObject::toggleSpiderMode @ 0x14039bdcf
// > PlayerObject::togglePlayerScale @ 0x1403a0850
// > ??> @ 0x1406d6758
//
// 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
//
// Hidden C++ exception states: #wind=1
void PlayerObject::updatePlayerFrame(PlayerObject *a1, int a2)
{
int v3; // r14d
GameManager *v4; // rcx
cocos2d::CCString *v5; // rax
const char *CString; // rdi
cocos2d::CCString *v7; // rax
const char *v8; // rsi
cocos2d::CCString *v9; // rax
const char *v10; // rbp
cocos2d::CCSprite *m_iconSprite; // rcx
cocos2d::CCSprite_vtbl *v12; // rbx
cocos2d::CCSpriteFrameCache *v13; // rax
struct cocos2d::CCSpriteFrame *v14; // rax
cocos2d::CCSprite_vtbl *v15; // rbx
__int64 v16; // rcx
cocos2d::CCSpriteFrameCache *v17; // rax
struct cocos2d::CCSpriteFrame *v18; // rax
cocos2d::CCSprite_vtbl *v19; // rbx
__int64 v20; // rcx
cocos2d::CCSpriteFrameCache *v21; // rax
struct cocos2d::CCSpriteFrame *v22; // rax
const struct cocos2d::CCSize *v23; // rax
double v24; // xmm0_8
cocos2d::CCSprite_vtbl *v25; // rbx
const cocos2d::CCPoint *v26; // rax
cocos2d::CCString *v27; // rax
const char *v28; // rax
size_t v29; // r8
__int128 v30; // [rsp+20h] [rbp-48h] BYREF
__int64 v31; // [rsp+30h] [rbp-38h]
__int64 v32; // [rsp+38h] [rbp-30h]
cocos2d::CCSize v33; // [rsp+70h] [rbp+8h] BYREF
void *v34; // [rsp+80h] [rbp+18h]
v3 = 485;
if ( a2 < 485 )
v3 = a2;
if ( v3 <= 0 )
v3 = 0;
else
a1->m_maybeSavedPlayerFrame = v3;
v4 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v34 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v34);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = (GameManager *)qword_1406C2ED8;
}
GameManager::loadIcon(v4, v3, 0, a1->m_iconRequestID);
v5 = cocos2d::CCString::createWithFormat("player_%02d_001.png", v3);
CString = cocos2d::CCString::getCString(v5);
v7 = cocos2d::CCString::createWithFormat("player_%02d_2_001.png", v3);
v8 = cocos2d::CCString::getCString(v7);
v9 = cocos2d::CCString::createWithFormat("player_%02d_glow_001.png", v3);
v10 = cocos2d::CCString::getCString(v9);
m_iconSprite = a1->m_iconSprite;
v12 = m_iconSprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v13 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(m_iconSprite);
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, CString);
v12->setDisplayFrame(a1->m_iconSprite, v14);
v15 = a1->m_iconSpriteSecondary->__vftable;
v17 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v16);
v18 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v17, v8);
v15->setDisplayFrame(a1->m_iconSpriteSecondary, v18);
v19 = a1->m_iconGlow->__vftable;
v21 = (cocos2d::CCSpriteFrameCache *)cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache(v20);
v22 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v21, v10);
v19->setDisplayFrame(a1->m_iconGlow, v22);
v23 = a1->m_iconSprite->getContentSize(a1->m_iconSprite);
v24 = cocos2d::CCSize::CCSize(&v33, v23);
v25 = a1->m_iconSpriteSecondary->__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v24, v33.width * 0.5);
v25->setPosition_0(a1->m_iconSpriteSecondary, v26);
v27 = cocos2d::CCString::createWithFormat("player_%02d_extra_001.png", v3);
v28 = cocos2d::CCString::getCString(v27);
v30 = 0;
v31 = 0;
v32 = 0;
v29 = -1;
do
++v29;
while ( v28[v29] );
sub_14003A930(&v30, v28, v29);
PlayerObject::updatePlayerSpriteExtra(a1, &v30);
}