// // MapSelectLayer::init from 0x50f6b4 to 0x50fb34 (1152 bytes) // // 0 xrefs: // // 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 MapSelectLayer::init(MapSelectLayer *a1) { _BOOL4 v2; // r0 bool v3; // r8 cocos2d::CCArray *v4; // r0 cocos2d::CCSprite *v5; // r0 CCMenuItemSpriteExtra *v6; // r5 cocos2d::CCNode *v7; // r9 void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10 cocos2d::CCDirector *v9; // r0 float v10; // s16 cocos2d::CCDirector *v11; // r0 float v12; // r0 GJBigSprite *v13; // r0 GJBigSprite_vtbl *v14; // r3 GJBigSprite *v15; // r9 void (__fastcall *v16)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10 cocos2d::CCNode *v17; // r0 GameManager *v18; // r0 SimplePlayer *v19; // r0 SimplePlayer_vtbl *v20; // r3 GJMapObject *v21; // r10 float v22; // r3 SimplePlayer *m_player; // r7 SimplePlayer *v24; // r7 GameManager *v25; // r9 GameManager *v26; // r0 GameManager *v27; // r9 GameManager *v28; // r0 int v29; // r0 GameManager *v30; // r0 SimplePlayer *v31; // r7 GameManager *v32; // r11 GameManager *v33; // r0 int v34; // r0 int v35; // r7 GJMapObject *Monster; // r10 int v37; // s16 int v38; // r0 cocos2d::CCPoint v39; // r1 float v40; // r3 GJMapObject *v41; // r10 cocos2d::CCPoint v42; // r1 float v43; // r3 GameLevelManager *v44; // r7 GJGameLevel *LocalLevelByName; // r7 GameLevelManager *v46; // r0 LevelEditorLayer *v47; // r0 LevelEditorLayer *m_editorLayer; // r0 LevelEditorLayer *v49; // r0 cocos2d::ccColor3B v51; // [sp+8h] [bp-1Ch] BYREF cocos2d::CCPoint v52; // [sp+Ch] [bp-18h] BYREF void (*v53)(MapSelectLayer *, cocos2d::CCObject *); // [sp+14h] [bp-10h] int v54; // [sp+18h] [bp-Ch] v2 = cocos2d::CCLayer::init(a1); v3 = v2; if ( v2 ) { v4 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v2); a1->m_monsters = v4; cocos2d::CCObject::retain(v4); v5 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png"); v53 = MapSelectLayer::onBack; v54 = 0; v6 = CCMenuItemSpriteExtra::create( v5, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(MapSelectLayer::onBack, (unsigned int)a1)); CCMenuItemSpriteExtra::setSizeMult(v6, 1.6); v7 = (cocos2d::CCNode *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v6, nullptr); a1->addChild_0(a1, v7, 1); setPosition = v7->setPosition; v9 = cocos2d::CCDirector::sharedDirector(); v10 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v9)); v11 = cocos2d::CCDirector::sharedDirector(); v12 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v11)); cocos2d::CCPoint::CCPoint(&v52, v10 + 25.0, v12 - 22.0); setPosition(v7, &v52); GameManager::sharedState()->m_somethingInMenuLayer = 0; v13 = GJBigSprite::create(); v14 = v13->__vftable; v15 = v13; a1->m_bigSprite = v13; v16 = v14->setPosition; cocos2d::CCPoint::CCPoint(&v52, -165.0, -800.0); v16(v15, &v52); GJBigSprite::updateSpriteVisibility(a1->m_bigSprite); a1->m_bigSprite->m_loadSprites = 1; v17 = cocos2d::CCNode::create(); a1->m_mainLayer = v17; a1->m_bigSprite->addChild_0(a1->m_bigSprite, v17, 20); v18 = GameManager::sharedState(); v19 = SimplePlayer::create(v18->m_playerFrame.random - v18->m_playerFrame.seed); v20 = v19->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable; a1->m_player = v19; ((void (__fastcall *)(SimplePlayer *, int))v20->setScale)(v19, 1056964608); v21 = GJMapObject::create(a1->m_player); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v21, 0); cocos2d::CCPoint::CCPoint(&v52, 462.0, 950.0); GJMapObject::setObjectOrigin(v21, (cocos2d::CCPoint)(unsigned int)&v52, v22); m_player = a1->m_player; m_player->m_hasGlowOutline = GameManager::sharedState()->m_playerGlow; v24 = a1->m_player; v25 = GameManager::sharedState(); v26 = GameManager::sharedState(); v51 = GameManager::colorForIdx(v25, v26->m_playerColor.random - v26->m_playerColor.seed); v27 = GameManager::sharedState(); v28 = GameManager::sharedState(); *(cocos2d::ccColor3B *)&v29 = GameManager::colorForIdx(v27, v28->m_playerColor2.random - v28->m_playerColor2.seed); LOWORD(v52.x) = v29; BYTE2(v52.x) = BYTE2(v29); SimplePlayer::setColors(v24, &v51, (const cocos2d::ccColor3B *)&v52); v30 = GameManager::sharedState(); if ( v30->m_playerGlowColor.random - v30->m_playerGlowColor.seed < 0 ) { SimplePlayer::disableCustomGlowColor(a1->m_player); } else { v31 = a1->m_player; v32 = GameManager::sharedState(); v33 = GameManager::sharedState(); *(cocos2d::ccColor3B *)&v34 = GameManager::colorForIdx( v32, v33->m_playerGlowColor.random - v33->m_playerGlowColor.seed); LOWORD(v52.x) = v34; BYTE2(v52.x) = BYTE2(v34); SimplePlayer::enableCustomGlowColor(v31, (const cocos2d::ccColor3B *)&v52); } v35 = 10; SimplePlayer::updateColors(a1->m_player); GJMapObject::startPlayerJumpLoop(v21); do { Monster = GJMapObject::createMonster((int)&stru_38C.st_size + 2); a1->m_mainLayer->addChild_0(a1->m_mainLayer, Monster, 0); v37 = rand(); v38 = rand(); cocos2d::CCPoint::CCPoint( &v52, (float)((float)((float)((float)((float)v37 * 4.6566e-10) + (float)((float)v37 * 4.6566e-10)) - 1.0) * 100.0) + 600.0, (float)((float)((float)((float)((float)v38 * 4.6566e-10) + (float)((float)v38 * 4.6566e-10)) - 1.0) * 100.0) + 600.0); LODWORD(v39.x) = &v52; v39.y = 50.0; GJMapObject::setObjectOrigin(Monster, v39, v40); cocos2d::CCArray::addObject(a1->m_monsters, Monster); --v35; } while ( v35 ); v41 = GJMapObject::createMonster((int)&stru_52C.st_name + 3); a1->m_mainLayer->addChild_0(a1->m_mainLayer, v41, 0); cocos2d::CCPoint::CCPoint(&v52, 436.0, 776.0); v42.y = 50.0; LODWORD(v42.x) = &v52; GJMapObject::setObjectOrigin(v41, v42, v43); v41->m_shadowSprite->setVisible(v41->m_shadowSprite, 0); cocos2d::CCArray::addObject(a1->m_monsters, v41); a1->m_editMode = 0; v44 = GameLevelManager::sharedState(); sub_776584((int)&v52, "gamemap"); LocalLevelByName = (GJGameLevel *)GameLevelManager::getLocalLevelByName((int)v44, (int)&v52); sub_774008(&v52); if ( !LocalLevelByName ) { v46 = GameLevelManager::sharedState(); LocalLevelByName = GameLevelManager::createNewLevel(v46); sub_776584((int)&v52, "gamemap"); sub_775D40(&LocalLevelByName->m_levelName, &v52); sub_774008(&v52); } v47 = LevelEditorLayer::create(LocalLevelByName, !a1->m_editMode); a1->m_editorLayer = v47; LevelEditorLayer::toggleBackground(v47, 0); LevelEditorLayer::toggleGround(a1->m_editorLayer, 0); if ( a1->m_editMode ) { a1->addChild(a1, a1->m_editorLayer); a1->m_editorLayer->addChild_0(a1->m_editorLayer, a1->m_bigSprite, -100); } else { m_editorLayer = a1->m_editorLayer; m_editorLayer->m_alwaysHideParticleIcons = 1; LevelEditorLayer::updatePreviewParticles(m_editorLayer); v49 = a1->m_editorLayer; v49->m_alwaysPreviewMode = 1; LevelEditorLayer::updateEditorMode(v49); a1->addChild(a1, a1->m_bigSprite); a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_editorLayer, 100); a1->setKeypadEnabled(a1, 1); a1->setKeyboardEnabled(a1, 1); a1->setTouchEnabled(a1, 1); a1->setMouseEnabled(a1, 1); } cocos2d::CCNode::scheduleUpdate(a1); } return v3; }
GD Web Decomp Icon

GD Web Decomp

Raw Source