//
// TutorialLayer::loadPage from 0x42bb14 to 0x42bd96 (642 bytes)
//
// 2 xrefs:
// > TutorialLayer::init @ 0x42c126
// > TutorialLayer::onNext @ 0x42c1ac
//
// 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 TutorialLayer::loadPage(TutorialLayer *a1, int a2)
{
cocos2d::CCDirector *v4; // r0
cocos2d::CCString *v5; // r0
cocos2d::CCSprite *CString; // r0
const char *v7; // r1
cocos2d::CCNode *v8; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
char *v11; // r1
char *v12; // r1
float v13; // s19
int v14; // r8
float v15; // s18
cocos2d::CCNode *v16; // r8
void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
void (*setVisible)(void); // r3
char *v19; // [sp+14h] [bp-20h] BYREF
char v20; // [sp+18h] [bp-1Ch] BYREF
cocos2d::CCSize v21; // [sp+1Ch] [bp-18h] BYREF
cocos2d::CCPoint v22; // [sp+24h] [bp-10h] BYREF
a1->m_tutorialLayer->removeAllChildrenWithCleanup(a1->m_tutorialLayer, 1);
TutorialLayer::removeTutorialTexture(a1);
a1->m_page = a2;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v21, v4);
v5 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"tutorial_%02d.png",
(const char *)a2);
CString = (cocos2d::CCSprite *)cocos2d::CCString::getCString(v5);
v8 = (cocos2d::CCNode *)cocos2d::CCSprite::create(CString, v7);
setAnchorPoint = v8->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v22, 0.0, 0.0);
setAnchorPoint(v8, &v22);
if ( LOBYTE(AppDelegate::get()->m_runningScene) )
((void (__fastcall *)(cocos2d::CCNode *, int))v8->setScale)(v8, 0x40000000);
a1->m_tutorialLayer->addChild(a1->m_tutorialLayer, v8);
setPosition = v8->setPosition;
cocos2d::CCPoint::CCPoint(
&v22,
(float)((float)(v21.width * 0.5) - 210.0) + 10.0,
(float)((float)(v21.height * 0.5) - 130.0) + 10.0);
setPosition(v8, &v22);
sub_776584((int)&v19, (char *)&unk_939830);
switch ( a2 )
{
case 1:
v11 = "Tap the screen to jump.\nHold down to keep jumping.";
goto LABEL_5;
case 2:
v11 = "Hold to fly up.\nRelease to fly down.";
LABEL_5:
sub_7753D4((int)&v19, v11);
goto LABEL_11;
case 3:
v12 = "You can enter practice mode from the pause menu.\n"
"Practice mode lets you place checkpoints.";
goto LABEL_8;
case 4:
sub_7753D4(
(int)&v19,
"You can place checkpoints manually, or use the auto-checkpoint feature.\n"
"Tap the delete button to remove your last checkpoint.");
v13 = -13.0;
v14 = 1110704128;
v15 = 0.55;
break;
case 5:
v12 = "Jump Orbs activate when you are on top of them.\n"
"Tap while touching an orb to interact with it and use its effect.";
LABEL_8:
sub_7753D4((int)&v19, v12);
v13 = -13.0;
v14 = 1109393408;
v15 = 0.6;
break;
default:
LABEL_11:
v13 = 0.0;
v14 = 1109393408;
v15 = 0.7;
break;
}
sub_776584((int)&v20, v19);
cocos2d::CCPoint::CCPoint(&v22, 0.5, 1.0);
v16 = (cocos2d::CCNode *)TextArea::create(
(TextArea *)&v20,
(std::string)"bigFont.fnt",
(const char *)0x3F800000,
COERCE_INT(400.0 / v15),
&v22,
(cocos2d::CCPoint)(unsigned int)v14);
sub_774008(&v20);
v16->setScale(v16, COERCE_FLOAT(LODWORD(v15)));
a1->m_tutorialLayer->addChild(a1->m_tutorialLayer, v16);
v17 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v22, v21.width * 0.5, (float)((float)((float)(v21.height * 0.5) + 130.0) - 75.0) + v13);
v17(v16, &v22);
setVisible = (void (*)(void))a1->m_nextButton->setVisible;
if ( a1->m_page <= 4 )
{
setVisible();
a1->m_nextButton->setEnabled(a1->m_nextButton, 1);
a1->m_exitButton->setVisible(a1->m_exitButton, 0);
}
else
{
setVisible();
a1->m_nextButton->setEnabled(a1->m_nextButton, 0);
a1->m_exitButton->setVisible(a1->m_exitButton, 1);
}
((void (*)(void))a1->m_exitButton->setEnabled)();
sub_774008(&v19);
}