Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 28, 2007, 10:30:29 PM (18 years ago)
Author:
rgrieder
Message:
  • added Vector2, Vector3, Matrix3, ColourValue, Quaternion and String to the misc folder as header files (each of them contains #include <string> … typedef std::string String , etc.)
  • please use String from now on by including <misc/String.h"
  • removed #include <OgreVector3.h", etc. from "CoreIncludes.h" (adjusted all source files)
  • adjusted all the source files (except network, that keeps <string> for the moment) (what a mess..)
  • moved usleep hack to misc/Sleep.h
  • relative include paths for files from other root directories (like misc, network, etc.) (but it stills writes "../Orxonox.h" when in folder orxonox/objects)
  • "OgreSceneManager.h" —> <OgreSceneManager.h>
  • included OrxonoxPrereqs in every file in folder orxonox
  • moved HUD and ParticleInterface to namespace orxonox
  • removed some using namespace Ogre/std when appropriate
  • I hope I haven't forgotten important points..
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/Orxonox.cc

    r673 r708  
    3232
    3333//****** OGRE ******
    34 #include <OgreString.h>
    3534#include <OgreException.h>
    3635#include <OgreRoot.h>
     
    4746
    4847//****** STD *******
    49 #include <string>
    5048#include <iostream>
    5149#include <exception>
    5250
    5351//***** ORXONOX ****
     52//misc
     53#include "misc/Sleep.h"
     54
    5455// loader and audio
    5556#include "loader/LevelLoader.h"
     
    7778namespace orxonox
    7879{
    79   using namespace Ogre;
    80 
    8180   // put this in a seperate Class or solve the problem in another fashion
    82   class OrxListener : public FrameListener
     81  class OrxListener : public Ogre::FrameListener
    8382  {
    8483    public:
     
    9089      }
    9190
    92       bool frameStarted(const FrameEvent& evt)
     91      bool frameStarted(const Ogre::FrameEvent& evt)
    9392      {
    9493        auMan_->update();
     
    154153   * @param path path to config (in home dir or something)
    155154   */
    156   void Orxonox::init(int argc, char **argv, std::string path)
     155  void Orxonox::init(int argc, char **argv, String path)
    157156  {
    158157    //TODO: find config file (assuming executable directory)
    159158    //TODO: read config file
    160159    //TODO: give config file to Ogre
    161     std::string mode;
     160    String mode;
    162161//     if(argc>=2)
    163 //       mode = std::string(argv[1]);
     162//       mode = String(argv[1]);
    164163//     else
    165164//       mode = "";
     
    170169    //mode = "presentation";
    171170    if(ar.errorHandling()) die();
    172     if(mode == std::string("server"))
     171    if(mode == String("server"))
    173172    {
    174173      serverInit(path);
    175174      mode_ = SERVER;
    176175    }
    177     else if(mode == std::string("client"))
     176    else if(mode == String("client"))
    178177    {
    179178      clientInit(path);
    180179      mode_ = CLIENT;
    181180    }
    182     else if(mode == std::string("presentation"))
     181    else if(mode == String("presentation"))
    183182    {
    184183      serverInit(path);
     
    244243  }
    245244
    246   void Orxonox::standaloneInit(std::string path)
     245  void Orxonox::standaloneInit(String path)
    247246  {
    248247    ogre_->setConfigPath(path);
     
    263262  }
    264263
    265   void Orxonox::playableServer(std::string path)
     264  void Orxonox::playableServer(String path)
    266265  {
    267266    ogre_->setConfigPath(path);
     
    297296  }
    298297
    299   void Orxonox::serverInit(std::string path)
     298  void Orxonox::serverInit(String path)
    300299  {
    301300    COUT(2) << "initialising server" << std::endl;
     
    307306  }
    308307
    309   void Orxonox::clientInit(std::string path)
     308  void Orxonox::clientInit(String path)
    310309  {
    311310    COUT(2) << "initialising client" << std::endl;
     
    322321  void Orxonox::defineResources()
    323322  {
    324     Ogre::String secName, typeName, archName;
     323    String secName, typeName, archName;
    325324    Ogre::ConfigFile cf;
    326325#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
     
    341340        archName = i->second;
    342341#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    343         ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
     342        Ogre::ResourceGroupManager::getSingleton().addResourceLocation( String(macBundlePath() + "/" + archName), typeName, secName);
    344343#else
    345         ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
     344        Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
    346345#endif
    347346      }
     
    352351  {
    353352    if (!root_->restoreConfig() && !root_->showConfigDialog())
    354       throw Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
     353      throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
    355354  }
    356355
     
    362361  void Orxonox::initializeResourceGroups()
    363362  {
    364     TextureManager::getSingleton().setDefaultNumMipmaps(5);
    365     ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
     363    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
     364    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    366365  }
    367366
     
    381380    loader_->loadLevel();
    382381
    383     Overlay* hudOverlay = OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    384     hud::HUD* orxonoxHud;
    385     orxonoxHud = new hud::HUD();
     382    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     383    HUD* orxonoxHud;
     384    orxonoxHud = new HUD();
    386385    orxonoxHud->setEnergyValue(20);
    387386    orxonoxHud->setEnergyDistr(20,20,60);
     
    427426    // fixes auto repeat problem
    428427    #if defined OIS_LINUX_PLATFORM
    429       pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
     428      pl.insert(std::make_pair(String("XAutoRepeatOn"), String("true")));
    430429    #endif
    431430
    432     RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();
     431      Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();
    433432    win->getCustomAttribute("WINDOW", &windowHnd);
    434433    windowHndStr << windowHnd;
    435     pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
     434    pl.insert(std::make_pair(String("WINDOW"), windowHndStr.str()));
    436435    inputManager_ = OIS::InputManager::createInputSystem(pl);
    437436
Note: See TracChangeset for help on using the changeset viewer.