Index: code/branches/network/src/orxonox/GraphicsEngine.cc
===================================================================
--- code/branches/network/src/orxonox/GraphicsEngine.cc	(revision 925)
+++ code/branches/network/src/orxonox/GraphicsEngine.cc	(revision 926)
@@ -37,4 +37,5 @@
 #include <OgreRenderWindow.h>
 
+#include "core/CoreIncludes.h"
 #include "core/Debug.h"
 #include "GraphicsEngine.h"
@@ -47,7 +48,9 @@
   GraphicsEngine::GraphicsEngine()
   {
+    RegisterObject(GraphicsEngine);
+    //this->bOverwritePath_ = false;
+    this->setConfigValues();
     // set to standard values
     this->configPath_ = "";
-    this->dataPath_ = "";
     this->root_ = 0;
     this->scene_ = 0;
@@ -58,4 +61,10 @@
   GraphicsEngine::~GraphicsEngine()
   {
+  }
+
+  void GraphicsEngine::setConfigValues()
+  {
+    SetConfigValue(dataPath_, dataPath_).description("relative path to media data");
+
   }
 
@@ -90,6 +99,9 @@
   }
 
-  bool GraphicsEngine::load()
+  bool GraphicsEngine::load(std::string dataPath)
   {
+    // temporary overwrite of dataPath, change ini file for permanent change
+    if( dataPath != "" )
+      dataPath_ = dataPath;
     loadRessourceLocations(this->dataPath_);
     if (!root_->restoreConfig() && !root_->showConfigDialog())
@@ -103,4 +115,5 @@
     this->renderWindow_ = root_->getAutoCreatedWindow();
     TextureManager::getSingleton().setDefaultNumMipmaps(5);
+    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
     ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
   }
Index: code/branches/network/src/orxonox/GraphicsEngine.h
===================================================================
--- code/branches/network/src/orxonox/GraphicsEngine.h	(revision 925)
+++ code/branches/network/src/orxonox/GraphicsEngine.h	(revision 926)
@@ -14,4 +14,5 @@
 
 #include "OrxonoxPrereqs.h"
+#include "core/BaseObject.h"
 
 
@@ -21,5 +22,6 @@
    * graphics engine manager class
  */
-  class _OrxonoxExport GraphicsEngine {
+  class _OrxonoxExport GraphicsEngine : public BaseObject
+  {
     public:
       GraphicsEngine();
@@ -27,6 +29,7 @@
       // find a better way for this
       inline Ogre::Root* getRoot() { return root_; };
+      void setConfigValues();
       void setup();
-      bool load();
+      bool load(std::string path);
       void loadRessourceLocations(std::string path);
       Ogre::SceneManager* getSceneManager();
@@ -45,4 +48,5 @@
       Ogre::SceneManager* scene_;       //!< scene manager of the game
       Ogre::RenderWindow* renderWindow_;//!< the current render window
+      //bool               bOverwritePath_; //!< overwrites path
 
   };
Index: code/branches/network/src/orxonox/Orxonox.cc
===================================================================
--- code/branches/network/src/orxonox/Orxonox.cc	(revision 925)
+++ code/branches/network/src/orxonox/Orxonox.cc	(revision 926)
@@ -35,11 +35,7 @@
 
 //****** OGRE ******
-#include <OgreException.h>
+//#include <OgreException.h>
 #include <OgreFrameListener.h>
 #include <OgreRoot.h>
-#include <OgreRenderWindow.h>
-#include <OgreTextureManager.h>
-#include <OgreResourceGroupManager.h>
-#include <OgreConfigFile.h>
 #include <OgreOverlay.h>
 #include <OgreOverlayManager.h>
@@ -47,14 +43,12 @@
 #include <OgreWindowEventUtilities.h>
 
-//****** OIS *******
-#include <OIS/OIS.h>
-
 //****** STD *******
-#include <iostream>
-#include <exception>
+//#include <iostream>
+//#include <exception>
+#include <deque>
 
 //***** ORXONOX ****
 //misc
-#include "util/Sleep.h"
+//#include "util/Sleep.h"
 
 // audio
@@ -68,5 +62,4 @@
 
 // objects
-#include "tools/Timer.h"
 #include "core/ArgReader.h"
 #include "core/Debug.h"
@@ -75,4 +68,5 @@
 #include "core/Tickable.h"
 #include "hud/HUD.h"
+#include "tools/Timer.h"
 #include "objects/weapon/BulletManager.h"
 
@@ -83,7 +77,4 @@
 namespace orxonox
 {
-  /// init static singleton reference of Orxonox
-  Orxonox* Orxonox::singletonRef_ = NULL;
-
   /**
    * create a new instance of Orxonox
@@ -94,12 +85,7 @@
     this->dataPath_ = "";
     this->auMan_ = 0;
-    this->singletonRef_ = 0;
-    //this->keyboard_ = 0;
-    //this->mouse_ = 0;
-    //this->inputManager_ = 0;
     this->inputHandler_ = 0;
-    this->frameListener_ = 0;
     this->root_ = 0;
-    // turn frame smoothing on by setting a value different from 0
+    // turn on frame smoothing by setting a value different from 0
     this->frameSmoothingTime_ = 0.0f;
     this->bAbort_ = false;
@@ -126,6 +112,5 @@
     //TODO: give config file to Ogre
     std::string mode;
-    
-    
+
     ArgReader ar = ArgReader(argc, argv);
     ar.checkArgument("mode", mode, false);
@@ -197,5 +182,4 @@
     Factory::createClassHierarchy();
     createScene();
-    setupScene();
     setupInputSystem();
     
@@ -211,5 +195,4 @@
     Factory::createClassHierarchy();
     createScene();
-    setupScene();
     setupInputSystem();
     
@@ -222,7 +205,6 @@
   Orxonox* Orxonox::getSingleton()
   {
-    if (!singletonRef_)
-      singletonRef_ = new Orxonox();
-    return singletonRef_;
+    static Orxonox theOnlyInstance;
+    return &theOnlyInstance;
   }
 
@@ -252,5 +234,5 @@
     ogre_->setup();
     root_ = ogre_->getRoot();
-    if(!ogre_->load()) die(/* unable to load */);
+    if(!ogre_->load(this->dataPath_)) die(/* unable to load */);
     
     server_g = new network::Server();
@@ -267,5 +249,5 @@
     else
       client_g = new network::Client(serverIp_, NETWORK_PORT);
-    if(!ogre_->load()) die(/* unable to load */);
+    if(!ogre_->load(this->dataPath_)) die(/* unable to load */);
   }
   
@@ -277,56 +259,10 @@
     ogre_->setup();
     root_ = ogre_->getRoot();
-    if(!ogre_->load()) die(/* unable to load */);
-  }
-
-  void Orxonox::defineResources()
-  {
-    std::string secName, typeName, archName;
-    Ogre::ConfigFile cf;
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-    cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
-#else
-    cf.load(dataPath_ + "resources.cfg");
-#endif
-
-    Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
-    while (seci.hasMoreElements())
-    {
-      secName = seci.peekNextKey();
-      Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
-      Ogre::ConfigFile::SettingsMultiMap::iterator i;
-      for (i = settings->begin(); i != settings->end(); ++i)
-      {
-        typeName = i->first;
-        archName = i->second;
-#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation( std::string(macBundlePath() + "/" + archName), typeName, secName);
-#else
-        Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
-#endif
-      }
-    }
-  }
-
-  void Orxonox::setupRenderSystem()
-  {
-    if (!root_->restoreConfig() && !root_->showConfigDialog())
-      throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
-  }
-
-  void Orxonox::createRenderWindow()
-  {
-    root_->initialise(true, "OrxonoxV2");
-  }
-
-  void Orxonox::initializeResourceGroups()
-  {
-    Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
-    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
+    if(!ogre_->load(this->dataPath_)) die(/* unable to load */);
   }
 
   void Orxonox::createScene(void)
   {
-	// Init audio
+	  // Init audio
     auMan_ = new audio::AudioManager();
 
@@ -334,11 +270,8 @@
 
     // load this file from config
-//    loader_ = new loader::LevelLoader("sample.oxw");
-//    loader_->loadLevel();
     Level* startlevel = new Level("levels/sample.oxw");
     Loader::open(startlevel);
 
     Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
-    //HUD* orxonoxHud;
     orxonoxHUD_ = new HUD();
     orxonoxHUD_->setEnergyValue(20);
@@ -350,25 +283,6 @@
     auMan_->ambientAdd("a2");
     auMan_->ambientAdd("a3");
-                                //auMan->ambientAdd("ambient1");
+    //auMan->ambientAdd("ambient1");
     auMan_->ambientStart();*/
-  }
-
-
-  void Orxonox::setupScene()
-  {
-//    SceneManager *mgr = ogre_->getSceneManager();
-
-
-//    SceneNode* node = (SceneNode*)mgr->getRootSceneNode()->getChild("OgreHeadNode");
-//     SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
-
-
-/*
-    particle::ParticleInterface *e = new particle::ParticleInterface(mgr,"engine","Orxonox/strahl");
-    e->particleSystem_->setParameter("local_space","true");
-    e->setPositionOfEmitter(0, Vector3(0,-10,0));
-    e->setDirection(Vector3(0,0,-1));
-    e->addToSceneNode(node);
-*/
   }
 
Index: code/branches/network/src/orxonox/Orxonox.h
===================================================================
--- code/branches/network/src/orxonox/Orxonox.h	(revision 925)
+++ code/branches/network/src/orxonox/Orxonox.h	(revision 926)
@@ -9,8 +9,7 @@
 
 #include <string>
-#include <deque>
 
 #include <OgrePrerequisites.h>
-#include <OIS/OISPrereqs.h>
+//#include <OIS/OISPrereqs.h>
 
 #include "OrxonoxPrereqs.h"
@@ -43,6 +42,4 @@
       inline GraphicsEngine* getOgrePointer()              { return ogre_; };
       inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
-      //inline OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
-      //inline OIS::Mouse* getMouse()                        { return this->mouse_; }
       inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
 
@@ -58,13 +55,8 @@
       void clientStart();
       void standaloneStart();
-      void defineResources();
-      void setupRenderSystem();
-      void createRenderWindow();
-      void initializeResourceGroups();
+
       void createScene(void);
-      void setupScene();
       void setupInputSystem();
       void startRenderLoop();
-      void updateTimers(float);
       float calculateEventTime(unsigned long, std::deque<unsigned long>&);
 
@@ -74,13 +66,7 @@
       GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
       std::string           dataPath_;      //!< path to data
-//      loader::LevelLoader*  loader_;        //!< level loader builds the scene
       audio::AudioManager*  auMan_;         //!< audio manager
       BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
-      static Orxonox*       singletonRef_;
       InputHandler*         inputHandler_;
-      //OIS::Keyboard*        keyboard_;
-      //OIS::Mouse*           mouse_;
-      //OIS::InputManager*    inputManager_;
-      OrxListener*          frameListener_;
       Ogre::Root*           root_;
       // TODO: make this a config-value by creating a config class for orxonox
@@ -88,5 +74,5 @@
       // little hack to actually show something dynamic in the HUD
       HUD*                  orxonoxHUD_;
-      bool                  bAbort_;
+      bool                  bAbort_;        //!< aborts the render loop if true
 
       // this is used to identify the mode (server/client/...) we're in
