//
// GJGameLevel::init from 0x10055b3d0 to 0x10055b5e3 (531 bytes)
//
// 1 xrefs:
// > ??> @ 0x100960c60
//
// 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
//
bool __fastcall GJGameLevel::init(GJGameLevel *a1)
{
int v2; // eax
int v3; // eax
int v4; // eax
int v5; // eax
int v6; // eax
int v7; // eax
int v8; // eax
cocos2d::CCDictionary *v9; // rax
cocos2d::CCDictionary *m_lastBuildSave; // rdi
cocos2d::CCDictionary *v11; // r14
std::string::assign((std::string *)&a1->m_levelName, "");
std::string::assign((std::string *)&a1->m_levelDesc, "");
std::string::assign((std::string *)&a1->m_levelString, "");
std::string::assign((std::string *)&a1->m_personalBests, "");
a1->m_levelVersion = 1;
a1->m_levelType = 0;
v2 = dword_1009A28E8;
a1->m_M_ID = dword_1009A28E8;
dword_1009A28E8 = v2 + 1;
a1->m_attempts.value = 0;
v3 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_attempts.seed = v3;
a1->m_attempts.random = v3;
a1->m_jumps.value = 0;
v4 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_jumps.seed = v4;
a1->m_jumps.random = v4;
a1->m_clicks.value = 0;
v5 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_clicks.seed = v5;
a1->m_clicks.random = v5;
a1->m_attemptTime.value = 0;
v6 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_attemptTime.seed = v6;
a1->m_attemptTime.random = v6;
a1->m_chk = 0;
a1->m_coins = 0;
a1->m_stars.value = 0;
v7 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_stars.seed = v7;
a1->m_stars.random = v7;
a1->m_demon.value = 0;
v8 = (int)(float)((float)((float)rand() * 4.6566129e-10) * 1000.0);
a1->m_demon.seed = v8;
a1->m_demon.random = v8;
*(_WORD *)&a1->m_dontSave = 0;
v9 = cocos2d::CCDictionary::create();
m_lastBuildSave = a1->m_lastBuildSave;
if ( m_lastBuildSave != v9 )
{
v11 = v9;
if ( v9 )
{
cocos2d::CCObject::retain(v9);
m_lastBuildSave = a1->m_lastBuildSave;
}
if ( m_lastBuildSave )
cocos2d::CCObject::release(m_lastBuildSave);
a1->m_lastBuildSave = v11;
}
return 1;
}