//
// SimplePlayer::init from 0x50d028 to 0x50d32a (770 bytes)
//
// 1 xrefs:
// > SimplePlayer::create @ 0x50d3bc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:51:29 +0000
//
int __fastcall SimplePlayer::init(SimplePlayer *this, int a2)
{
GameManager *v4; // r0
int v5; // r8
unsigned int v6; // r7
size_t v7; // r0
int v8; // r11
GameManager *v9; // r0
int **v10; // r0
const char *v11; // r1
cocos2d::CCSprite *v12; // r0
int v13; // r0
int v14; // r3
const char *v15; // r1
cocos2d::CCSprite *v16; // r0
int v17; // r0
int v18; // r9
void (__fastcall *v19)(int, const char **); // r10
cocos2d::CCSprite *v20; // r0
int v21; // r0
int v22; // r9
void (__fastcall *v23)(int, const char **); // r10
const char *v24; // r1
cocos2d::CCSprite *v25; // r0
int v26; // r0
int v27; // r9
void (__fastcall *v28)(int, const char **); // r10
const char *v29; // r1
cocos2d::CCSprite *v30; // r0
int v31; // r0
int v32; // r9
void (__fastcall *v33)(int, const char **); // r10
const char *v35; // [sp+Ch] [bp-240h] BYREF
int v36; // [sp+10h] [bp-23Ch]
int v37[3]; // [sp+14h] [bp-238h] BYREF
int v38[3]; // [sp+20h] [bp-22Ch] BYREF
int v39[2]; // [sp+2Ch] [bp-220h] BYREF
cocos2d::CCSprite *v40; // [sp+34h] [bp-218h]
int v41[3]; // [sp+38h] [bp-214h] BYREF
unsigned int v42; // [sp+44h] [bp-208h] BYREF
unsigned int v43; // [sp+48h] [bp-204h]
char *v44; // [sp+4Ch] [bp-200h]
_BYTE v45[500]; // [sp+50h] [bp-1FCh] BYREF
v4 = (GameManager *)GameManager::sharedState(this);
*((_DWORD *)this + 136) = GameManager::getIconRequestID(v4);
if ( a2 <= 0 )
{
v5 = 1;
}
else
{
v5 = 485;
if ( a2 <= 485 )
v5 = a2;
}
v43 = 500;
v44 = v45;
v42 = 0;
v35 = "player_";
v36 = 0;
fmt::BasicWriter::operator<<(&v42, "player_", 0);
if ( v5 <= 9 )
{
v35 = "0";
v36 = 0;
fmt::BasicWriter::operator<<(&v42, "0", 0);
}
v35 = (const char *)v5;
fmt::BasicWriter::FormatInt,char>>(&v42, v5);
v6 = v42;
if ( v42 + 1 > v43 )
fmt::internal::Array::grow((int)&v42, v42 + 1);
v44[v6] = 0;
memset(v37, 0, sizeof(v37));
v7 = strlen(v44);
std::string::__init(v37, v44, v7);
std::string::basic_string(v38, (int)v37);
std::string::append(v38, "_001.png");
std::string::basic_string(v39, (int)v37);
std::string::append(v39, "_2_001.png");
std::string::basic_string(v41, (int)v37);
std::string::append(v41, "_glow_001.png");
v8 = cocos2d::CCSprite::init(this);
if ( v8 )
{
v9 = (GameManager *)(*(int (__fastcall **)(SimplePlayer *, void *))(*(_DWORD *)this + 568))(this, &unk_D2BCC8);
v10 = (int **)GameManager::sharedState(v9);
GameManager::loadIcon(v10, v5, 0, *((_DWORD *)this + 136));
if ( (v38[0] & 1) != 0 )
v12 = (cocos2d::CCSprite *)v38[2];
else
v12 = (cocos2d::CCSprite *)((char *)v38 + 1);
v13 = cocos2d::CCSprite::createWithSpriteFrameName(v12, v11);
v14 = *(_DWORD *)this;
*((_DWORD *)this + 127) = v13;
(*(void (__fastcall **)(SimplePlayer *, int, int))(v14 + 232))(this, v13, 1);
if ( (v39[0] & 1) != 0 )
v16 = v40;
else
v16 = (cocos2d::CCSprite *)((char *)v39 + 1);
v17 = cocos2d::CCSprite::createWithSpriteFrameName(v16, v15);
*((_DWORD *)this + 128) = v17;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 127) + 232))(*((_DWORD *)this + 127), v17, -1);
v18 = *((_DWORD *)this + 128);
v19 = *(void (__fastcall **)(int, const char **))(*(_DWORD *)v18 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v35, *((const cocos2d::CCPoint **)this + 127));
v19(v18, &v35);
if ( (v39[0] & 1) != 0 )
v20 = v40;
else
v20 = (cocos2d::CCSprite *)((char *)v39 + 1);
v21 = cocos2d::CCSprite::createWithSpriteFrameName(v20, (const char *)(LOBYTE(v39[0]) << 31));
*((_DWORD *)this + 129) = v21;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 127) + 232))(*((_DWORD *)this + 127), v21, -2);
v22 = *((_DWORD *)this + 129);
v23 = *(void (__fastcall **)(int, const char **))(*(_DWORD *)v22 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v35, *((const cocos2d::CCPoint **)this + 127));
v23(v22, &v35);
if ( (v41[0] & 1) != 0 )
v25 = (cocos2d::CCSprite *)v41[2];
else
v25 = (cocos2d::CCSprite *)((char *)v41 + 1);
v26 = cocos2d::CCSprite::createWithSpriteFrameName(v25, v24);
*((_DWORD *)this + 130) = v26;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 127) + 232))(*((_DWORD *)this + 127), v26, -3);
v27 = *((_DWORD *)this + 130);
v28 = *(void (__fastcall **)(int, const char **))(*(_DWORD *)v27 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v35, *((const cocos2d::CCPoint **)this + 127));
v28(v27, &v35);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 130) + 172))(*((_DWORD *)this + 130), 0);
if ( (v39[0] & 1) != 0 )
v30 = v40;
else
v30 = (cocos2d::CCSprite *)((char *)v39 + 1);
v31 = cocos2d::CCSprite::createWithSpriteFrameName(v30, v29);
*((_DWORD *)this + 131) = v31;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 127) + 232))(*((_DWORD *)this + 127), v31, 1);
v32 = *((_DWORD *)this + 131);
v33 = *(void (__fastcall **)(int, const char **))(*(_DWORD *)v32 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v35, *((const cocos2d::CCPoint **)this + 127));
v33(v32, &v35);
SimplePlayer::updatePlayerFrame((int)this, v5, 0);
}
std::string::~string((int)v41);
std::string::~string((int)v39);
std::string::~string((int)v38);
std::string::~string((int)v37);
if ( v44 != v45 && v44 )
operator delete[](v44);
return v8;
}