//
// cocos2d::CCDirector::replaceScene from 0x5c36bc to 0x5c3730 (116 bytes)
//
// 80 xrefs:
// > MenuLayer::onPlay @ 0x30a6be
// > MenuLayer::onCreator @ 0x30a6f6
// > MenuLayer::onGarage @ 0x30a72e
// > LoadingLayer::loadingFinished @ 0x30b680
// > GameManager::reloadMenu @ 0x3204b6
// > GameManager::reloadAllStep5 @ 0x320546
// > GameManager::safePopScene @ 0x3234d0
// > GameManager::reloadAll @ 0x323568
// > GameManager::returnToLastScene @ 0x324678
// > GameManager::returnToLastScene @ 0x324742
// > LevelListCell::onClick @ 0x330376
// > CreatorLayer::onSecretVault @ 0x3aaa42
// > CreatorLayer::onTreasureRoom @ 0x3aac30
// > CreatorLayer::onBack @ 0x3aaeca
// > LevelSearchLayer::onSearchMode @ 0x3af158
// > LevelInfoLayer::playStep4 @ 0x3b1182
// > LevelInfoLayer::onBack @ 0x3b177c
// > LevelInfoLayer::onPlayReplay @ 0x3b2840
// > LevelInfoLayer::onClone @ 0x3b2914
// > EditLevelLayer::playStep3 @ 0x3b6016
// > EditLevelLayer::onTest @ 0x3b7c26
// > EditLevelLayer::onEdit @ 0x3b7eec
// > EditLevelLayer::onBack @ 0x3b7f8c
// > EditLevelLayer::onClone @ 0x3b80a6
// > UploadPopup::onReturnToLevel @ 0x3b8904
// > LevelBrowserLayer::createNewLevel @ 0x3bb674
// > LevelBrowserLayer::createNewList @ 0x3bb724
// > LevelBrowserLayer::onSavedMode @ 0x3bd4ea
// > LevelBrowserLayer::onLocalMode @ 0x3bd558
// > LevelBrowserLayer::onMyOnlineLevels @ 0x3bd620
// > LevelBrowserLayer::onFavorites @ 0x3bd6c0
// > LevelBrowserLayer::onSaved @ 0x3bd754
// > LevelBrowserLayer::FLAlert_Clicked @ 0x3bdce8
// > GameLevelManager::gotoLevelPage @ 0x3c7216
// > GJGarageLayer::onShop @ 0x402342
// > GJGarageLayer::onBack @ 0x4023ac
// > LevelSelectLayer::onBack @ 0x40863c
// > LevelPage::onTheTower @ 0x40891c
// > LevelPage::onSecretDoor @ 0x408aec
// > LevelPage::playStep3 @ 0x409050
// > OptionsLayer::onSecretVault @ 0x4218ce
// > VideoOptionsLayer::onApply @ 0x4220d8
// > GraphicsReloadLayer::performReload @ 0x422252
// > VideoOptionsLayer::reloadMenu @ 0x42488e
// > InfoLayer::onOriginal @ 0x42eef2
// > InfoLayer::onSimilar @ 0x42fa8e
// > GJGameLoadingLayer::loadLevel @ 0x46c372
// > GJGameLoadingLayer::transitionToLoadingLayer @ 0x47cd1e
// > SecretLayer::onBack @ 0x4c9560
// > GauntletSelectLayer::onPlay @ 0x4d6ddc
// > GauntletSelectLayer::onBack @ 0x4d709c
// > GauntletLayer::onBack @ 0x4da068
// > GJShopLayer::onBack @ 0x4e1c46
// > GJShopLayer::dialogClosed @ 0x4e1dda
// > SecretLayer2::onSecretLevel @ 0x4eab92
// > SecretLayer2::onBack @ 0x4eb26e
// > SecretLayer2::onDoor @ 0x4ede94
// > SecretLayer3::onBack @ 0x4ee116
// > SecretLayer4::onBack @ 0x4f0188
// > GJWorldNode::playStep3 @ 0x4fc950
// > WorldSelectLayer::onBack @ 0x4fcb46
// > MapSelectLayer::onBack @ 0x50dcee
// > MultiplayerLayer::onBtn1 @ 0x52906c
// > MultiplayerLayer::onBtn2 @ 0x52909c
// > MultiplayerLayer::onBack @ 0x5290c8
// > MPLobbyLayer::onBack @ 0x535972
// > LevelAreaInnerLayer::playStep1 @ 0x56be16
// > LevelAreaInnerLayer::onOnlineVault @ 0x56be56
// > LevelAreaLayer::onBack @ 0x56bf92
// > LevelAreaInnerLayer::onBack @ 0x56c082
// > LevelAreaLayer::onEnterTower @ 0x56da6a
// > SecretRewardsLayer::onBack @ 0x585726
// > SecretRewardsLayer::showShop @ 0x585758
// > UploadListPopup::onBack @ 0x58eed2
// > UploadListPopup::onReturnToList @ 0x591bd4
// > LevelListLayer::cloneList @ 0x591d6c
// > LevelListLayer::onBack @ 0x591fc6
// > SecretLayer6::onBack @ 0x59c38e
// > SecretLayer5::onBack @ 0x59c3de
// > cocos2d::CCTransitionScene::setNewScene @ 0x5d0e3a
//
// 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 cocos2d::CCDirector::replaceScene(cocos2d::CCDirector *a1, cocos2d::CCScene *a2)
{
_BOOL4 v4; // r6
unsigned int v5; // r0
unsigned int v6; // r8
if ( a2 )
v4 = _dynamic_cast(
a2,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCScene,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCTransitionScene,
0) != nullptr;
else
v4 = 0;
if ( a1->m_bIsTransitioning && v4 )
return 0;
v5 = cocos2d::CCArray::count(a1->m_pobScenesStack);
a1->m_bSendCleanupToScene = 1;
v6 = v5;
cocos2d::CCDirector::checkSceneReference(a1);
cocos2d::CCArray::replaceObjectAtIndex(a1->m_pobScenesStack, v6 - 1, (cocos2d::_ccArray *)a2, 1);
a1->m_pNextScene = a2;
if ( !v4 )
cocos2d::CCDirector::willSwitchToScene(a1, a2);
a1->m_bIsTransitioning = v4;
return 1;
}