Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/orxonox.cc

    r9406 r9869  
    4141#include "sound_engine.h"
    4242#include "util/loading/resource_manager.h"
     43
    4344#include "cd_engine.h"
    44 #include "text_engine.h"
    4545#include "event_handler.h"
    4646
    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
    5351#include "shell_command_class.h"
    5452#include "shell_command.h"
    55 #include "shell_buffer.h"
    56 
    57 #include "util/loading/load_param_description.h"
    5853
    5954#include "network_manager.h"
     
    9792REGISTER_ARG_ARG(  _, write_dict,  "compression", "writedict",    "write packets to DATA/dicts/newdict",               "numBytes" );
    9893
     94ObjectListDefinition(Orxonox);
    9995
    10096/**
     
    105101Orxonox::Orxonox ()
    106102{
    107   this->setClassID(CL_ORXONOX, "Orxonox");
     103  this->registerObject(this, Orxonox::_objectList);
    108104  this->setName("orxonox-main");
    109105
     
    127123
    128124  // class-less services/factories
    129   Factory::deleteFactories();
    130125  FastFactory::deleteAll();
    131126  OrxShell::ShellCommandClass::unregisterAllCommands();
    132127
    133   LoadClassDescription::deleteAllDescriptions();
    134 
    135128  // handlers
    136   delete ResourceManager::getInstance(); // deletes the Resource Manager
     129  Resources::ResourceManager::deleteInstance(); // deletes the Resource Manager
    137130
    138131  // engines
     
    142135  delete EventHandler::getInstance();
    143136
     137  Resources::ResourceManager::deleteInstance();
    144138  // output-buffer
    145   delete OrxShell::ShellBuffer::getInstance();
     139  delete DebugBuffer::getInstance();
    146140
    147141  SDL_QuitSubSystem(SDL_INIT_TIMER);
    148   ClassList::debug();
     142
     143
     144  ObjectListBase::debugAll(1);
    149145
    150146  Preferences::getInstance()->save();
     
    260256  GraphicsEngine::getInstance()->initFromPreferences();
    261257
    262   std::string iconName = ResourceManager::getFullName("pictures/fighter-top-32x32.bmp");
     258  std::string iconName = Resources::ResourceManager::getInstance()->prependAbsoluteMainPath("pictures/fighter-top-32x32.bmp");
    263259  if (!iconName.empty())
    264260  {
     
    331327
    332328//#include "util/loading/dynamic_loader.h"
    333 
    334329/**
    335330 * initializes and loads resource files
     
    345340  if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "")
    346341  {
    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)))
    349344    {
    350345      PRINTF(1)("Data Could not be located in %s\n", dataPath.c_str());
    351346    }
    352347  }
    353 
    354 
    355   while (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     348  while (!Resources::ResourceManager::getInstance()->checkFileInMainPath(File(DEFAULT_DATA_DIR_CHECKFILE)))
    356349  {
    357350
    358351    PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
    359352              "!!!  Please Change in File %s Section %s Entry %s to a suitable value !!!\n",
    360               ResourceManager::getInstance()->getDataDir().c_str(),
     353              Resources::ResourceManager::getInstance()->mainGlobalPath().name().c_str(),
    361354              this->configFileName.c_str(),
    362355              CONFIG_SECTION_GENERAL,
     
    367360      return(-1);
    368361    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  }
    373364
    374365  //! @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
    381381  return 0;
    382382}
     
    388388int Orxonox::initMisc()
    389389{
    390   OrxShell::ShellBuffer::getInstance();
     390  DebugBuffer::getInstance();
    391391
    392392  // start the collision detection engine
     
    570570  }
    571571
    572   printf("finished inizialisation\n");
     572  PRINTF(5)("finished inizialisation\n");
    573573  orx->start();
    574574
Note: See TracChangeset for help on using the changeset viewer.