Index: code/trunk/src/orxonox/overlays/map/Map.cc
===================================================================
--- code/trunk/src/orxonox/overlays/map/Map.cc	(revision 3110)
+++ code/trunk/src/orxonox/overlays/map/Map.cc	(revision 3196)
@@ -24,36 +24,37 @@
  *
  */
+
 #include "Map.h"
 
 #include <string>
-#include "util/String.h"
+
+#include <OgreBorderPanelOverlayElement.h>
+#include <OgreCamera.h>
+#include <OgreEntity.h>
+#include <OgreHardwarePixelBuffer.h>
+#include <OgreMaterialManager.h>
+#include <OgreMovablePlane.h>
+#include <OgreOverlay.h>
+#include <OgreOverlayContainer.h>
+#include <OgreOverlayManager.h>
+#include <OgrePass.h>
+#include <OgreRenderTexture.h>
+#include <OgreResourceGroupManager.h>
+#include <OgreRoot.h>
 #include <OgreSceneManager.h>
 #include <OgreSceneNode.h>
-#include <OgreEntity.h>
-#include <OgreNode.h>
-
-
-#include <OgreRenderWindow.h>
-#include <OgreRenderTexture.h>
+#include <OgreTechnique.h>
 #include <OgreTexture.h>
+#include <OgreTextureManager.h>
 #include <OgreViewport.h>
 
-#include <OgreMaterialManager.h>
-#include <OgreRoot.h>
-#include <OgreHardwarePixelBuffer.h>
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "interfaces/RadarViewable.h"
+#include "objects/Scene.h"
+#include "objects/controllers/HumanController.h"
+#include "objects/worldentities/CameraPosition.h"
 #include "objects/worldentities/ControllableEntity.h"
-#include "objects/worldentities/CameraPosition.h"
-
-#include <OgreOverlay.h>
-#include <OgreMovablePlane.h>
-#include <OgreOverlayElement.h>
-#include <OgreOverlayManager.h>
-#include <OgreOverlayContainer.h>
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/ConsoleCommand.h"
-#include "objects/Scene.h"
-#include "objects/RadarViewable.h"
-#include "objects/controllers/HumanController.h"
 
  namespace orxonox
@@ -264,5 +265,5 @@
     }
 
-    Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, std::string matName)
+    Ogre::MaterialPtr Map::createRenderCamera(Ogre::Camera * cam, const std::string& matName)
     {
         Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual(matName+"_tex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
@@ -400,4 +401,10 @@
     }
 
+    // HACK!
+    void Map::hackDestroyMap()
+    {
+        Map::OverlayMaterial_.setNull();
+    }
+
     void Map::tick(float dt)
     {
Index: code/trunk/src/orxonox/overlays/map/Map.h
===================================================================
--- code/trunk/src/orxonox/overlays/map/Map.h	(revision 3110)
+++ code/trunk/src/orxonox/overlays/map/Map.h	(revision 3196)
@@ -25,26 +25,14 @@
  */
 
-#ifndef _MAP_H__
-#define _MAP_H__
+#ifndef _Map_H__
+#define _Map_H__
 
-#include <string>
 #include "OrxonoxPrereqs.h"
-#include <OgrePrerequisites.h>
-#include <OgreSceneManager.h>
-#include <OgreSceneNode.h>
-#include <OgreEntity.h>
-#include <OgreOverlay.h>
-#include <OgreOverlayElement.h>
-#include <OgreOverlayManager.h>
-#include <OgreOverlayContainer.h>
-#include <OgreMovablePlane.h>
 
-#include <OgreBorderPanelOverlayElement.h>
-#include <OgreTextAreaOverlayElement.h>
+#include <OgreMaterial.h>
 
+#include "util/UtilPrereqs.h"
+#include "interfaces/Tickable.h"
 #include "overlays/OrxonoxOverlay.h"
-#include "objects/Tickable.h"
-
-
 
 namespace orxonox
@@ -55,5 +43,5 @@
     public: // functions
         Map(BaseObject* creator);
-        ~Map();
+        virtual ~Map();
 
         virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
@@ -61,7 +49,9 @@
         virtual void changedOwner();
 
-        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, std::string matName);
+        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName);
 
         static void openMap();
+        // HACK!
+        static void hackDestroyMap();
 
 //Not yet implemented
@@ -126,3 +116,3 @@
 }
 
-#endif /* _MAP_H__ */
+#endif /* _Map_H__ */
