GameScene: Difference between revisions

From ZeldaMods (Breath of the Wild)
Jump to navigation Jump to search
imported>Leoetlino
mNo edit summary
imported>Leoetlino
No edit summary
Line 64: Line 64:
*** KingEditor: Stubbed
*** KingEditor: Stubbed
*** E3Mgr: init
*** E3Mgr: init
== Initial state ==
The initial state the game launches into is determined by GameScene<ref>GameScene::initialize, 0x71007A86CC</ref>.
<source lang="cpp">
const bool isFirstLaunch = SaveSystem::sInstance->isFirstLaunch();
State* state = isFirstLaunch ? &state_NewSave : &state_LunchTitle;
if ( aocManager::sInstance && aocManager::sInstance->flags & 2 )
  nn::err::ShowUnacceptableAddOnContentVersionError();
const bool isDemo = E3Mgr::sInstance && E3Mgr::sInstance->isDemoMode();
if (isDemo)
  state = &state_LunchTitle;
if (!isDemo && isFirstLaunch)
  sIsFirstNonDemoLaunch = 1;
StateMachine::changeState(&this->stateMachine, state);
</source>
<references/>
[[Category:Internals]]
[[Category:Internals]]
[[Category:Subsystems (BotW)]]
[[Category:Subsystems (BotW)]]

Revision as of 15:43, 13 October 2018

GameScene
Subsystem
Official name Yes
Description Handles the main loop and stages
Init function Switch 1.5.0: 0x71007D1DD8
Wii U 1.5.0: ???
Debug only No

GameScene is a critical subsystem that is responsible for core functionality such as initialising other components, creating stages (world, title screen, etc.) and handling the game's main loop.

Unlike most other subsystems, GameScene is not a singleton: it is a member of the uking::frm::System structure[1].

Init

Initial state

The initial state the game launches into is determined by GameScene[2].

const bool isFirstLaunch = SaveSystem::sInstance->isFirstLaunch();
State* state = isFirstLaunch ? &state_NewSave : &state_LunchTitle;

if ( aocManager::sInstance && aocManager::sInstance->flags & 2 )
  nn::err::ShowUnacceptableAddOnContentVersionError();

const bool isDemo = E3Mgr::sInstance && E3Mgr::sInstance->isDemoMode();
if (isDemo)
  state = &state_LunchTitle;

if (!isDemo && isFirstLaunch)
  sIsFirstNonDemoLaunch = 1;

StateMachine::changeState(&this->stateMachine, state);
  1. uking::frm::System::gameScene @ 0x10 (Switch)
  2. GameScene::initialize, 0x71007A86CC