MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / init

Method init

src/Menu/StartState.cpp:128–149  ·  view source on GitHub ↗

* Reset and reload data. */

Source from the content-addressed store, hash-verified

126 * Reset and reload data.
127 */
128void StartState::init()
129{
130 State::init();
131
132 // Silence!
133 Sound::stop();
134 Music::stop();
135 _game->setResourcePack(0);
136 if (!Options::mute && Options::reload)
137 {
138 Mix_CloseAudio();
139 _game->initAudio();
140 }
141
142 // Load the game data in a separate thread
143 _thread = SDL_CreateThread(load, (void*)_game);
144 if (_thread == 0)
145 {
146 // If we can't create the thread, just load it as usual
147 load((void*)_game);
148 }
149}
150
151/**
152 * If the loading fails, it shows an error, otherwise moves on to the game.

Callers 1

btnOkClickMethod · 0.45

Calls 4

initFunction · 0.85
loadFunction · 0.85
setResourcePackMethod · 0.80
initAudioMethod · 0.80

Tested by

no test coverage detected