Changeset 5693 for code/trunk/src/orxonox/Main.cc
- Timestamp:
- Aug 29, 2009, 10:19:38 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/libraries (added) merged: 5612-5613,5615-5619,5621-5623,5625-5640,5642-5643,5647-5649,5665-5666,5685-5687,5692
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/Main.cc
r3370 r5693 27 27 * 28 28 */ 29 29 30 30 /** 31 31 @file 32 32 @brief 33 Entry point of the program.33 The main function of Orxonox. 34 34 */ 35 35 … … 37 37 #include "SpecialConfig.h" 38 38 39 #ifdef ORXONOX_USE_WINMAIN40 # ifndef WIN32_LEAN_AND_MEAN41 # define WIN32_LEAN_AND_MEAN42 # endif43 #include <windows.h>44 #endif45 46 #include "util/Debug.h"47 39 #include "util/Exception.h" 48 40 #include "core/CommandLine.h" 49 41 #include "core/Game.h" 42 #include "Main.h" 50 43 51 44 SetCommandLineSwitch(console).information("Start in console mode (text IO only)"); … … 56 49 SetCommandLineSwitch(standalone).information("Start in standalone mode"); 57 50 58 /* 59 @brief 60 Main method. Game starts here (except for static initialisations). 61 */ 62 #ifdef ORXONOX_USE_WINMAIN 63 INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT) 64 #else 65 int main(int argc, char** argv) 66 #endif 51 namespace orxonox 67 52 { 68 using namespace orxonox; 69 70 Game* game = 0; 71 try 53 /** 54 @brief 55 Main method. Game starts here (except for static initialisations). 56 */ 57 int main(const std::string& strCmdLine) 72 58 { 73 #ifndef ORXONOX_USE_WINMAIN 74 std::string strCmdLine; 75 for (int i = 1; i < argc; ++i) 76 strCmdLine += argv[i] + std::string(" "); 77 #endif 78 game = new Game(strCmdLine); 59 Game* game = new Game(strCmdLine); 79 60 80 61 game->setStateHierarchy( … … 108 89 else 109 90 Game::getInstance().requestStates("graphics, mainMenu"); 91 92 game->run(); 93 delete game; 94 95 return 0; 110 96 } 111 catch (const std::exception& ex)112 {113 COUT(0) << "Orxonox failed to initialise: " << ex.what() << std::endl;114 COUT(0) << "Terminating program." << std::endl;115 return 1;116 }117 catch (...)118 {119 COUT(0) << "Orxonox failed to initialise: " << std::endl;120 COUT(0) << "Terminating program." << std::endl;121 return 1;122 }123 124 game->run();125 delete game;126 127 return 0;128 97 }
Note: See TracChangeset
for help on using the changeset viewer.