Index: /code/branches/main_reto/bin/resources.cfg
===================================================================
--- /code/branches/main_reto/bin/resources.cfg	(revision 288)
+++ /code/branches/main_reto/bin/resources.cfg	(revision 289)
@@ -8,12 +8,11 @@
 FileSystem=../Media
 FileSystem=../Media/fonts
-FileSystem=../Media/materials/programs
+#FileSystem=../Media/materials/programs
 FileSystem=../Media/materials/scripts
 FileSystem=../Media/materials/textures
 FileSystem=../Media/models
-#FileSystem=../Media/overlays
+FileSystem=../Media/overlay
 #FileSystem=../Media/particle
 FileSystem=../Media/gui
-#FileSystem=../Media/DeferredShadingMedia
 Zip=../Media/packs/cubemap.zip
 #Zip=../Media/packs/cubemapsJS.zip
Index: /code/branches/main_reto/src/CMakeLists.txt
===================================================================
--- /code/branches/main_reto/src/CMakeLists.txt	(revision 288)
+++ /code/branches/main_reto/src/CMakeLists.txt	(revision 289)
@@ -3,5 +3,4 @@
 # create a few variables to simplify life
 SET( ORXONOX_SRC
-	camera_manager.cc
 	inertial_node.cc
 	main.cc
Index: de/branches/main_reto/src/camera_manager.cc
===================================================================
--- /code/branches/main_reto/src/camera_manager.cc	(revision 288)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   License notice:
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OgreSceneManager.h"
-#include "OgreCamera.h"
-
-#include "camera_manager.h"
-
-namespace orxonox {
-  using namespace Ogre;
-
-  CameraManager::CameraManager(SceneManager *mScene) : mSceneMgr(mSceneMgr)
-  {
-  }
-
-
-  CameraManager::~CameraManager()
-  {
-  }
-
-
-  bool CameraManager::setCameraPosition(int n)
-  {
-	  return true;
-  }
-
-}
Index: de/branches/main_reto/src/camera_manager.h
===================================================================
--- /code/branches/main_reto/src/camera_manager.h	(revision 288)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *
- *
- *   License notice:
- *
- *   This program is free software: you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation, either version 3 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-
-#ifndef CAMERA_MANAGER_H
-#define CAMERA_MANAGER_H
-
-#include "OgrePrerequisites.h"
-
-#include "orxonox_prerequisites.h"
-
-
-namespace orxonox {
-
-  class CameraManager
-  {
-  public:
-    CameraManager(Ogre::SceneManager*);
-	  ~CameraManager();
-
-	  bool setCameraPosition(int);
-
-  protected:
-	  Ogre::SceneManager *mSceneMgr;
-	  Ogre::Camera *mCamera;
-  };
-
-}
-
-#endif /* CAMERA_MANAGER_H */
Index: /code/branches/main_reto/src/hud/CMakeLists.txt
===================================================================
--- /code/branches/main_reto/src/hud/CMakeLists.txt	(revision 288)
+++ /code/branches/main_reto/src/hud/CMakeLists.txt	(revision 289)
@@ -4,4 +4,5 @@
 SET( HUD_SRC
 	hud_overlay.cc
+	test_overlay.cc
    )
 
Index: /code/branches/main_reto/src/hud/test_overlay.cc
===================================================================
--- /code/branches/main_reto/src/hud/test_overlay.cc	(revision 289)
+++ /code/branches/main_reto/src/hud/test_overlay.cc	(revision 289)
@@ -0,0 +1,124 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+//#include "OgreMath.h"
+//#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreOverlayManager.h"
+#include "OgreOverlay.h"
+#include "OgreOverlayElement.h"
+#include "OgreRenderWindow.h"
+#include "OgreRenderTarget.h"
+
+#include "test_overlay.h"
+
+
+namespace orxonox {
+namespace hud {
+  using namespace Ogre;
+
+  TestOverlay::TestOverlay(RenderWindow *window)
+    :window_(window)
+  {
+    //TODO: write safe guard
+    overlay_ = OverlayManager::getSingleton().getByName("Core/DebugOverlay");
+  }
+
+
+  TestOverlay::~TestOverlay()
+  {
+  }
+
+
+  void TestOverlay::show()
+  {
+    //TODO: safe guard
+    overlay_->show();
+  }
+
+
+  void TestOverlay::hide()
+  {
+    //TODO: safe guard
+    overlay_->hide();
+  }
+
+
+  void TestOverlay::setDebugText(Ogre::String &str)
+  {
+    debugText_ = str;
+  }
+
+
+  bool TestOverlay::tick(unsigned long, Ogre::Real)
+  {
+    static String currFps = "Current FPS: ";
+    static String avgFps = "Average FPS: ";
+    static String bestFps = "Best FPS: ";
+    static String worstFps = "Worst FPS: ";
+    static String tris = "Triangle Count: ";
+    static String batches = "Batch Count: ";
+
+    // update stats when necessary
+    try {
+      OverlayElement* guiAvg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/AverageFps");
+      OverlayElement* guiCurr = OverlayManager::getSingleton()
+        .getOverlayElement("Core/CurrFps");
+      OverlayElement* guiBest = OverlayManager::getSingleton()
+        .getOverlayElement("Core/BestFps");
+      OverlayElement* guiWorst = OverlayManager::getSingleton()
+        .getOverlayElement("Core/WorstFps");
+
+      const RenderTarget::FrameStats& stats = window_->getStatistics();
+      guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
+      guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
+      guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
+        +" "+StringConverter::toString(stats.bestFrameTime)+" ms");
+      guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
+        +" "+StringConverter::toString(stats.worstFrameTime)+" ms");
+
+      OverlayElement* guiTris = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumTris");
+      guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
+
+      OverlayElement* guiBatches = OverlayManager::getSingleton()
+        .getOverlayElement("Core/NumBatches");
+      guiBatches->setCaption(batches
+        + StringConverter::toString(stats.batchCount));
+
+      OverlayElement* guiDbg = OverlayManager::getSingleton()
+        .getOverlayElement("Core/DebugText");
+      guiDbg->setCaption(debugText_);
+    }
+    catch(...) { /* ignore */ }
+
+    return true;
+  }
+}
+}
Index: /code/branches/main_reto/src/hud/test_overlay.h
===================================================================
--- /code/branches/main_reto/src/hud/test_overlay.h	(revision 289)
+++ /code/branches/main_reto/src/hud/test_overlay.h	(revision 289)
@@ -0,0 +1,69 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ *
+ *   Author:
+ *      HUD design: Yuning Chai
+ *      Implementation: Yuning Chai
+ *   Co-authors:
+ *      Implementation: Reto Grieder
+ *
+ */
+
+
+#ifndef TEST_OVERLAY_H
+#define TEST_OVERLAY_H
+
+#include "OgrePrerequisites.h"
+
+#include "orxonox_prerequisites.h"
+
+
+namespace orxonox {
+namespace hud {
+
+  class TestOverlay
+  {
+  public:
+    TestOverlay(Ogre::RenderWindow*);
+	  virtual ~TestOverlay();
+
+    void show();
+
+    void hide();
+
+    void setDebugText(Ogre::String&);
+
+    bool tick(unsigned long, Ogre::Real);
+
+  protected:
+
+  public:
+
+  protected:
+    Ogre::Overlay *overlay_;
+    Ogre::RenderWindow *window_;
+
+    Ogre::String debugText_;
+
+  };
+}
+}
+
+#endif /* TEST_OVERLAY_H */
Index: /code/branches/main_reto/src/main.cc
===================================================================
--- /code/branches/main_reto/src/main.cc	(revision 288)
+++ /code/branches/main_reto/src/main.cc	(revision 289)
@@ -26,4 +26,6 @@
  */
 
+//#define WITH_HIERARCHY
+
 #include "OgrePlatform.h"
 #include "OgreException.h"
@@ -31,4 +33,5 @@
 #include "orxonox.h"
 
+#ifdef WITH_HIERARCHY
 #include "class_hierarchy/BaseObject.h"
 #include "class_hierarchy/Test.h"
@@ -36,4 +39,5 @@
 #include "class_hierarchy/test2.h"
 #include "class_hierarchy/test3.h"
+#endif
 
 
@@ -50,5 +54,5 @@
 #endif 
   {
-#if 1
+#ifndef WITH_HIERARCHY
     try {
       // create an orxonox application and run it
Index: /code/branches/main_reto/src/orxonox.cc
===================================================================
--- /code/branches/main_reto/src/orxonox.cc	(revision 288)
+++ /code/branches/main_reto/src/orxonox.cc	(revision 289)
@@ -99,5 +99,6 @@
 	  ogre_->initialise();
 
-	  runMgr_ = new RunManager(ogre_);
+    runMgr_ = RunManager::createSingleton();
+    runMgr_->initialise(ogre_);
 
 	  return true;
@@ -113,5 +114,5 @@
 		  delete timer_;
 	  if (runMgr_)
-		  delete runMgr_;
+      RunManager::destroySingleton();
 	  if (ogre_)
 		  delete ogre_;
Index: /code/branches/main_reto/src/orxonox_prerequisites.h
===================================================================
--- /code/branches/main_reto/src/orxonox_prerequisites.h	(revision 288)
+++ /code/branches/main_reto/src/orxonox_prerequisites.h	(revision 289)
@@ -56,4 +56,5 @@
     
     class HUDOverlay;
+    class TestOverlay;
 
   }
Index: /code/branches/main_reto/src/run_manager.cc
===================================================================
--- /code/branches/main_reto/src/run_manager.cc	(revision 288)
+++ /code/branches/main_reto/src/run_manager.cc	(revision 289)
@@ -26,20 +26,16 @@
 
 
-#include "Ogre.h"
-//#include "OgreRoot.h"
-//#include "OgreSceneManager.h"
-//#include "OgreSceneNode.h"
-//#include "OgreCamera.h"
-//#include "OgreViewport.h"
-//#include "OgreRenderWindow.h"
-//#include "OgreOverlay.h"
-//#include "OgreOverlayManager.h"
-//#include "OgreOverlayElement.h"
-//#include "OgreTextureManager.h"
-//#include "OgreMaterialManager.h"
-//#include "OgreLogManager.h"
-//#include "OgreVector3.h"
-//#include "OgreStringConverter.h"
-//#include "OgreWindowEventUtilities.h"
+#include "OgreVector3.h"
+#include "OgreStringConverter.h"
+#include "OgreRoot.h"
+#include "OgreSceneManager.h"
+#include "OgreSceneNode.h"
+#include "OgreCamera.h"
+#include "OgreViewport.h"
+#include "OgreRenderWindow.h"
+#include "OgreTextureManager.h"
+#include "OgreMaterialManager.h"
+#include "OgreLogManager.h"
+#include "OgreWindowEventUtilities.h"
 
 //Use this define to signify OIS will be used as a DLL
@@ -51,5 +47,4 @@
 #include "orxonox_scene.h"
 #include "orxonox_ship.h"
-#include "camera_manager.h"
 #include "inertial_node.h"
 
@@ -59,11 +54,8 @@
 
 #include "hud/hud_overlay.h"
+#include "hud/test_overlay.h"
 
 #include "run_manager.h"
 
-namespace Ogre {
-  using namespace orxonox;
-  template<> RunManager* Singleton<RunManager>::ms_Singleton = 0;
-}
 
 namespace orxonox {
@@ -85,30 +77,26 @@
   */
 
-  RunManager* RunManager::getSingletonPtr(void)
-  {
-      return ms_Singleton;
-  }
-  RunManager& RunManager::getSingleton(void)
-  {  
-      assert( ms_Singleton );  return ( *ms_Singleton );  
-  }
-
-
-  /**
-  * Contructor only needs the render window and the Root object which are both
-  * the OgreControl object.
-  * Right now the constructor does all the initialisation work. This could also
-  * be done in a new method "initialize()", for whatever purpose.
-  * 
-  * 
+
+  RunManager* RunManager::singletonPtr_s = NULL;
+
+
+  /**
+  * Contructor only needs the Root object.
+  */
+  RunManager::RunManager()
+        : ogre_(NULL), window_(NULL), screenShotCounter_(0),
+        timeUntilNextToggle_(0), mouseSensitivity_(0.003), inputManager_(0),
+        mouse_(0), keyboard_(0), joystick_(0), statsOn_(true)
+  {
+  }
+
+  /**
   * @param ogre_ The OgreControl object holding the render window and the Root
   */
-  RunManager::RunManager(OgreControl * ogre)
-        : ogre_(ogre), window_(ogre->getRenderWindow()), //leftButtonDown_(false),
-        statsOn_(true), screenShotCounter_(0), timeUntilNextToggle_(0),
-        filtering_(TFO_BILINEAR), aniso_(1), sceneDetailIndex_(0),
-        mouseSensitivity_(0.003),
-        debugOverlay_(0), inputManager_(0), mouse_(0), keyboard_(0), joystick_(0)
-  {
+  void RunManager::initialise(OgreControl *ogre)
+    {
+    ogre_ = ogre;
+    window_ = ogre->getRenderWindow();
+
     // SETTING UP THE SCENE
 
@@ -129,14 +117,7 @@
 
     // Create a space ship object and its SceneNode.
-    // Some ideas about the steering: The ship should only receive events like
-    // up, down, left, right, roll left, roll right, move down, move up, etc).
-    // Multiple interpretations of these commands would make the game more
-    // but it also makes AI steering more difficult, since for every type of
-    // steering, new methods have to be written.
-    // --> clearly define how a space ship can fly (rolling?, conservation of
-    // impuls?, direct mouse sight steeering?, etc.)
     // It should also be considered, that the ship should provide another Node
     // for a camera to be attached (otherwise the spaceship in front of the
-    // would be very static, never moving at all).
+    // ship would be very static, never moving at all).
 
     // Construct a new spaceship and give it the node
@@ -148,5 +129,5 @@
 
     // load all resources and create the entities by calling the initialise()
-    // methods for each object (don't initialise in the constructor!).
+    // methods for each object (no constructor initialisations!).
     backgroundScene_->initialise();
     playerShip_->initialise();
@@ -154,8 +135,4 @@
 
     // CAMERA AND VIEWPORT
-    // TODO: create a camera manager. It should be able to change its position
-    // around the space ship (predefined states would be nice too). And it should
-    // also be able to switch between different locations (like ship, spactator,
-    // certain fixed positions (e.g. finish line, etc.)). These are just ideas.
 
     // create camera and viewport
@@ -164,5 +141,5 @@
 
     // create HUD
-    hud_ = new HUDOverlay();
+    hud_ = new hud::TestOverlay(window_);
     hud_->show();
 
@@ -171,13 +148,8 @@
     TextureManager::getSingleton().setDefaultNumMipmaps(5);
 
-    
 
     // HUMAN INTERFACE
 
-    using namespace OIS;
-
-    //debugOverlay_ = OverlayManager::getSingleton()
-    //  .getByName("Core/DebugOverlay");
-    
+    using namespace OIS;    
 
     LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
@@ -233,9 +205,11 @@
     if (bulletManager_)
       delete bulletManager_;
-  }
-
-
-  /**
-  * Method to compute anyting between 2 frames.
+    if (hud_)
+      delete hud_;
+  }
+
+
+  /**
+  * Method to compute anything between 2 frames.
   * 
   * Everything that needs to be computed during the games happens right here.
@@ -258,6 +232,14 @@
 
 
-    // Update the 'HUD'
-    //updateStats();
+    // Update the HUD
+    hud_->setDebugText(" | Speed = "
+      + StringConverter::toString(playerShip_->getSpeed())
+      + " | Left Ammo = "
+      + StringConverter::toString(playerShip_
+      ->getMainWeapon()->getAmmoState())
+      + " | Ammo stock = "
+      + StringConverter::toString(playerShip_->getAmmoStock()));
+
+    hud_->tick(time, deltaTime);
 
     // update the bullet positions
@@ -412,30 +394,4 @@
     {
       statsOn_ = !statsOn_;
-      //showDebugOverlay(statsOn_);
-      timeUntilNextToggle_ = 1;
-    }
-
-    if( keyboard_->isKeyDown(KC_T) && timeUntilNextToggle_ <= 0 )
-    {
-      switch(filtering_)
-      {
-      case TFO_BILINEAR:
-        filtering_ = TFO_TRILINEAR;
-        aniso_ = 1;
-        break;
-      case TFO_TRILINEAR:
-        filtering_ = TFO_ANISOTROPIC;
-        aniso_ = 8;
-        break;
-      case TFO_ANISOTROPIC:
-        filtering_ = TFO_BILINEAR;
-        aniso_ = 1;
-        break;
-      default: break;
-      }
-      MaterialManager::getSingleton().setDefaultTextureFiltering(filtering_);
-      MaterialManager::getSingleton().setDefaultAnisotropy(aniso_);
-
-      //showDebugOverlay(statsOn_);
       timeUntilNextToggle_ = 1;
     }
@@ -447,39 +403,5 @@
       window_->writeContentsToFile(ss.str());
       timeUntilNextToggle_ = 0.5;
-      debugText_ = "Saved: " + ss.str();
-    }
-
-    if(keyboard_->isKeyDown(KC_R) && timeUntilNextToggle_ <=0)
-    {
-      sceneDetailIndex_ = (sceneDetailIndex_+1)%3 ;
-      switch(sceneDetailIndex_) {
-          case 0 : camera_->setPolygonMode(PM_SOLID); break;
-          case 1 : camera_->setPolygonMode(PM_WIREFRAME); break;
-          case 2 : camera_->setPolygonMode(PM_POINTS); break;
-      }
-      timeUntilNextToggle_ = 0.5;
-    }
-
-    static bool displayCameraDetails = false;
-    if(keyboard_->isKeyDown(KC_P) && timeUntilNextToggle_ <= 0)
-    {
-      displayCameraDetails = !displayCameraDetails;
-      timeUntilNextToggle_ = 0.5;
-      if (!displayCameraDetails)
-        debugText_ = "";
-    }
-
-    // Print camera details
-    if(displayCameraDetails)
-      debugText_ = " | Speed = "
-            + StringConverter::toString(playerShip_->getSpeed())
-            + " | Left Ammo = "
-            + StringConverter::toString(playerShip_
-            ->getMainWeapon()->getAmmoState())
-            + " | Ammo stock = "
-            + StringConverter::toString(playerShip_->getAmmoStock());
-    // debugText_ = "P: " + StringConverter::toString(camera_
-    //      ->getDerivedPosition()) + " " + "O: "
-    //      + StringConverter::toString(camera_->getDerivedOrientation());
+    }
 
     // Return true to continue rendering
@@ -515,65 +437,16 @@
 
   /**
-  * Show the debug overlay of desired.
+  * Show an overlay desired.
   * @param show Whether or not to show the debug overlay
   */
   void RunManager::showDebugOverlay(bool show)
   {
-    if (debugOverlay_)
+    if (hud_)
     {
       if (show)
-        debugOverlay_->show();
+        hud_->show();
       else
-        debugOverlay_->hide();
-    }
-  }
-
-
-  /**
-  * Show stats (e.g. FPS) in the left lower corner of the screen.
-  * Copied from the ExampleFrameListener.h in the Ogre SDK
-  */
-  void RunManager::updateStats(void)
-  {
-    static String currFps = "Current FPS: ";
-    static String avgFps = "Average FPS: ";
-    static String bestFps = "Best FPS: ";
-    static String worstFps = "Worst FPS: ";
-    static String tris = "Triangle Count: ";
-    static String batches = "Batch Count: ";
-
-    // update stats when necessary
-    try {
-      OverlayElement* guiAvg = OverlayManager::getSingleton()
-        .getOverlayElement("Core/AverageFps");
-      OverlayElement* guiCurr = OverlayManager::getSingleton()
-        .getOverlayElement("Core/CurrFps");
-      OverlayElement* guiBest = OverlayManager::getSingleton()
-        .getOverlayElement("Core/BestFps");
-      OverlayElement* guiWorst = OverlayManager::getSingleton()
-        .getOverlayElement("Core/WorstFps");
-
-      const RenderTarget::FrameStats& stats = window_->getStatistics();
-      guiAvg->setCaption(avgFps + StringConverter::toString(stats.avgFPS));
-      guiCurr->setCaption(currFps + StringConverter::toString(stats.lastFPS));
-      guiBest->setCaption(bestFps + StringConverter::toString(stats.bestFPS)
-        +" "+StringConverter::toString(stats.bestFrameTime)+" ms");
-      guiWorst->setCaption(worstFps + StringConverter::toString(stats.worstFPS)
-        +" "+StringConverter::toString(stats.worstFrameTime)+" ms");
-
-      OverlayElement* guiTris = OverlayManager::getSingleton()
-        .getOverlayElement("Core/NumTris");
-      guiTris->setCaption(tris + StringConverter::toString(stats.triangleCount));
-
-      OverlayElement* guiBatches = OverlayManager::getSingleton()
-        .getOverlayElement("Core/NumBatches");
-      guiBatches->setCaption(batches
-        + StringConverter::toString(stats.batchCount));
-
-      OverlayElement* guiDbg = OverlayManager::getSingleton()
-        .getOverlayElement("Core/DebugText");
-      guiDbg->setCaption(debugText_);
-    }
-    catch(...) { /* ignore */ }
+        hud_->hide();
+    }
   }
 
@@ -581,9 +454,9 @@
   /**
   * Simple camera creator.
-  * playerShip_Node->attachObject(camera_) should no be here! This is what the camera
-  * manager is for. Right now, this method should do just fine, setting the
-  * cam behind the ship.
-  */
-  void RunManager::createCamera(void)
+  * playerShip_Node->attachObject(camera_) should not be here! This is what
+  * the camera manager is for. Right now, this method should do just fine,
+  * setting the cam behind the ship.
+  */
+  void RunManager::createCamera()
   {
     camera_ = sceneMgr_->createCamera("PlayerCam");
@@ -599,5 +472,5 @@
   * camera created so far.
   */
-  void RunManager::createViewports(void)
+  void RunManager::createViewports()
   {
     // Create one viewport, entire window
@@ -610,3 +483,29 @@
   }
 
+
+  RunManager* RunManager::createSingleton()
+  {
+    if (singletonPtr_s)
+      return NULL;
+    singletonPtr_s = new RunManager();
+    return singletonPtr_s;
+  }
+
+  void RunManager::destroySingleton()
+  {
+    if (singletonPtr_s)
+      delete singletonPtr_s;
+  }
+
+
+  RunManager& RunManager::getSingleton()
+  {
+    return *singletonPtr_s;
+  }
+
+  RunManager* RunManager::getSingletonPtr()
+  {
+    return singletonPtr_s;
+  }
+
 }
Index: /code/branches/main_reto/src/run_manager.h
===================================================================
--- /code/branches/main_reto/src/run_manager.h	(revision 288)
+++ /code/branches/main_reto/src/run_manager.h	(revision 289)
@@ -32,6 +32,5 @@
 #include "OgrePrerequisites.h"
 #include "OgreWindowEventUtilities.h"
-#include "OgreTextureManager.h"
-#include "OgreSingleton.h"
+//#include "OgreTextureManager.h"
 
 #include <OIS/OISPrereqs.h>
@@ -44,12 +43,10 @@
   // let the class inherit from WindowEventListener in order for the RunMgr
   // to act as the central point of all the calcuations in Orxonox
-  class RunManager : public Ogre::WindowEventListener,
-                     public Ogre::Singleton<RunManager>
+  class RunManager : public Ogre::WindowEventListener
   {
   public:
-    RunManager(OgreControl*);
-
     virtual ~RunManager();
-    //void initialise(OgreControl*);
+    
+    void initialise(OgreControl*);
 
     bool tick(unsigned long, Ogre::Real);
@@ -65,4 +62,8 @@
     int getNumberOfAmmos();
 
+    static RunManager* createSingleton();
+
+    static void destroySingleton();
+
     static RunManager& getSingleton(void);
 
@@ -71,4 +72,6 @@
 
   protected:
+    RunManager();
+
 	  void createCamera(void);
 
@@ -93,6 +96,4 @@
 	  /** OUTPUT **/
 
-	  void updateStats(void);
-
 	  void showDebugOverlay(bool);
 
@@ -108,5 +109,5 @@
 	  OrxonoxScene *backgroundScene_;
 	  OrxonoxShip  *playerShip_;
-    hud::HUDOverlay   *hud_;
+    hud::TestOverlay *hud_;
 
     // Bullet manager
@@ -121,14 +122,8 @@
     // fields from the example framework
 	  bool statsOn_;
-	  std::string debugText_;
 
 	  unsigned int screenShotCounter_;
 	  // just to stop toggles flipping too fast
 	  Ogre::Real timeUntilNextToggle_;
-	  //bool leftButtonDown_;
-	  Ogre::TextureFilterOptions filtering_;
-	  int aniso_;
-	  int sceneDetailIndex_;
-	  Ogre::Overlay* debugOverlay_;
 
 	  //OIS Input devices
@@ -138,4 +133,7 @@
 	  OIS::JoyStick* joystick_;
 
+    // singleton pointer
+    static RunManager *singletonPtr_s;
+
   };
 
Index: /code/branches/main_reto/src/weapon/barrel_gun.cc
===================================================================
--- /code/branches/main_reto/src/weapon/barrel_gun.cc	(revision 288)
+++ /code/branches/main_reto/src/weapon/barrel_gun.cc	(revision 289)
@@ -95,5 +95,5 @@
   void BarrelGun::primaryFiring(unsigned int time)
   {
-    if (time > 1000/primaryFiringRate_)
+    if (time > (unsigned int)1000/primaryFiringRate_)
     {
       currentState_ = IDLE;
@@ -133,5 +133,5 @@
   void BarrelGun::secondaryFiring(unsigned int time)
   {
-    if (time > 1000/secondaryFiringRate_)
+    if (time > (unsigned int)1000/secondaryFiringRate_)
       currentState_ = IDLE;
   }
