Index: code/branches/objecthierarchy2/src/orxonox/CameraManager.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/CameraManager.cc	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/CameraManager.cc	(revision 2396)
@@ -29,11 +29,15 @@
 #include "CameraManager.h"
 
+#include <OgreSceneManager.h>
 #include <OgreViewport.h>
-#include <OgreSceneManager.h>
 #include <OgreCamera.h>
+#include <OgreCompositorManager.h>
+#include <OgreResource.h>
 
 #include "core/Core.h"
+#include "core/Iterator.h"
 #include "objects/worldentities/Camera.h"
 #include "objects/Scene.h"
+#include "tools/Shader.h"
 #include "util/String.h"
 
@@ -57,8 +61,5 @@
 
         if (this->fallbackCamera_)
-        {
             this->fallbackCamera_->getSceneManager()->destroyCamera(this->fallbackCamera_);
-COUT(0) << "remove camera-manager" << std::endl;
-        }
     }
 
@@ -83,8 +84,7 @@
             this->fallbackCamera_->getSceneManager()->destroyCamera(this->fallbackCamera_);
             this->fallbackCamera_ = 0;
-COUT(0) << "remove fallback camera" << std::endl;
         }
 
-        camera->setFocus(this->viewport_);
+        camera->setFocus();
 
         // make sure we don't add it twice
@@ -110,15 +110,11 @@
             // set new focus if possible
             if (this->cameraList_.size() > 0)
-                this->cameraList_.front()->setFocus(this->viewport_);
+                this->cameraList_.front()->setFocus();
             else
             {
                 // there are no more cameras, create a fallback
                 if (!this->fallbackCamera_)
-                {
-COUT(0) << "create fallback camera" << std::endl;
                     this->fallbackCamera_ = camera->getScene()->getSceneManager()->createCamera(getUniqueNumberString());
-                }
-                this->viewport_->setCamera(this->fallbackCamera_);
-COUT(0) << "use fallback camera" << std::endl;
+                this->useCamera(this->fallbackCamera_);
             }
         }
@@ -128,3 +124,27 @@
         }
     }
+
+    void CameraManager::useCamera(Ogre::Camera* camera)
+    {
+        // This workaround is needed to avoid weird behaviour with active compositors while
+        // switching the camera (like freezing the image)
+        //
+        // Last known Ogre version needing this workaround:
+        // 1.4.8
+
+        // deactivate all compositors
+        {
+            Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator();
+            while (iterator.hasMoreElements())
+                Ogre::CompositorManager::getSingleton().setCompositorEnabled(this->viewport_, iterator.getNext()->getName(), false);
+        }
+
+        this->viewport_->setCamera(camera);
+
+        // reactivate all visible compositors
+        {
+            for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it)
+                it->updateVisibility();
+        }
+    }
 }
Index: code/branches/objecthierarchy2/src/orxonox/CameraManager.h
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/CameraManager.h	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/CameraManager.h	(revision 2396)
@@ -57,4 +57,6 @@
             static CameraManager& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
 
+            void useCamera(Ogre::Camera* camera);
+
         private:
             CameraManager(const CameraManager&);
Index: code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/gamestates/GSLevel.cc	(revision 2396)
@@ -101,9 +101,10 @@
         }
 
+        this->playerManager_ = new PlayerManager();
+
         if (Core::isMaster())
         {
             // create the global LevelManager
             this->levelManager_ = new LevelManager();
-            this->playerManager_ = new PlayerManager();
 
             // reset game speed to normal
Index: code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.cc	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.cc	(revision 2396)
@@ -36,7 +36,4 @@
 #include <OgreSceneManager.h>
 #include <OgreSceneNode.h>
-#include <OgreViewport.h>
-#include <OgreCompositorManager.h>
-#include <OgreResource.h>
 
 #include "util/Exception.h"
@@ -44,5 +41,4 @@
 #include "core/ConfigValueIncludes.h"
 #include "objects/Scene.h"
-#include "tools/Shader.h"
 #include "CameraManager.h"
 
@@ -54,5 +50,5 @@
     {
         RegisterObject(Camera);
-COUT(0) << this << ": created camera" << std::endl;
+
         if (!this->getScene() || !this->getScene()->getSceneManager())
             ThrowException(AbortLoading, "Can't create Camera, no scene or no scene manager given.");
@@ -80,5 +76,4 @@
             this->getScene()->getSceneManager()->destroyCamera(this->camera_);
         }
-COUT(0) << this << ": destroyed camera" << std::endl;
     }
 
@@ -123,32 +118,11 @@
     void Camera::removeFocus()
     {
-COUT(0) << this << ": remove focus" << std::endl;
         this->bHasFocus_ = false;
     }
 
-    void Camera::setFocus(Ogre::Viewport* viewport)
+    void Camera::setFocus()
     {
-        // This workaround is needed to avoid weird behaviour with active compositors while
-        // switching the camera (like freezing the image)
-        //
-        // Last known Ogre version needing this workaround:
-        // 1.4.8
-
-        // deactivate all compositors
-        {
-            Ogre::ResourceManager::ResourceMapIterator iterator = Ogre::CompositorManager::getSingleton().getResourceIterator();
-            while (iterator.hasMoreElements())
-                Ogre::CompositorManager::getSingleton().setCompositorEnabled(viewport, iterator.getNext()->getName(), false);
-        }
-
         this->bHasFocus_ = true;
-        viewport->setCamera(this->camera_);
-COUT(0) << this << ": set focus" << std::endl;
-
-        // reactivate all visible compositors
-        {
-            for (ObjectList<Shader>::iterator it = ObjectList<Shader>::begin(); it != ObjectList<Shader>::end(); ++it)
-                it->updateVisibility();
-        }
+        CameraManager::getInstance().useCamera(this->camera_);
     }
 }
Index: code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.h
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.h	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/objects/worldentities/Camera.h	(revision 2396)
@@ -62,5 +62,5 @@
         private:
             void removeFocus();
-            void setFocus(Ogre::Viewport* viewport);
+            void setFocus();
             void configvaluecallback_changedNearClipDistance();
 
Index: code/branches/objecthierarchy2/src/orxonox/tools/Shader.cc
===================================================================
--- code/branches/objecthierarchy2/src/orxonox/tools/Shader.cc	(revision 2369)
+++ code/branches/objecthierarchy2/src/orxonox/tools/Shader.cc	(revision 2396)
@@ -83,6 +83,6 @@
     Shader::~Shader()
     {
-/*
-        if (this->isInitialized() && this->bLoadCompositor_ && this->compositor_ != "")
+
+        if (this->bLoadCompositor_ && this->compositorInstance_)
         {
             Ogre::Viewport* viewport = GraphicsEngine::getInstance().getViewport();
@@ -90,5 +90,5 @@
             Ogre::CompositorManager::getSingleton().removeCompositor(viewport, this->compositor_);
         }
-*/
+
     }
 
