Changeset 4556 in orxonox.OLD for orxonox/trunk/src/orxonox.cc
- Timestamp:
- Jun 8, 2005, 2:35:10 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/orxonox.cc
r4504 r4556 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 16 16 You should have received a copy of the GNU General Public License 17 17 along with this program; if not, write to the Free Software Foundation, 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 19 20 20 … … 68 68 \brief remove Orxonox from memory 69 69 */ 70 Orxonox::~Orxonox () 70 Orxonox::~Orxonox () 71 71 { 72 72 int i =0; … … 96 96 /** 97 97 \brief this finds the config file 98 98 99 99 Since the config file varies from user to user and since one may want to specify different config files 100 100 for certain occasions or platforms this function finds the right config file for every occasion and stores … … 115 115 // parse command line 116 116 // config file 117 117 118 118 getConfigFile (argc, argv); 119 119 SDL_Init (SDL_INIT_TIMER); … … 130 130 //printf("> Initializing world\n"); 131 131 //if( init_world () == -1) return -1; PB: world will be initialized when started 132 132 133 133 return 0; 134 134 } … … 137 137 \brief initializes SDL and OpenGL 138 138 */ 139 int Orxonox::initVideo() 139 int Orxonox::initVideo() 140 140 { 141 141 PRINTF(3)("> Initializing video\n"); 142 142 143 143 GraphicsEngine::getInstance(); 144 144 145 145 return 0; 146 146 } … … 150 150 \brief initializes the sound engine 151 151 */ 152 int Orxonox::initSound() 152 int Orxonox::initSound() 153 153 { 154 154 PRINT(3)("> Initializing sound\n"); … … 162 162 \brief initializes input functions 163 163 */ 164 int Orxonox::initInput() 164 int Orxonox::initInput() 165 165 { 166 166 this->eventHandler = EventHandler::getInstance(); 167 167 this->eventHandler->init(); 168 168 169 169 return 0; 170 170 } … … 174 174 \brief initializes network system 175 175 */ 176 int Orxonox::initNetworking() 176 int Orxonox::initNetworking() 177 177 { 178 178 printf("Not yet implemented\n"); … … 184 184 \brief initializes and loads resource files 185 185 */ 186 int Orxonox::initResources() 186 int Orxonox::initResources() 187 187 { 188 188 PRINT(3)("initializing ResourceManager\n"); … … 200 200 memset (namebuf, 0, 256); 201 201 memset (valuebuf, 0, 256); 202 202 203 203 while( parser.nextVar (namebuf, valuebuf) != -1) 204 204 { 205 205 if (!strcmp(namebuf, CONFIG_NAME_DATADIR)) 206 207 208 209 210 211 212 213 214 206 { 207 // printf("Not yet implemented\n"); 208 if (!resourceManager->setDataDir(valuebuf)) 209 { 210 PRINTF(1)("Data Could not be located\n"); 211 exit(-1); 212 } 213 } 214 215 215 memset (namebuf, 0, 256); 216 216 memset (valuebuf, 0, 256); 217 217 } 218 218 219 219 if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE)) 220 220 { 221 221 PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n", 222 223 224 225 222 resourceManager->getDataDir(), 223 DEFAULT_CONFIG_FILE, 224 CONFIG_SECTION_DATA, 225 CONFIG_NAME_DATADIR); 226 226 exit(-1); 227 227 } … … 250 250 void Orxonox::start() 251 251 { 252 252 253 253 this->gameLoader = GameLoader::getInstance(); 254 254 this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc"); … … 261 261 /** 262 262 \brief handles sprecial events from localinput 263 \param event: an event not handled by the CommandNode 263 \param event: an event not handled by the CommandNode 264 264 */ 265 265 void Orxonox::graphicsHandler(SDL_Event* event) … … 274 274 } 275 275 } 276 276 277 277 278 278 /** … … 292 292 here the journey begins 293 293 */ 294 int main(int argc, char** argv) 295 { 294 int main(int argc, char** argv) 295 { 296 296 297 297 // here the pre-arguments are loaded, these are needed to go either to orxonx itself, Help, or Benchmark. … … 333 333 { 334 334 if (ResourceManager::isFile("~/.orxonox/orxonox.lock")) 335 336 335 ResourceManager::deleteFile("~/.orxonox/orxonox.lock"); 336 337 337 // starting the GUI 338 338 Gui* gui = new Gui(argc, argv); … … 340 340 341 341 if (! gui->startOrxonox) 342 343 342 return 0; 343 344 344 delete gui; 345 345 } 346 346 347 347 PRINT(0)(">>> Starting Orxonox <<<\n"); 348 348 … … 350 350 351 351 Orxonox *orx = Orxonox::getInstance(); 352 352 353 353 if((*orx).init(argc, argv) == -1) 354 354 { … … 356 356 return -1; 357 357 } 358 358 359 359 orx->start(); 360 360 361 361 delete orx; 362 362 ResourceManager::deleteFile("~/.orxonox/orxonox.lock"); 363 364 } 363 364 }
Note: See TracChangeset
for help on using the changeset viewer.