//
// PlayerObject::updatePlayerSwingFrame from 0x10022a4e0 to 0x10022a678 (408 bytes)
//
// 2 xrefs:
// > PlayerObject::toggleSwingMode @ 0x10022a368
// > MenuGameLayer::resetPlayer @ 0x10039b324
//
// 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::updatePlayerSwingFrame(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_iconSprite; // x24
cocos2d::CCSpriteFrameCache *v13; // x0
cocos2d::CCSpriteFrame *v14; // x0
cocos2d::CCSprite *m_iconSpriteSecondary; // x21
cocos2d::CCSpriteFrameCache *v16; // x0
cocos2d::CCSpriteFrame *v17; // x0
cocos2d::CCSprite *m_iconGlow; // 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 >= 43 )
v3 = 43;
else
v3 = a2;
if ( v3 <= 1 )
v4 = 1;
else
v4 = v3;
v5 = GameManager::sharedState();
GameManager::loadIcon(v5, v4, 7, a1->m_iconRequestID);
v6 = (cocos2d::CCString *)sub_100268F4C("swing_%02d_001.png", v4);
CString = cocos2d::CCString::getCString(v6);
v8 = (cocos2d::CCString *)sub_100268F4C("swing_%02d_2_001.png", v4);
v9 = cocos2d::CCString::getCString(v8);
v10 = (cocos2d::CCString *)sub_100268F4C("swing_%02d_glow_001.png", v4);
v11 = cocos2d::CCString::getCString(v10);
m_iconSprite = a1->m_iconSprite;
v13 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v14 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v13, CString);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_iconSprite->setDisplayFrame)(m_iconSprite, v14);
m_iconSpriteSecondary = a1->m_iconSpriteSecondary;
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v17 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, v9);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_iconSpriteSecondary->setDisplayFrame)(
m_iconSpriteSecondary,
v17);
m_iconGlow = a1->m_iconGlow;
v19 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v20 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v19, v11);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_iconGlow->setDisplayFrame)(m_iconGlow, v20);
v21 = (double *)((__int64 (__fastcall *)(cocos2d::CCSprite *))a1->m_iconSprite->getContentSize)(a1->m_iconSprite);
v22.n128_f64[0] = sub_100022AFC(&v30, v21);
v23 = a1->m_iconSpriteSecondary;
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("swing_%02d_extra_001.png", v4);
v26 = (char *)cocos2d::CCString::getCString(v25);
sub_100009900(__p, v26);
PlayerObject::updatePlayerSpriteExtra((__int64)a1, (const char *)__p);
if ( v28 < 0 )
operator delete(__p[0]);
}