//
// PlayerObject::updatePlayerJetpackFrame from 0x1004168f0 to 0x100416b15 (549 bytes)
//
// 1 xrefs:
// > PlayerObject::toggleFlyMode @ 0x100416498
//
// 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::updatePlayerJetpackFrame(PlayerObject *a1, int a2)
{
int v2; // r14d
GameManager *v3; // rax
cocos2d::CCString *v4; // rax
const char *CString; // r13
cocos2d::CCString *v6; // rax
const char *v7; // r12
cocos2d::CCString *v8; // rax
cocos2d::CCSprite *m_vehicleSprite; // r15
cocos2d::CCSpriteFrameCache *v10; // rax
cocos2d::CCSpriteFrame *v11; // rax
cocos2d::CCSprite *m_vehicleSpriteSecondary; // r15
cocos2d::CCSpriteFrameCache *v13; // rax
cocos2d::CCSpriteFrame *v14; // rax
cocos2d::CCSprite *m_vehicleGlow; // r15
cocos2d::CCSpriteFrameCache *v16; // rax
cocos2d::CCSpriteFrame *v17; // rax
_QWORD *v18; // rax
cocos2d::CCSprite *v19; // r15
double v20; // xmm0_8
cocos2d::CCString *v21; // rax
const char *v22; // r15
size_t v23; // rax
size_t v24; // r14
char *v25; // r12
size_t v26; // r13
char v27; // [rsp+0h] [rbp-60h]
char v28; // [rsp+0h] [rbp-60h]
char v29; // [rsp+0h] [rbp-60h]
char v30; // [rsp+0h] [rbp-60h]
float v31; // [rsp+8h] [rbp-58h] BYREF
const char *v32; // [rsp+10h] [rbp-50h]
__int64 v33; // [rsp+18h] [rbp-48h] BYREF
_QWORD __dst[2]; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v2 = a2;
if ( a2 >= 8 )
v2 = 8;
if ( v2 < 2 )
v2 = 1;
v3 = GameManager::sharedState();
GameManager::loadIcon(v3, v2, 8, a1->m_iconRequestID);
v4 = (cocos2d::CCString *)sub_1007AB580("jetpack_%02d_001.png", v27);
CString = cocos2d::CCString::getCString(v4);
v6 = (cocos2d::CCString *)sub_1007AB580("jetpack_%02d_2_001.png", v28);
v7 = cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCString *)sub_1007AB580("jetpack_%02d_glow_001.png", v29);
v32 = cocos2d::CCString::getCString(v8);
m_vehicleSprite = a1->m_vehicleSprite;
v10 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v11 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v10, CString);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleSprite->setDisplayFrame)(
m_vehicleSprite,
v11);
m_vehicleSpriteSecondary = a1->m_vehicleSpriteSecondary;
v13 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, v7);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleSpriteSecondary->setDisplayFrame)(
m_vehicleSpriteSecondary,
v14);
m_vehicleGlow = a1->m_vehicleGlow;
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v17 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v32);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_vehicleGlow->setDisplayFrame)(
m_vehicleGlow,
v17);
v18 = (_QWORD *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_vehicleSprite->getContentSize)(a1->m_vehicleSprite);
sub_10028CFC0(&v33, v18);
v19 = a1->m_vehicleSpriteSecondary;
*(_QWORD *)&v20 = (unsigned int)v33;
*(float *)&v20 = *(float *)&v33 * 0.5;
sub_10028CBE0(&v31, *(float *)&v33 * 0.5, 0.5 * *((float *)&v33 + 1));
((void (__fastcall *)(cocos2d::CCSprite *, float *))v19->setPosition)(v19, &v31);
v21 = (cocos2d::CCString *)sub_1007AB580("jetpack_%02d_extra_001.png", v30);
v22 = cocos2d::CCString::getCString(v21);
v23 = strlen(v22);
if ( v23 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v20);
v24 = v23;
if ( v23 >= 0x17 )
{
v26 = 26;
if ( (v23 | 7) != 0x17 )
v26 = (v23 | 7) + 1;
v25 = (char *)operator new(v26);
__p = v25;
__dst[0] = v26 + 1;
__dst[1] = v24;
goto LABEL_12;
}
LOBYTE(__dst[0]) = 2 * v23;
v25 = (char *)__dst + 1;
if ( v23 )
LABEL_12:
memmove(v25, v22, v24);
v25[v24] = 0;
PlayerObject::updateShipSpriteExtra((__int64)a1, (__int64)__dst);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
}