Changeset 7661 in orxonox.OLD for trunk/src/orxonox.cc
- Timestamp:
- May 18, 2006, 12:55:34 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/orxonox.cc
r7460 r7661 30 30 #include "globals.h" 31 31 32 #include "gui.h" 33 32 #include "gui/qt_gui/qt_gui.h" 33 34 #include "file.h" 34 35 #include "parser/ini_parser/ini_parser.h" 35 36 #include "util/loading/game_loader.h" … … 189 190 const std::string& Orxonox::getConfigFile () 190 191 { 191 if (ResourceManager::isFile("orxonox.conf")) 192 File orxConfFile("orxonox.conf"); 193 if (orxConfFile.isFile()) 192 194 { 193 195 this->configFileName = "orxonox.conf"; 194 196 } 195 197 else 196 this->configFileName = ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE);198 this->configFileName = File(DEFAULT_CONFIG_FILE).name(); 197 199 198 200 PRINTF(3)("Parsed Config File: '%s'\n", this->configFileName); … … 280 282 PRINT(3)("> Initializing input\n"); 281 283 284 EventHandler::getInstance()-> 282 285 EventHandler::getInstance()->init(); 283 286 EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE); … … 319 322 // init the resource manager 320 323 std::string dataPath; 321 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_ DATA, CONFIG_NAME_DATADIR, ""))!= "")324 if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "") 322 325 { 323 326 if (!ResourceManager::getInstance()->setDataDir(dataPath) && … … 334 337 ResourceManager::getInstance()->getDataDir().c_str(), 335 338 this->configFileName.c_str(), 336 CONFIG_SECTION_ DATA,339 CONFIG_SECTION_GENERAL, 337 340 CONFIG_NAME_DATADIR ); 338 Gui* gui = newGui(argc, argv);341 OrxGui::Gui* gui = new OrxGui::QtGui(argc, argv); 339 342 gui->startGui(); 340 343 delete gui; … … 425 428 CmdLinePrefsReader prefs; 426 429 427 IniFilePrefsReader ini(ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE)); 430 IniFilePrefsReader ini(File(DEFAULT_CONFIG_FILE).name()); 431 Preferences::getInstance()->setUserIni(File(DEFAULT_CONFIG_FILE).name()); 428 432 429 433 prefs.parse(argc, argv); … … 501 505 { 502 506 // checking for existence of the configuration-files, or if the lock file is still used 503 if (showGui || (! ResourceManager::isFile("./orxonox.conf") &&504 !ResourceManager::isFile(DEFAULT_CONFIG_FILE))507 if (showGui || (!File("./orxonox.conf").isFile() && 508 !File(DEFAULT_CONFIG_FILE).isFile()) 505 509 #if DEBUG < 3 // developers do not need to see the GUI, when orxonox fails 506 510 || ResourceManager::isFile(DEFAULT_LOCK_FILE) … … 508 512 ) 509 513 { 510 if (ResourceManager::isFile(DEFAULT_LOCK_FILE)) 511 ResourceManager::deleteFile(DEFAULT_LOCK_FILE); 514 File lockFile(DEFAULT_LOCK_FILE); 515 if (lockFile.isFile()) 516 lockFile.remove(); 512 517 513 518 // starting the GUI 514 Gui* gui = new Gui(argc, argv);515 gui ->startGui();516 517 if ( ! gui->startOrxonox)519 OrxGui::QtGui gui(argc, argv); 520 gui.startGui(); 521 522 if (gui.getState() & OrxGui::Gui::Quitting) 518 523 return 0; 519 524 520 delete gui;521 525 } 522 526 523 527 PRINT(0)(">>> Starting Orxonox <<<\n"); 524 528 525 ResourceManager::touchFile(DEFAULT_LOCK_FILE);529 File(DEFAULT_LOCK_FILE).touch(); 526 530 527 531 Orxonox *orx = Orxonox::getInstance(); … … 537 541 538 542 delete orx; 539 ResourceManager::deleteFile("~/.orxonox/orxonox.lock");540 } 543 File("~/.orxonox/orxonox.lock").remove(); 544 }
Note: See TracChangeset
for help on using the changeset viewer.