If you can't tell what the main() is for you should have your programming license revoked...
| 45 | // If you can't tell what the main() is for you should have your |
| 46 | // programming license revoked... |
| 47 | int 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__ |