Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7661 in orxonox.OLD for trunk/src/orxonox.cc


Ignore:
Timestamp:
May 18, 2006, 12:55:34 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the QT_GUI back to the trunk
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/qt_gui . -r7607:HEAD

absolutely no conflicts :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/orxonox.cc

    r7460 r7661  
    3030#include "globals.h"
    3131
    32 #include "gui.h"
    33 
     32#include "gui/qt_gui/qt_gui.h"
     33
     34#include "file.h"
    3435#include "parser/ini_parser/ini_parser.h"
    3536#include "util/loading/game_loader.h"
     
    189190const std::string& Orxonox::getConfigFile ()
    190191{
    191   if (ResourceManager::isFile("orxonox.conf"))
     192  File orxConfFile("orxonox.conf");
     193  if (orxConfFile.isFile())
    192194  {
    193195    this->configFileName =  "orxonox.conf";
    194196  }
    195197  else
    196     this->configFileName = ResourceManager::homeDirCheck(DEFAULT_CONFIG_FILE);
     198    this->configFileName = File(DEFAULT_CONFIG_FILE).name();
    197199
    198200  PRINTF(3)("Parsed Config File: '%s'\n", this->configFileName);
     
    280282  PRINT(3)("> Initializing input\n");
    281283
     284  EventHandler::getInstance()->
    282285  EventHandler::getInstance()->init();
    283286  EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE);
     
    319322  // init the resource manager
    320323  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, ""))!= "")
    322325  {
    323326    if (!ResourceManager::getInstance()->setDataDir(dataPath) &&
     
    334337    ResourceManager::getInstance()->getDataDir().c_str(),
    335338    this->configFileName.c_str(),
    336               CONFIG_SECTION_DATA,
     339              CONFIG_SECTION_GENERAL,
    337340              CONFIG_NAME_DATADIR );
    338     Gui* gui = new Gui(argc, argv);
     341    OrxGui::Gui* gui = new OrxGui::QtGui(argc, argv);
    339342    gui->startGui();
    340343    delete gui;
     
    425428  CmdLinePrefsReader prefs;
    426429
    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());
    428432
    429433  prefs.parse(argc, argv);
     
    501505{
    502506  // 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())
    505509#if DEBUG < 3 // developers do not need to see the GUI, when orxonox fails
    506510      || ResourceManager::isFile(DEFAULT_LOCK_FILE)
     
    508512     )
    509513  {
    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();
    512517
    513518    // 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)
    518523      return 0;
    519524
    520     delete gui;
    521525  }
    522526
    523527  PRINT(0)(">>> Starting Orxonox <<<\n");
    524528
    525   ResourceManager::touchFile(DEFAULT_LOCK_FILE);
     529  File(DEFAULT_LOCK_FILE).touch();
    526530
    527531  Orxonox *orx = Orxonox::getInstance();
     
    537541
    538542  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.