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

Function main

src/main.cpp:47–81  ·  view source on GitHub ↗

If you can't tell what the main() is for you should have your programming license revoked...

Source from the content-addressed store, hash-verified

45// If you can't tell what the main() is for you should have your
46// programming license revoked...
47int main(int argc, char *argv[])
48{
49 // Uncomment to check memory leaks in VS
50 //_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
51
52#ifndef _DEBUG
53 try
54 {
55 Logger::reportingLevel() = LOG_INFO;
56#else
57 Logger::reportingLevel() = LOG_DEBUG;
58#endif
59 if (!Options::init(argc, argv))
60 return EXIT_SUCCESS;
61 std::ostringstream title;
62 title << "OpenXcom " << OPENXCOM_VERSION_SHORT << OPENXCOM_VERSION_GIT;
63 Options::baseXResolution = Options::displayWidth;
64 Options::baseYResolution = Options::displayHeight;
65 game = new Game(title.str());
66 game->setState(new StartState(game));
67 game->run();
68#ifndef _DEBUG
69 }
70 catch (std::exception &e)
71 {
72 CrossPlatform::showError(e.what());
73 exit(EXIT_FAILURE);
74 }
75#endif
76 Options::save();
77
78 // Comment this for faster exit.
79 delete game;
80 return EXIT_SUCCESS;
81}
82
83
84#ifdef __MORPHOS__

Callers

nothing calls this directly

Calls 6

initFunction · 0.85
showErrorFunction · 0.85
saveFunction · 0.85
setStateMethod · 0.80
whatMethod · 0.80
runMethod · 0.45

Tested by

no test coverage detected