//
// PlayerObject::updatePlayerShipFrame from 0x3411ac to 0x3412ea (318 bytes)
//
// 2 xrefs:
// > PlayerObject::toggleFlyMode @ 0x346e98
// > MenuGameLayer::resetPlayer @ 0x3a9990
//
// 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
//
void PlayerObject::updatePlayerShipFrame(PlayerObject *a1, int a2)
{
const char *v3; // r4
GameManager *v4; // r0
cocos2d::CCString *v5; // r0
const char *CString; // r11
cocos2d::CCString *v7; // r0
const char *v8; // r10
cocos2d::CCString *v9; // r0
const char *v10; // r0
cocos2d::CCSprite *m_vehicleSprite; // r6
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r8
const char *v13; // r9
cocos2d::CCSpriteFrameCache *v14; // r0
cocos2d::CCSpriteFrame *v15; // r0
cocos2d::CCSprite *m_vehicleSpriteSecondary; // r6
void (__fastcall *v17)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r8
cocos2d::CCSpriteFrameCache *v18; // r0
cocos2d::CCSpriteFrame *v19; // r0
cocos2d::CCSprite *m_vehicleGlow; // r6
void (__fastcall *v21)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r8
cocos2d::CCSpriteFrameCache *v22; // r0
cocos2d::CCSpriteFrame *v23; // r0
const cocos2d::CCSize *v24; // r0
cocos2d::CCSprite *v25; // r8
void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCString *v27; // r0
char *v28; // r0
cocos2d::CCSize v29; // [sp+4h] [bp-18h] BYREF
cocos2d::CCPoint v30; // [sp+Ch] [bp-10h] BYREF
if ( a2 <= 0 )
{
v3 = (_BYTE *)(&dword_0 + 1);
}
else
{
if ( a2 >= 169 )
a2 = 169;
v3 = (const char *)a2;
}
v4 = GameManager::sharedState();
GameManager::loadIcon(v4, (int)v3, 1, a1->m_iconRequestID);
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"ship_%02d_001.png", v3);
CString = cocos2d::CCString::getCString(v5);
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"ship_%02d_2_001.png", v3);
v8 = cocos2d::CCString::getCString(v7);
v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"ship_%02d_glow_001.png", v3);
v10 = cocos2d::CCString::getCString(v9);
m_vehicleSprite = a1->m_vehicleSprite;
setDisplayFrame = m_vehicleSprite->setDisplayFrame;
v13 = v10;
v14 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v15 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, CString);
setDisplayFrame(m_vehicleSprite, v15);
m_vehicleSpriteSecondary = a1->m_vehicleSpriteSecondary;
v17 = m_vehicleSpriteSecondary->setDisplayFrame;
v18 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v19 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v18, v8);
v17(m_vehicleSpriteSecondary, v19);
m_vehicleGlow = a1->m_vehicleGlow;
v21 = m_vehicleGlow->setDisplayFrame;
v22 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v23 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v22, v13);
v21(m_vehicleGlow, v23);
v24 = a1->m_vehicleSprite->getContentSize(a1->m_vehicleSprite);
cocos2d::CCSize::CCSize(&v29, v24);
v25 = a1->m_vehicleSpriteSecondary;
setPosition = v25->setPosition;
cocos2d::CCPoint::CCPoint(&v30, v29.width * 0.5, v29.height * 0.5);
setPosition(v25, &v30);
v27 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"ship_%02d_extra_001.png", v3);
v28 = (char *)cocos2d::CCString::getCString(v27);
sub_776584((int)&v30, v28);
PlayerObject::updateShipSpriteExtra((int)a1, (const char **)&v30);
sub_774008(&v30);
}