// // LevelSelectLayer::init from 0x8c4ffc to 0x8c59a4 (2472 bytes) // // 2 xrefs: // > LevelSelectLayer::create @ 0x8c5a58 // > @ 0xafbd0 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // 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 12:56:33 +0000 // __int64 __fastcall LevelSelectLayer::init(LevelSelectLayer *this, int a2) { GameStatsManager *v4; // x0 unsigned int v5; // w24 __int64 v7; // x0 GameManager *isItemUnlocked; // x0 AchievementManager *v9; // x0 _BOOL8 isAchievementEarned; // x0 cocos2d::CCDirector *v11; // x0 const char *v12; // x1 __int64 v13; // x19 void (__fastcall *v14)(__int64, __int64 *); // x22 __int64 v15; // x19 void (__fastcall *v16)(__int64, __int64 *); // x22 __int64 v17; // x0 __int64 (__fastcall *v18)(__int64, __int64 *); // x2 GameManager *v19; // x0 __int64 v20; // x0 int v21; // w2 __int64 v22; // x0 __int64 v23; // x3 float v24; // s0 unsigned int v25; // w19 const char *v26; // x1 cocos2d::CCDirector **v27; // x22 void (__fastcall *v28)(cocos2d::CCDirector **, __int64 *); // x25 float v29; // s9 void (__fastcall *v30)(cocos2d::CCDirector **, __int64 *); // x25 cocos2d::CCDirector *v31; // x0 float v32; // s0 const char *v33; // x1 cocos2d::CCDirector **v34; // x22 void (__fastcall *v35)(cocos2d::CCDirector **, __int64 *); // x27 void (__fastcall *v36)(cocos2d::CCDirector **, __int64 *); // x27 cocos2d::CCDirector *v37; // x0 cocos2d::CCDirector *ScreenLeft; // x0 float v39; // s0 float v40; // s9 cocos2d::CCDirector *v41; // x0 float v42; // s0 const char *v43; // x1 cocos2d::CCDirector **v44; // x22 void (__fastcall *v45)(cocos2d::CCDirector **, __int64 *); // x25 void (__fastcall *v46)(cocos2d::CCDirector **, __int64 *); // x25 cocos2d::CCDirector *v47; // x0 cocos2d::CCDirector *ScreenRight; // x0 float v49; // s0 float v50; // s9 cocos2d::CCDirector *v51; // x0 float v52; // s0 cocos2d::CCArray *v53; // x0 cocos2d::CCArray *v54; // x25 GameLevelManager *v55; // x0 cocos2d::CCArray *v56; // x22 GameLevelManager *v57; // x0 const char *v58; // x1 cocos2d::CCObject *MainLevel; // x0 GJGameLevel *v60; // x1 int v61; // w19 cocos2d::CCObject *v62; // x0 GJGameLevel *v63; // x0 cocos2d::CCObject *v64; // x19 int v65; // w2 GJGameLevel *v66; // x0 cocos2d::CCObject *v67; // x19 int v68; // w2 __int64 v69; // x0 cocos2d::CCDirector *v70; // x0 cocos2d::CCArray **v71; // x19 float v72; // s8 cocos2d::CCDirector *v73; // x0 float v74; // s0 __int64 v75; // x1 int PageCount; // w0 int v77; // w1 bool v78; // zf cocos2d::CCNode **v79; // x0 const char *v80; // x2 __int64 v81; // x19 cocos2d::CCMenu *v82; // x19 cocos2d::CCDirector **v83; // x19 float v84; // s9 __int64 (__fastcall *v85)(cocos2d::CCDirector **, __int64 *); // x22 cocos2d::CCDirector *v86; // x0 float v87; // s0 cocos2d::CCMenu *v88; // x0 float v89; // s8 cocos2d::CCNode *v90; // x19 PlatformToolbox *v91; // x0 unsigned __int8 isControllerConnected; // w0 const char *v93; // x1 int v94; // w26 cocos2d::CCSprite *v95; // x22 cocos2d::CCDirector **v96; // x22 void (__fastcall *v97)(cocos2d::CCDirector **, __int64 *); // x27 cocos2d::CCDirector *v98; // x0 float v99; // s0 const char *v100; // x1 char *v101; // x0 __int64 v102; // x0 cocos2d::CCDirector **v103; // x22 void (__fastcall *v104)(cocos2d::CCDirector **, __int64 *); // x27 cocos2d::CCDirector *v105; // x0 float v106; // s0 const char *v107; // x1 __int64 v108; // x0 cocos2d::CCMenu *v109; // x22 cocos2d::CCDirector **v110; // x19 __int64 (__fastcall *v111)(cocos2d::CCDirector **, __int64 *); // x25 cocos2d::CCDirector *v112; // x0 cocos2d::CCDirector *v113; // x0 float v114; // s0 float v115; // s8 cocos2d::CCDirector *v116; // x0 float v117; // s0 GameManager *v118; // x0 cocos2d::CCMenu *v119; // x0 cocos2d::CCDirector **v120; // x19 const char *v121; // x1 __int64 v122; // x0 const char *v123; // x1 __int64 v124; // x0 __int64 v125; // x0 __int64 v126; // x25 void (__fastcall *v127)(__int64, __int64 *); // x27 void (__fastcall *v128)(cocos2d::CCDirector **, __int64 *); // x25 cocos2d::CCDirector *v129; // x0 cocos2d::CCDirector *v130; // x0 float v131; // s0 float v132; // s8 cocos2d::CCDirector *v133; // x0 float v134; // s0 cocos2d::CCMenuItem *v135; // x2 void (__fastcall *v136)(LevelSelectLayer *, __int64 *); // x19 GameManager *v137; // x0 __int64 v138; // [xsp+78h] [xbp+78h] __int64 v139; // [xsp+80h] [xbp+80h] BYREF _BYTE v140[8]; // [xsp+88h] [xbp+88h] BYREF __int64 v141; // [xsp+90h] [xbp+90h] BYREF v4 = (GameStatsManager *)(unsigned __int8)cocos2d::CCLayer::init(this); v5 = (unsigned __int8)v4; if ( (_BYTE)v4 ) { v7 = GameStatsManager::sharedState(v4); isItemUnlocked = (GameManager *)(unsigned __int8)GameStatsManager::isItemUnlocked(v7, 12, 4); if ( (_BYTE)isItemUnlocked ) { v137 = (GameManager *)GameManager::sharedState(isItemUnlocked); GameManager::setUGV(v137, "6", 1u); } (*(void (__fastcall **)(LevelSelectLayer *, __int64))(*(_QWORD *)this + 1072LL))(this, 1); (*(void (__fastcall **)(LevelSelectLayer *, __int64))(*(_QWORD *)this + 1088LL))(this, 1); s_didClick = 0; v9 = (AchievementManager *)AchievementManager::sharedState((AchievementManager *)&s_didClick); isAchievementEarned = AchievementManager::isAchievementEarned(v9, "geometry.ach.secret04"); *((_BYTE *)this + 464) = isAchievementEarned; v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)isAchievementEarned); cocos2d::CCDirector::getWinSize(&v139, v11); v13 = cocos2d::CCSprite::create((cocos2d::CCSprite *)"GJ_gradientBG.png", v12); *((_QWORD *)this + 54) = v13; v14 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v13 + 296LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, 0.0, 0.0); v14(v13, &v141); (*(void (__fastcall **)(LevelSelectLayer *, _QWORD, __int64))(*(_QWORD *)this + 464LL))( this, *((_QWORD *)this + 54), 4294967294LL); (*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 54) + 128LL))( *((_QWORD *)this + 54), (float)(*(float *)&v139 + 10.0) / *(float *)(*((_QWORD *)this + 54) + 432LL)); (*(void (__fastcall **)(_QWORD, float))(**((_QWORD **)this + 54) + 144LL))( *((_QWORD *)this + 54), (float)(*((float *)&v139 + 1) + 10.0) / *(float *)(*((_QWORD *)this + 54) + 436LL)); v15 = *((_QWORD *)this + 54); v16 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v15 + 184LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, -5.0, -5.0); v16(v15, &v141); v17 = *((_QWORD *)this + 54); v18 = *(__int64 (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 960LL); LOWORD(v141) = 32040; BYTE2(v141) = -1; v19 = (GameManager *)v18(v17, &v141); v20 = GameManager::sharedState(v19); v22 = GJGroundLayer::create((GJGroundLayer *)*(unsigned int *)(v20 + 984), 1, v21); v23 = *(_QWORD *)this; *((_QWORD *)this + 55) = v22; (*(void (__fastcall **)(LevelSelectLayer *))(v23 + 464))(this); v24 = (float)(*((float *)&v139 + 1) * 0.5) + -110.0; if ( v24 > 128.0 ) v24 = 128.0; v25 = 1; GJGroundLayer::positionGround(*((GJGroundLayer **)this + 55), v24); v27 = (cocos2d::CCDirector **)cocos2d::CCSprite::createWithSpriteFrameName( (cocos2d::CCSprite *)"GJ_topBar_001.png", v26); v28 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v27 + 37); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, 0.5, 1.0); v28(v27, &v141); v29 = *(float *)&v139 * 0.5; v30 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v27 + 23); v31 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v27); cocos2d::CCDirector::getScreenTop(v31); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v29, v32 + 1.0); v30(v27, &v141); (*(void (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **, __int64))(*(_QWORD *)this + 464LL))( this, v27, 1); v34 = (cocos2d::CCDirector **)cocos2d::CCSprite::createWithSpriteFrameName( (cocos2d::CCSprite *)"GJ_sideArt_001.png", v33); v35 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v34 + 37); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, 0.0, 0.0); v35(v34, &v141); v36 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v34 + 23); v37 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v34); ScreenLeft = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v37); v40 = v39; v41 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenLeft); cocos2d::CCDirector::getScreenBottom(v41); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v40 - 1.0, v42 - 1.0); v36(v34, &v141); (*(void (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **, __int64))(*(_QWORD *)this + 464LL))( this, v34, 1); v44 = (cocos2d::CCDirector **)cocos2d::CCSprite::createWithSpriteFrameName( (cocos2d::CCSprite *)"GJ_sideArt_001.png", v43); v45 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v44 + 37); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, 1.0, 0.0); v45(v44, &v141); v46 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v44 + 23); v47 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v44); ScreenRight = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v47); v50 = v49; v51 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(ScreenRight); cocos2d::CCDirector::getScreenBottom(v51); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v50 + 1.0, v52 - 1.0); v46(v44, &v141); cocos2d::CCSprite::setFlipX((cocos2d::CCSprite *)v44, 1); v53 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **, __int64))(*(_QWORD *)this + 464LL))( this, v44, 1); v54 = (cocos2d::CCArray *)cocos2d::CCArray::create(v53); v55 = (GameLevelManager *)cocos2d::CCArray::create(v54); v56 = v55; do { v57 = (GameLevelManager *)GameLevelManager::sharedState(v55); v58 = (const char *)v25++; MainLevel = (cocos2d::CCObject *)GameLevelManager::getMainLevel(v57, v58, 1u); v55 = (GameLevelManager *)cocos2d::CCArray::addObject(v56, MainLevel); } while ( v25 != 23 ); v61 = 3; do { v62 = (cocos2d::CCObject *)LevelPage::create(nullptr, v60); v63 = (GJGameLevel *)cocos2d::CCArray::addObject(v54, v62); --v61; } while ( v61 ); v64 = (cocos2d::CCObject *)GJGameLevel::create(v63); *((_DWORD *)v64 + 84) = -2; v65 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0); *((_DWORD *)v64 + 83) = v65; *((_DWORD *)v64 + 82) = v65 - 2; v66 = (GJGameLevel *)cocos2d::CCArray::addObject(v56, v64); v67 = (cocos2d::CCObject *)GJGameLevel::create(v66); *((_DWORD *)v67 + 84) = -1; v68 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0); *((_DWORD *)v67 + 83) = v68; *((_DWORD *)v67 + 82) = v68 - 1; cocos2d::CCArray::addObject(v56, v67); v69 = BoomScrollLayer::create(v54, 0, 1u, v56, (__int64)this + 416); *((_QWORD *)this + 56) = v69; v70 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(LevelSelectLayer *, __int64))(*(_QWORD *)this + 456LL))( this, v69); v71 = *((cocos2d::CCArray ***)this + 56); v72 = *(float *)&v139 * 0.5; v73 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v70); cocos2d::CCDirector::getScreenBottom(v73); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v72, v74 + 15.0); BoomScrollLayer::setPagesIndicatorPosition(v71, (__int64)&v141); v75 = *((_QWORD *)this + 56); *((_DWORD *)this + 106) = v139; *(_QWORD *)(*(_QWORD *)(v75 + 504) + 408LL) = (char *)this + 408; PageCount = getPageCount(); v77 = PageCount; if ( a2 ) { v78 = PageCount - 1 == a2; v79 = *((cocos2d::CCNode ***)this + 56); if ( v78 ) { BoomScrollLayer::instantMoveToPage(v79, v77 - 2); BoomScrollLayer::instantMoveToPage(*((cocos2d::CCNode ***)this + 56), a2); } else { BoomScrollLayer::instantMoveToPage(v79, a2); } } else { v136 = *(void (__fastcall **)(LevelSelectLayer *, __int64 *))(*(_QWORD *)this + 1160LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, (const cocos2d::CCPoint *)&unk_155CB88); v136(this, &v141); } v81 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Download the soundtrack", "bigFont.fnt", v80); (*(void (__fastcall **)(__int64, float))(*(_QWORD *)v81 + 160LL))(v81, 0.5); v82 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create( v81, 0, (__int64)this, (__int64)LevelSelectLayer::onDownload, 0); CCMenuItemSpriteExtra::setSizeMult((__int64)v82, 1.1); v83 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(v82, nullptr); (*(void (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **))(*(_QWORD *)this + 456LL))(this, v83); v84 = *(float *)&v139 * 0.5; v85 = *((__int64 (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v83 + 23); v86 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v83); cocos2d::CCDirector::getScreenBottom(v86); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v84, v87 + 35.0); v88 = (cocos2d::CCMenu *)v85(v83, &v141); v89 = *((float *)&v139 + 1) * 0.5; v90 = (cocos2d::CCNode *)cocos2d::CCMenu::create(v88); v91 = (PlatformToolbox *)(*(__int64 (__fastcall **)(LevelSelectLayer *, cocos2d::CCNode *, __int64))(*(_QWORD *)this + 464LL))( this, v90, 5); isControllerConnected = PlatformToolbox::isControllerConnected(v91); v94 = isControllerConnected; if ( isControllerConnected ) { v95 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName( (cocos2d::CCSprite *)"controllerBtn_DPad_Left_001.png", v93); } else { v95 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName( (cocos2d::CCSprite *)"navArrowBtn_001.png", v93); cocos2d::CCSprite::setFlipX(v95, 1); } v96 = (cocos2d::CCDirector **)CCMenuItemSpriteExtra::create( (__int64)v95, 0, (__int64)this, (__int64)LevelSelectLayer::onPrev, 0); (*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCDirector **))(*(_QWORD *)v90 + 456LL))(v90, v96); CCMenuItemSpriteExtra::setSizeMult((__int64)v96, 2.0); v97 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v96 + 23); v98 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v96); cocos2d::CCDirector::getScreenLeft(v98); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v140, v99 + 25.0, v89); cocos2d::CCNode::convertToNodeSpace(&v141, v90, (const cocos2d::CCPoint *)v140); v97(v96, &v141); if ( v94 ) v101 = "controllerBtn_DPad_Right_001.png"; else v101 = "navArrowBtn_001.png"; v102 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)v101, v100); v103 = (cocos2d::CCDirector **)CCMenuItemSpriteExtra::create( v102, 0, (__int64)this, (__int64)LevelSelectLayer::onNext, 0); (*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCDirector **))(*(_QWORD *)v90 + 456LL))(v90, v103); CCMenuItemSpriteExtra::setSizeMult((__int64)v103, 2.0); v104 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v103 + 23); v105 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v103); cocos2d::CCDirector::getScreenRight(v105); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v140, v106 - 25.0, v89); cocos2d::CCNode::convertToNodeSpace(&v141, v90, (const cocos2d::CCPoint *)v140); v104(v103, &v141); v108 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v107); v109 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create( v108, 0, (__int64)this, (__int64)LevelSelectLayer::onBack, 0); CCMenuItemSpriteExtra::setSizeMult((__int64)v109, 1.6); v110 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(v109, nullptr); (*(void (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **, __int64))(*(_QWORD *)this + 464LL))( this, v110, 1); v111 = *((__int64 (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v110 + 23); v112 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v110); v113 = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenLeft(v112); v115 = v114; v116 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v113); cocos2d::CCDirector::getScreenTop(v116); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v115 + 25.0, v117 - 22.0); v118 = (GameManager *)v111(v110, &v141); v119 = (cocos2d::CCMenu *)GameManager::sharedState(v118); *((_BYTE *)v119 + 1064) = 0; v120 = (cocos2d::CCDirector **)cocos2d::CCMenu::create(v119); (*(void (__fastcall **)(LevelSelectLayer *, cocos2d::CCDirector **))(*(_QWORD *)this + 456LL))(this, v120); v122 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_infoIcon_001.png", v121); v138 = CCMenuItemSpriteExtra::create(v122, 0, (__int64)this, (__int64)LevelSelectLayer::onInfo, 0); CCMenuItemSpriteExtra::setSizeMult(v138, 2.0); (*((void (__fastcall **)(cocos2d::CCDirector **, __int64))*v120 + 57))(v120, v138); v124 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"sideBtn_death_001.png", v123); v125 = CCMenuItemSpriteExtra::create(v124, 0, (__int64)this, (__int64)LevelSelectLayer::onDeathTracker, 0); *((_QWORD *)this + 59) = v125; CCMenuItemSpriteExtra::setSizeMult(v125, 2.0); (*((void (__fastcall **)(cocos2d::CCDirector **, _QWORD))*v120 + 57))(v120, *((_QWORD *)this + 59)); v126 = *((_QWORD *)this + 59); v127 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v126 + 184LL); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, 0.0, -40.0); v127(v126, &v141); LevelSelectLayer::updateDeathButton((__int64)this, *(_DWORD *)(*((_QWORD *)this + 56) + 588LL)); v128 = *((void (__fastcall **)(cocos2d::CCDirector **, __int64 *))*v120 + 23); v129 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(*v120); v130 = (cocos2d::CCDirector *)cocos2d::CCDirector::getScreenRight(v129); v132 = v131; v133 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v130); cocos2d::CCDirector::getScreenTop(v133); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v141, v132 - 20.0, v134 - 20.0); v128(v120, &v141); if ( v94 ) GameToolbox::addBackButton(this, v109, v135); } return v5; }
GD Web Decomp Icon

GD Web Decomp

Raw Source