Index: code/branches/objecthierarchy/src/core/CoreIncludes.h
===================================================================
--- code/branches/objecthierarchy/src/core/CoreIncludes.h	(revision 2082)
+++ code/branches/objecthierarchy/src/core/CoreIncludes.h	(revision 2084)
@@ -46,4 +46,5 @@
 #include "Factory.h"
 #include "ClassFactory.h"
+#include "Functor.h"
 #include "util/Debug.h"
 
@@ -128,3 +129,11 @@
     orxonox::Factory::getIdentifier(networkID)
 
+/**
+    @brief Registers a member function as callback when an object of 'type' is created.
+    @param
+*/
+#define RegisterConstructionCallback(ThisClassName, TargetClassName, FunctionName) \
+    orxonox::ClassIdentifier<TargetClassName>::getIdentifier()->addConstructionCallback( \
+        createFunctor(&ThisClassName::FunctionName)->setObject(this))
+
 #endif /* _CoreIncludes_H__ */
Index: code/branches/objecthierarchy/src/core/Functor.h
===================================================================
--- code/branches/objecthierarchy/src/core/Functor.h	(revision 2082)
+++ code/branches/objecthierarchy/src/core/Functor.h	(revision 2084)
@@ -167,14 +167,16 @@
             }
 
-            void setObject(T* object)
+            FunctorMember* setObject(T* object)
             {
                 this->bConstObject_ = false;
                 this->object_ = object;
+                return this;
             }
 
-            void setObject(const T* object)
+            FunctorMember* setObject(const T* object)
             {
                 this->bConstObject_ = true;
                 this->constObject_ = object;
+                return this;
             }
 
Index: code/branches/objecthierarchy/src/core/Identifier.cc
===================================================================
--- code/branches/objecthierarchy/src/core/Identifier.cc	(revision 2082)
+++ code/branches/objecthierarchy/src/core/Identifier.cc	(revision 2084)
@@ -63,4 +63,5 @@
         this->bHasConfigValues_ = false;
         this->bHasConsoleCommands_ = false;
+        this->bHasConstructionCallback_ = false;
 
         this->children_ = new std::set<const Identifier*>();
@@ -508,4 +509,36 @@
 
     /**
+        @brief Adds a construction callback functor that gets called every time an object is created.
+        @param functor Functor pointer to any function with no argument.
+    */
+    void Identifier::addConstructionCallback(Functor* functor)
+    {
+        for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
+        {
+            if (this->constructionCallbacks_[i] == functor)
+                return;
+        }
+        this->constructionCallbacks_.push_back(functor);
+        this->bHasConstructionCallback_ = true;
+    }
+
+    /**
+        @brief Removes a construction callback functor that gets called every time an object is created.
+        @param functor Functor pointer to any function with no argument.
+    */
+    void Identifier::removeConstructionCallback(Functor* functor)
+    {
+        for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
+        {
+            if (this->constructionCallbacks_[i] == functor)
+            {
+                this->constructionCallbacks_.erase(this->constructionCallbacks_.begin() + i);
+            }
+        }
+        if (constructionCallbacks_.empty())
+            this->bHasConstructionCallback_ = false;
+    }
+
+    /**
         @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
         @param out The outstream
Index: code/branches/objecthierarchy/src/core/Identifier.h
===================================================================
--- code/branches/objecthierarchy/src/core/Identifier.h	(revision 2082)
+++ code/branches/objecthierarchy/src/core/Identifier.h	(revision 2084)
@@ -57,4 +57,5 @@
 #include <set>
 #include <map>
+#include <vector>
 #include <string>
 #include <utility>
@@ -221,4 +222,6 @@
             /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
             inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
+            /** @brief Returns true if this class has at least one construction callback Functor registered. */
+            inline bool hasConstructionCallback() const { return this->bHasConstructionCallback_; }
 
             /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
@@ -247,4 +250,7 @@
             ConsoleCommand* getConsoleCommand(const std::string& name) const;
             ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
+
+            void addConstructionCallback(Functor* functor);
+            void removeConstructionCallback(Functor* functor);
 
             void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
@@ -267,4 +273,7 @@
             /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */
             inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
+
+            bool bHasConstructionCallback_;                                //!< True if at least one Functor is registered to get informed when an object of type T is created.
+            std::vector<Functor*> constructionCallbacks_;                  //!< All construction callback Functors of this class.
 
             ObjectListBase* objects_;                                      //!< The list of all objects of this class
@@ -441,4 +450,11 @@
         COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
         object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
+        if (this->bHasConstructionCallback_)
+        {
+            // Call all registered callbacks that a new object of type T has been created.
+            // Do NOT deliver a T* pointer here because it's way too risky (object not yet fully created).
+            for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
+                (*constructionCallbacks_[i])();
+        }
     }
 
Index: code/branches/objecthierarchy/src/network/packet/Packet.cc
===================================================================
--- code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 2082)
+++ code/branches/objecthierarchy/src/network/packet/Packet.cc	(revision 2084)
@@ -214,4 +214,5 @@
   delete it->second;
   //packetMap_.erase(it);
+  COUT(4) << "PacketMap size: " << packetMap_.size() << std::endl;
 }
 
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc	(revision 2082)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.cc	(revision 2084)
@@ -51,7 +51,10 @@
 #include "core/input/KeyBinder.h"
 #include "core/input/ExtendedInputState.h"
+#include "core/Loader.h"
+#include "core/XMLFile.h"
 #include "overlays/console/InGameConsole.h"
 #include "gui/GUIManager.h"
 #include "tools/WindowEventListener.h"
+#include "objects/Tickable.h"
 #include "Settings.h"
 
@@ -65,4 +68,5 @@
         , renderWindow_(0)
         , viewport_(0)
+        , bWindowEventListenerUpdateRequired_(false)
         , inputManager_(0)
         , console_(0)
@@ -77,4 +81,5 @@
         , statisticsStartCount_(0)
         , tickTime_(0)
+        , debugOverlay_(0)
     {
         RegisterRootObject(GSGraphics);
@@ -114,10 +119,13 @@
         this->initialiseResources();
 
-
-        // HACK: temporary:
-        //graphicsEngine_->renderWindow_  = this->renderWindow_;
-        //graphicsEngine_->root_          = this->ogreRoot_;
-        //graphicsEngine_->viewport_      = this->viewport_;
-
+        // We want to get informed whenever an object of type WindowEventListener is created
+        // in order to later update the window size.
+        bWindowEventListenerUpdateRequired_ = false;
+        RegisterConstructionCallback(GSGraphics, orxonox::WindowEventListener, requestWindowEventListenerUpdate);
+
+        // load debug overlay
+        COUT(3) << "Loading Debug Overlay..." << std::endl;
+        this->debugOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/debug.oxo");
+        Loader::open(debugOverlay_);
 
         // Calls the InputManager which sets up the input devices.
@@ -166,4 +174,7 @@
         //delete this->masterKeyBinder_;
         delete this->inputManager_;
+
+        Loader::unload(this->debugOverlay_);
+        delete this->debugOverlay_;
 
         // destroy render window
@@ -222,4 +233,17 @@
         this->console_->tick(dt);
         this->tickChild(time);
+
+        /*** HACK *** HACK ***/
+        // Call the Tickable objects
+        for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
+            it->tick(time.getDeltaTime());
+        /*** HACK *** HACK ***/
+
+        if (this->bWindowEventListenerUpdateRequired_)
+        {
+            // Update all WindowEventListeners for the case a new one was created.
+            this->windowResized(this->renderWindow_);
+            this->bWindowEventListenerUpdateRequired_ = false;
+        }
 
         unsigned long long timeAfterTick = time.getRealMicroseconds();
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h	(revision 2082)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSGraphics.h	(revision 2084)
@@ -77,7 +77,10 @@
         void windowClosed      (Ogre::RenderWindow* rw);
 
+        void requestWindowEventListenerUpdate() { this->bWindowEventListenerUpdateRequired_ = true; }
+
     private: // variables
         Ogre::RenderWindow*   renderWindow_;          //!< the current render window
         Ogre::Viewport*       viewport_;              //!< default full size viewport
+        bool bWindowEventListenerUpdateRequired_;     //!< True if a new WindowEventListener was created but not yet updated.
 
         // managed singletons
@@ -97,4 +100,5 @@
         unsigned long         statisticsStartCount_;
         unsigned int          tickTime_;
+        XMLFile*              debugOverlay_;
 
         // config values
Index: code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc	(revision 2082)
+++ code/branches/objecthierarchy/src/orxonox/gamestates/GSLevel.cc	(revision 2084)
@@ -163,7 +163,8 @@
     void GSLevel::ticked(const Clock& time)
     {
-        // Call the scene objects
-        for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
-            it->tick(time.getDeltaTime() * this->timeFactor_);
+        // Commented by 1337: Temporarily moved to GSGraphics.
+        //// Call the scene objects
+        //for (ObjectList<Tickable>::iterator it = ObjectList<Tickable>::begin(); it; ++it)
+        //    it->tick(time.getDeltaTime() * this->timeFactor_);
     }
 
Index: code/branches/objecthierarchy/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- code/branches/objecthierarchy/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 2082)
+++ code/branches/objecthierarchy/src/orxonox/overlays/OrxonoxOverlay.cc	(revision 2084)
@@ -76,7 +76,7 @@
         this->overlay_->add2D(this->background_);
 
-        // We'll have to get the aspect ratio manually for the first time. Afterwards windowResized() gets
-        // called automatically by GSGraphics.
-        this->windowAspectRatio_ = Ogre::OverlayManager::getSingleton().getViewportAspectRatio();
+        // We'll have to set the aspect ratio to a default value first.
+        // GSGraphics gets informed about our construction here and can update us in the next tick.
+        this->windowAspectRatio_ = 1.0;
         this->sizeCorrectionChanged();
 
