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

Method load

src/Menu/StartState.cpp:302–332  ·  view source on GitHub ↗

* Loads game data and updates status accordingly. * @param game_ptr Pointer to the game. * @return Thread status, 0 = ok */

Source from the content-addressed store, hash-verified

300 * @return Thread status, 0 = ok
301 */
302int StartState::load(void *game_ptr)
303{
304 Game *game = (Game*)game_ptr;
305 try
306 {
307 Log(LOG_INFO) << "Loading ruleset...";
308 game->loadRuleset();
309 Log(LOG_INFO) << "Ruleset loaded successfully.";
310 Log(LOG_INFO) << "Loading resources...";
311 game->setResourcePack(new XcomResourcePack(game->getRuleset()->getExtraSprites(), game->getRuleset()->getExtraSounds()));
312 Log(LOG_INFO) << "Resources loaded successfully.";
313 Log(LOG_INFO) << "Loading language...";
314 game->defaultLanguage();
315 Log(LOG_INFO) << "Language loaded successfully.";
316 loading = LOADING_SUCCESSFUL;
317 }
318 catch (Exception &e)
319 {
320 error = e.what();
321 Log(LOG_ERROR) << error;
322 loading = LOADING_FAILED;
323 }
324 catch (YAML::Exception &e)
325 {
326 error = e.what();
327 Log(LOG_ERROR) << error;
328 loading = LOADING_FAILED;
329 }
330
331 return 0;
332}
333
334}

Callers 1

initMethod · 0.45

Calls 7

loadRulesetMethod · 0.80
setResourcePackMethod · 0.80
getExtraSpritesMethod · 0.80
getExtraSoundsMethod · 0.80
defaultLanguageMethod · 0.80
whatMethod · 0.80
getRulesetMethod · 0.45

Tested by

no test coverage detected