Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 23, 2006, 5:08:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: fallback test for ORXONOX-data-directory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/orxonox.cc

    r8623 r8749  
    3131
    3232#include "gui/qt/qt_gui.h"
     33#include "gui/qt/qt_gui_datadir_fallback.h"
    3334
    3435#include "parser/ini_parser/ini_parser.h"
     
    227228  // initialize everything
    228229  SDL_Init(0);
     230  if( initVideo() == -1)
     231    return -1;
    229232  if( initResources () == -1)
    230     return -1;
    231   if( initVideo() == -1)
    232233    return -1;
    233234  if( initSound() == -1)
     
    286287  PRINT(3)("> Initializing input\n");
    287288
    288   EventHandler::getInstance()->
    289289  EventHandler::getInstance()->init();
    290290  EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE);
     
    336336  }
    337337
    338   if (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
    339   {
     338
     339  while (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     340  {
     341
    340342    PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
    341343              "!!!  Please Change in File %s Section %s Entry %s to a suitable value !!!\n",
     
    344346              CONFIG_SECTION_GENERAL,
    345347              CONFIG_NAME_DATADIR );
    346     OrxGui::Gui* gui = new OrxGui::QtGui(argc, argv);
     348    OrxGui::Gui* gui = new OrxGui::QtGuiDataDirFallback(argc, argv);
    347349    gui->startGui();
    348350    delete gui;
    349     exit(-1);
    350   }
     351    ResourceManager::getInstance()->setDataDir(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""));
     352
     353  }
     354
     355
    351356  //! @todo this is a hack and should be loadable
    352357  std::string imageDir = ResourceManager::getInstance()->getFullName("maps");
     
    356361
    357362  //  DynamicLoader::loadDyLib("libtest.so");
     363  return 0;
     364}
     365
     366/**
     367 * initializes miscelaneous features
     368 * @return -1 on failure
     369 */
     370int Orxonox::initMisc()
     371{
     372  OrxShell::ShellBuffer::getInstance();
    358373
    359374  // start the collision detection engine
    360375  CDEngine::getInstance();
    361   return 0;
    362 }
    363 
    364 /**
    365  * initializes miscelaneous features
    366  * @return -1 on failure
    367  */
    368 int Orxonox::initMisc()
    369 {
    370   OrxShell::ShellBuffer::getInstance();
     376
    371377  return 0;
    372378}
Note: See TracChangeset for help on using the changeset viewer.