Changeset 9869 in orxonox.OLD for trunk/src/orxonox.cc
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/orxonox.cc
r9406 r9869 41 41 #include "sound_engine.h" 42 42 #include "util/loading/resource_manager.h" 43 43 44 #include "cd_engine.h" 44 #include "text_engine.h"45 45 #include "event_handler.h" 46 46 47 #include "util/loading/factory.h" 48 #include "fast_factory.h" 49 50 #include "benchmark.h" 51 52 #include "class_list.h" 47 #include "loading/fast_factory.h" 48 49 #include "subprojects/benchmark.h" 50 53 51 #include "shell_command_class.h" 54 52 #include "shell_command.h" 55 #include "shell_buffer.h"56 57 #include "util/loading/load_param_description.h"58 53 59 54 #include "network_manager.h" … … 97 92 REGISTER_ARG_ARG( _, write_dict, "compression", "writedict", "write packets to DATA/dicts/newdict", "numBytes" ); 98 93 94 ObjectListDefinition(Orxonox); 99 95 100 96 /** … … 105 101 Orxonox::Orxonox () 106 102 { 107 this-> setClassID(CL_ORXONOX, "Orxonox");103 this->registerObject(this, Orxonox::_objectList); 108 104 this->setName("orxonox-main"); 109 105 … … 127 123 128 124 // class-less services/factories 129 Factory::deleteFactories();130 125 FastFactory::deleteAll(); 131 126 OrxShell::ShellCommandClass::unregisterAllCommands(); 132 127 133 LoadClassDescription::deleteAllDescriptions();134 135 128 // handlers 136 delete ResourceManager::getInstance(); // deletes the Resource Manager129 Resources::ResourceManager::deleteInstance(); // deletes the Resource Manager 137 130 138 131 // engines … … 142 135 delete EventHandler::getInstance(); 143 136 137 Resources::ResourceManager::deleteInstance(); 144 138 // output-buffer 145 delete OrxShell::ShellBuffer::getInstance();139 delete DebugBuffer::getInstance(); 146 140 147 141 SDL_QuitSubSystem(SDL_INIT_TIMER); 148 ClassList::debug(); 142 143 144 ObjectListBase::debugAll(1); 149 145 150 146 Preferences::getInstance()->save(); … … 260 256 GraphicsEngine::getInstance()->initFromPreferences(); 261 257 262 std::string iconName = Resource Manager::getFullName("pictures/fighter-top-32x32.bmp");258 std::string iconName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath("pictures/fighter-top-32x32.bmp"); 263 259 if (!iconName.empty()) 264 260 { … … 331 327 332 328 //#include "util/loading/dynamic_loader.h" 333 334 329 /** 335 330 * initializes and loads resource files … … 345 340 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "") 346 341 { 347 if (!ResourceManager::getInstance()->setDataDir(dataPath) &&348 !ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))342 Resources::ResourceManager::getInstance()->setMainGlobalPath(dataPath) ; 343 if(!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE))) 349 344 { 350 345 PRINTF(1)("Data Could not be located in %s\n", dataPath.c_str()); 351 346 } 352 347 } 353 354 355 while (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE)) 348 while (!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE))) 356 349 { 357 350 358 351 PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \ 359 352 "!!! Please Change in File %s Section %s Entry %s to a suitable value !!!\n", 360 Resource Manager::getInstance()->getDataDir().c_str(),353 Resources::ResourceManager::getInstance()->mainGlobalPath().name().c_str(), 361 354 this->configFileName.c_str(), 362 355 CONFIG_SECTION_GENERAL, … … 367 360 return(-1); 368 361 delete gui; 369 ResourceManager::getInstance()->setDataDir(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, "")); 370 371 } 372 362 Resources::ResourceManager::getInstance()->setMainGlobalPath(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, "")); 363 } 373 364 374 365 //! @todo this is a hack and should be loadable 375 std::string imageDir = ResourceManager::getInstance()->getFullName("maps"); 376 ResourceManager::getInstance()->addImageDir(imageDir); 377 imageDir = ResourceManager::getInstance()->getFullName("pictures"); 378 ResourceManager::getInstance()->addImageDir(imageDir); 379 380 // DynamicLoader::loadDyLib("libtest.so"); 366 Resources::ResourceManager::getInstance()->addResourceSubPath("Texture", "maps"); 367 Resources::ResourceManager::getInstance()->addResourceSubPath("Texture", "pictures"); 368 369 Resources::ResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "sound"); 370 Resources::ResourceManager::getInstance()->addResourceSubPath("SoundBuffer", "music"); 371 372 Resources::ResourceManager::getInstance()->addResourceSubPath("Shader", "shaders"); 373 Resources::ResourceManager::getInstance()->addResourceSubPath("OBJ", "models"); 374 375 Resources::ResourceManager::getInstance()->addKeepLevelName("Imediately"); 376 Resources::ResourceManager::getInstance()->addKeepLevelName("LevelEnd"); 377 Resources::ResourceManager::getInstance()->addKeepLevelName("CampaignEnd"); 378 Resources::ResourceManager::getInstance()->addKeepLevelName("GameEnd"); 379 Resources::ResourceManager::getInstance()->setDefaultKeepLevel(std::string("GameEnd")); 380 381 381 return 0; 382 382 } … … 388 388 int Orxonox::initMisc() 389 389 { 390 OrxShell::ShellBuffer::getInstance();390 DebugBuffer::getInstance(); 391 391 392 392 // start the collision detection engine … … 570 570 } 571 571 572 printf("finished inizialisation\n");572 PRINTF(5)("finished inizialisation\n"); 573 573 orx->start(); 574 574
Note: See TracChangeset
for help on using the changeset viewer.