//
// PlayerObject::updatePlayerShipFrame from 0x10022990c to 0x100229aa4 (408 bytes)
//
// 2 xrefs:
// > PlayerObject::toggleFlyMode @ 0x1002297a4
// > MenuGameLayer::resetPlayer @ 0x10039b04c
//
// 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 __fastcall PlayerObject::updatePlayerShipFrame(PlayerObject *a1, int a2)
{
int v3; // w8
int v4; // w20
GameManager *v5; // x0
cocos2d::CCString *v6; // x0
const char *CString; // x21
cocos2d::CCString *v8; // x0
const char *v9; // x22
cocos2d::CCString *v10; // x0
const char *v11; // x23
cocos2d::CCSprite *m_vehicleSprite; // x24
cocos2d::CCSpriteFrameCache *v13; // x0
cocos2d::CCSpriteFrame *v14; // x0
cocos2d::CCSprite *m_vehicleSpriteSecondary; // x21
cocos2d::CCSpriteFrameCache *v16; // x0
cocos2d::CCSpriteFrame *v17; // x0
cocos2d::CCSprite *m_vehicleGlow; // x21
cocos2d::CCSpriteFrameCache *v19; // x0
cocos2d::CCSpriteFrame *v20; // x0
double *v21; // x0
__n128 v22; // q0
cocos2d::CCSprite *v23; // x21
__n128 v24; // q1
cocos2d::CCString *v25; // x0
char *v26; // x0
void *__p[2]; // [xsp+8h] [xbp-58h] BYREF
char v28; // [xsp+1Fh] [xbp-41h]
int v29; // [xsp+20h] [xbp-40h] BYREF
__int64 v30; // [xsp+28h] [xbp-38h] BYREF
if ( a2 >= 169 )
v3 = 169;
else
v3 = a2;
if ( v3 <= 1 )
v4 = 1;
else
v4 = v3;
v5 = GameManager::sharedState();
GameManager::loadIcon(v5, v4, 1, a1->m_iconRequestID);
v6 = (cocos2d::CCString *)sub_100268F4C("ship_%02d_001.png", v4);
CString = cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCString *)sub_100268F4C("ship_%02d_2_001.png", v4);
v9 = cocos2d::CCString::getCString(v8);
v10 = (cocos2d::CCString *)sub_100268F4C("ship_%02d_glow_001.png", v4);
v11 = cocos2d::CCString::getCString(v10);
m_vehicleSprite = a1->m_vehicleSprite;
v13 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, CString);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleSprite->setDisplayFrame)(
m_vehicleSprite,
v14);
m_vehicleSpriteSecondary = a1->m_vehicleSpriteSecondary;
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v17 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v9);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleSpriteSecondary->setDisplayFrame)(
m_vehicleSpriteSecondary,
v17);
m_vehicleGlow = a1->m_vehicleGlow;
v19 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v20 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v19, v11);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleGlow->setDisplayFrame)(
m_vehicleGlow,
v20);
v21 = (double *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_vehicleSprite->getContentSize)(a1->m_vehicleSprite);
v22.n128_f64[0] = sub_100022AFC(&v30, v21);
v23 = a1->m_vehicleSpriteSecondary;
v22.n128_f32[0] = *(float *)&v30 * 0.5;
v24.n128_f32[0] = *((float *)&v30 + 1) * 0.5;
sub_100022980(v22, v24, &v29);
((void (__fastcall *)(cocos2d::CCSprite *, int *))v23->setPosition)(v23, &v29);
v25 = (cocos2d::CCString *)sub_100268F4C("ship_%02d_extra_001.png", v4);
v26 = (char *)cocos2d::CCString::getCString(v25);
sub_100009900(__p, v26);
PlayerObject::updateShipSpriteExtra((__int64)a1, (const char *)__p);
if ( v28 < 0 )
operator delete(__p[0]);
}