MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / start

Function start

src/OpenLoco/src/Title.cpp:126–162  ·  view source on GitHub ↗

0x0046AD7D

Source from the content-addressed store, hash-verified

124
125 // 0x0046AD7D
126 void start()
127 {
128 GameCommands::setUpdatingCompanyId(CompanyManager::getControllingId());
129 if (SceneManager::isPaused())
130 {
131 GameCommands::registers regs;
132 regs.bl = GameCommands::Flags::apply;
133 GameCommands::togglePause(regs);
134 }
135
136 auto currentScreenFlags = SceneManager::getSceneFlags();
137 SceneManager::removeSceneFlags(SceneManager::Flags::networked);
138 Ui::WindowManager::closeAllFloatingWindows();
139 setSceneFlags(currentScreenFlags);
140 SceneManager::addSceneFlags(SceneManager::Flags::title);
141 SceneManager::setGameSpeed(GameSpeed::Normal);
142 ObjectManager::unloadAll();
143 auto& selection = ObjectManager::prepareSelectionList(false);
144 ObjectManager::loadSelectionListObjects(selection.objectFlags);
145 ObjectManager::freeSelectionList();
146 ObjectManager::reloadAll();
147 Scenario::sub_4748D4();
148 Scenario::reset();
149 resetSubsystems();
150 MessageManager::reset();
151 Gui::init();
152 reset();
153 Gfx::invalidateScreen();
154 SceneManager::resetSceneAge();
155
156 if (Config::get().audio.playTitleMusic)
157 {
158 Audio::playMusic(Environment::PathId::css5, Config::get().audio.mainVolume, true);
159 }
160
161 SceneManager::addSceneFlags(SceneManager::Flags::initialised);
162 }
163
164 void stop()
165 {

Callers 3

quitGameFunction · 0.70
returnToTitleFunction · 0.70
initialiseFunction · 0.70

Calls 15

setUpdatingCompanyIdFunction · 0.85
getControllingIdFunction · 0.85
togglePauseFunction · 0.85
getSceneFlagsFunction · 0.85
removeSceneFlagsFunction · 0.85
setSceneFlagsFunction · 0.85
addSceneFlagsFunction · 0.85
unloadAllFunction · 0.85
loadSelectionListObjectsFunction · 0.85
freeSelectionListFunction · 0.85
reloadAllFunction · 0.85
sub_4748D4Function · 0.85

Tested by

no test coverage detected