Index: code/trunk/cmake/BuildConfig.cmake
===================================================================
--- code/trunk/cmake/BuildConfig.cmake	(revision 5692)
+++ code/trunk/cmake/BuildConfig.cmake	(revision 5693)
@@ -31,4 +31,5 @@
 SET(DEFAULT_LIBRARY_PATH lib)
 SET(DEFAULT_ARCHIVE_PATH lib/static)
+SET(DEFAULT_MODULE_PATH  lib/modules)
 SET(DEFAULT_DOC_PATH     doc)
 SET(DEFAULT_MEDIA_PATH   media)
@@ -40,4 +41,5 @@
 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_LIBRARY_PATH})
 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${DEFAULT_ARCHIVE_PATH})
+SET(CMAKE_MODULE_OUTPUT_DIRECTORY  ${CMAKE_BINARY_DIR}/${DEFAULT_MODULE_PATH})
 # Do not set doc and media, rather check in the two subdirectories
 # whether they concur with the DEFAULT_..._PATH
@@ -70,4 +72,6 @@
 ENDIF()
 
+# Set the extension of the dynamic modules
+SET(ORXONOX_MODULE_EXTENSION ".module")
 
 ################# OGRE Plugins ##################
@@ -132,4 +136,5 @@
   SET(ORXONOX_LIBRARY_INSTALL_PATH ${DEFAULT_LIBRARY_PATH})
   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${DEFAULT_ARCHIVE_PATH})
+  SET(ORXONOX_MODULE_INSTALL_PATH  ${DEFAULT_MODULE_PATH})
   SET(ORXONOX_DOC_INSTALL_PATH     ${DEFAULT_DOC_PATH})
   SET(ORXONOX_MEDIA_INSTALL_PATH   ${DEFAULT_MEDIA_PATH})
@@ -142,4 +147,5 @@
   SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox)
   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/lib/orxonox/static)
+  SET(ORXONOX_MODULE_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/lib/orxonox/modules)
   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
@@ -152,4 +158,5 @@
   SET(ORXONOX_LIBRARY_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_LIBRARY_PATH})
   SET(ORXONOX_ARCHIVE_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}/${DEFAULT_ARCHIVE_PATH})
+  SET(ORXONOX_MODULE_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MODULE_PATH})
   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/${DEFAULT_DOC_PATH})
   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/${DEFAULT_MEDIA_PATH})
@@ -167,5 +174,5 @@
 # when building, don't use the install RPATH already
 # (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
+SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
 
 # the RPATH to be used when installing
Index: code/trunk/cmake/TargetUtilities.cmake
===================================================================
--- code/trunk/cmake/TargetUtilities.cmake	(revision 5692)
+++ code/trunk/cmake/TargetUtilities.cmake	(revision 5693)
@@ -24,4 +24,6 @@
  #    accepts a lot more input information. Simply supply the keywords
  #    described below in any order you wish.
+ #    The output is then stored in "_arg_ARGNAME" where ARGNAME is the the
+ #    name of the switch or list.
  #
  #    Switches: (when given --> TRUE, FALSE otherwise)
@@ -33,7 +35,10 @@
  #      NO_SOURCE_GROUPS:  Don't create msvc source groups
  #      STATIC/SHARED:     Inherited from ADD_LIBRARY
+ #      MODULE:            For dynamic module libraries
  #      WIN32:             Inherited from ADD_EXECUTABLE
  #      PCH_NO_DEFAULT:    Do not make precompiled header files default if
  #                         specified with PCH_FILE
+ #      NO_INSTALL:        Do not install the target at all
+ #
  #    Lists:
  #      LINK_LIBRARIES:    Redirects to TARGET_LINK_LIBRARIES
@@ -44,4 +49,5 @@
  #      PCH_FILE:          Precompiled header file
  #      PCH_EXCLUDE:       Source files to be excluded from PCH support
+ #      OUTPUT_NAME:       If you want a different name than the target name
  #  Note:
  #    This function also installs the target!
@@ -75,7 +81,7 @@
   SET(_switches   FIND_HEADER_FILES  EXCLUDE_FROM_ALL  ORXONOX_EXTERNAL
                   NO_DLL_INTERFACE   NO_SOURCE_GROUPS  ${_additional_switches}
-                  PCH_NO_DEFAULT NO_INSTALL)
+                  PCH_NO_DEFAULT     NO_INSTALL        MODULE)
   SET(_list_names LINK_LIBRARIES  VERSION   SOURCE_FILES  DEFINE_SYMBOL
-                  TOLUA_FILES     PCH_FILE  PCH_EXCLUDE)
+                  TOLUA_FILES     PCH_FILE  PCH_EXCLUDE OUTPUT_NAME)
   PARSE_MACRO_ARGUMENTS("${_switches}" "${_list_names}" ${ARGN})
 
@@ -142,4 +148,11 @@
   ENDIF()
 
+  # MODULE A
+  # Always create shared libraries
+  IF(_arg_MODULE)
+    SET(_arg_SHARED SHARED)
+    SET(_arg_STATIC)
+  ENDIF()
+
   # Add the library/executable
   IF("${_target_type}" STREQUAL "LIBRARY")
@@ -151,4 +164,13 @@
   ENDIF()
 
+  # MODULE B
+  IF (_arg_MODULE)
+    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES
+      RUNTIME_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Windows
+      LIBRARY_OUTPUT_DIRECTORY ${CMAKE_MODULE_OUTPUT_DIRECTORY} # Unix
+    )
+    ADD_MODULE(${_target_name})
+  ENDIF()
+
   # LINK_LIBRARIES
   IF(_arg_LINK_LIBRARIES)
@@ -168,4 +190,9 @@
   ENDIF()
 
+  # OUTPUT_NAME
+  IF(_arg_OUTPUT_NAME)
+    SET_TARGET_PROPERTIES(${_target_name} PROPERTIES OUTPUT_NAME  ${_arg_OUTPUT_NAME})
+  ENDIF()
+
   # Second part of precompiled header files
   IF(PCH_COMPILER_SUPPORT AND PCH_ENABLE_${_target_name_upper} AND _arg_PCH_FILE)
@@ -174,10 +201,51 @@
 
   IF(NOT _arg_STATIC AND NOT _arg_NO_INSTALL)
-    INSTALL(TARGETS ${_target_name}
-      RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
-      LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH}
-      #ARCHIVE DESTINATION ${ORXONOX_ARCHIVE_INSTALL_PATH}
+    IF(_arg_MODULE)
+      INSTALL(TARGETS ${_target_name}
+        RUNTIME DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
+        LIBRARY DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
+      )
+    ELSE()
+      INSTALL(TARGETS ${_target_name}
+        RUNTIME DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
+        LIBRARY DESTINATION ${ORXONOX_LIBRARY_INSTALL_PATH}
+      )
+    ENDIF()
+  ENDIF()
+
+ENDFUNCTION(TU_ADD_TARGET)
+
+
+# Creates a helper file with name <name_of_the_library>.module
+# This helps finding dynamically loadable modules at runtime
+
+FUNCTION(ADD_MODULE _target)
+  # We use the properties to get the name because the librarys name may differ from
+  # the target name (for example orxonox <-> liborxonox)
+
+  GET_TARGET_PROPERTY(_target_loc ${_target} LOCATION)
+  GET_FILENAME_COMPONENT(_target_name ${_target_loc} NAME_WE)
+
+  IF(CMAKE_CONFIGURATION_TYPES)
+    FOREACH(_config ${CMAKE_CONFIGURATION_TYPES})
+      SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_config}/${_target_name}${ORXONOX_MODULE_EXTENSION})
+
+      FILE(WRITE ${_module_filename})
+
+      INSTALL(
+        FILES ${_module_filename}
+        DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
+        CONFIGURATIONS ${_config}
+      )
+    ENDFOREACH()
+  ELSE()
+    SET(_module_filename ${CMAKE_MODULE_OUTPUT_DIRECTORY}/${_target_name}${ORXONOX_MODULE_EXTENSION})
+
+    FILE(WRITE ${_module_filename})
+
+    INSTALL(
+      FILES ${_module_filename}
+      DESTINATION ${ORXONOX_MODULE_INSTALL_PATH}
     )
   ENDIF()
-
-ENDFUNCTION(TU_ADD_TARGET)
+ENDFUNCTION(ADD_MODULE)
Index: code/trunk/src/SpecialConfig.h.in
===================================================================
--- code/trunk/src/SpecialConfig.h.in	(revision 5692)
+++ code/trunk/src/SpecialConfig.h.in	(revision 5693)
@@ -74,4 +74,5 @@
     // INSTALLATION PATHS
     const char ORXONOX_RUNTIME_INSTALL_PATH[] = "@ORXONOX_RUNTIME_INSTALL_PATH@";
+    const char ORXONOX_MODULE_INSTALL_PATH[]  = "@ORXONOX_MODULE_INSTALL_PATH@";
     const char ORXONOX_MEDIA_INSTALL_PATH[]   = "@ORXONOX_MEDIA_INSTALL_PATH@";
     /* Config and Log path might be relative because they could be user and therefore runtime dependent */
@@ -82,7 +83,9 @@
     const char ORXONOX_MEDIA_DEV_PATH[]       = "@CMAKE_MEDIA_OUTPUT_DIRECTORY@";
 #ifdef CMAKE_CONFIGURATION_TYPES
+    const char ORXONOX_MODULE_DEV_PATH[]      = "@CMAKE_MODULE_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
     const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@/" BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
     const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@/"    BOOST_PP_STRINGIZE(CMAKE_BUILD_TYPE);
 #else
+    const char ORXONOX_MODULE_DEV_PATH[]      = "@CMAKE_MODULE_OUTPUT_DIRECTORY@";
     const char ORXONOX_CONFIG_DEV_PATH[]      = "@CMAKE_CONFIG_OUTPUT_DIRECTORY@";
     const char ORXONOX_LOG_DEV_PATH[]         = "@CMAKE_LOG_OUTPUT_DIRECTORY@";
@@ -91,4 +94,7 @@
     const char ORXONOX_DEP_LIB_PATH[]         = "@DEP_LIBRARY_DIR@";
 #endif
+
+    // Module extension
+    const char ORXONOX_MODULE_EXTENSION[]     = "@ORXONOX_MODULE_EXTENSION@";
 
     // OGRE PLUGINS
Index: code/trunk/src/core/CMakeLists.txt
===================================================================
--- code/trunk/src/core/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/core/CMakeLists.txt	(revision 5693)
@@ -23,4 +23,6 @@
   ConfigValueContainer.cc
   Core.cc
+  DynLib.cc
+  DynLibManager.cc
   Event.cc
   Game.cc
Index: code/trunk/src/core/Core.cc
===================================================================
--- code/trunk/src/core/Core.cc	(revision 5692)
+++ code/trunk/src/core/Core.cc	(revision 5693)
@@ -40,4 +40,5 @@
 #include <cstdlib>
 #include <cstdio>
+#include <boost/version.hpp>
 #include <boost/filesystem.hpp>
 #include <OgreRenderWindow.h>
@@ -68,4 +69,5 @@
 #include "ConfigValueIncludes.h"
 #include "CoreIncludes.h"
+#include "DynLibManager.h"
 #include "Factory.h"
 #include "GameMode.h"
@@ -80,4 +82,11 @@
 #include "input/InputManager.h"
 
+// Boost 1.36 has some issues with deprecated functions that have been omitted
+#if (BOOST_VERSION == 103600)
+#  define BOOST_LEAF_FUNCTION filename
+#else
+#  define BOOST_LEAF_FUNCTION leaf
+#endif
+
 namespace orxonox
 {
@@ -241,4 +250,5 @@
         boost::filesystem::path rootPath_;
         boost::filesystem::path executablePath_;        //!< Path to the executable
+        boost::filesystem::path modulePath_;            //!< Path to the modules
         boost::filesystem::path mediaPath_;             //!< Path to the media file folder
         boost::filesystem::path configPath_;            //!< Path to the config file folder
@@ -256,16 +266,73 @@
         , bGraphicsLoaded_(false)
     {
-        // Parse command line arguments first
+        // Set the hard coded fixed paths
+        this->setFixedPaths();
+
+        // Create a new dynamic library manager
+        this->dynLibManager_.reset(new DynLibManager());
+
+        // Load modules
+        try
+        {
+            // We search for helper files with the following extension
+            std::string moduleextension = ORXONOX_MODULE_EXTENSION;
+            size_t moduleextensionlength = moduleextension.size();
+
+            // Search in the directory of our executable
+            boost::filesystem::path searchpath = this->configuration_->modulePath_;
+
+            // Add that path to the PATH variable in case a module depends on another one
+            std::string pathVariable = getenv("PATH");
+            putenv(const_cast<char*>(("PATH=" + pathVariable + ";" + configuration_->modulePath_.string()).c_str()));
+
+            boost::filesystem::directory_iterator file(searchpath);
+            boost::filesystem::directory_iterator end;
+
+            // Iterate through all files
+            while (file != end)
+            {
+                std::string filename = file->BOOST_LEAF_FUNCTION();
+
+                // Check if the file ends with the exension in question
+                if (filename.size() > moduleextensionlength)
+                {
+                    if (filename.substr(filename.size() - moduleextensionlength) == moduleextension)
+                    {
+                        // We've found a helper file - now load the library with the same name
+                        std::string library = filename.substr(0, filename.size() - moduleextensionlength);
+                        boost::filesystem::path librarypath = searchpath / library;
+
+                        try
+                        {
+                            DynLibManager::getInstance().load(librarypath.string());
+                        }
+                        catch (const std::exception& e)
+                        {
+                            COUT(1) << "Couldn't load module \"" << librarypath.string() << "\": " << e.what() << std::endl;
+                        }
+                        catch (...)
+                        {
+                            COUT(1) << "Couldn't load module \"" << librarypath.string() << "\"" << std::endl;
+                        }
+                    }
+                }
+
+                ++file;
+            }
+        }
+        catch (const std::exception& e)
+        {
+            COUT(1) << "An error occurred while loading modules: " << e.what() << std::endl;
+        }
+        catch (...)
+        {
+            COUT(1) << "An error occurred while loading modules." << std::endl;
+        }
+
+        // Parse command line arguments AFTER the modules have been loaded (static code!)
         CommandLine::parseCommandLine(cmdLine);
 
-        // Determine and set the location of the executable
-        setExecutablePath();
-
-        // Determine whether we have an installed or a binary dir run
-        // The latter occurs when simply running from the build directory
-        checkDevBuild();
-
-        // Make sure the directories we write in exist or else make them
-        createDirectories();
+        // Set configurable paths like log, config and media
+        this->setConfigurablePaths();
 
         // create a signal handler (only active for linux)
@@ -507,8 +574,17 @@
     /**
     @brief
-        Compares the executable path with the working directory
-    */
-    void Core::setExecutablePath()
-    {
+        Retrievs the executable path and sets all hard coded fixed path (currently only the module path)
+        Also checks for "orxonox_dev_build.keep_me" in the executable diretory.
+        If found it means that this is not an installed run, hence we
+        don't write the logs and config files to ~/.orxonox
+    @throw
+        GeneralException
+    */
+    void Core::setFixedPaths()
+    {
+        //////////////////////////
+        // FIND EXECUTABLE PATH //
+        //////////////////////////
+
 #ifdef ORXONOX_PLATFORM_WINDOWS
         // get executable module
@@ -553,27 +629,20 @@
         configuration_->executablePath_ = configuration_->executablePath_.branch_path(); // remove executable name
 #endif
-    }
-
-    /**
-    @brief
-        Checks for "orxonox_dev_build.keep_me" in the executable diretory.
-        If found it means that this is not an installed run, hence we
-        don't write the logs and config files to ~/.orxonox
-    @throws
-        GeneralException
-    */
-    void Core::checkDevBuild()
-    {
+
+        /////////////////////
+        // SET MODULE PATH //
+        /////////////////////
+
         if (boost::filesystem::exists(configuration_->executablePath_ / "orxonox_dev_build.keep_me"))
         {
             COUT(1) << "Running from the build tree." << std::endl;
             Core::bDevRun_ = true;
-            configuration_->mediaPath_  = ORXONOX_MEDIA_DEV_PATH;
-            configuration_->configPath_ = ORXONOX_CONFIG_DEV_PATH;
-            configuration_->logPath_    = ORXONOX_LOG_DEV_PATH;
+            configuration_->modulePath_ = ORXONOX_MODULE_DEV_PATH;
         }
         else
         {
+
 #ifdef INSTALL_COPYABLE // --> relative paths
+
             // Also set the root path
             boost::filesystem::path relativeExecutablePath(ORXONOX_RUNTIME_INSTALL_PATH);
@@ -585,10 +654,42 @@
                 ThrowException(General, "Could not derive a root directory. Might the binary installation directory contain '..' when taken relative to the installation prefix path?");
 
+            // Module path is fixed as well
+            configuration_->modulePath_ = configuration_->rootPath_ / ORXONOX_MODULE_INSTALL_PATH;
+
+#else
+
+            // There is no root path, so don't set it at all
+            // Module path is fixed as well
+            configuration_->modulePath_ = ORXONOX_MODULE_INSTALL_PATH;
+
+#endif
+        }
+    }
+
+    /**
+    @brief
+        Sets config, log and media path and creates folders if necessary.
+    @throws
+        GeneralException
+    */
+    void Core::setConfigurablePaths()
+    {
+        if (Core::isDevelopmentRun())
+        {
+            configuration_->mediaPath_  = ORXONOX_MEDIA_DEV_PATH;
+            configuration_->configPath_ = ORXONOX_CONFIG_DEV_PATH;
+            configuration_->logPath_    = ORXONOX_LOG_DEV_PATH;
+        }
+        else
+        {
+
+#ifdef INSTALL_COPYABLE // --> relative paths
+
             // Using paths relative to the install prefix, complete them
             configuration_->mediaPath_  = configuration_->rootPath_ / ORXONOX_MEDIA_INSTALL_PATH;
             configuration_->configPath_ = configuration_->rootPath_ / ORXONOX_CONFIG_INSTALL_PATH;
             configuration_->logPath_    = configuration_->rootPath_ / ORXONOX_LOG_INSTALL_PATH;
+
 #else
-            // There is no root path, so don't set it at all
 
             configuration_->mediaPath_  = ORXONOX_MEDIA_INSTALL_PATH;
@@ -607,5 +708,7 @@
             configuration_->configPath_ = userDataPath / ORXONOX_CONFIG_INSTALL_PATH;
             configuration_->logPath_    = userDataPath / ORXONOX_LOG_INSTALL_PATH;
-#endif
+
+#endif
+
         }
 
@@ -617,15 +720,6 @@
             configuration_->logPath_    = configuration_->logPath_    / directory;
         }
-    }
-
-    /*
-    @brief
-        Checks for the log and the config directory and creates them
-        if necessary. Otherwise me might have problems opening those files.
-    @throws
-        orxonox::GeneralException if the directory to be created is a file.
-    */
-    void Core::createDirectories()
-    {
+
+        // Create directories to avoid problems when opening files in non existent folders.
         std::vector<std::pair<boost::filesystem::path, std::string> > directories;
         directories.push_back(std::make_pair(boost::filesystem::path(configuration_->configPath_), "config"));
Index: code/trunk/src/core/Core.h
===================================================================
--- code/trunk/src/core/Core.h	(revision 5692)
+++ code/trunk/src/core/Core.h	(revision 5693)
@@ -114,10 +114,10 @@
             Core(const Core&); //!< Don't use (undefined symbol)
 
-            void checkDevBuild();
-            void setExecutablePath();
-            void createDirectories();
+            void setFixedPaths();
+            void setConfigurablePaths();
             void setThreadAffinity(int limitToCPU);
 
             // Mind the order for the destruction!
+            scoped_ptr<DynLibManager>     dynLibManager_;
             scoped_ptr<SignalHandler>     signalHandler_;
             SimpleScopeGuard              identifierDestroyer_;
Index: code/trunk/src/core/CorePrereqs.h
===================================================================
--- code/trunk/src/core/CorePrereqs.h	(revision 5692)
+++ code/trunk/src/core/CorePrereqs.h	(revision 5693)
@@ -112,4 +112,6 @@
     class ConsoleCommand;
     class Core;
+    class DynLib;
+    class DynLibManager;
     struct Event;
     class EventContainer;
Index: code/trunk/src/core/DynLib.cc
===================================================================
--- code/trunk/src/core/DynLib.cc	(revision 5693)
+++ code/trunk/src/core/DynLib.cc	(revision 5693)
@@ -0,0 +1,134 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// 08/11/2009: Small adjustments for Orxonox by Fabian 'x3n' Landau
+
+#include "DynLib.h"
+
+#include "util/Exception.h"
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
+#  define WIN32_LEAN_AND_MEAN
+#  ifndef NOMINMAX
+#    define NOMINMAX // required to stop windows.h messing up std::min
+#  endif
+#  include <windows.h>
+#endif
+
+#ifdef ORXONOX_PLATFORM_APPLE
+#   include "macPlugins.h"
+#endif
+
+namespace orxonox
+{
+    //-----------------------------------------------------------------------
+    DynLib::DynLib( const std::string& name )
+    {
+        mName = name;
+        m_hInst = NULL;
+    }
+
+    //-----------------------------------------------------------------------
+    DynLib::~DynLib()
+    {
+    }
+
+    //-----------------------------------------------------------------------
+    void DynLib::load()
+    {
+        // Log library load
+        COUT(2) << "Loading module " << mName << std::endl;
+
+		std::string name = mName;
+#ifdef ORXONOX_PLATFORM_LINUX
+        // dlopen() does not add .so to the filename, like windows does for .dll
+        if (name.substr(name.length() - 3, 3) != ".so")
+           name += ".so";
+#endif
+
+        m_hInst = (DYNLIB_HANDLE)DYNLIB_LOAD( name.c_str() );
+
+        if( !m_hInst )
+            ThrowException(
+                General,
+                "Could not load dynamic library " + mName +
+                ".  System Error: " + dynlibError());
+    }
+
+    //-----------------------------------------------------------------------
+    void DynLib::unload()
+    {
+        // Log library unload
+        COUT(4) << "Unloading module " << mName << std::endl;
+
+        if( DYNLIB_UNLOAD( m_hInst ) )
+		{
+            ThrowException(
+                General,
+                "Could not unload dynamic library " + mName +
+                ".  System Error: " + dynlibError());
+		}
+
+    }
+
+    //-----------------------------------------------------------------------
+    void* DynLib::getSymbol( const std::string& strName ) const throw()
+    {
+        return (void*)DYNLIB_GETSYM( m_hInst, strName.c_str() );
+    }
+    //-----------------------------------------------------------------------
+    std::string DynLib::dynlibError( void )
+    {
+#if defined(ORXONOX_PLATFORM_WINDOWS)
+        LPVOID lpMsgBuf;
+        FormatMessage(
+            FORMAT_MESSAGE_ALLOCATE_BUFFER |
+            FORMAT_MESSAGE_FROM_SYSTEM |
+            FORMAT_MESSAGE_IGNORE_INSERTS,
+            NULL,
+            GetLastError(),
+            MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+            (LPTSTR) &lpMsgBuf,
+            0,
+            NULL
+            );
+        std::string ret = (char*)lpMsgBuf;
+        // Free the buffer.
+        LocalFree( lpMsgBuf );
+        return ret;
+#elif defined(ORXONOX_PLATFORM_LINUX)
+        return std::string(dlerror());
+#elif defined(ORXONOX_PLATFORM_APPLE)
+        return std::string(mac_errorBundle());
+#else
+        return std::string("");
+#endif
+    }
+
+}
Index: code/trunk/src/core/DynLib.h
===================================================================
--- code/trunk/src/core/DynLib.h	(revision 5693)
+++ code/trunk/src/core/DynLib.h	(revision 5693)
@@ -0,0 +1,121 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// 08/11/2009: Small adjustments for Orxonox by Fabian 'x3n' Landau
+
+#ifndef _Core_DynLib_H__
+#define _Core_DynLib_H__
+
+#include "CorePrereqs.h"
+
+#include <string>
+
+#if defined(ORXONOX_PLATFORM_WINDOWS)
+#    define DYNLIB_HANDLE hInstance
+#    define DYNLIB_LOAD( a ) LoadLibraryEx( a, NULL, LOAD_WITH_ALTERED_SEARCH_PATH )
+#    define DYNLIB_GETSYM( a, b ) GetProcAddress( a, b )
+#    define DYNLIB_UNLOAD( a ) !FreeLibrary( a )
+
+struct HINSTANCE__;
+typedef struct HINSTANCE__* hInstance;
+
+#elif defined(ORXONOX_PLATFORM_LINUX)
+#    define DYNLIB_HANDLE void*
+#    define DYNLIB_LOAD( a ) dlopen( a, RTLD_LAZY | RTLD_GLOBAL)
+#    define DYNLIB_GETSYM( a, b ) dlsym( a, b )
+#    define DYNLIB_UNLOAD( a ) dlclose( a )
+
+#elif defined(ORXONOX_PLATFORM_APPLE)
+#    define DYNLIB_HANDLE CFBundleRef
+#    define DYNLIB_LOAD( a ) mac_loadExeBundle( a )
+#    define DYNLIB_GETSYM( a, b ) mac_getBundleSym( a, b )
+#    define DYNLIB_UNLOAD( a ) mac_unloadExeBundle( a )
+#endif
+
+namespace orxonox
+{
+    /** Resource holding data about a dynamic library.
+        @remarks
+            This class holds the data required to get symbols from
+            libraries loaded at run-time (i.e. from DLL's for so's)
+        @author
+            Adrian Cearnãu (cearny@cearny.ro)
+        @since
+            27 January 2002
+        @see
+            Resource
+    */
+	class _CoreExport DynLib
+    {
+	protected:
+		std::string mName;
+        /// Gets the last loading error
+        std::string dynlibError(void);
+    public:
+        /** Default constructor - used by DynLibManager.
+            @warning
+                Do not call directly
+        */
+        DynLib( const std::string& name );
+
+        /** Default destructor.
+        */
+        ~DynLib();
+
+        /** Load the library
+        */
+        void load();
+        /** Unload the library
+        */
+        void unload();
+		/// Get the name of the library
+		const std::string& getName(void) const { return mName; }
+
+        /**
+            Returns the address of the given symbol from the loaded library.
+            @param
+                strName The name of the symbol to search for
+            @returns
+                If the function succeeds, the returned value is a handle to
+                the symbol.
+            @par
+                If the function fails, the returned value is <b>NULL</b>.
+
+        */
+        void* getSymbol( const std::string& strName ) const throw();
+
+    protected:
+
+        /// Handle to the loaded library.
+        DYNLIB_HANDLE m_hInst;
+    };
+
+}
+
+#endif /* _Core_DynLib_H__ */
Index: code/trunk/src/core/DynLibManager.cc
===================================================================
--- code/trunk/src/core/DynLibManager.cc	(revision 5693)
+++ code/trunk/src/core/DynLibManager.cc	(revision 5693)
@@ -0,0 +1,86 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// 08/11/2009: Small adjustments for Orxonox by Fabian 'x3n' Landau
+
+#include "DynLibManager.h"
+
+#include "DynLib.h"
+
+namespace orxonox
+{
+    //-----------------------------------------------------------------------
+    //! Static pointer to the singleton
+    DynLibManager* DynLibManager::singletonPtr_s  = 0;
+
+    //-----------------------------------------------------------------------
+	DynLibManager::DynLibManager()
+	{
+	}
+	//-----------------------------------------------------------------------
+    DynLib* DynLibManager::load( const std::string& filename)
+    {
+		DynLibList::iterator i = mLibList.find(filename);
+		if (i != mLibList.end())
+		{
+			return i->second;
+		}
+		else
+		{
+	        DynLib* pLib = new DynLib(filename);
+			pLib->load();
+        	mLibList[filename] = pLib;
+	        return pLib;
+		}
+    }
+	//-----------------------------------------------------------------------
+	void DynLibManager::unload(DynLib* lib)
+	{
+		DynLibList::iterator i = mLibList.find(lib->getName());
+		if (i != mLibList.end())
+		{
+			mLibList.erase(i);
+		}
+		lib->unload();
+		delete lib;
+	}
+	//-----------------------------------------------------------------------
+    DynLibManager::~DynLibManager()
+    {
+        // Unload & delete resources in turn
+        for( DynLibList::iterator it = mLibList.begin(); it != mLibList.end(); ++it )
+        {
+            it->second->unload();
+            delete it->second;
+        }
+
+        // Empty the list
+        mLibList.clear();
+    }
+}
Index: code/trunk/src/core/DynLibManager.h
===================================================================
--- code/trunk/src/core/DynLibManager.h	(revision 5693)
+++ code/trunk/src/core/DynLibManager.h	(revision 5693)
@@ -0,0 +1,87 @@
+/*
+-----------------------------------------------------------------------------
+This source file is part of OGRE
+    (Object-oriented Graphics Rendering Engine)
+For the latest info, see http://www.ogre3d.org/
+
+Copyright (c) 2000-2006 Torus Knot Software Ltd
+Also see acknowledgements in Readme.html
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free Software
+Foundation; either version 2 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 Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA 02111-1307, USA, or go to
+http://www.gnu.org/copyleft/lesser.txt.
+
+You may alternatively use this source under the terms of a specific version of
+the OGRE Unrestricted License provided you have obtained such a license from
+Torus Knot Software Ltd.
+-----------------------------------------------------------------------------
+*/
+
+// 08/11/2009: Small adjustments for Orxonox by Fabian 'x3n' Landau
+
+#ifndef _Core_DynLibManager_H__
+#define _Core_DynLibManager_H__
+
+#include "CorePrereqs.h"
+#include "util/Singleton.h"
+
+namespace orxonox
+{
+    /** Manager for Dynamic-loading Libraries.
+        @remarks
+            This manager keeps a track of all the open dynamic-loading
+            libraries, opens them and returns references to already-open
+            libraries.
+    */
+    class _CoreExport DynLibManager: public Singleton<DynLibManager>
+    {
+        friend class Singleton<DynLibManager>;
+
+        protected:
+            typedef std::map<std::string, DynLib*> DynLibList;
+            DynLibList mLibList;
+
+        public:
+            /** Default constructor.
+                @note
+                    <br>Should never be called as the singleton is automatically
+                    created during the creation of the Root object.
+                @see
+                    Root::Root
+            */
+            DynLibManager();
+
+            /** Default destructor.
+                @see
+                    Root::~Root
+            */
+            virtual ~DynLibManager();
+
+            /** Loads the passed library.
+                @param
+                    filename The name of the library. The extension can be omitted
+            */
+            DynLib* load(const std::string& filename);
+
+            /** Unloads the passed library.
+            @param
+            filename The name of the library. The extension can be omitted
+            */
+            void unload(DynLib* lib);
+
+        private:
+            static DynLibManager* singletonPtr_s;
+    };
+}
+
+#endif /* _Core_DynLibManager_H__ */
Index: code/trunk/src/core/GUIManager.h
===================================================================
--- code/trunk/src/core/GUIManager.h	(revision 5692)
+++ code/trunk/src/core/GUIManager.h	(revision 5693)
@@ -50,4 +50,6 @@
 namespace orxonox
 {
+    class PlayerInfo; // Forward declaration
+
     /**
     @class GUIManager
@@ -77,4 +79,9 @@
         static GUIManager* getInstancePtr() { return singletonPtr_s; }
 
+        inline void setPlayer(const std::string& guiname, PlayerInfo* player)
+            { this->players_[guiname] = player; }
+        inline PlayerInfo* getPlayer(const std::string& guiname) const
+            { std::map<std::string, PlayerInfo*>::const_iterator it = this->players_.find(guiname); return (it != this->players_.end()) ? it->second : 0; }
+
     private:
         GUIManager(const GUIManager& instance); //!< private and undefined copy c'tor (this is a singleton class)
@@ -92,13 +99,14 @@
         void mouseScrolled (int abs, int rel);
 
-        boost::scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;  //!< CEGUI's interface to the Ogre Engine
-        boost::scoped_ptr<CEGUI::LuaScriptModule>   scriptModule_; //!< CEGUI's script module to use Lua
-        boost::scoped_ptr<CEGUI::System>            guiSystem_;    //!< CEGUI's main system
-        Ogre::RenderWindow*      renderWindow_;     //!< Ogre's render window to give CEGUI access to it
-        CEGUI::ResourceProvider* resourceProvider_; //!< CEGUI's resource provider
-        CEGUI::Logger*           ceguiLogger_;      //!< CEGUI's logger to be able to log CEGUI errors in our log
-        lua_State*               luaState_;         //!< Lua state, access point to the Lua engine
+        boost::scoped_ptr<CEGUI::OgreCEGUIRenderer> guiRenderer_;       //!< CEGUI's interface to the Ogre Engine
+        boost::scoped_ptr<CEGUI::LuaScriptModule>   scriptModule_;      //!< CEGUI's script module to use Lua
+        boost::scoped_ptr<CEGUI::System>            guiSystem_;         //!< CEGUI's main system
+        Ogre::RenderWindow*                         renderWindow_;      //!< Ogre's render window to give CEGUI access to it
+        CEGUI::ResourceProvider*                    resourceProvider_;  //!< CEGUI's resource provider
+        CEGUI::Logger*                              ceguiLogger_;       //!< CEGUI's logger to be able to log CEGUI errors in our log
+        lua_State*                                  luaState_;          //!< Lua state, access point to the Lua engine
+        std::map<std::string, PlayerInfo*>          players_;           //!< Stores the player (owner) for each gui
 
-        static GUIManager*       singletonPtr_s;    //!< Singleton reference to GUIManager
+        static GUIManager*                          singletonPtr_s;     //!< Singleton reference to GUIManager
 
     };
Index: code/trunk/src/core/Game.cc
===================================================================
--- code/trunk/src/core/Game.cc	(revision 5692)
+++ code/trunk/src/core/Game.cc	(revision 5693)
@@ -113,4 +113,6 @@
     */
     Game::Game(const std::string& cmdLine)
+        // Destroy factories before the Core!
+        : gsFactoryDestroyer_(Game::GameStateFactory::factories_s, &std::map<std::string, shared_ptr<GameStateFactory> >::clear)
     {
         this->bAbort_ = false;
Index: code/trunk/src/core/Game.h
===================================================================
--- code/trunk/src/core/Game.h	(revision 5692)
+++ code/trunk/src/core/Game.h	(revision 5693)
@@ -48,4 +48,5 @@
 
 #include "util/Debug.h"
+#include "util/ScopeGuard.h"
 #include "util/Singleton.h"
 
@@ -85,4 +86,5 @@
         typedef std::map<std::string, shared_ptr<GameState> > GameStateMap;
         typedef boost::shared_ptr<GameStateTreeNode> GameStateTreeNodePtr;
+
     public:
         Game(const std::string& cmdLine);
@@ -118,5 +120,5 @@
             static void createFactory(const std::string& className)
                 { factories_s[className].reset(new TemplateGameStateFactory<T>()); }
-        private:
+
             virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
             static std::map<std::string, shared_ptr<GameStateFactory> > factories_s;
@@ -129,4 +131,6 @@
                 { return shared_ptr<GameState>(new T(info)); }
         };
+        // For the factory destruction
+        typedef Loki::ObjScopeGuardImpl0<std::map<std::string, shared_ptr<GameStateFactory> >, void (std::map<std::string, shared_ptr<GameStateFactory> >::*)()> ObjScopeGuard;
 
         struct StatisticsTickInfo
@@ -156,4 +160,5 @@
         scoped_ptr<Clock>                  gameClock_;
         scoped_ptr<Core>                   core_;
+        ObjScopeGuard                      gsFactoryDestroyer_;
         scoped_ptr<GameConfiguration>      configuration_;
 
Index: code/trunk/src/core/TclThreadList.h
===================================================================
--- code/trunk/src/core/TclThreadList.h	(revision 5692)
+++ code/trunk/src/core/TclThreadList.h	(revision 5693)
Index: code/trunk/src/orxonox/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/CMakeLists.txt	(revision 5693)
@@ -19,14 +19,18 @@
 
 SET_SOURCE_FILES(ORXONOX_SRC_FILES
+  Main.cc
+
   CameraManager.cc
   LevelManager.cc
-  Main.cc
   PawnManager.cc
   PlayerManager.cc
+
+  InGameConsole.cc
+  Map.cc
 )
 ADD_SUBDIRECTORY(gamestates)
 ADD_SUBDIRECTORY(interfaces)
+ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(objects)
-ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(sound)
 ADD_SUBDIRECTORY(tools)
@@ -37,5 +41,5 @@
 ENDIF()
 
-ORXONOX_ADD_EXECUTABLE(orxonox
+ORXONOX_ADD_LIBRARY(orxonox
   FIND_HEADER_FILES
   TOLUA_FILES
@@ -43,10 +47,8 @@
     objects/pickup/BaseItem.h
     objects/pickup/PickupInventory.h
-    objects/quest/QuestDescription.h
-    objects/quest/QuestManager.h
+  DEFINE_SYMBOL
+    "ORXONOX_SHARED_BUILD"
   PCH_FILE
     OrxonoxPrecompiledHeaders.h
-  # When defined as WIN32 this removes the console window on Windows
-  ${ORXONOX_WIN32}
   LINK_LIBRARIES
     ${Boost_FILESYSTEM_LIBRARY}
@@ -66,8 +68,19 @@
     core
     network
+    tools
   SOURCE_FILES ${ORXONOX_SRC_FILES}
 )
 
-GET_TARGET_PROPERTY(_exec_loc orxonox LOCATION)
+ORXONOX_ADD_EXECUTABLE(orxonox-main
+  # When defined as WIN32 this removes the console window on Windows
+  ${ORXONOX_WIN32}
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES
+    Orxonox.cc
+  OUTPUT_NAME orxonox
+)
+
+GET_TARGET_PROPERTY(_exec_loc orxonox-main LOCATION)
 GET_FILENAME_COMPONENT(_exec_name ${_exec_loc} NAME)
 SET(ORXONOX_EXECUTABLE_NAME ${_exec_name} CACHE INTERNAL "")
@@ -89,4 +102,4 @@
   STRING(REGEX REPLACE "^Visual Studio ([0-9][0-9]?) .*$" "\\1"
          VISUAL_STUDIO_VERSION_SIMPLE "${CMAKE_GENERATOR}")
-  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox.vcproj.user")
+  CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/orxonox-main.vcproj.user.in" "${CMAKE_CURRENT_BINARY_DIR}/orxonox-main.vcproj.user")
 ENDIF(MSVC)
Index: code/trunk/src/orxonox/InGameConsole.cc
===================================================================
--- code/trunk/src/orxonox/InGameConsole.cc	(revision 5693)
+++ code/trunk/src/orxonox/InGameConsole.cc	(revision 5693)
@@ -0,0 +1,606 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+
+#include "InGameConsole.h"
+
+#include <algorithm>
+#include <string>
+#include <OgreOverlay.h>
+#include <OgreOverlayElement.h>
+#include <OgreOverlayManager.h>
+#include <OgreOverlayContainer.h>
+#include <OgreBorderPanelOverlayElement.h>
+#include <OgreTextAreaOverlayElement.h>
+#include <OgreFontManager.h>
+#include <OgreFont.h>
+
+#include "util/Math.h"
+#include "util/Convert.h"
+#include "util/UTFStringConversions.h"
+#include "core/Clock.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ConsoleCommand.h"
+#include "core/input/InputManager.h"
+#include "core/input/InputState.h"
+#include "core/input/InputBuffer.h"
+
+namespace orxonox
+{
+    const int LINES = 30;
+    const float CHAR_WIDTH = 7.45f; // fix this please - determine the char-width dynamically
+
+    SetConsoleCommand(InGameConsole, openConsole, true);
+    SetConsoleCommand(InGameConsole, closeConsole, true);
+
+    InGameConsole* InGameConsole::singletonPtr_s = 0;
+
+    /**
+        @brief Constructor: Creates and initializes the InGameConsole.
+    */
+    InGameConsole::InGameConsole()
+        : consoleOverlay_(0)
+        , consoleOverlayContainer_(0)
+        , consoleOverlayNoise_(0)
+        , consoleOverlayCursor_(0)
+        , consoleOverlayBorder_(0)
+        , consoleOverlayTextAreas_(0)
+        , inputState_(0)
+    {
+        RegisterObject(InGameConsole);
+
+        this->bActive_ = false;
+        this->cursor_ = 0.0f;
+        this->cursorSymbol_ = '|';
+        this->inputWindowStart_ = 0;
+        this->numLinesShifted_ = LINES - 1;
+        // for the beginning, don't scroll
+        this->scroll_ = 0;
+
+        this->setConfigValues();
+    }
+
+    /**
+        @brief Destructor: Destroys the TextAreas.
+    */
+    InGameConsole::~InGameConsole()
+    {
+        this->deactivate();
+
+        // destroy the input state previously created (InputBuffer gets destroyed by the Shell)
+        InputManager::getInstance().destroyState("console");
+
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+        if (ovMan)
+        {
+            if (this->consoleOverlayNoise_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayNoise_);
+            if (this->consoleOverlayCursor_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayCursor_);
+            Ogre::FontManager::getSingleton().remove("MonofurConsole");
+            if (this->consoleOverlayBorder_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayBorder_);
+            if (this->consoleOverlayTextAreas_)
+            {
+                for (int i = 0; i < LINES; i++)
+                {
+                    if (this->consoleOverlayTextAreas_[i])
+                      Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
+                    this->consoleOverlayTextAreas_[i] = 0;
+                }
+
+            }
+            if (this->consoleOverlayContainer_)
+                Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayContainer_);
+        }
+        if (this->consoleOverlayTextAreas_)
+        {
+            delete[] this->consoleOverlayTextAreas_;
+            this->consoleOverlayTextAreas_ = 0;
+        }
+
+        if (this->consoleOverlay_)
+            Ogre::OverlayManager::getSingleton().destroy(consoleOverlay_);
+    }
+
+    /**
+        @brief Sets the config values, describing the size of the console.
+    */
+    void InGameConsole::setConfigValues()
+    {
+        SetConfigValue(relativeWidth, 0.8);
+        SetConfigValue(relativeHeight, 0.4);
+        SetConfigValue(blinkTime, 0.5);
+        SetConfigValue(scrollSpeed_, 3.0f);
+        SetConfigValue(noiseSize_, 1.0f);
+        SetConfigValue(cursorSymbol_, '|');
+        SetConfigValue(bHidesAllInput_, false).callback(this, &InGameConsole::bHidesAllInputChanged);
+    }
+
+    /**
+        @brief Called whenever bHidesAllInput_ changes.
+    */
+    void InGameConsole::bHidesAllInputChanged()
+    {
+        if (inputState_)
+        {
+            if (bHidesAllInput_)
+            {
+                inputState_->setMouseHandler(&InputHandler::EMPTY);
+                inputState_->setJoyStickHandler(&InputHandler::EMPTY);
+            }
+            else
+            {
+                inputState_->setMouseHandler(0);
+                inputState_->setJoyStickHandler(0);
+            }
+        }
+    }
+
+    /**
+        @brief Initializes the InGameConsole.
+    */
+    void InGameConsole::initialise()
+    {
+        // create the corresponding input state
+        inputState_ = InputManager::getInstance().createInputState("console", false, false, InputStatePriority::Console);
+        inputState_->setKeyHandler(Shell::getInstance().getInputBuffer());
+        bHidesAllInputChanged();
+
+        // create overlay and elements
+        Ogre::OverlayManager* ovMan = Ogre::OverlayManager::getSingletonPtr();
+
+        // create actual overlay
+        this->consoleOverlay_ = ovMan->create("InGameConsoleConsole");
+
+        // create a container
+        this->consoleOverlayContainer_ = static_cast<Ogre::OverlayContainer*>(ovMan->createOverlayElement("Panel", "InGameConsoleContainer"));
+        this->consoleOverlayContainer_->setMetricsMode(Ogre::GMM_RELATIVE);
+        this->consoleOverlayContainer_->setPosition((1 - this->relativeWidth) / 2, 0);
+        this->consoleOverlayContainer_->setDimensions(this->relativeWidth, this->relativeHeight);
+        this->consoleOverlay_->add2D(this->consoleOverlayContainer_);
+
+        // create BorderPanel
+        this->consoleOverlayBorder_ = static_cast<Ogre::BorderPanelOverlayElement*>(ovMan->createOverlayElement("BorderPanel", "InGameConsoleBorderPanel"));
+        this->consoleOverlayBorder_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayBorder_->setMaterialName("ConsoleCenter");
+        this->consoleOverlayBorder_->setBorderSize(16, 16, 0, 16);
+        this->consoleOverlayBorder_->setBorderMaterialName("ConsoleBorder");
+        this->consoleOverlayBorder_->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
+        this->consoleOverlayBorder_->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
+        this->consoleOverlayBorder_->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
+        this->consoleOverlayBorder_->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
+        this->consoleOverlayBorder_->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayBorder_);
+
+        // create a new font to match the requested size exactly
+        Ogre::FontPtr font = static_cast<Ogre::FontPtr>
+            (Ogre::FontManager::getSingleton().create("MonofurConsole", "General"));
+        font->setType(Ogre::FT_TRUETYPE);
+        font->setSource("Monofur.ttf");
+        font->setTrueTypeSize(18);
+        // reto: I don't know why, but setting the resolution twice as high makes the font look a lot clearer
+        font->setTrueTypeResolution(192);
+        font->addCodePointRange(Ogre::Font::CodePointRange(33, 126));
+        font->addCodePointRange(Ogre::Font::CodePointRange(161, 255));
+
+        // create the text lines
+        this->consoleOverlayTextAreas_ = new Ogre::TextAreaOverlayElement*[LINES];
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i] = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleTextArea" + multi_cast<std::string>(i)));
+            this->consoleOverlayTextAreas_[i]->setMetricsMode(Ogre::GMM_PIXELS);
+            this->consoleOverlayTextAreas_[i]->setFontName("MonofurConsole");
+            this->consoleOverlayTextAreas_[i]->setCharHeight(18);
+            this->consoleOverlayTextAreas_[i]->setParameter("colour_top", "0.21 0.69 0.21");
+            this->consoleOverlayTextAreas_[i]->setLeft(8);
+            this->consoleOverlayTextAreas_[i]->setCaption("");
+            this->consoleOverlayContainer_->addChild(this->consoleOverlayTextAreas_[i]);
+        }
+
+        // create cursor (also a text area overlay element)
+        this->consoleOverlayCursor_ = static_cast<Ogre::TextAreaOverlayElement*>(ovMan->createOverlayElement("TextArea", "InGameConsoleCursor"));
+        this->consoleOverlayCursor_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayCursor_->setFontName("MonofurConsole");
+        this->consoleOverlayCursor_->setCharHeight(18);
+        this->consoleOverlayCursor_->setParameter("colour_top", "0.21 0.69 0.21");
+        this->consoleOverlayCursor_->setLeft(7);
+        this->consoleOverlayCursor_->setCaption(std::string(this->cursorSymbol_, 1));
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayCursor_);
+
+        // create noise
+        this->consoleOverlayNoise_ = static_cast<Ogre::PanelOverlayElement*>(ovMan->createOverlayElement("Panel", "InGameConsoleNoise"));
+        this->consoleOverlayNoise_->setMetricsMode(Ogre::GMM_PIXELS);
+        this->consoleOverlayNoise_->setPosition(5,0);
+        this->consoleOverlayNoise_->setMaterialName("ConsoleNoiseSmall");
+        // comment following line to disable noise
+        this->consoleOverlayContainer_->addChild(this->consoleOverlayNoise_);
+
+        this->windowResized(this->getWindowWidth(), this->getWindowWidth());
+
+        // move overlay "above" the top edge of the screen
+        // we take -1.2 because the border makes the panel bigger
+        this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+
+        Shell::getInstance().addOutputLevel(true);
+
+        COUT(4) << "Info: InGameConsole initialized" << std::endl;
+    }
+
+    // ###############################
+    // ###  ShellListener methods  ###
+    // ###############################
+
+    /**
+        @brief Called if all output-lines have to be redrawn.
+    */
+    void InGameConsole::linesChanged()
+    {
+        std::list<std::string>::const_iterator it = Shell::getInstance().getNewestLineIterator();
+        int max = 0;
+        for (int i = 1; i < LINES; ++i)
+        {
+            if (it != Shell::getInstance().getEndIterator())
+            {
+                ++it;
+                max = i;
+            }
+            else
+                break;
+        }
+
+        for (int i = LINES - 1; i > max; --i)
+            this->print("", i, true);
+
+        for (int i = max; i >= 1; --i)
+        {
+            --it;
+            this->print(*it, i, true);
+        }
+    }
+
+    /**
+        @brief Called if only the last output-line has changed.
+    */
+    void InGameConsole::onlyLastLineChanged()
+    {
+        if (LINES > 1)
+            this->print(*Shell::getInstance().getNewestLineIterator(), 1);
+    }
+
+    /**
+        @brief Called if a new output-line was added.
+    */
+    void InGameConsole::lineAdded()
+    {
+        this->numLinesShifted_ = 0;
+        this->shiftLines();
+        this->onlyLastLineChanged();
+    }
+
+    /**
+        @brief Called if the text in the input-line has changed.
+    */
+    void InGameConsole::inputChanged()
+    {
+        if (LINES > 0)
+            this->print(Shell::getInstance().getInput(), 0);
+
+        if (Shell::getInstance().getInput() == "" || Shell::getInstance().getInput().size() == 0)
+            this->inputWindowStart_ = 0;
+    }
+
+    /**
+        @brief Called if the position of the cursor in the input-line has changed.
+    */
+    void InGameConsole::cursorChanged()
+    {
+        unsigned int pos = Shell::getInstance().getCursorPosition() - inputWindowStart_;
+        if (pos > maxCharsPerLine_)
+            pos = maxCharsPerLine_;
+
+        this->consoleOverlayCursor_->setCaption(std::string(pos,' ') + cursorSymbol_);
+        this->consoleOverlayCursor_->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24);
+    }
+
+    /**
+        @brief Called if the console gets closed.
+    */
+    void InGameConsole::exit()
+    {
+        this->deactivate();
+    }
+
+    // ###############################
+    // ###  other external calls   ###
+    // ###############################
+
+    /**
+        @brief Used to control the actual scrolling and the cursor.
+    */
+    void InGameConsole::update(const Clock& time)
+    {
+        if (this->scroll_ != 0)
+        {
+            float oldTop = this->consoleOverlayContainer_->getTop();
+
+            if (this->scroll_ > 0)
+            {
+                // scrolling down
+                // enlarge oldTop a little bit so that this exponential function
+                // reaches 0 before infinite time has passed...
+                float deltaScroll = (oldTop - 0.01) * time.getDeltaTime() * this->scrollSpeed_;
+                if (oldTop - deltaScroll >= 0)
+                {
+                    // window has completely scrolled down
+                    this->consoleOverlayContainer_->setTop(0);
+                    this->scroll_ = 0;
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+
+            else
+            {
+                // scrolling up
+                // note: +0.01 for the same reason as when scrolling down
+                float deltaScroll = (1.2 * this->relativeHeight + 0.01 + oldTop) * time.getDeltaTime() * this->scrollSpeed_;
+                if (oldTop - deltaScroll <= -1.2 * this->relativeHeight)
+                {
+                    // window has completely scrolled up
+                    this->consoleOverlayContainer_->setTop(-1.2 * this->relativeHeight);
+                    this->scroll_ = 0;
+                    this->consoleOverlay_->hide();
+                }
+                else
+                    this->consoleOverlayContainer_->setTop(oldTop - deltaScroll);
+            }
+        }
+
+        if (this->bActive_)
+        {
+            this->cursor_ += time.getDeltaTime();
+            if (this->cursor_ >= this->blinkTime)
+            {
+                this->cursor_ = 0;
+                bShowCursor_ = !bShowCursor_;
+                if (bShowCursor_)
+                    this->consoleOverlayCursor_->show();
+                else
+                    this->consoleOverlayCursor_->hide();
+            }
+
+            // this creates a flickering effect (extracts exactly 80% of the texture at a random location)
+            float uRand = (rand() & 1023) / 1023.0f * 0.2f;
+            float vRand = (rand() & 1023) / 1023.0f * 0.2f;
+            this->consoleOverlayNoise_->setUV(uRand, vRand, 0.8f + uRand, 0.8f + vRand);
+        }
+    }
+
+    /**
+        @brief Resizes the console elements. Call if window size changes.
+    */
+    void InGameConsole::windowResized(unsigned int newWidth, unsigned int newHeight)
+    {
+        this->windowW_ = newWidth;
+        this->windowH_ = newHeight;
+        this->consoleOverlayBorder_->setWidth(static_cast<int>(this->windowW_* this->relativeWidth));
+        this->consoleOverlayBorder_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight));
+        this->consoleOverlayNoise_->setWidth(static_cast<int>(this->windowW_ * this->relativeWidth) - 10);
+        this->consoleOverlayNoise_->setHeight(static_cast<int>(this->windowH_ * this->relativeHeight) - 5);
+        this->consoleOverlayNoise_->setTiling(consoleOverlayNoise_->getWidth() / (50.0f * this->noiseSize_), consoleOverlayNoise_->getHeight() / (50.0f * this->noiseSize_));
+
+        // now adjust the text lines...
+        this->desiredTextWidth_ = static_cast<int>(this->windowW_ * this->relativeWidth) - 12;
+
+        if (LINES > 0)
+            this->maxCharsPerLine_ = std::max(10U, static_cast<unsigned int>(static_cast<float>(this->desiredTextWidth_) / CHAR_WIDTH));
+        else
+            this->maxCharsPerLine_ = 10;
+
+        for (int i = 0; i < LINES; i++)
+        {
+            this->consoleOverlayTextAreas_[i]->setWidth(this->desiredTextWidth_);
+            this->consoleOverlayTextAreas_[i]->setTop(static_cast<int>(this->windowH_ * this->relativeHeight) - 24 - 14*i);
+        }
+
+        this->linesChanged();
+        this->cursorChanged();
+    }
+
+    // ###############################
+    // ###    internal methods     ###
+    // ###############################
+
+    /**
+        @brief Prints string to bottom line.
+        @param s String to be printed
+    */
+    void InGameConsole::print(const std::string& text, int index, bool alwaysShift)
+    {
+        char level = 0;
+        if (text.size() > 0)
+            level = text[0];
+
+        std::string output = text;
+
+        if (level >= -1 && level <= 5)
+            output.erase(0, 1);
+
+        if (LINES > index)
+        {
+            this->colourLine(level, index);
+
+            if (index > 0)
+            {
+                unsigned int linesUsed = 1;
+                while (output.size() > this->maxCharsPerLine_)
+                {
+                    ++linesUsed;
+                    this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output.substr(0, this->maxCharsPerLine_)));
+                    output.erase(0, this->maxCharsPerLine_);
+                    output.insert(0, 1, ' ');
+                    if (linesUsed > numLinesShifted_ || alwaysShift)
+                        this->shiftLines();
+                    this->colourLine(level, index);
+                }
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+                this->displayedText_ = output;
+                this->numLinesShifted_ = linesUsed;
+            }
+            else
+            {
+                if (output.size() > this->maxCharsPerLine_)
+                {
+                    if (Shell::getInstance().getInputBuffer()->getCursorPosition() < this->inputWindowStart_)
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition();
+                    else if (Shell::getInstance().getInputBuffer()->getCursorPosition() >= (this->inputWindowStart_ + this->maxCharsPerLine_ - 1))
+                        this->inputWindowStart_ = Shell::getInstance().getInputBuffer()->getCursorPosition() - this->maxCharsPerLine_ + 1;
+
+                    output = output.substr(this->inputWindowStart_, this->maxCharsPerLine_);
+                }
+                else
+                  this->inputWindowStart_ = 0;
+                this->displayedText_ = output;
+                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::UTFString>(output));
+            }
+        }
+    }
+
+    /**
+        @brief Shows the InGameConsole.
+    */
+    void InGameConsole::activate()
+    {
+        if (!this->bActive_)
+        {
+            this->bActive_ = true;
+            InputManager::getInstance().enterState("console");
+            Shell::getInstance().registerListener(this);
+
+            this->windowResized(this->windowW_, this->windowH_);
+            this->linesChanged();
+            this->cursorChanged();
+            this->consoleOverlay_->show();
+
+            // scroll down
+            this->scroll_ = 1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+    @brief Hides the InGameConsole.
+    */
+    void InGameConsole::deactivate()
+    {
+        if (this->bActive_)
+        {
+            this->bActive_ = false;
+            InputManager::getInstance().leaveState("console");
+            Shell::getInstance().unregisterListener(this);
+
+            // scroll up
+            this->scroll_ = -1;
+            // the rest is done by tick
+        }
+    }
+
+    /**
+        @brief Shifts all output lines one line up
+    */
+    void InGameConsole::shiftLines()
+    {
+        for (unsigned int i = LINES - 1; i > 1; --i)
+        {
+            this->consoleOverlayTextAreas_[i]->setCaption(this->consoleOverlayTextAreas_[i - 1]->getCaption());
+            this->consoleOverlayTextAreas_[i]->setColourTop(this->consoleOverlayTextAreas_[i - 1]->getColourTop());
+            this->consoleOverlayTextAreas_[i]->setColourBottom(this->consoleOverlayTextAreas_[i - 1]->getColourBottom());
+        }
+    }
+
+    void InGameConsole::colourLine(int colourcode, int index)
+    {
+        if (colourcode == -1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.90, 0.90, 0.90, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 1.00, 1.00, 1.00));
+        }
+        else if (colourcode == 1)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.25, 0.25, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.50, 0.50, 1.00));
+        }
+        else if (colourcode == 2)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.95, 0.50, 0.20, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.70, 0.50, 1.00));
+        }
+        else if (colourcode == 3)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.50, 0.50, 0.95, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.80, 1.00, 1.00));
+        }
+        else if (colourcode == 4)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.65, 0.48, 0.44, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(1.00, 0.90, 0.90, 1.00));
+        }
+        else if (colourcode == 5)
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.40, 0.20, 0.40, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 0.60, 0.80, 1.00));
+        }
+        else
+        {
+            this->consoleOverlayTextAreas_[index]->setColourTop   (ColourValue(0.21, 0.69, 0.21, 1.00));
+            this->consoleOverlayTextAreas_[index]->setColourBottom(ColourValue(0.80, 1.00, 0.80, 1.00));
+        }
+    }
+
+    // ###############################
+    // ###      satic methods      ###
+    // ###############################
+
+    /**
+        @brief Activates the console.
+    */
+    /*static*/ void InGameConsole::openConsole()
+    {
+        InGameConsole::getInstance().activate();
+    }
+
+    /**
+        @brief Deactivates the console.
+    */
+    /*static*/ void InGameConsole::closeConsole()
+    {
+        InGameConsole::getInstance().deactivate();
+    }
+}
Index: code/trunk/src/orxonox/InGameConsole.h
===================================================================
--- code/trunk/src/orxonox/InGameConsole.h	(revision 5693)
+++ code/trunk/src/orxonox/InGameConsole.h	(revision 5693)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Felix Schulthess
+ *   Co-authors:
+ *      Fabian 'x3n' Landau
+ *
+ */
+
+#ifndef _InGameConsole_H__
+#define _InGameConsole_H__
+
+
+#include "OrxonoxPrereqs.h"
+
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "util/Singleton.h"
+#include "core/Shell.h"
+#include "core/WindowEventListener.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener
+    {
+        friend class Singleton<InGameConsole>;
+    public: // functions
+        InGameConsole();
+        ~InGameConsole();
+
+        void initialise();
+        void destroy();
+        void setConfigValues();
+
+        void update(const Clock& time);
+
+        static void openConsole();
+        static void closeConsole();
+
+    private: // functions
+        InGameConsole(const InGameConsole& other);
+
+        void activate();
+        void deactivate();
+
+        void linesChanged();
+        void onlyLastLineChanged();
+        void lineAdded();
+        void inputChanged();
+        void cursorChanged();
+        void exit();
+
+        void shiftLines();
+        void colourLine(int colourcode, int index);
+        void setCursorPosition(unsigned int pos);
+        void print(const std::string& text, int index, bool alwaysShift = false);
+
+        void windowResized(unsigned int newWidth, unsigned int newHeight);
+
+        // config value related
+        void bHidesAllInputChanged();
+
+    private: // variables
+        bool bActive_;
+        int windowW_;
+        int windowH_;
+        int desiredTextWidth_;
+        unsigned int maxCharsPerLine_;
+        unsigned int numLinesShifted_;
+        int scroll_;
+        float cursor_;
+        unsigned int inputWindowStart_;
+        bool bShowCursor_;
+        std::string displayedText_;
+        Ogre::Overlay* consoleOverlay_;
+        Ogre::OverlayContainer* consoleOverlayContainer_;
+        Ogre::PanelOverlayElement* consoleOverlayNoise_;
+        Ogre::TextAreaOverlayElement* consoleOverlayCursor_;
+        Ogre::BorderPanelOverlayElement* consoleOverlayBorder_;
+        Ogre::TextAreaOverlayElement** consoleOverlayTextAreas_;
+
+        // input related
+        InputState* inputState_;
+
+        // config values
+        float relativeWidth;
+        float relativeHeight;
+        float blinkTime;
+        float scrollSpeed_;
+        float noiseSize_;
+        char cursorSymbol_;
+        bool bHidesAllInput_;
+
+        static InGameConsole* singletonPtr_s;
+    };
+}
+
+#endif /* _InGameConsole_H__ */
Index: code/trunk/src/orxonox/Main.cc
===================================================================
--- code/trunk/src/orxonox/Main.cc	(revision 5692)
+++ code/trunk/src/orxonox/Main.cc	(revision 5693)
@@ -27,9 +27,9 @@
  *
  */
- 
+
 /**
 @file
 @brief
-    Entry point of the program.
+    The main function of Orxonox.
 */
 
@@ -37,15 +37,8 @@
 #include "SpecialConfig.h"
 
-#ifdef ORXONOX_USE_WINMAIN
-# ifndef WIN32_LEAN_AND_MEAN
-#  define WIN32_LEAN_AND_MEAN
-# endif
-#include <windows.h>
-#endif
-
-#include "util/Debug.h"
 #include "util/Exception.h"
 #include "core/CommandLine.h"
 #include "core/Game.h"
+#include "Main.h"
 
 SetCommandLineSwitch(console).information("Start in console mode (text IO only)");
@@ -56,25 +49,13 @@
 SetCommandLineSwitch(standalone).information("Start in standalone mode");
 
-/*
-@brief
-    Main method. Game starts here (except for static initialisations).
-*/
-#ifdef ORXONOX_USE_WINMAIN
-INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
-#else
-int main(int argc, char** argv)
-#endif
+namespace orxonox
 {
-    using namespace orxonox;
-
-    Game* game = 0;
-    try
+    /**
+    @brief
+        Main method. Game starts here (except for static initialisations).
+    */
+    int main(const std::string& strCmdLine)
     {
-#ifndef ORXONOX_USE_WINMAIN
-        std::string strCmdLine;
-        for (int i = 1; i < argc; ++i)
-            strCmdLine += argv[i] + std::string(" ");
-#endif
-        game = new Game(strCmdLine);
+        Game* game = new Game(strCmdLine);
 
         game->setStateHierarchy(
@@ -108,21 +89,9 @@
         else
             Game::getInstance().requestStates("graphics, mainMenu");
+
+        game->run();
+        delete game;
+
+        return 0;
     }
-    catch (const std::exception& ex)
-    {
-        COUT(0) << "Orxonox failed to initialise: " << ex.what() << std::endl;
-        COUT(0) << "Terminating program." << std::endl;
-        return 1;
-    }
-    catch (...)
-    {
-        COUT(0) << "Orxonox failed to initialise: " << std::endl;
-        COUT(0) << "Terminating program." << std::endl;
-        return 1;
-    }
-
-    game->run();
-    delete game;
-
-    return 0;
 }
Index: code/trunk/src/orxonox/Main.h
===================================================================
--- code/trunk/src/orxonox/Main.h	(revision 5693)
+++ code/trunk/src/orxonox/Main.h	(revision 5693)
@@ -0,0 +1,40 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Main_H__
+#define _Main_H__
+
+#include "OrxonoxPrereqs.h"
+
+namespace orxonox
+{
+    _OrxonoxExport int main(const std::string& strCmdLine);
+}
+
+#endif /* _Main_H__ */
Index: code/trunk/src/orxonox/Map.cc
===================================================================
--- code/trunk/src/orxonox/Map.cc	(revision 5693)
+++ code/trunk/src/orxonox/Map.cc	(revision 5693)
@@ -0,0 +1,456 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Si Sun
+ *
+ */
+
+#include "Map.h"
+
+#include <string>
+
+#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 <OgreTechnique.h>
+#include <OgreTexture.h>
+#include <OgreTextureManager.h>
+#include <OgreViewport.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"
+
+ namespace orxonox
+ {
+    CreateFactory(Map);
+    SetConsoleCommand(Map, openMap, true);
+    //SetConsoleCommand(Map, rotateYaw, true).setAsInputCommand();
+    //SetConsoleCommand(Map, rotatePitch, true).setAsInputCommand();
+    SetConsoleCommand(Map, Zoom, true).setAsInputCommand();
+
+
+    Map* Map::singletonMap_s = 0;
+    Ogre::SceneManager* Map::mapSceneM_s = 0;
+    Ogre::Camera* Map::Cam_ = 0;
+    Ogre::SceneNode* Map::CamNode_ = 0;
+    Ogre::MaterialPtr Map::OverlayMaterial_;// = init();
+    Ogre::Overlay* Map::overlay_ = 0;
+/*
+Ogre::MaterialPtr Map::init()
+{
+    Ogre::MaterialPtr tmp;
+    tmp.setNull();
+    return tmp;
+}
+*/
+
+    //int Map::mouseLookSpeed_ = 200;
+    //Ogre::SceneNode* Map::playerShipNode_ = 0;
+
+    const int PITCH=-30;
+    const int DISTANCE=200;
+
+    Map::Map(BaseObject* creator) : OrxonoxOverlay(creator)
+    {
+        RegisterObject(Map);
+        Map::singletonMap_s=this;
+
+        //Getting Scene Manager (Hack)
+        if( !sManager_ )
+        {
+            ObjectList<Scene>::iterator it = ObjectList<Scene>::begin();
+            this->sManager_ = it->getSceneManager();
+        }
+        if( !Map::getMapSceneManager() )
+        {
+            Map::setMapSceneManager( Ogre::Root::getSingletonPtr()->createSceneManager( Ogre::ST_GENERIC,"MapScene" ) );
+        }
+
+        this->playerShipNode_ = 0;
+        //this->sNode_ = new Ogre::SceneNode(sManager_);
+        //oManager_ = Ogre::OverlayManager::getSingletonPtr();
+        //overlay_ = oManager_->create("Map");
+        //overlay_ is member of OrxonoxOverlay
+
+        //Not Showing the map as default
+        //this->isVisible_=false;
+        //overlay_->hide();
+        this->mouseLookSpeed_ = 200;
+
+        //TestEntity
+        //Ogre::Entity * ent = mapSceneM_s->createEntity("ent", "drone.mesh");
+
+        //Map::getMapSceneManager()->getRootSceneNode()->attachObject( ent );
+        /*sNode_->setPosition(0,0,-50);
+        overlay_->add3D(sNode_);
+        */
+
+
+
+
+
+        // Alter the camera aspect ratio to match the viewport
+        //mCamera->setAspectRatio(Real(vp->getActualWidth()) / Real(vp->getActualHeight()));
+        if(!Map::Cam_)
+            Cam_ = Map::getMapSceneManager()->createCamera("ReflectCam");
+        //Cam_->setPosition(200,170, -160);
+        //Cam_->lookAt(0,0,0);
+        Cam_->setAspectRatio(1);
+        //Cam_->setRenderingDistance(0);
+        if(!Map::CamNode_)
+            CamNode_ = Map::getMapSceneManager()->getRootSceneNode()->createChildSceneNode();
+
+
+        //Create overlay material
+        if(Map::OverlayMaterial_.isNull())
+            Map::OverlayMaterial_ = this->createRenderCamera(Cam_, "RttMat");
+/*
+        Ogre::TexturePtr rttTex = Ogre::TextureManager::getSingleton().createManual("RttTex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, 512, 512, 0, Ogre::PF_R8G8B8, Ogre::TU_RENDERTARGET);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(Cam_);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create("RttMat", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState("RttTex");
+*/
+
+
+        // create overlay
+/*
+        Ogre::Overlay* pOverlay = Ogre::OverlayManager::getSingleton().create("Overlay1");
+
+        // Create a panel with RenderToTexture texture
+        Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+        m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+        m_pOverlayPanel->setPosition(10, 10);
+        m_pOverlayPanel->setDimensions(500, 300);
+        // Give overlay a texture
+        m_pOverlayPanel->setMaterialName(camMat_id);
+        pOverlay->add2D(m_pOverlayPanel);
+        pOverlay->show();
+*/
+        if(!this->overlay_)
+        {
+            this->overlay_ = Ogre::OverlayManager::getSingletonPtr()->create("MapOverlay");
+            Ogre::OverlayContainer* m_pOverlayPanel = static_cast<Ogre::OverlayContainer*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel","OverlayPanelName%d"));
+            //m_pOverlayPanel->setMetricsMode(Ogre::GMM_PIXELS);
+            //m_pOverlayPanel->setPosition(10, 10);
+            //m_pOverlayPanel->setDimensions(600, 400);
+            m_pOverlayPanel->setPosition(0.01, 0.003);
+            m_pOverlayPanel->setDimensions(0.5, 0.4);
+            // Give overlay a texture
+            m_pOverlayPanel->setMaterialName("RttMat");
+            overlay_->add2D(m_pOverlayPanel);
+
+            //Add Borders
+            Ogre::BorderPanelOverlayElement* oBorder = static_cast<Ogre::BorderPanelOverlayElement*>(Ogre::OverlayManager::getSingletonPtr()->createOverlayElement("BorderPanel", "MapBorderPanel" + getUniqueNumberString()));
+            oBorder->setBorderSize( 0.003, 0.003 );
+            oBorder->setDimensions(0.5, 0.4);
+            oBorder->setBorderMaterialName("StatsBorder");
+            oBorder->setTopBorderUV(0.49, 0.0, 0.51, 0.5);
+            oBorder->setTopLeftBorderUV(0.0, 0.0, 0.5, 0.5);
+            oBorder->setTopRightBorderUV(0.5, 0.0, 1.0, 0.5);
+            oBorder->setLeftBorderUV(0.0, 0.49, 0.5, 0.51);
+            oBorder->setRightBorderUV(0.5, 0.49, 1.0, 0.5);
+            oBorder->setBottomBorderUV(0.49, 0.5, 0.51, 1.0);
+            oBorder->setBottomLeftBorderUV(0.0, 0.5, 0.5, 1.0);
+            oBorder->setBottomRightBorderUV(0.5, 0.5, 1.0, 1.0);
+            //overlay_->add2D(oBorder);
+            m_pOverlayPanel->addChild(oBorder);
+        }
+
+
+        //Not Showing the map as default
+        this->isVisible_=false;
+        overlay_->hide();
+
+        //Create plane to show gridTypeError: blimport() takes no keyword arguments
+/*        Ogre::Entity* plane_ent;
+        if(Map::getMapSceneManager()->hasEntity("MapPlane"))
+            plane_ent = Map::getMapSceneManager()->getEntity("MapPlane");
+        else
+            plane_ent = Map::getMapSceneManager()->createEntity( "MapPlane", "plane.mesh");
+*/
+        this->movablePlane_ = new Ogre::MovablePlane( Vector3::UNIT_Y, 0 );
+        this->movablePlane_->normalise();
+
+        if(!Map::getMapSceneManager()->hasEntity("MapPlane"))
+        {
+            Ogre::Entity* plane_ent = Map::getMapSceneManager()->createEntity( "MapPlane", "plane.mesh");
+            planeNode_ = Map::getMapSceneManager()->createSceneNode();
+        //Create plane for calculations
+
+
+        //Ogre::MaterialPtr plane_mat = Ogre::MaterialManager::getSingleton().create("mapgrid", "General");
+        //plane_mat->getTechnique(0)->getPass(0)->createTextureUnitState("mapgrid.tga");
+        //plane_ent->setMaterialName("mapgrid");
+            plane_ent->setMaterialName("Map/Grid");
+            planeNode_->attachObject(plane_ent);
+
+            planeNode_->scale(160,1,160);
+//        planeNode_->attachObject(movablePlane_);
+        //Ogre::Material plane_mat = Ogre::MaterialManager::getSingletonPtr()->getByName("rock");
+
+
+        //ToDo create material script
+            Ogre::MaterialPtr myManualObjectMaterial = Ogre::MaterialManager::getSingleton().create("Map/Line","General");
+            myManualObjectMaterial->setReceiveShadows(false);
+            myManualObjectMaterial->getTechnique(0)->setLightingEnabled(true);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setDiffuse(1,1,0,0);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setAmbient(1,1,0);
+            myManualObjectMaterial->getTechnique(0)->getPass(0)->setSelfIllumination(1,1,0);
+        }
+    }
+
+    Map::~Map()
+    {
+        this->singletonMap_s = 0;
+        //delete this->overlay_;
+        /*if (this->isInitialized())
+        {
+        //delete sManager_;
+        //delete Map::getMapSceneManager()->getRootSceneNode();
+        //delete oManager_;
+        //delete CamNode_;
+        //delete Cam_;
+        //delete mapSceneM_s;
+        //Map::getMapSceneManager()->destroyAllEntities();
+        //Map::getMapSceneManager()->destroyAllCameras();
+        delete Map::getMapSceneManager();
+        }*/
+    }
+
+    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);
+
+        Ogre::RenderTexture *renderTexture = rttTex->getBuffer()->getRenderTarget();
+
+        renderTexture->addViewport(cam);
+        renderTexture->getViewport(0)->setClearEveryFrame(true);
+        renderTexture->getViewport(0)->setBackgroundColour(ColourValue::Black);
+        renderTexture->getViewport(0)->setOverlaysEnabled(false);
+
+        Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().create(matName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
+        Ogre::Technique *technique = material->createTechnique();
+        technique->createPass();
+        material->getTechnique(0)->getPass(0)->setLightingEnabled(false);
+        material->getTechnique(0)->getPass(0)->createTextureUnitState(matName+"_tex");
+        return material;
+    }
+
+    void Map::updatePositions()
+    {
+
+//Ogre::Entity * ent;// = mapSceneM_s->createEntity("ent1", "drone.mesh");
+       for(ObjectList<orxonox::RadarViewable>::iterator it = ObjectList<orxonox::RadarViewable>::begin();
+            it!=ObjectList<orxonox::RadarViewable>::end();
+            it++)
+        {
+            //COUT(0) << "Radar_Position: " << it->getRVWorldPosition() << std::endl;
+            //Ogre::SceneNode node = it->getMapNode();
+            //Ogre::Entity ent = it->getMapEntity();
+            if( !(it->MapNode_) )
+            {
+                it->MapNode_ = Map::getMapSceneManager()->getRootSceneNode()->createChildSceneNode( it->getRVWorldPosition() );
+                //it->MapNode_->translate( it->getRVOrientedVelocity(), Ogre::TS_WORLD );
+                /*if(it->getRadarObjectShape() == RadarViewable::Dot)
+                {
+                    //if( !(it->MapEntity_) )//check wether the entity is already attached
+                    //{
+                        //it->MapEntity_ = Map::getMapSceneManager()->createEntity( getUniqueNumberString(), "drone.mesh");
+                        //it->addEntity();
+                        //it->MapNode_->attachObject( it->MapEntity_ );
+                        //it->MapNode_->attachObject( it->line_ );
+                   // }
+                }*/
+                it->addMapEntity();
+            }
+            if(it->isHumanShip_)
+            {
+                this->movablePlane_->redefine(it->MapNode_->getLocalAxes().GetColumn(1) , it->MapNode_->getPosition());
+                if(it->isHumanShip_ && it->MapNode_ != this->playerShipNode_)
+                {
+                    this->playerShipNode_ = it->MapNode_;
+                    if(planeNode_ && this->planeNode_->getParent())
+                        this->planeNode_->getParent()->removeChild(this->planeNode_);
+                    this->playerShipNode_->addChild(this->planeNode_);
+                //Movable Plane needs to be attached direcly for calculations
+                //this->movablePlane_->detatchFromParent();
+                //this->movablePlane_->getParentSceneNode()->detachObject(this->movablePlane_);
+                //this->movablePlane_->redefine(it->MapNode_->getLocalAxes().GetColumn(1) , it->MapNode_->getPosition());
+                //it->MapNode_->attachObject(this->movablePlane_);
+                    if(planeNode_ && this->CamNode_->getParent())
+                        this->CamNode_->getParent()->removeChild(this->CamNode_);
+                    this->playerShipNode_->addChild(this->CamNode_);
+                    this->CamNode_->attachObject(this->Cam_);
+                //this->CamNodeHelper_ = this->CamNode_->createChildSceneNode();
+                //this->CamNodeHelper_->attachObject(this->Cam_);
+                    this->Cam_->setPosition(0, 0, DISTANCE);
+                    this->Cam_->pitch( static_cast<Degree>(PITCH) );
+                    this->Cam_->lookAt(this->playerShipNode_->getPosition());
+                //this->Cam_->setAutoTracking(true, this->playerShipNode_);
+                }
+            }
+            it->updateMapPosition();
+
+
+
+
+
+
+        }
+    }
+
+
+
+    void Map::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(Map, XMLPort, xmlElement, mode);
+    }
+
+    void Map::changedOwner()
+    {
+        SUPER(Map, changedOwner);
+        //COUT(0) << "shipptr" << this->getOwner()->getReverseCamera() << std::endl;
+
+        ControllableEntity* entity = orxonox_cast<ControllableEntity*>(this->getOwner());
+        if(entity && entity->getReverseCamera())
+        {
+            //COUT(0) << "foo";
+            entity->getReverseCamera()->attachCamera(this->Cam_);
+        }
+    }
+
+
+    void Map::toggleVisibility()
+    {
+        if (!(this->isVisible_))
+        {
+            this->overlay_->show();
+            this->isVisible_=1;
+            //set mouselook when showing map
+            if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && !HumanController::localController_s->controllableEntity_->isInMouseLook())
+            HumanController::localController_s->controllableEntity_->mouseLook();
+        }
+        else
+        {
+            this->overlay_->hide();
+            this->isVisible_=0;
+            if (HumanController::localController_s && HumanController::localController_s->controllableEntity_ && HumanController::localController_s->controllableEntity_->isInMouseLook())
+            HumanController::localController_s->controllableEntity_->mouseLook();
+        }
+    }
+
+    //Static function to toggle visibility of the map
+    void Map::openMap()
+    {
+        for(ObjectList<orxonox::Map>::iterator it = ObjectList<orxonox::Map>::begin();
+            it!=ObjectList<orxonox::Map>::end();
+            it++)
+        {
+        //Map * m = it->getMap();
+        //COUT(0) << it->isVisible_ << std::endl;
+        it->toggleVisibility();
+        //it->updatePositions();
+        }
+    }
+
+    // HACK!
+    void Map::hackDestroyMap()
+    {
+        Map::OverlayMaterial_.setNull();
+    }
+
+    void Map::tick(float dt)
+    {
+        //Debug
+        //COUT(0) << "MovablePlane Position: " << this->movablePlane_->getParentSceneNode()->getName() << this->movablePlane_->getParentSceneNode()->getPosition() << std::endl;
+        //COUT(0) << "planeNode_ Position: " << this->planeNode_ ->getName() << this->planeNode_->getPosition() << std::endl;
+        //COUT(0) <<  "planeNode_ Parrent Position" << this->planeNode_->getParent()->getName() << this->planeNode_->getParent()->getPosition() << std::endl;
+        if( this->isVisible_ )
+            updatePositions();
+        //Cam_->roll(Degree(1));
+
+    }
+
+    void Map::rotateYaw(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+
+/*
+        singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(1) ));
+
+        Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y);
+        Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
+*/
+        singletonMap_s->CamNode_->yaw( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_PARENT);
+    }
+
+    void Map::rotatePitch(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+            //singletonMap_s->Cam_->setOrientation(singletonMap_s->Cam_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , Vector3::UNIT_X));
+/*        singletonMap_s->CamNode_->setOrientation(singletonMap_s->CamNode_->getOrientation() * Quaternion( static_cast<Degree>(-value.y * singletonMap_s->mouseLookSpeed_) , singletonMap_s->playerShipNode_->getLocalAxes().GetColumn(0) ));
+
+        Map::singletonMap_s->CamNodeHelper_->setDirection(Vector3::UNIT_Y, Ogre::Node::TS_PARENT, Vector3::UNIT_Y);
+        Map::singletonMap_s->CamNodeHelper_->lookAt(Vector3(0,0,0), Ogre::Node::TS_PARENT);
+*/
+        singletonMap_s->CamNode_->pitch( static_cast<Degree>(value.y * singletonMap_s->mouseLookSpeed_), Ogre::Node::TS_LOCAL);
+
+    }
+
+    void Map::Zoom(const Vector2& value)
+    {
+        if(!( Map::singletonMap_s && Map::singletonMap_s->CamNode_ ))
+            return;
+        //COUT(0) << value.y << std::endl;
+        Map::singletonMap_s->Cam_->setPosition(0,0, Map::singletonMap_s->Cam_->getPosition().z + value.y * Map::singletonMap_s->mouseLookSpeed_ );
+    }
+ }
Index: code/trunk/src/orxonox/Map.h
===================================================================
--- code/trunk/src/orxonox/Map.h	(revision 5693)
+++ code/trunk/src/orxonox/Map.h	(revision 5693)
@@ -0,0 +1,118 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Si Sun
+ *
+ */
+
+#ifndef _Map_H__
+#define _Map_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <OgreMaterial.h>
+
+#include "util/UtilPrereqs.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OrxonoxOverlay.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport Map : public OrxonoxOverlay, public Tickable
+    {
+
+    public: // functions
+        Map(BaseObject* creator);
+        virtual ~Map();
+
+        virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
+        virtual void tick(float dt);
+        virtual void changedOwner();
+
+        static Ogre::MaterialPtr createRenderCamera(Ogre::Camera * cam, const std::string& matName);
+
+        static void openMap();
+        // HACK!
+        static void hackDestroyMap();
+
+//Not yet implemented
+        static const int maxRange_s=1000;
+
+        static void rotateYaw(const Vector2& value);
+        static void rotatePitch(const Vector2& value);
+        static void Zoom(const Vector2& value);
+        // variables
+
+
+        bool inline getVisibility()
+            { return this->isVisible_; };
+
+        static inline Ogre::SceneManager* getMapSceneManagerPtr()
+        {
+            return Map::singletonMap_s->mapSceneM_s;
+        }
+        static inline Map* getSingletonPtr()
+        {
+            return Map::singletonMap_s;
+        }
+
+        static inline Ogre::SceneManager* getMapSceneManager()
+        {
+            return Map::mapSceneM_s;
+        }
+
+
+
+    private: // functions
+
+        void toggleVisibility();
+        void updatePositions();
+//        void changedPlayerNode();
+        static inline void setMapSceneManager( Ogre::SceneManager * sm)
+        {
+            Map::mapSceneM_s = sm;
+        }
+        //static Ogre::MaterialPtr init();
+
+    private: // variables
+        static Map* singletonMap_s;
+
+        Ogre::SceneManager* sManager_;
+        Ogre::OverlayManager * oManager_;
+
+        static Ogre::SceneManager* mapSceneM_s;
+        static Ogre::SceneNode* CamNode_;
+        static Ogre::Camera* Cam_;
+        static Ogre::MaterialPtr OverlayMaterial_;
+        static Ogre::Overlay* overlay_;
+        //Ogre::SceneNode* CamNodeHelper_;
+        Ogre::SceneNode* playerShipNode_;
+        Ogre::SceneNode* planeNode_;
+        Ogre::MovablePlane* movablePlane_;
+        int mouseLookSpeed_;
+        bool isVisible_;
+
+    friend class RadarViewable;
+    };
+}
+
+#endif /* _Map_H__ */
Index: code/trunk/src/orxonox/Orxonox.cc
===================================================================
--- code/trunk/src/orxonox/Orxonox.cc	(revision 5693)
+++ code/trunk/src/orxonox/Orxonox.cc	(revision 5693)
@@ -0,0 +1,81 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Benjamin Knecht <beni_at_orxonox.net>, (C) 2007
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Entry point of the program.
+*/
+
+#include "OrxonoxPrereqs.h"
+#include "SpecialConfig.h"
+
+#ifdef ORXONOX_USE_WINMAIN
+# ifndef WIN32_LEAN_AND_MEAN
+#  define WIN32_LEAN_AND_MEAN
+# endif
+#include <windows.h>
+#endif
+
+#include "util/Debug.h"
+#include "Main.h"
+
+/*
+@brief
+    Main method. Game starts here (except for static initialisations).
+*/
+#ifdef ORXONOX_USE_WINMAIN
+INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
+#else
+int main(int argc, char** argv)
+#endif
+{
+    try
+    {
+#ifndef ORXONOX_USE_WINMAIN
+        std::string strCmdLine;
+        for (int i = 1; i < argc; ++i)
+            strCmdLine += argv[i] + std::string(" ");
+
+        return orxonox::main(strCmdLine);
+#endif
+    }
+    catch (const std::exception& ex)
+    {
+        COUT(0) << "Orxonox failed to initialise: " << ex.what() << std::endl;
+        COUT(0) << "Terminating program." << std::endl;
+        return 1;
+    }
+    catch (...)
+    {
+        COUT(0) << "Orxonox failed to initialise: " << std::endl;
+        COUT(0) << "Terminating program." << std::endl;
+        return 1;
+    }
+}
Index: code/trunk/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 5692)
+++ code/trunk/src/orxonox/OrxonoxPrereqs.h	(revision 5693)
@@ -37,9 +37,10 @@
 #include "OrxonoxConfig.h"
 
+#include "tools/ToolsPrereqs.h"
+
 //-----------------------------------------------------------------------
 // Shared library settings
 //-----------------------------------------------------------------------
-#define ORXONOX_NO_EXPORTS // This is an executable that needs no exports
-#if defined(ORXONOX_PLATFORM_WINDOWS) && !(defined(ORXONOX_STATIC_BUILD) || defined(ORXONOX_NO_EXPORTS))
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
 #  ifdef ORXONOX_SHARED_BUILD
 #    define _OrxonoxExport __declspec(dllexport)
@@ -63,21 +64,5 @@
 namespace orxonox
 {
-    namespace LODParticle
-    {
-        enum Value
-        {
-            Off = 0,
-            Low = 1,
-            Normal = 2,
-            High = 3
-        };
-    }
-
-    class RadarViewable;
-    class Radar;
-    class RadarListener;
-
-    class Teamcolourable;
-
+    // manager
     class CameraManager;
     class LevelManager;
@@ -85,4 +70,13 @@
     class PlayerManager;
 
+    // interfaces
+    class GametypeMessageListener;
+    class NotificationListener;
+    class PawnListener;
+    class RadarListener;
+    class RadarViewable;
+    class Rewardable;
+    class Teamcolourable;
+
     // objects
     class Level;
@@ -90,23 +84,5 @@
     class Tickable;
 
-    class AddQuest;
-    class AddQuestHint;
-    class AddReward;
-    class ChangeQuestStatus;
-    class CompleteQuest;
-    class FailQuest;
-    class GlobalQuest;
-    class LocalQuest;
-    class Quest;
-    class QuestDescription;
-    class QuestEffect;
-    class QuestEffectBeacon;
-    class QuestHint;
-    class QuestItem;
-    class QuestListener;
-    class QuestManager;
-    class QuestNotification;
-    class Rewardable;
-
+    // worldentities
     class WorldEntity;
     class StaticEntity;
@@ -114,8 +90,6 @@
     class ControllableEntity;
     class MovableEntity;
-    class Sublevel;
-    class ForceField;
-    class Attacher;
-
+
+    // graphics
     class Model;
     class Billboard;
@@ -129,15 +103,27 @@
     class ParticleEmitter;
     class ParticleSpawner;
-
+    class Camera;
+
+    // mixed
     class PongCenterpoint;
     class PongBall;
     class PongBat;
 
-    class Camera;
-    class CameraPosition;
+    class EventListener;
+    class EventDispatcher;
+    class EventTarget;
+
     class SpawnPoint;
     class TeamSpawnPoint;
+
+    class Attacher;
+    class CameraPosition;
+    class Sublevel;
+    class ForceField;
+    class Radar;
+
     class Test;
 
+    // pawns
     class Spectator;
     class Pawn;
@@ -146,4 +132,14 @@
     class Destroyer;
 
+    // gametypes
+    class Gametype;
+    class Deathmatch;
+    class TeamDeathmatch;
+    class Asteroids;
+    class TeamBaseMatch;
+    class UnderAttack;
+    class Pong;
+
+    // pickups
     class BaseItem;
     class DroppedItem;
@@ -160,4 +156,5 @@
     class PassiveItem;
 
+    // items
     class Item;
     class Engine;
@@ -165,4 +162,5 @@
     class RotatingEngine;
 
+    // trigger
     class Trigger;
     class DistanceTrigger;
@@ -171,4 +169,5 @@
     class CheckPoint;
 
+    // weaponsystem
     class WeaponSystem;
     class WeaponSet;
@@ -178,26 +177,7 @@
     class WeaponMode;
     class DefaultWeaponmodeLink;
-    class MuzzleFlash;
-
-    class LaserFire;
-    class FusionFire;
-    class HsW01;
-    class LightningGun;
-    class EnergyDrink;
-
-    class ReplenishingMunition;
     class Munition;
-    class LaserMunition;
-    class FusionMunition;
-
-    class Projectile;
-    class BillboardProjectile;
-    class ParticleProjectile;
-    class LightningGunProjectile;
-
-    class EventListener;
-    class EventDispatcher;
-    class EventTarget;
-
+
+    // controller
     class Controller;
     class HumanController;
@@ -209,4 +189,5 @@
     class PongAI;
 
+    // infos
     class Info;
     class PlayerInfo;
@@ -216,17 +197,4 @@
     class GametypeInfo;
 
-    class Gametype;
-    class Deathmatch;
-    class TeamDeathmatch;
-    class Asteroids;
-    class TeamBaseMatch;
-    class UnderAttack;
-    class Pong;
-
-    class Scores;
-    class CreateLines;
-    class Scoreboard;
-    class Stats;
-
     // collision
     class CollisionShape;
@@ -236,39 +204,10 @@
     class WorldEntityCollisionShape;
 
-    // tools
-    class BillboardSet;
-    class Light;
-    class Mesh;
-    class ParticleInterface;
-    class Shader;
-    template <class T>
-    class Timer;
-
     // overlays
-    class BarColour;
-    class DebugFPSText;
-    class DebugRTRText;
-    class GUIOverlay;
-    class HUDBar;
-    class HUDNavigation;
-    class HUDRadar;
-    class HUDSpeedBar;
-    class HUDHealthBar;
-    class HUDTimer;
-    class InGameConsole;
+    class OverlayGroup;
+    class OrxonoxOverlay;
     class Notification;
     class NotificationManager;
-    class NotificationOverlay;
-    class NotificationQueue;
-    class OrxonoxOverlay;
-    class OverlayGroup;
-    class OverlayText;
-    class FadeoutText;
-    class GametypeStatus;
-    class AnnounceMessage;
-    class KillMessage;
-    class DeathMessage;
-    class CreateLines;
-    class Scoreboard;
+    class InGameConsole;
     class Map;
 
@@ -279,11 +218,4 @@
 }
 
-namespace Ogre
-{
-    // OGRE Wiki adapted code
-    class DynamicLines;
-    class DynamicRenderable;
-}
-
 // Bullet Physics Engine
 class btTransform;
Index: code/trunk/src/orxonox/PawnManager.h
===================================================================
--- code/trunk/src/orxonox/PawnManager.h	(revision 5692)
+++ code/trunk/src/orxonox/PawnManager.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include "util/Singleton.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/gamestates/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+SET_SOURCE_FILES(GAMESTATES_SRC_FILES
   GSClient.cc
   GSDedicated.cc
@@ -10,2 +10,11 @@
   GSStandalone.cc
 )
+
+ORXONOX_ADD_LIBRARY(gamestates
+  MODULE
+  DEFINE_SYMBOL
+    "GAMESTATES_SHARED_BUILD"
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${GAMESTATES_SRC_FILES}
+)
Index: code/trunk/src/orxonox/gamestates/GSClient.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSClient.cc	(revision 5693)
@@ -40,5 +40,5 @@
     DeclareGameState(GSClient, "client", false, true);
 
-    SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as strin in the form #.#.#.#");
+    SetCommandLineArgument(ip, "127.0.0.1").information("Sever IP as string in the form #.#.#.#");
 
     GSClient::GSClient(const GameStateInfo& info)
Index: code/trunk/src/orxonox/gamestates/GSClient.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSClient.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSClient.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _GSClient_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 
 #include "core/GameState.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSClient : public GameState
+    class _GameStatesExport GSClient : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSDedicated.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSDedicated.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSDedicated.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _GSDedicated_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 
 #include "core/GameState.h"
@@ -44,6 +44,6 @@
 namespace orxonox
 {
-    
-    class _OrxonoxExport GSDedicated : public GameState
+
+    class _GameStatesExport GSDedicated : public GameState
     {
     public:
@@ -61,10 +61,10 @@
         void setTerminalMode();
         static void resetTerminalMode();
-        
+
         void insertCharacter( unsigned int position, char c );
         void deleteCharacter( unsigned int position );
-        
+
         Server*                 server_;
-        
+
         boost::thread           *inputThread_;
         boost::recursive_mutex  inputLineMutex_;
@@ -76,5 +76,5 @@
         std::queue<std::string> commandQueue_;
         static termios*         originalTerminalSettings_;
-        
+
         unsigned int            cursorX_;
         unsigned int            cursorY_;
Index: code/trunk/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 5693)
@@ -47,9 +47,9 @@
 #include "core/Loader.h"
 #include "core/XMLFile.h"
-#include "overlays/console/InGameConsole.h"
+#include "InGameConsole.h"
 #include "sound/SoundManager.h"
 
 // HACK:
-#include "overlays/map/Map.h"
+#include "Map.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 5693)
@@ -36,5 +36,5 @@
 #define _GSGraphics_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 #include "core/GameState.h"
 
@@ -47,5 +47,5 @@
         This game state is only left out if we start a dedicated server where no graphics are present.
     */
-    class _OrxonoxExport GSGraphics : public GameState
+    class _GameStatesExport GSGraphics : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSIOConsole.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSIOConsole.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSIOConsole.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _GSIOConsole_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 #include "core/GameState.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport GSIOConsole : public GameState
+    class _GameStatesExport GSIOConsole : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 5693)
@@ -45,8 +45,6 @@
 #include "core/XMLFile.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/Radar.h"
-#include "objects/quest/QuestManager.h"
-#include "overlays/notifications/NotificationManager.h"
 #include "CameraManager.h"
 #include "LevelManager.h"
@@ -110,7 +108,5 @@
         this->playerManager_ = new PlayerManager();
 
-        this->questManager_ = new QuestManager();
-
-        this->notificationManager_ = new NotificationManager();
+        this->scope_GSLevel_ = new Scope<ScopeID::GSLevel>();
 
         if (GameMode::isMaster())
@@ -201,14 +197,8 @@
         }
 
-        if (this->questManager_)
-        {
-            delete this->questManager_;
-            this->questManager_ = NULL;
-        }
-
-        if (this->notificationManager_)
-        {
-            delete this->notificationManager_;
-            this->notificationManager_ = NULL;
+        if (this->scope_GSLevel_)
+        {
+            delete this->scope_GSLevel_;
+            this->scope_GSLevel_ = NULL;
         }
 
Index: code/trunk/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 5693)
@@ -30,7 +30,8 @@
 #define _GSLevel_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 
 #include <string>
+#include "util/Scope.h"
 #include "core/OrxonoxClass.h"
 #include "core/GameState.h"
@@ -38,5 +39,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSLevel : public GameState, public OrxonoxClass
+    class _GameStatesExport GSLevel : public GameState, public OrxonoxClass
     {
     public:
@@ -62,13 +63,12 @@
         void keybindInternal(const std::string& command, bool bTemporary);
 
-        KeyBinder*            keyBinder_;               //!< tool that loads and manages the input bindings
-        InputState*           gameInputState_;          //!< input state for normal ingame playing
-        InputState*           guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
-        InputState*           guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
-        Radar*                radar_;                   //!< represents the Radar (not the HUD part)
-        CameraManager*        cameraManager_;           //!< camera manager for this level
-        PlayerManager*        playerManager_;           //!< player manager for this level
-        QuestManager*         questManager_;
-        NotificationManager*  notificationManager_;
+        KeyBinder*               keyBinder_;               //!< tool that loads and manages the input bindings
+        InputState*              gameInputState_;          //!< input state for normal ingame playing
+        InputState*              guiMouseOnlyInputState_;  //!< input state if we only need the mouse to use the GUI
+        InputState*              guiKeysOnlyInputState_;   //!< input state if we only need the keys to use the GUI
+        Radar*                   radar_;                   //!< represents the Radar (not the HUD part)
+        CameraManager*           cameraManager_;           //!< camera manager for this level
+        PlayerManager*           playerManager_;           //!< player manager for this level
+        Scope<ScopeID::GSLevel>* scope_GSLevel_;
 
         //##### ConfigValues #####
Index: code/trunk/src/orxonox/gamestates/GSMainMenu.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSMainMenu.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSMainMenu.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _GSMainMenu_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 
 #include "util/OgreForwardRefs.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSMainMenu : public GameState
+    class _GameStatesExport GSMainMenu : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 5693)
@@ -38,6 +38,6 @@
 #include "ToluaBindOrxonox.h"
 #include "tools/Timer.h"
-#include "interfaces/TimeFactorListener.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/TimeFactorListener.h"
+#include "tools/interfaces/Tickable.h"
 #include "LevelManager.h"
 
Index: code/trunk/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _GSRoot_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 #include "core/GameState.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport GSRoot : public GameState
+    class _GameStatesExport GSRoot : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSServer.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSServer.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSServer.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _GSServer_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 
 #include "core/GameState.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GSServer : public GameState
+    class _GameStatesExport GSServer : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GSStandalone.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSStandalone.h	(revision 5692)
+++ code/trunk/src/orxonox/gamestates/GSStandalone.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _GSStandalone_H__
 
-#include "OrxonoxPrereqs.h"
+#include "gamestates/GameStatesPrereqs.h"
 #include "core/GameState.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport GSStandalone : public GameState
+    class _GameStatesExport GSStandalone : public GameState
     {
     public:
Index: code/trunk/src/orxonox/gamestates/GameStatesPrereqs.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GameStatesPrereqs.h	(revision 5693)
+++ code/trunk/src/orxonox/gamestates/GameStatesPrereqs.h	(revision 5693)
@@ -0,0 +1,60 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _GameStatesPrereqs_H__
+#define _GameStatesPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef GAMESTATES_SHARED_BUILD
+#    define _GameStatesExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _GameStatesExport
+#    else
+#      define _GameStatesExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _GameStatesExport  __attribute__ ((visibility("default")))
+#else
+#  define _GameStatesExport
+#endif
+
+#endif /* _GameStatesPrereqs_H__ */
Index: code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 5692)
+++ code/trunk/src/orxonox/interfaces/InterfaceCompilation.cc	(revision 5693)
@@ -30,5 +30,5 @@
 @file
 @brief
-    Compiles all the interfaces (except RadarViewable) with mostly just a constructor.
+    Compiles all the interfaces in the orxonox library with mostly just a constructor.
 */
 
@@ -38,6 +38,5 @@
 #include "Rewardable.h"
 #include "TeamColourable.h"
-#include "Tickable.h"
-#include "TimeFactorListener.h"
+#include "NotificationListener.h"
 
 #include "core/CoreIncludes.h"
@@ -81,25 +80,4 @@
 
     //----------------------------
-    // TimeFactorListener
-    //----------------------------
-    float TimeFactorListener::timefactor_s = 1.0f;
-
-    TimeFactorListener::TimeFactorListener()
-    {
-        RegisterRootObject(TimeFactorListener);
-    }
-
-    //----------------------------
-    // Tickable
-    //----------------------------
-    /**
-        @brief Constructor: Registers the object in the Tickable-list
-    */
-    Tickable::Tickable()
-    {
-        RegisterRootObject(Tickable);
-    }
-
-    //----------------------------
     // Rewardable
     //----------------------------
@@ -108,3 +86,11 @@
         RegisterObject(Rewardable);
     }
+
+    //----------------------------
+    // NotificationListener
+    //----------------------------
+    NotificationListener::NotificationListener()
+    {
+        RegisterObject(NotificationListener);
+    }
 }
Index: code/trunk/src/orxonox/interfaces/NotificationListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/NotificationListener.h	(revision 5693)
+++ code/trunk/src/orxonox/interfaces/NotificationListener.h	(revision 5693)
@@ -0,0 +1,59 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationListener class.
+*/
+
+#ifndef _NotificationListener_H__
+#define _NotificationListener_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include <ctime>
+#include <set>
+#include <string>
+
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _OrxonoxExport NotificationListener : virtual public OrxonoxClass
+    {
+        public:
+            NotificationListener();
+            virtual ~NotificationListener() {}
+
+            virtual const std::set<std::string> & getTargetsSet() = 0;
+            virtual void update(void) = 0;
+            virtual void update(Notification* notification, const std::time_t & time) = 0;
+    };
+}
+
+#endif /* _NotificationListener_H__ */
Index: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 5692)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc	(revision 5693)
@@ -38,5 +38,5 @@
 #include "objects/worldentities/WorldEntity.h"
 #include "objects/Radar.h"
-#include "overlays/map/Map.h"
+#include "Map.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/interfaces/Tickable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/Tickable.h	(revision 5692)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 2
- *   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, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Fabian 'x3n' Landau
- *   Co-authors:
- *      ...
- *
- */
-
-/*!
-    @file
-    @brief Declaration of the Tickable interface.
-
-    The Tickable interface provides a tick(dt) function, that gets called every frame.
-    float dt is the time since the last frame in seconds.
-
-    Attention:
-    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
-    parent::tick(dt) function explicitly in their implementation of tick(dt) because it's a virtual function.
-*/
-
-#ifndef _Tickable_H__
-#define _Tickable_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/OrxonoxClass.h"
-#include "core/Super.h"
-
-namespace orxonox
-{
-    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
-    class _OrxonoxExport Tickable : virtual public OrxonoxClass
-    {
-        public:
-            /**
-                @brief Gets called every frame.
-                @param dt The time since the last frame in seconds
-            */
-            virtual void tick(float dt) { }
-
-        protected:
-            Tickable();
-    };
-
-    SUPER_FUNCTION(1, Tickable, tick, true);
-}
-
-#endif /* _Tickable_H__ */
Index: code/trunk/src/orxonox/interfaces/TimeFactorListener.h
===================================================================
--- code/trunk/src/orxonox/interfaces/TimeFactorListener.h	(revision 5692)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   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 2
- *   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, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _TimeFactorListener_H__
-#define _TimeFactorListener_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport TimeFactorListener : virtual public OrxonoxClass
-    {
-        friend class GSRoot;
-
-        public:
-            TimeFactorListener();
-            virtual ~TimeFactorListener() {}
-
-        protected:
-            virtual void changedTimeFactor(float factor_new, float factor_old) {}
-            inline float getTimeFactor() const
-                { return TimeFactorListener::timefactor_s; }
-
-        private:
-            static float timefactor_s;
-    };
-}
-
-#endif /* _TimeFactorListener_H__ */
Index: code/trunk/src/orxonox/objects/Radar.h
===================================================================
--- code/trunk/src/orxonox/objects/Radar.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/Radar.h	(revision 5693)
@@ -42,5 +42,5 @@
 #include "core/ObjectListIterator.h"
 #include "interfaces/RadarViewable.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/objects/Scene.h
===================================================================
--- code/trunk/src/orxonox/objects/Scene.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/Scene.h	(revision 5693)
@@ -41,5 +41,5 @@
 #include "core/BaseObject.h"
 #include "network/synchronisable/Synchronisable.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/objects/Test.h
===================================================================
--- code/trunk/src/orxonox/objects/Test.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/Test.h	(revision 5693)
@@ -33,5 +33,5 @@
 #include "core/BaseObject.h"
 #include "network/synchronisable/Synchronisable.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 
@@ -50,5 +50,5 @@
       void setConfigValues();
       void registerVariables();
-      
+
       static void call(unsigned int clientID);
       void call2(unsigned int clientID, std::string s1, std::string s2, std::string s3, std::string s4);
@@ -65,5 +65,5 @@
       void checkU3();
       void checkU4();
-      
+
       //signed functions
       void setS1(TYPE value){ s1 = value; }
@@ -75,10 +75,10 @@
       void checkS3();
       void checkS4();
-      
+
       static void printV1(){ instance_->checkU1(); }
       static void printV2(){ instance_->checkU2(); }
       static void printV3(){ instance_->checkU3(); }
       static void printV4(){ instance_->checkU4(); }
-      
+
       void printBlaBla(std::string s1, std::string s2, std::string s3, std::string s4, std::string s5);
 
@@ -88,10 +88,10 @@
       UTYPE u3;
       UTYPE u4;
-      
+
       TYPE s1;
       TYPE s2;
       TYPE s3;
       TYPE s4;
-      
+
       static Test* instance_;
   };
Index: code/trunk/src/orxonox/objects/controllers/AIController.h
===================================================================
--- code/trunk/src/orxonox/objects/controllers/AIController.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/controllers/AIController.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include "tools/Timer.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "ArtificialController.h"
 
Index: code/trunk/src/orxonox/objects/controllers/HumanController.cc
===================================================================
--- code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 5692)
+++ code/trunk/src/orxonox/objects/controllers/HumanController.cc	(revision 5693)
@@ -35,5 +35,5 @@
 #include "objects/gametypes/Gametype.h"
 #include "objects/infos/PlayerInfo.h"
-#include "overlays/map/Map.h"
+#include "Map.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/objects/controllers/PongAI.h
===================================================================
--- code/trunk/src/orxonox/objects/controllers/PongAI.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/controllers/PongAI.h	(revision 5693)
@@ -34,5 +34,5 @@
 #include <list>
 #include "util/Math.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "Controller.h"
 
Index: code/trunk/src/orxonox/objects/controllers/WaypointController.h
===================================================================
--- code/trunk/src/orxonox/objects/controllers/WaypointController.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/controllers/WaypointController.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include <vector>
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "ArtificialController.h"
 
Index: code/trunk/src/orxonox/objects/gametypes/Gametype.h
===================================================================
--- code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/gametypes/Gametype.h	(revision 5693)
@@ -38,5 +38,5 @@
 #include "core/BaseObject.h"
 #include "core/Identifier.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/infos/GametypeInfo.h"
 
@@ -133,5 +133,5 @@
 
             inline  void startTimer()
-            { 
+            {
                 this->time_ = this->timeLimit_;
                 this->timerIsActive_ = true;
Index: code/trunk/src/orxonox/objects/items/Engine.h
===================================================================
--- code/trunk/src/orxonox/objects/items/Engine.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/items/Engine.h	(revision 5693)
@@ -32,5 +32,5 @@
 #include "OrxonoxPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "Item.h"
 
Index: code/trunk/src/orxonox/objects/pickup/DroppedItem.h
===================================================================
--- code/trunk/src/orxonox/objects/pickup/DroppedItem.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/pickup/DroppedItem.h	(revision 5693)
@@ -38,5 +38,5 @@
 
 #include "tools/Timer.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/worldentities/StaticEntity.h"
 
Index: code/trunk/src/orxonox/objects/pickup/PickupSpawner.h
===================================================================
--- code/trunk/src/orxonox/objects/pickup/PickupSpawner.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/pickup/PickupSpawner.h	(revision 5693)
@@ -39,5 +39,5 @@
 #include <string>
 #include "tools/Timer.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/worldentities/StaticEntity.h"
 
Index: code/trunk/src/orxonox/objects/quest/AddQuest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/AddQuest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/AddQuest.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _AddQuest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 #include "ChangeQuestStatus.h"
 
@@ -43,19 +43,19 @@
     @brief
         Adds a Quest, resp. changes the quests status to active for the player invoking the Quest.
-        
+
         Creating a AddQuest through XML goes as follows:
-        
+
         <AddQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be added.
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport AddQuest : public ChangeQuestStatus
+    class _QuestExport AddQuest : public ChangeQuestStatus
     {
         public:
         AddQuest(BaseObject* creator);
         virtual ~AddQuest();
-    
+
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a AddQuest object through XML.
-    
+
         virtual bool invoke(PlayerInfo* player); //!< Invokes the QuestEffect.
 
Index: code/trunk/src/orxonox/objects/quest/AddQuestHint.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/AddQuestHint.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/AddQuestHint.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _AddQuestHint_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
@@ -45,12 +45,12 @@
     @brief
         Adds a QuestHint, resp. activates the QuestHint of the given id for the player the QuestEffect is invoked on.
-        
+
     Creating a AddQuestHint through XML goes as follows:
-        
+
         <AddQuestHint hintId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the QuestHint that should be added.
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport AddQuestHint : public QuestEffect
+    class _QuestExport AddQuestHint : public QuestEffect
     {
         public:
@@ -71,5 +71,5 @@
             inline const std::string & getHintId(void) const
                 { return this->hintId_; }
-            
+
             bool setHintId(const std::string & id); //!< Sets the id of the QuestHint.
 
Index: code/trunk/src/orxonox/objects/quest/AddReward.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/AddReward.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/AddReward.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _AddReward_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -45,7 +45,7 @@
     @brief
         Adds a list of Rewardables to a player.
-        
+
         Creating a AddReward through XML goes as follows:
-        
+
         <AddReward>
             <Rewardable /> //A list of Rewardable objects to be rewarded the player, see the specific Rewardables for their respective XML representations.
@@ -56,5 +56,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport AddReward : public QuestEffect
+    class _QuestExport AddReward : public QuestEffect
     {
         public:
@@ -75,5 +75,5 @@
             inline void addRewardable(Rewardable* reward)
                 { this->rewards_.push_back(reward); }
-        
+
             const Rewardable* getRewardables(unsigned int index) const; //!< Returns the Rewardable object at the given index.
 
Index: code/trunk/src/orxonox/objects/quest/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/quest/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+SET_SOURCE_FILES(QUEST_SRC_FILES
   AddQuest.cc
   AddQuestHint.cc
@@ -18,2 +18,20 @@
   QuestNotification.cc
 )
+
+ADD_SUBDIRECTORY(notifications)
+
+# add the parent directory for tolua (TODO: remove this if the quest module is moved somewhere else)
+INCLUDE_DIRECTORIES(..)
+
+ORXONOX_ADD_LIBRARY(quest
+  MODULE
+  TOLUA_FILES
+    QuestDescription.h
+    QuestManager.h
+  DEFINE_SYMBOL
+    "QUEST_SHARED_BUILD"
+  LINK_LIBRARIES
+    orxonox
+    overlays
+  SOURCE_FILES ${QUEST_SRC_FILES}
+)
Index: code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/ChangeQuestStatus.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _ChangeQuestStatus_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
@@ -48,5 +48,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport ChangeQuestStatus : public QuestEffect
+    class _QuestExport ChangeQuestStatus : public QuestEffect
     {
         public:
@@ -68,5 +68,5 @@
         private:
             std::string questId_; //!< The id of the Quest the status should be changed of.
-            
+
             bool setQuestId(const std::string & id); //!< Sets the id of the Quest.
 
Index: code/trunk/src/orxonox/objects/quest/CompleteQuest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/CompleteQuest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/CompleteQuest.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _CompleteQuest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 #include "ChangeQuestStatus.h"
 
@@ -43,12 +43,12 @@
     @brief
         Completes a Quest (with a specified id) for the player invoking the QuestEffect.
-        
+
         Creating a CompleteQuest through XML goes as follows:
-        
+
         <CompleteQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be completed.
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport CompleteQuest : public ChangeQuestStatus
+    class _QuestExport CompleteQuest : public ChangeQuestStatus
     {
         public:
Index: code/trunk/src/orxonox/objects/quest/FailQuest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/FailQuest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/FailQuest.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _FailQuest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 #include "ChangeQuestStatus.h"
 
@@ -43,12 +43,12 @@
     @brief
         Fails a quest (with a specified id) for the player invoking the QuestEffect.
-        
+
         Creating a FailQuest through XML goes as follows:
-        
+
         <FailQuest questId="id" />  //Where id is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information, and identifies the Quest that should be failed.
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport FailQuest : public ChangeQuestStatus
+    class _QuestExport FailQuest : public ChangeQuestStatus
     {
         public:
Index: code/trunk/src/orxonox/objects/quest/GlobalQuest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/GlobalQuest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/GlobalQuest.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -35,5 +35,5 @@
 #define _GlobalQuest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -47,7 +47,7 @@
         GlobalQuests are Quests, that have the same status for all players.
         This means, that when a player successfully completes a GlobalQuest, it is completed for all players that have it.
-        
+
         Creating a GlobalQuest through XML goes as follows:
-        
+
         <GlobalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
             <QuestDescription title="Title" description="Description." /> //The description of the quest.
@@ -81,5 +81,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport GlobalQuest : public Quest
+    class _QuestExport GlobalQuest : public Quest
     {
         public:
@@ -88,5 +88,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a GlobalQuest object through XML.
-            
+
             virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
             virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
@@ -98,5 +98,5 @@
 
             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const; //!< Returns the status of the Quest for a specific player.
-            
+
             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status); //!< Sets the status for a specific player.
 
@@ -105,5 +105,5 @@
             QuestStatus::Value status_; //!< The status of this Quest.
             std::list<QuestEffect*> rewards_; //!< Reward QuestEffects only invoked on the player completing the Quest.
-            
+
             bool addRewardEffect(QuestEffect* effect); //!< Adds a reward QuestEffect to the list of reward QuestEffects.
             const QuestEffect* getRewardEffects(unsigned int index) const; //!< Returns the reward QuestEffect at the given index.
Index: code/trunk/src/orxonox/objects/quest/LocalQuest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/LocalQuest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/LocalQuest.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -35,5 +35,5 @@
 #define _LocalQuest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <map>
@@ -46,7 +46,7 @@
         Handles Quests which have different states for different players.
         LocalQuests have (as opposed to GlobalQuests) a different state for each player, that means if for one player the status of the Quest changes it does not for all the other players which also possess this quest.
-        
+
         Creating a LocalQuest through XML goes as follows:
-        
+
         <LocalQuest id="questId"> //Where questId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
             <QuestDescription title="Title" description="Description." /> //The description of the quest.
@@ -75,5 +75,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport LocalQuest : public Quest
+    class _QuestExport LocalQuest : public Quest
     {
         public:
@@ -82,5 +82,5 @@
 
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a LocalQuest object through XML.
-            
+
             virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
             virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
Index: code/trunk/src/orxonox/objects/quest/Quest.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/Quest.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/Quest.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -32,9 +32,9 @@
         The Quest is the parent class of LocalQuest and GlobalQuest.
 */
- 
+
 #ifndef _Quest_H__
 #define _Quest_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -62,10 +62,10 @@
         A Quest has several hints (QuestHint) that can be unlocked through QuestEffects and then display aid in solving the Quest.
         A Quest has a list of QuestEffects that are invoked when the quest is failed and also a list of QuestEffects that are invoked, when the Quest is completed.
-        
+
         Quest itself should not be instantiated, if you want to create a quest either go for LocalQuest or GlobalQuest, whichever suits you needs better.
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport Quest : public QuestItem
+    class _QuestExport Quest : public QuestItem
     {
         public:
@@ -81,5 +81,5 @@
             inline Quest* getParentQuest(void) const
                 { return this->parentQuest_; }
-                
+
             /**
             @brief Returns the list of subquests.
@@ -95,14 +95,14 @@
             inline const std::list<QuestHint*> & getHintsList(void) const
                 { return this->hints_; }
-        
+
             bool isInactive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'inactive'.
             bool isActive(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'active'.
             bool isFailed(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'failed'.
             bool isCompleted(const PlayerInfo* player) const; //!< Returns true if the quest status for the specific player is 'completed'.
-        
+
             bool start(PlayerInfo* player); //!< Sets a Quest to active.
             virtual bool fail(PlayerInfo* player); //!< Fails the Quest.
             virtual bool complete(PlayerInfo* player); //!< Completes the Quest.
-        
+
             bool addListener(QuestListener* listener); //!< Adds a QuestListener to the list of QuestListeners listening to this Quest.
 
@@ -116,5 +116,5 @@
             const QuestEffect* getFailEffect(unsigned int index) const; //!< Returns the fail QuestEffect at the given index.
             const QuestEffect* getCompleteEffect(unsigned int index) const; //!< Returns the complete QuestEffect at the given index.
-            
+
             /**
             @brief Returns the list of fail QuestEffects.
@@ -123,5 +123,5 @@
             inline std::list<QuestEffect*> & getFailEffectList(void)
                 { return this->failEffects_; }
-                
+
             /**
             @brief Returns the list of complete QuestEffects.
@@ -133,5 +133,5 @@
             virtual QuestStatus::Value getStatus(const PlayerInfo* player) const = 0; //!< Returns the status of the Quest for a specific player.
             virtual bool setStatus(PlayerInfo* player, const QuestStatus::Value & status) = 0; //!< Changes the status for a specific player.
-            
+
         private:
             Quest* parentQuest_; //!< Pointer to the parentquest.
@@ -142,7 +142,7 @@
             std::list<QuestEffect*> failEffects_; //!< A list of all QuestEffects to be invoked, when the Quest has been failed.
             std::list<QuestEffect*> completeEffects_; //!< A list of QuestEffects to be invoked, when the Quest has been completed.
-            
+
             std::list<QuestListener*> listeners_; //!< A list of QuestListeners, that listen to what exactly happens with this Quest.
-            
+
             bool setParentQuest(Quest* quest); //!< Sets the parentquest of the Quest.
             bool addSubQuest(Quest* quest); //!< Adds a subquest to the Quest.
Index: code/trunk/src/orxonox/objects/quest/QuestDescription.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestDescription.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestDescription.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _QuestDescription_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
@@ -47,12 +47,12 @@
         This class is a description of a QuestItem.
         It holds a title and a description.
-        
+
         Creating a QuestDescription through XML goes as follows:
-        
+
         <QuestDescription title="Title" description="Description Text" failMessage="You fail." completeMessage="You win!" />
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestDescription : public BaseObject
+    class _QuestExport QuestDescription : public BaseObject
     {
 // tolua_end
@@ -70,5 +70,5 @@
             inline const std::string & getTitle(void) const
                 { return this->title_; }
-        
+
             /**
             @brief Returns the description text.
@@ -78,5 +78,5 @@
                 { return this->description_; }
 // tolua_end
-        
+
             /**
             @brief Returns the fail message.
@@ -85,5 +85,5 @@
             inline const std::string & getFailMessage(void) const
                 { return this->failMessage_; }
-        
+
             /**
             @brief Returns the complete message.
@@ -92,5 +92,5 @@
             inline const std::string & getCompleteMessage(void) const
                 { return this->completeMessage_; }
-        
+
             /**
             @brief Sends a Notification displaying that a QuestHint was added.
@@ -99,5 +99,5 @@
             inline bool sendAddHintNotification(void) const
                 { return notificationHelper("hint", ""); }
-        
+
             /**
             @brief Sends a Notification displaying that a Quest was added.
@@ -106,5 +106,5 @@
             inline bool sendAddQuestNotification(void) const
                 { return notificationHelper("quest", "start"); }
-        
+
             /**
             @brief Sends a Notification displaying that a Quest was failed.
@@ -113,5 +113,5 @@
             inline bool sendFailQuestNotification(void) const
                 { return notificationHelper("quest", "fail"); }
-        
+
             /**
             @brief Sends a Notification displaying that a Quest was completed.
@@ -135,5 +135,5 @@
             inline void setTitle(const std::string & title)
                 { this->title_ = title; }
-                
+
             /**
             @brief Sets the description text.
@@ -149,5 +149,5 @@
             inline void setFailMessage(const std::string & message)
                 { this->failMessage_ = message; }
-                
+
             /**
             @brief Sets the complete message.
Index: code/trunk/src/orxonox/objects/quest/QuestEffect.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestEffect.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestEffect.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -35,5 +35,5 @@
 #define _QuestEffect_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -49,5 +49,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestEffect : public BaseObject
+    class _QuestExport QuestEffect : public BaseObject
     {
         public:
Index: code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestEffectBeacon.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _QuestEffectBeacon_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -58,7 +58,7 @@
         A QuestEffectBeacon can be executed a defined number of times.
         A QuestEffectBeacon can be inactive or active.
-        
+
         Creating a QuestEffectBeacon through XML goes as follows:
-        
+
         <QuestEffectBeacon times=n> //Where 'n' is eighter a number >= 0, which means the QuestEffectBeacon can be executed n times. Or n = -1, which means the QuestEffectBeacon can be executed an infinite number of times.
             <effects>
@@ -79,16 +79,16 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestEffectBeacon : public StaticEntity
+    class _QuestExport QuestEffectBeacon : public StaticEntity
     {
         public:
             QuestEffectBeacon(BaseObject* creator);
             virtual ~QuestEffectBeacon();
-            
+
             virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestEffectBeacon object through XML.
-            
+
             virtual void processEvent(Event& event); //!< Processes an event for this QuestEffectBeacon.
-            
+
             bool execute(bool b, PlayerTrigger* trigger); //!< Executes the QuestEffects of the QuestEffectBeacon.
-            
+
             /**
             @brief Tests whether the QuestEffectBeacon is active.
@@ -97,10 +97,10 @@
             inline bool isActive(void)
             { return this->status_ == QuestEffectBeaconStatus::Active; }
-            
+
             bool setActive(bool activate); //!< Set the status of the QuestEffectBeacon.
-            
+
         protected:
             bool decrementTimes(void); //!< Decrement the number of times the QuestEffectBeacon can still be executed.
-            
+
             /**
             @brief Returns the number of times the QUestEffectBeacon can still be executed.
@@ -109,17 +109,17 @@
             inline const int & getTimes(void) const
                 { return this->times_; }
-    
+
         private:
             static const int INFINITE_TIME = -1; //!< Constant to avoid using magic numbers.
-            
+
             std::list<QuestEffect*> effects_; //!< The list of QuestEffects to be invoked on the executing player.
             int times_; //!< Number of times the beacon can be exectued.
             QuestEffectBeaconStatus::Value status_; //!< The status of the QUestEffectBeacon, Can be eighter active or inactive.
-            
+
             bool setTimes(const int & n); //!< Set the number of times the QuestEffectBeacon can be executed.
             bool addEffect(QuestEffect* effect); //!< Add a QuestEffect to the QuestEffectBeacon.
-            
+
             const QuestEffect* getEffect(unsigned int index) const; //!< Get the QuestEffect at a given index.
-    
+
     };
 
Index: code/trunk/src/orxonox/objects/quest/QuestHint.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestHint.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestHint.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -35,5 +35,5 @@
 #define _QuestHint_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <map>
@@ -57,7 +57,7 @@
         Consists of title and description (which is stored in a QuestDescription object) in textual form and must belong to a quest.
         A QuestHint has a defined status (inactive or active, where inactive is default) for each player, which means each a QuestHint exists only once for all players, it doesn't belong to a player, it just has different states for each of them.
-        
+
         Creating a QuestHint through XML goes as follows:
-        
+
         <QuestHint id="hintId">  //Where hintId is a GUID, see http://en.wikipedia.org/wiki/Globally_Unique_Identifier#Basic_structure for more information
             <QuestDesctription title="" description="" />
@@ -66,5 +66,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestHint : public QuestItem
+    class _QuestExport QuestHint : public QuestItem
     {
 
Index: code/trunk/src/orxonox/objects/quest/QuestItem.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestItem.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestItem.h	(revision 5693)
@@ -26,5 +26,5 @@
  *
  */
- 
+
 /**
     @file
@@ -37,5 +37,5 @@
 #define _QuestItem_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
@@ -51,5 +51,5 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestItem : public BaseObject
+    class _QuestExport QuestItem : public BaseObject
     {
 
@@ -66,5 +66,5 @@
             inline const std::string & getId(void) const
                 { return this->id_; }
-            
+
             /**
             @brief Returns the QuestDescription of the QuestItem.
@@ -78,5 +78,5 @@
         protected:
             void setId(const std::string & id); //!< Sets the id of the QuestItem.
-            
+
             /**
             @brief Sets the description of the QuestItem.
Index: code/trunk/src/orxonox/objects/quest/QuestListener.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestListener.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestListener.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _QuestListener_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
@@ -58,11 +58,11 @@
     @brief
         Provides a way to react to the starting, completing and failing of Quests.
-        
+
         The XML representation goes as follows:
         You can use the QuestListener as if it were a Trigger or EventListener, that fires an Event when the status (depending on the set mode) of the given Quest changes.
-        
+
         <BaseObject> // The object that should react to the status change of a Quest.
             <events>
-                <function> // Where function is the method of the object that schould be executed. Normally this would be visibility or activity.
+                <function> // Where function is the method of the object that should be executed. Normally this would be visibility or activity.
                     <QuestListener questId="someQuestId" mode="someMode" /> // Where someQuestId is the identifier for the Quest the QuestListener is reacting to, and someMode is the kind of status change the QUestListener reacts to (all, start, complete or fail).
                 </function>
@@ -72,26 +72,26 @@
     Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestListener : public BaseObject
+    class _QuestExport QuestListener : public BaseObject
     {
     public:
         QuestListener(BaseObject* creator);
         virtual ~QuestListener();
-        
+
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a QuestListener object through XML.
-        
+
         static void advertiseStatusChange(std::list<QuestListener*> & listeners, const std::string & status); //!< Makes all QuestListener in the list aware that a certain status change has occured.
-        
+
         bool setQuestId(const std::string & id); //!< Sets the questId of the Quest the QuestListener reacts to.
         bool setMode(const std::string & mode); //!< Sets the mode of the QuestListener.
-        
+
         std::string getMode(void); //!< Get the mode of the QuestListener.
-        
-        const std::string & getQuestId(void);        
+
+        const std::string & getQuestId(void);
         bool execute(void); //!< Executes the QuestListener, resp. fires an Event.
-        
+
     private:
         QuestListenerMode::Value mode_; //!< The mode of the QuestListener.
         Quest* quest_; //!< A pointer to the Quest the QuestListener is reacting to.
-    
+
     };
 
Index: code/trunk/src/orxonox/objects/quest/QuestManager.cc
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestManager.cc	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestManager.cc	(revision 5693)
@@ -36,8 +36,7 @@
 #include "util/Exception.h"
 #include "core/CoreIncludes.h"
+#include "core/GUIManager.h"
 
 #include "objects/infos/PlayerInfo.h"
-#include "objects/infos/PlayerInfo.h"
-#include "overlays/GUIOverlay.h"
 #include "Quest.h"
 #include "QuestHint.h"
@@ -66,5 +65,4 @@
     QuestManager::~QuestManager()
     {
-
     }
 
@@ -203,5 +201,5 @@
     /**
     @brief
-        
+
     @param name
     @return
@@ -209,29 +207,17 @@
     QuestContainer* QuestManager::getQuestTree(std::string & name)
     {
-        GUIOverlay* gui = NULL;
-        for (ObjectList<GUIOverlay>::iterator it = ObjectList<GUIOverlay>::begin(); it != ObjectList<GUIOverlay>::end(); ++it)
-            if (it->getGUIName() == name)
-                gui = *it;
-
-        PlayerInfo* player;
-        if(gui == NULL)
-        {
-            COUT(1) << "Error: No GUIOverlay with the given name '" << name << "' present." << std::endl;
+        PlayerInfo* player = GUIManager::getInstance().getPlayer(name);
+        if(player == NULL)
+        {
+            COUT(1) << "Error: GUIOverlay with name '" << name << "' has no player." << std::endl;
             return NULL;
         }
-        BaseObject* obj = gui->getOwner();
-        if(obj == NULL)
-        {
-            COUT(1) << "Error: GUIOverlay has no owner. " << std::endl;
-            return NULL;
-        }
-        player = orxonox_cast<PlayerInfo*>(obj);
-    
+
         QuestContainer* root = NULL;
         QuestContainer* current = NULL;
-        
+
         std::list<Quest*>* rootQuests = new std::list<Quest*>();
         getRootQuests(player, *rootQuests);
-        
+
         for(std::list<Quest*>::iterator it = rootQuests->begin(); it != rootQuests->end(); it++)
         {
@@ -246,5 +232,5 @@
                 current->next = container;
             }
-            
+
             current = container;
 
@@ -260,5 +246,5 @@
     /**
     @brief
-        
+
     @param player
     @param list
@@ -279,5 +265,5 @@
     /**
     @brief
-        
+
     @param quest
     @param player
@@ -310,5 +296,5 @@
             COUT(1) << "An error occurred. A Quest of un-specified status wanted to be displayed." << std::endl;
         }
-        
+
         std::list<Quest*> quests = quest->getSubQuestList();
         QuestContainer* current = NULL;
@@ -329,5 +315,5 @@
                     current->next = subContainer;
                 }
-                
+
                 current = subContainer;
             }
@@ -336,5 +322,5 @@
             current->next = NULL;
         container->subQuests = first;
-        
+
         return container;
     }
@@ -342,5 +328,5 @@
     /**
     @brief
-        
+
     @param quest
     @param player
@@ -368,5 +354,5 @@
                     current->next = hint;
                 }
-                
+
                 current = hint;
             }
Index: code/trunk/src/orxonox/objects/quest/QuestManager.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestManager.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestManager.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _QuestManager_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <list>
@@ -41,5 +41,5 @@
 #include <string>
 
-#include "util/Singleton.h"
+#include "util/ScopedSingleton.h"
 #include "core/OrxonoxClass.h"
 
@@ -66,4 +66,6 @@
     };
 
+    typedef ScopedSingleton<QuestManager, ScopeID::GSLevel> ScopedSingletonQuestManagerGSLevel; // workaround for tolua
+
     /**
     @brief
@@ -73,8 +75,8 @@
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestManager : public Singleton<QuestManager>, public orxonox::OrxonoxClass
+    class _QuestExport QuestManager : public ScopedSingletonQuestManagerGSLevel, public orxonox::OrxonoxClass
     {
 // tolua_end
-            friend class Singleton<QuestManager>;
+            friend class ScopedSingleton<QuestManager, ScopeID::GSLevel>;
         public:
             QuestManager();
@@ -82,5 +84,5 @@
 
             //! Returns a reference to the single instance of the Quest Manager.
-            static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export
+            static QuestManager& getInstance() { return ScopedSingleton<QuestManager, ScopeID::GSLevel>::getInstance(); } // tolua_export
 
             bool registerQuest(Quest* quest); //!< Registers a Quest in the QuestManager.
Index: code/trunk/src/orxonox/objects/quest/QuestNotification.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestNotification.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/quest/QuestNotification.h	(revision 5693)
@@ -26,12 +26,12 @@
  *
  */
- 
+
 #ifndef _QuestNotification_H__
 #define _QuestNotification_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/quest/QuestPrereqs.h"
 
 #include <string>
-#include "overlays/notifications/Notification.h"
+#include "notifications/Notification.h"
 
 namespace orxonox {
@@ -39,9 +39,9 @@
     /**
     @brief
-        
+
     @author
         Damian 'Mozork' Frick
     */
-    class _OrxonoxExport QuestNotification : public Notification
+    class _QuestExport QuestNotification : public Notification
     {
         public:
@@ -49,12 +49,12 @@
             QuestNotification(const std::string & message);
             virtual ~QuestNotification();
-            
+
             bool send(void);
-     
+
         private:
             static const std::string SENDER;
-            
+
             void initialize(void);
- 
+
     };
 
Index: code/trunk/src/orxonox/objects/quest/QuestPrereqs.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/QuestPrereqs.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/QuestPrereqs.h	(revision 5693)
@@ -0,0 +1,92 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _QuestsystemPrereqs_H__
+#define _QuestsystemPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef QUEST_SHARED_BUILD
+#    define _QuestExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _QuestExport
+#    else
+#      define _QuestExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _QuestExport  __attribute__ ((visibility("default")))
+#else
+#  define _QuestExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class AddQuest;
+    class AddQuestHint;
+    class AddReward;
+    class ChangeQuestStatus;
+    class CompleteQuest;
+    class FailQuest;
+    class GlobalQuest;
+    class LocalQuest;
+    class Quest;
+    class QuestDescription;
+    class QuestEffect;
+    class QuestEffectBeacon;
+    class QuestHint;
+    class QuestItem;
+    class QuestListener;
+    class QuestManager;
+    class QuestNotification;
+    class Rewardable;
+
+    class Notification;
+    class NotificationListener;
+    class NotificationManager;
+    class NotificationOverlay;
+    class NotificationQueue;
+}
+
+#endif /* _QuestsystemPrereqs_H__ */
Index: code/trunk/src/orxonox/objects/quest/notifications/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/CMakeLists.txt	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/CMakeLists.txt	(revision 5693)
@@ -0,0 +1,6 @@
+ADD_SOURCE_FILES(QUEST_SRC_FILES
+  Notification.cc
+  NotificationManager.cc
+  NotificationOverlay.cc
+  NotificationQueue.cc
+)
Index: code/trunk/src/orxonox/objects/quest/notifications/Notification.cc
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/Notification.cc	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/Notification.cc	(revision 5693)
@@ -0,0 +1,130 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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 thes
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the Notification class.
+*/
+
+#include "Notification.h"
+
+#include "core/CoreIncludes.h"
+#include "NotificationManager.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Default constructor. Initializes the object.
+    */
+    Notification::Notification(BaseObject* creator) : BaseObject(creator)
+    {
+        RegisterObject(Notification);
+        this->initialize();
+    }
+    
+    /**
+    @brief
+        Constructor. Creates a Notification with the input message.
+    @param message
+        The message of the Notification.
+    */
+    Notification::Notification(const std::string & message) : BaseObject(NULL)
+    {
+        this->message_ = message;
+    }
+    
+    /**
+    @brief
+        Destructor.
+    */
+    Notification::~Notification()
+    {
+    }
+    
+    /**
+    @brief
+        Registers the object and sets some default values.
+    */
+    void Notification::initialize(void)
+    {
+        this->message_ = "";
+        this->sender_ = NotificationManager::NONE;
+        this->sent_ = false;
+    }
+    
+    /**
+    @brief
+        Sends the Notification to the Notificationmanager, with sender NetificationManager::NONE.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::send(void)
+    {
+        return this->send(NotificationManager::NONE);
+    }
+    
+    /**
+    @brief
+        Sends the Notification to the Notificationmanager, which then in turn distributes it to the different NotificationQueues.
+    @param sender
+        The sender the Notification was sent by. Used by the NotificationManager to distributes the notification to the correct NotificationQueues.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::send(const std::string & sender)
+    {
+        this->sender_ = sender;
+        bool successful = NotificationManager::getInstance().registerNotification(this);
+        if(!successful)
+            return false;
+        this->sent_ = true;
+        
+        COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
+        
+        return true;
+    }
+    
+    /**
+    @brief
+        Sets the message of the notification.
+    @param message
+        The message to be set.
+    @return
+        Returns true if successful.
+    */
+    bool Notification::setMessage(const std::string & message)
+    {
+        if(this->isSent()) //!< The message cannot be changed if the message has already been sent.
+            return false;
+        this->message_ = message;
+        return true;
+    }
+
+}
Index: code/trunk/src/orxonox/objects/quest/notifications/Notification.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/Notification.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/Notification.h	(revision 5693)
@@ -0,0 +1,90 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the Notification class.
+*/
+
+#ifndef _Notification_H__
+#define _Notification_H__
+
+#include "objects/quest/QuestPrereqs.h"
+
+#include <string>
+#include "core/BaseObject.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        A Notification is a short message used to inform the player about something that just happened. A Notification can be sent from any part of orxonox and is then displayed in the proper NotificationQueue (depending on which senders the specific NotificationQueue accepts).
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _QuestExport Notification : public BaseObject
+    {
+        public:
+            Notification(BaseObject* creator);
+            Notification(const std::string & message);
+            virtual ~Notification();
+
+            bool send(void); //!< Sends the Notification to the Notificationmanager, with sender NotificationManager::NONE;
+            bool send(const std::string & sender); //!< Sends the Notification to the Notificationmanager.
+
+            /**
+            @brief Checks whether the Notification was sent.
+            @return Returns true if the Notification was sent already.
+            */
+            inline bool isSent(void) const
+                { return this->sent_; }
+            /**
+            @brief Returns the message of the Notification.
+            @return Returns the message of the Notification.
+            */
+            inline const std::string & getMessage(void) const
+                { return this->message_; }
+
+            inline const std::string & getSender(void) const
+                { return this->sender_; }
+
+            bool setMessage(const std::string & message); //!< Sets the message of the notification.
+
+        private:
+            std::string message_; //!< The Notification message.
+            std::string sender_; //!< The sender of the notification.
+            bool sent_; //!< Whether Notification has been sent, if so it cannot be changed.
+
+            void initialize(void);
+
+    };
+
+}
+
+#endif /* _Notification_H__ */
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.cc
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.cc	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.cc	(revision 5693)
@@ -0,0 +1,190 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationManager class.
+*/
+
+#include "NotificationManager.h"
+
+#include <set>
+
+#include "core/CoreIncludes.h"
+#include "Notification.h"
+#include "interfaces/NotificationListener.h"
+
+namespace orxonox
+{
+
+    const std::string NotificationManager::ALL = "all";
+    const std::string NotificationManager::NONE = "none";
+
+    NotificationManager* NotificationManager::singletonPtr_s = NULL;
+
+    /**
+    @brief
+        Constructor. Registers the Object.
+    */
+    NotificationManager::NotificationManager()
+    {
+        RegisterRootObject(NotificationManager);
+
+        this->highestIndex_ = 0;
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationManager::~NotificationManager()
+    {
+    }
+
+    /**
+    @brief
+        Registers a Notification within the NotificationManager and makes sure that the Notification is sent to all the NotificationListeners associated with its sender.
+    @param notification
+        The Notification to be registered.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::registerNotification(Notification* notification)
+    {
+
+        if(notification == NULL) //!< A NULL-Notification cannot be registered.
+            return false;
+
+        std::time_t time = std::time(0); //TDO: Doesn't this expire? //!< Get current time.
+
+        this->allNotificationsList_.insert(std::pair<std::time_t,Notification*>(time,notification));
+
+        if(notification->getSender() == NONE) //!< If the sender has no specific name, then the Notification is only added to the list of all Notifications.
+            return true;
+
+        bool all = false;
+        if(notification->getSender() == ALL) //!< If all are the sender, then the Notifications is added to every NotificationListener.
+            all = true;
+
+        //!< Insert the notification in all listeners that have its sender as target.
+        for(std::map<NotificationListener*,int>::iterator it = this->listenerList_.begin(); it != this->listenerList_.end(); it++) //!< Iterate through all listeners.
+        {
+            std::set<std::string> set = it->first->getTargetsSet();
+            if(all || set.find(notification->getSender()) != set.end() || set.find(ALL) != set.end()) //TDO: Make sure this works.
+            {
+                this->notificationLists_[it->second]->insert(std::pair<std::time_t,Notification*>(time,notification)); //!< Insert the Notification in the Notifications list of the current NotificationListener.
+                it->first->update(notification, time); //!< Update the listener.
+            }
+        }
+
+        COUT(3) << "Notification registered with the NotificationManager." << std::endl;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Registers a NotificationListener within the NotificationManager.
+    @param listener
+        The NotificationListener to be registered.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::registerListener(NotificationListener* listener)
+    {
+        this->highestIndex_ += 1;
+        int index = this->highestIndex_;
+
+        this->listenerList_[listener] = index; //!< Add the NotificationListener to the list of listeners.
+
+        std::set<std::string> set = listener->getTargetsSet(); //TDO: Works this?
+
+        //! If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
+        if(set.find(ALL) != set.end())
+        {
+            this->notificationLists_[index] = &this->allNotificationsList_;
+            COUT(3) << "NotificationListener registered with the NotificationManager." << std::endl;
+            return true;
+        }
+
+        this->notificationLists_[index] = new std::multimap<std::time_t,Notification*>;
+        std::multimap<std::time_t,Notification*> map = *this->notificationLists_[index];
+
+        //! Iterate through all Notifications to determine whether any of them should belong to the newly registered NotificationListener.
+        for(std::multimap<std::time_t,Notification*>::iterator it = this->allNotificationsList_.begin(); it != this->allNotificationsList_.end(); it++)
+        {
+            if(set.find(it->second->getSender()) != set.end()) //!< Checks whether the overlay has the sender of the current notification as target.
+            {
+                map.insert(std::pair<std::time_t,Notification*>(it->first, it->second));
+            }
+        }
+
+        listener->update(); //!< Update the listener.
+
+        COUT(3) << "NotificationListener registered with the NotificationManager." << std::endl;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Fetches the Notifications for a specific NotificationListener in a specified timeframe.
+    @param listener
+        The NotificationListener the Notifications are fetched for.
+    @param map
+        A multimap, in which the notifications are stored.
+    @param timeFrameStart
+        The start time of the timeframe.
+    @param timeFrameEnd
+        The end time of the timeframe.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationManager::getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd)
+    {
+        if(listener == NULL || map == NULL)
+            return false;
+
+        std::multimap<std::time_t,Notification*>* notifications = this->notificationLists_[this->listenerList_[listener]]; //!< The Notifications for the input NotificationListener.
+
+        if(notifications == NULL) //!< Returns NULL, if there are no Notifications.
+            return true;
+
+        std::multimap<std::time_t,Notification*>::iterator it, itLowest, itHighest;
+        itLowest = notifications->lower_bound(timeFrameStart);
+        itHighest = notifications->upper_bound(timeFrameStart);
+
+        for(it = itLowest; it != itHighest; it++) //!< Iterate through the Notifications from the start of the time Frame to the end of it.
+        {
+            map->insert(std::pair<std::time_t,Notification*>(it->first,it->second)); //!< Add the found Notifications to the map.
+        }
+
+        return true;
+    }
+
+}
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationManager.h	(revision 5693)
@@ -0,0 +1,104 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationManager class.
+*/
+
+#ifndef _NotificationManager_H__
+#define _NotificationManager_H__
+
+#include "objects/quest/QuestPrereqs.h"
+
+#include <ctime>
+#include <map>
+#include <string>
+
+#include "util/ScopedSingleton.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The Singleton NotificationManager functions as a gateway between Notifications and NotificationListeners.
+        It receives, organizes Notifications and the redistributes them to the specific NotificationListeners.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _QuestExport NotificationManager : public ScopedSingleton<NotificationManager, ScopeID::GSLevel>, public OrxonoxClass
+    {
+            friend class ScopedSingleton<NotificationManager, ScopeID::GSLevel>;
+        public:
+            NotificationManager();
+            virtual ~NotificationManager();
+
+            static const std::string ALL;
+            static const std::string NONE;
+
+            bool registerNotification(Notification* notification); //!< Registers a Notification within the NotificationManager.
+            bool registerListener(NotificationListener* listener); //!< Registers a NotificationListener within the NotificationManager.
+
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart, const std::time_t & timeFrameEnd); //!< Returns the Notifications for a specific NotificationListener in a specified timeframe.
+
+            /**
+            @brief Fetches the Notifications for a specific NotificationListener starting at a specified time.
+            @param listener The NotificationListener the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
+            @param timeFrameStart The start time the Notifications are fetched from.
+            @return Returns true if successful.
+            */
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, const std::time_t & timeFrameStart)
+                { return this->getNotifications(listener, map, timeFrameStart, std::time(0)); }
+            /**
+            @brief Fetches the Notifications for a specific NotificationListener starting at a specified timespan before now.
+            @param listener The NotificationListener the Notifications are fetched for.
+            @param map A multimap, in which the notifications are stored.
+            @param timeDelay The timespan.
+            @return Returns true if successful.
+            */
+            bool getNotifications(NotificationListener* listener, std::multimap<std::time_t,Notification*>* map, int timeDelay)
+                { return this->getNotifications(listener, map, std::time(0)-timeDelay, std::time(0)); }
+
+        private:
+            static NotificationManager* singletonPtr_s;
+
+            int highestIndex_; //!< This variable holds the highest index (resp. key) in notificationLists_s, to secure that  no key appears twice.
+
+            std::multimap<std::time_t,Notification*> allNotificationsList_; //!< Container where all notifications are stored (together with their respecive timestamps).
+            std::map<NotificationListener*,int> listenerList_; //!< Container where all NotificationListeners are stored with a number as identifier.
+            std::map<int,std::multimap<std::time_t,Notification*>*> notificationLists_; //!< Container where all Notifications, for each identifier (associated with a NotificationListener), are stored.
+
+
+    };
+
+}
+
+#endif /* _NotificationManager_H__ */
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.cc
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.cc	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.cc	(revision 5693)
@@ -0,0 +1,136 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationOverlay class.
+*/
+
+#include "NotificationOverlay.h"
+
+#include "util/Exception.h"
+#include "core/CoreIncludes.h"
+#include "objects/quest/notifications/Notification.h"
+#include "NotificationQueue.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Constructor. Intializes the class.
+    */
+    NotificationOverlay::NotificationOverlay(BaseObject* creator) : OverlayText(creator)
+    {
+        RegisterObject(NotificationOverlay);
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue.
+    @param queue
+        A pointer to the queue the NotificatonOverlay belongs to.
+    @param notification
+        A pointer to the Notification represented by this overlay.
+    @throws Argument
+        Throws an Argument-Exception if either no Notification or no NotificationQueue were input.
+    */
+    NotificationOverlay::NotificationOverlay(NotificationQueue* queue, Notification* notification) : OverlayText(NULL)
+    {
+        this->initialize();
+
+        if(notification == NULL || queue == NULL) //!> If either notification or queue are not given an Exception is thrown.
+        {
+            ThrowException(Argument, "There were NULL-Pointer arguments in NotificationOverlay creation.");
+        }
+
+        this->queue_ = queue;
+        this->defineOverlay();
+
+        this->processNotification(notification);
+    }
+
+    /**
+    @brief
+        Initializes and Registers the object.
+    */
+    void NotificationOverlay::initialize(void)
+    {
+        this->queue_ = NULL;
+    }
+
+    /**
+    @brief
+        Set some Overlay-specific values.
+    */
+    void NotificationOverlay::defineOverlay(void)
+    {
+        this->setFont(this->queue_->getFont());
+        this->setTextSize(this->queue_->getFontSize());
+
+        this->setPosition(this->queue_->getPosition());
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationOverlay::~NotificationOverlay()
+    {
+    }
+
+    /**
+    @brief
+        Processes the input notification, resp. sees to it. that the NotificationOverlay displays the Notification message.
+    @param notification
+        A pointer to the notification that should be processed.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationOverlay::processNotification(Notification* notification)
+    {
+        if(notification == NULL)
+            return false;
+        this->setCaption(clipMessage(notification->getMessage()));
+        this->notification_ = notification;
+        return true;
+    }
+
+    /**
+    @brief
+        Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.
+    */
+    std::string NotificationOverlay::clipMessage(const std::string & message)
+    {
+        if(message.length() <= static_cast<unsigned int>(this->queue_->getNotificationLength())) //!< If the message is not too long.
+            return message;
+        return message.substr(0, this->queue_->getNotificationLength());
+    }
+
+}
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationOverlay.h	(revision 5693)
@@ -0,0 +1,83 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationOverlay class.
+*/
+
+
+#ifndef _NotificationOverlay_H__
+#define _NotificationOverlay_H__
+
+#include "objects/quest/QuestPrereqs.h"
+
+#include <string>
+#include "orxonox/overlays/OverlayText.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        The NotificationOverlay is used to display single Notifications, then bundled in a NotificationQUeue.
+    @author
+        Damian 'Mozork' Frick
+    */
+    class _QuestExport NotificationOverlay : public OverlayText
+    {
+
+        public:
+            NotificationOverlay(BaseObject* creator);
+            NotificationOverlay(NotificationQueue* queue, Notification* notification);
+            virtual ~NotificationOverlay();
+
+            bool processNotification(Notification* notification); //!< Processes the input Notification.
+
+            /**
+            @brief Sets the font size of this overlay's text.
+            @param size The font size.
+            */
+            inline void setFontSize(float size)
+                { this->setTextSize(size); }
+
+        protected:
+            std::string clipMessage(const std::string & message); //!< Clips the input message if too long.
+
+        private:
+            NotificationQueue* queue_; //!< The NotificationQeue this overlay belongs to.
+            Notification* notification_; //!< The Notification this overlay displays.
+
+            void initialize(void); //!< Initializes the object.
+            void defineOverlay(void); //!< Sets some overlay-specific values.
+
+    };
+
+}
+
+#endif /* _NotificationOverlay_H__ */
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.cc
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.cc	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.cc	(revision 5693)
@@ -0,0 +1,449 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Implementation of the NotificationQueue class.
+*/
+
+#include "NotificationQueue.h"
+
+#include <sstream>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "NotificationOverlay.h"
+#include "objects/quest/notifications/NotificationManager.h"
+
+namespace orxonox
+{
+
+    CreateFactory(NotificationQueue);
+
+    const std::string NotificationQueue::DEFAULT_FONT = "VeraMono";
+    const Vector2 NotificationQueue::DEFAULT_POSITION = Vector2(0.0,0.0);
+    const float NotificationQueue::DEFAULT_FONT_SIZE  = 0.025f;
+
+    /**
+    @brief
+        Constructor. Creates and initializes the object.
+    */
+    NotificationQueue::NotificationQueue(BaseObject* creator) : OverlayGroup(creator)
+    {
+        RegisterObject(NotificationQueue);
+        this->initialize();
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    NotificationQueue::~NotificationQueue()
+    {
+        this->targets_.clear();
+        this->clear();
+    }
+
+    /**
+    @brief
+        Initializes the object.
+        Registers the object, initializes variables, sets default values and registers the queue with the NotificationManager.
+    */
+    void NotificationQueue::initialize(void)
+    {
+        this->size_ = 0;
+        this->tickTime_ = 0.0;
+
+        NotificationManager::getInstance().registerListener(this);
+    }
+
+    /**
+    @brief
+        Sets the defaults.
+    */
+    void NotificationQueue::setDefaults(void)
+    {
+        this->setMaxSize(DEFAULT_SIZE);
+        this->setNotificationLength(DEFAULT_LENGTH);
+        this->setDisplayTime(DEFAULT_DISPLAY_TIME);
+        this->setPosition(DEFAULT_POSITION);
+
+        this->setTargets(NotificationManager::ALL);
+
+        this->setFontSize(DEFAULT_FONT_SIZE);
+        this->setFont(DEFAULT_FONT);
+    }
+
+    /**
+    @brief
+        Method for creating a NotificationQueue object through XML.
+    */
+    void NotificationQueue::XMLPort(Element& xmlElement, XMLPort::Mode mode)
+    {
+        SUPER(NotificationQueue, XMLPort, xmlElement, mode);
+
+        this->setDefaults();
+
+        XMLPortParam(NotificationQueue, "maxSize", setMaxSize, getMaxSize, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "notificationLength", setNotificationLength, getNotificationLength, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "displayTime", setDisplayTime, getDisplayTime, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "targets", setTargets, getTargets, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "font", setFont, getFont, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "fontSize", setFontSize, getFontSize, xmlElement, mode);
+        XMLPortParam(NotificationQueue, "position", setPosition, getPosition, xmlElement, mode);
+
+        COUT(3) << "NotificationQueue created." << std::endl;
+    }
+
+    /**
+    @brief
+        Updates the queue from time to time.
+    @param dt
+        The time interval that has passed since the last tick.
+    */
+    void NotificationQueue::tick(float dt)
+    {
+        this->tickTime_ += dt; //!< Add the time interval that has passed to the time counter.
+        if(this->tickTime_ >= 1.0) //!< If the time counter is greater than 1s all Notifications that have expired are removed, if it is smaller we wait to the next tick.
+        {
+            this->timeLimit_.time = std::time(0)-this->displayTime_; //!< Container containig the current time.
+
+            std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it;
+            it = this->containers_.begin();
+            while(it != this->containers_.upper_bound(&this->timeLimit_)) //!< Iterate through all elements whose creation time is smaller than the current time minus the display time.
+            {
+                this->removeContainer(*it);
+                this->scroll(Vector2(0.0,-(1.1*this->getFontSize())));
+                it = this->containers_.begin(); //TDO: Needed?
+            }
+
+            this->tickTime_ = 0.0; //!< Reset time counter.
+        }
+    }
+
+    /**
+    @brief
+        Updates the NotificationQueue.
+        Updates by clearing the queue and requesting all relevant Notifications from the NotificationManager and inserting the in the queue.
+    */
+    void NotificationQueue::update(void)
+    {
+        this->clear();
+
+        std::multimap<std::time_t,Notification*>* notifications = new std::multimap<std::time_t,Notification*>;
+        if(!NotificationManager::getInstance().getNotifications(this, notifications, this->displayTime_)) //!< Get the Notifications sent in the interval form now to minus the display time.
+        {
+            COUT(1) << "NotificationQueue update failed due to undetermined cause." << std::endl;
+            return;
+        }
+
+        if(notifications->empty())
+            return;
+
+        for(std::multimap<std::time_t,Notification*>::iterator it = notifications->begin(); it != notifications->end(); it++) //!> Add all Notifications.
+        {
+            this->addNotification(it->second, it->first);
+        }
+
+        delete notifications;
+
+        COUT(3) << "NotificationQueue updated." << std::endl;
+    }
+
+    /**
+    @brief
+        Updates the NotificationQueue by adding an new Notification.
+    @param notification
+        Pointer to the Notification.
+    @param time
+        The time the Notification was sent.
+    */
+    void NotificationQueue::update(Notification* notification, const std::time_t & time)
+    {
+        this->addNotification(notification, time);
+
+        std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it;
+        while(this->getSize() > this->getMaxSize())
+        {
+            it = this->containers_.begin();
+            this->removeContainer(*it);
+            this->scroll(Vector2(0.0,-(1.1*this->getFontSize())));
+        }
+
+        COUT(3) << "NotificationQueue updated. A new Notifications has been added." << std::endl;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of displayed Notifications.
+    @param size
+        The size to be set.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setMaxSize(int size)
+    {
+        if(size < 0)
+            return false;
+        this->maxSize_ = size;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of characters a Notification message displayed by this queue is allowed to have.
+    @param length
+        The length to be set.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setNotificationLength(int length)
+    {
+        if(length < 0)
+            return false;
+        this->notificationLength_ = length;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the maximum number of seconds a Notification is displayed.
+    @param time
+        The number of seconds the Notifications is displayed.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setDisplayTime(int time)
+    {
+        if(time < 0)
+            return false;
+        this->displayTime_ = time;
+        this->update();
+        return true;
+    }
+
+    /**
+    @brief
+        Produces all targets concatinated as string, with kommas (',') as seperators.
+    @param string
+        Pointer to a string which will be used by the method to fill with the concatination of the targets.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::getTargets(std::string* string) const
+    {
+        if(string == NULL)
+        {
+            COUT(4) << "Input string must have memory allocated." << std::endl;
+            return false;
+        }
+        string->clear();
+        bool first = true;
+        for(std::set<std::string>::const_iterator it = this->targets_.begin(); it != this->targets_.end(); it++) //!< Iterate through the set of targets.
+        {
+            if(!first)
+            {
+                *string += ",";
+            }
+            else
+            {
+                first = false;
+            }
+            *string += *it;
+        }
+
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the targets of the queue.
+        The targets are the senders whose Notifications are displayed in this queue.
+    @param targets
+        Accepts a string of targets, each seperated by commas (','), spaces are ignored.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setTargets(const std::string & targets)
+    {
+        this->targets_.clear();
+
+        std::string* pTemp;
+        unsigned int index = 0;
+        while( index < targets.size() ) //!< Go through the string, character by character until the end is reached.
+        {
+            pTemp = new std::string("");
+            while(index < targets.size() && targets[index] != ',' && targets[index] != ' ')
+            {
+                *pTemp += targets[index];
+                index++;
+            }
+            index++;
+            this->targets_.insert(*pTemp);
+        }
+
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the font size.
+    @param size
+        The font size.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setFontSize(float size)
+    {
+        if(size <= 0)
+            return false;
+        this->fontSize_ = size;
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); it++) //!< Set the font size for each overlay.
+        {
+            it->second->overlay->setFontSize(size);
+        }
+        return true;
+    }
+
+    /**
+    @brief
+        Sets the font.
+    @param font
+        The font.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::setFont(const std::string & font)
+    {
+        this->font_ = font;
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); it++) //!< Set the font for each overlay.
+        {
+            it->second->overlay->setFont(font);
+        }
+        return true;
+    }
+
+    /**
+    @brief
+        Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
+    @param pos
+        The vector the NotificationQueue is scrolled.
+    */
+    void NotificationQueue::scroll(const Vector2 pos)
+    {
+        for (std::map<Notification*, NotificationOverlayContainer*>::iterator it = this->overlays_.begin(); it != this->overlays_.end(); ++it) //!< Scroll each overlay.
+        {
+            it->second->overlay->scroll(pos);
+        }
+    }
+
+    /**
+    @brief
+        Aligns all the Notifications to the position of the NotificationQueue.
+    */
+    void NotificationQueue::positionChanged(void)
+    {
+        int counter = 0;
+        for (std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it = this->containers_.begin(); it != this->containers_.end(); it++) //!< Set the position for each overlay.
+        {
+            (*it)->overlay->setPosition(this->getPosition());
+            (*it)->overlay->scroll(Vector2(0.0,(1.1*this->getFontSize())*counter));
+            counter++;
+        }
+    }
+
+    /**
+    @brief
+        Adds a Notification, to the queue.
+        It inserts it into the storage containers, creates an corresponding overlay and a container.
+    @param notification
+        The Notification.
+    @param time
+        The time.
+    */
+    void NotificationQueue::addNotification(Notification* notification, const std::time_t & time)
+    {
+        NotificationOverlayContainer* container = new NotificationOverlayContainer;
+        container->overlay = new NotificationOverlay(this, notification);
+        container->notification = notification;
+        container->time = time;
+        std::string timeString = std::ctime(&time);
+        timeString.erase(timeString.length()-1);
+        std::ostringstream stream;
+        stream << reinterpret_cast<unsigned long>(notification);
+        std::string addressString = stream.str() ;
+        container->name = "NotificationOverlay(" + timeString + ")&" + addressString;
+
+        this->containers_.insert(container);
+        this->overlays_[notification] = container;
+        this->addElement(container->overlay);
+        this->size_= this->size_+1;
+
+        container->overlay->scroll(Vector2(0.0,(1.1*this->getFontSize())*(this->getSize()-1)));
+    }
+
+    /**
+    @brief
+        Removes a container from the queue.
+    @param container
+        A pointer to the container.
+    @return
+        Returns true if successful.
+    */
+    bool NotificationQueue::removeContainer(NotificationOverlayContainer* container)
+    {
+        if(this->size_ == 0) //!< You cannot remove anything if the queue is empty.
+            return false;
+
+        this->removeElement(container->overlay);
+        this->containers_.erase(container);
+        this->overlays_.erase(container->notification);
+        delete container->overlay;
+        delete container;
+        this->size_= this->size_-1;
+
+        return true;
+    }
+
+    /**
+    @brief
+        Clears the queue by removing all containers.
+    */
+    void NotificationQueue::clear(void)
+    {
+        std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare>::iterator it = this->containers_.begin();
+        while(it != this->containers_.end())
+        {
+            this->removeContainer(*it);
+            it = this->containers_.begin(); //TDO: Needed?
+        }
+    }
+
+}
Index: code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.h
===================================================================
--- code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/quest/notifications/NotificationQueue.h	(revision 5693)
@@ -0,0 +1,210 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Damian 'Mozork' Frick
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file
+    @brief Definition of the NotificationQueue class.
+*/
+
+#ifndef _NotificationOueue_H__
+#define _NotificationOueue_H__
+
+#include "objects/quest/QuestPrereqs.h"
+
+#include <ctime>
+#include <map>
+#include <set>
+#include <string>
+
+#include "util/Math.h"
+#include "tools/interfaces/Tickable.h"
+#include "overlays/OverlayGroup.h"
+#include "interfaces/NotificationListener.h"
+
+namespace orxonox
+{
+
+    //! Container to allow easy handling.
+    struct NotificationOverlayContainer
+    {
+        NotificationOverlay* overlay; //!< Pointer to the NotificationOverlay, everything is about.
+        Notification* notification; //!< The Notification displayed by the overlay.
+        time_t time; //!< The time the Notification was sent and thus first displayed.
+        std::string name; //!< The name of the overlay.
+    };
+
+    //! Struct to allow ordering of NotificationOverlayContainers.
+    struct NotificationOverlayContainerCompare {
+        bool operator() (const NotificationOverlayContainer* const & a, const NotificationOverlayContainer* const & b) const
+            { return a->time < b->time; } //!< Ordered by time.
+    };
+
+    /**
+    @brief
+        Displays Notifications from specific senders.
+        Beware! The NotificationQueue is an OverlayGruop and thus cannot be be a sub-element of an OverlayGroup (at least no for now.)
+
+        Creating a NotificationQueue through XML goes as follows:
+        <NotificationQueue
+            name = "SuperQueue" //Name of your OverlayQueue.
+            maxSize = "5" //The maximum size of Notifications displayed.
+            notificationLength = "64" //The maximum number of characters of a Notification, that are displayed. (Default is 5)
+            displayTime = "30" //The time a Notification is displayed in seconds. (Default is 30)
+            targets = "target1, target2" //The senders this NotificationQueue displays Notifications from. (all, if all Notifications should be displayed.)
+            font = "VeraMono" //The font (Default is VeraMono)
+            fontSize = '0.4' //The font size. (Default is 0.025)
+            position = "0.0, .0.0" //The position of the NotificationQueue. (Default is 0.0,0.0)
+        />
+    @author
+        Damian 'Mozork' Frick
+    */
+
+    class _QuestExport NotificationQueue : public OverlayGroup, public Tickable, public NotificationListener
+    {
+
+        public:
+            NotificationQueue(BaseObject* creator);
+            virtual ~NotificationQueue();
+
+            virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode); //!< Method for creating a NotificationQueue object through XML.
+
+            virtual void tick(float dt); //!< To update from time to time.
+
+            void update(void); //!< Updates the queue.
+            void update(Notification* notification, const std::time_t & time); //!< Adds a Notification to the queue.
+
+            /**
+            @brief Returns the maximum number of Notifications displayed.
+            @return Returns maximum size.
+            */
+            inline int getMaxSize() const
+                { return this->maxSize_; }
+            /**
+            @brief Returns the current number of Notifications displayed.
+            @return Returns the size of the queue.
+            */
+            inline int getSize() const
+                { return this->size_; }
+            /**
+            @brief Returns the maximum length in characters a Notification message is allowed to have.
+            @return Returns the maximum Notification length.
+            */
+            inline int getNotificationLength() const
+                { return this->notificationLength_; }
+            /**
+            @brief Returns the time interval the Notification is displayed.
+            @return Returns the display time.
+            */
+            inline int getDisplayTime() const
+                { return this->displayTime_; }
+            /**
+            @brief Returns the position of the NotificationQueue.
+            @return Returns the position.
+            */
+            inline const Vector2 & getPosition() const
+                { return this->position_; }
+            /**
+            @brief Returns the font size used to display the Notifications.
+            @return  Returns the font size.
+            */
+            inline float getFontSize() const
+                { return this->fontSize_; }
+            /**
+            @brief Returns the font used to display the Notifications.
+            @return Returns the font.
+            */
+            inline const std::string & getFont() const
+                { return this->font_; }
+
+            /**
+            @brief Returns the targets of this queue, reps. the senders which Notifications are displayed in this queue.
+            @return Retuns a set of string holding the different targets.
+            */
+            inline const std::set<std::string> & getTargetsSet()
+                { return this->targets_; }
+            bool getTargets(std::string* string) const; //!< Returns a string consisting of the concatination of the targets.
+
+            /**
+            @brief Sets the position of the NotificationQueue.
+            @param pos The position.
+            */
+            inline void setPosition(Vector2 pos)
+                { this->position_ = pos; this->positionChanged(); }
+
+            void scroll(const Vector2 pos); //!< Scrolls the NotificationQueue, meaning all NotificationOverlays are moved the input vector.
+
+        private:
+            static const int DEFAULT_SIZE = 5; //!< The default maximum number of Notifications displayed.
+            static const int DEFAULT_LENGTH = 64; //!< The default maximum number of Notifications displayed.
+            static const int DEFAULT_DISPLAY_TIME = 30; //!< The default display time.
+            static const float DEFAULT_FONT_SIZE; //!< The default font size.
+
+            static const std::string DEFAULT_FONT; //!< The default font.
+            static const Vector2 DEFAULT_POSITION; //!< the default position.
+
+            int maxSize_; //!< The maximal number of Notifications displayed.
+            int size_; //!< The number of Notifications displayed.
+            int notificationLength_; //!< The maximal number of characters a Notification-message is allowed to have.
+            int displayTime_; //!< The time a Notification is displayed.
+            Vector2 position_; //!< The position of the NotificationQueue.
+
+            std::set<std::string> targets_; //!< The targets the Queue displays Notifications of.
+
+            float fontSize_; //!< The font size.
+            std::string font_; //!< The font.
+
+            std::multiset<NotificationOverlayContainer*, NotificationOverlayContainerCompare> containers_; //!< Multiset, because the ordering is based on, not necessarily unique, timestamps.
+            std::map<Notification*, NotificationOverlayContainer*> overlays_; //!< Mapping notifications to their corresponding overlay containers, for easier association and finding.
+
+            float tickTime_; //!< Helper variable, to not have to check for overlays that have been displayed too long, every tick.
+            NotificationOverlayContainer timeLimit_; //!< Helper object to check against to determine whether Notifications have expired.
+
+            void initialize(void); //!< Initializes the object.
+            void setDefaults(void); //!< Helper method to set the default values.
+
+            bool setMaxSize(int size); //!< Sets the maximum number of displayed Notifications.
+            bool setNotificationLength(int length); //!< Sets the maximum number of characters a Notification message displayed by this queue is allowed to have.
+            bool setDisplayTime(int time); //!< Sets the maximum number of seconds a Notification is displayed.
+
+            bool setTargets(const std::string & targets); //!< Set the targets of this queue.
+
+            bool setFontSize(float size); //!< Set the font size.
+            bool setFont(const std::string & font); //!< Set the font.
+
+            void positionChanged(void); //!< Aligns all the Notifications to the position of the NotificationQueue.
+
+            void addNotification(Notification* notification, const std::time_t & time); //!< Add a notification to the queue.
+            bool removeContainer(NotificationOverlayContainer* container); //!< Remove a container from the queue.
+
+            void clear(void); //!< Clear the queue.
+
+    };
+
+}
+
+#endif /* _NotificationOverlay_H__ */
Index: code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/CMakeLists.txt	(revision 5693)
@@ -8,4 +8,7 @@
   WeaponSystem.cc
   DefaultWeaponmodeLink.cc
+)
+
+SET_SOURCE_FILES(WEAPONSYSTEM_SRC_FILES
   MuzzleFlash.cc
 )
@@ -14,2 +17,11 @@
 ADD_SUBDIRECTORY(projectiles)
 ADD_SUBDIRECTORY(weaponmodes)
+
+ORXONOX_ADD_LIBRARY(weaponsystem
+  MODULE
+  DEFINE_SYMBOL
+    "WEAPONSYSTEM_SHARED_BUILD"
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${WEAPONSYSTEM_SRC_FILES}
+)
Index: code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/MuzzleFlash.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _MuzzleFlash_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include "tools/Timer.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport MuzzleFlash : public Billboard
+    class _WeaponsystemExport MuzzleFlash : public Billboard
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/WeaponsystemPrereqs.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/WeaponsystemPrereqs.h	(revision 5693)
+++ code/trunk/src/orxonox/objects/weaponsystem/WeaponsystemPrereqs.h	(revision 5693)
@@ -0,0 +1,84 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _WeaponsystemPrereqs_H__
+#define _WeaponsystemPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+#include "OrxonoxPrereqs.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef WEAPONSYSTEM_SHARED_BUILD
+#    define _WeaponsystemExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _WeaponsystemExport
+#    else
+#      define _WeaponsystemExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _WeaponsystemExport  __attribute__ ((visibility("default")))
+#else
+#  define _WeaponsystemExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class LaserFire;
+    class FusionFire;
+    class HsW01;
+    class LightningGun;
+    class EnergyDrink;
+
+    class Projectile;
+    class BillboardProjectile;
+    class ParticleProjectile;
+    class LightningGunProjectile;
+
+    class ReplenishingMunition;
+    class LaserMunition;
+    class FusionMunition;
+
+    class MuzzleFlash;
+}
+
+#endif /* _WeaponsystemPrereqs_H__ */
Index: code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/munitions/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(WEAPONSYSTEM_SRC_FILES
   ReplenishingMunition.cc
   LaserMunition.cc
Index: code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/munitions/FusionMunition.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _FusionMunition_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "objects/weaponsystem/Munition.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport FusionMunition : public Munition
+    class _WeaponsystemExport FusionMunition : public Munition
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/munitions/LaserMunition.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _LaserMunition_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "ReplenishingMunition.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport LaserMunition : public ReplenishingMunition
+    class _WeaponsystemExport LaserMunition : public ReplenishingMunition
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/munitions/ReplenishingMunition.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _ReplenishingMunition_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include "tools/Timer.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport ReplenishingMunition : public Munition
+    class _WeaponsystemExport ReplenishingMunition : public Munition
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/projectiles/BillboardProjectile.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _BillboardProjectile_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include "util/Math.h"
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport BillboardProjectile : public Projectile
+    class _WeaponsystemExport BillboardProjectile : public Projectile
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/projectiles/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(WEAPONSYSTEM_SRC_FILES
   BillboardProjectile.cc
   ParticleProjectile.cc
Index: code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/projectiles/LightningGunProjectile.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _LightningGunProjectile_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include <string>
@@ -38,14 +38,14 @@
 namespace orxonox
 {
-    class _OrxonoxExport LightningGunProjectile : public BillboardProjectile
+    class _WeaponsystemExport LightningGunProjectile : public BillboardProjectile
     {
         public:
             LightningGunProjectile(BaseObject* creator);
             virtual ~LightningGunProjectile() {}
-            
+
             virtual void setMaterial(const std::string& material);
 
         protected:
-            void changeTexture();        
+            void changeTexture();
             unsigned int textureIndex_;
             unsigned int maxTextureIndex_;
Index: code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/projectiles/ParticleProjectile.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _ParticleProjectile_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "BillboardProjectile.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport ParticleProjectile : public BillboardProjectile
+    class _WeaponsystemExport ParticleProjectile : public BillboardProjectile
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/projectiles/Projectile.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _Projectile_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include "tools/Timer.h"
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport Projectile : public MovableEntity, public PawnListener
+    class _WeaponsystemExport Projectile : public MovableEntity, public PawnListener
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(WEAPONSYSTEM_SRC_FILES
   EnergyDrink.cc
   FusionFire.cc
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/EnergyDrink.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _EnergyDrink_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include <string>
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport EnergyDrink : public WeaponMode
+    class _WeaponsystemExport EnergyDrink : public WeaponMode
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/FusionFire.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _FusionFire_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "objects/weaponsystem/WeaponMode.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport FusionFire : public WeaponMode
+    class _WeaponsystemExport FusionFire : public WeaponMode
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/HsW01.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _HsW01_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 
 #include "tools/Timer.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport HsW01 : public WeaponMode
+    class _WeaponsystemExport HsW01 : public WeaponMode
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LaserFire.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _LaserFire_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "objects/weaponsystem/WeaponMode.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport LaserFire : public WeaponMode
+    class _WeaponsystemExport LaserFire : public WeaponMode
     {
         public:
Index: code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h
===================================================================
--- code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/weaponsystem/weaponmodes/LightningGun.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _LightningGun_H__
 
-#include "OrxonoxPrereqs.h"
+#include "objects/weaponsystem/WeaponsystemPrereqs.h"
 #include "objects/weaponsystem/WeaponMode.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport LightningGun : public WeaponMode
+    class _WeaponsystemExport LightningGun : public WeaponMode
     {
         public:
Index: code/trunk/src/orxonox/objects/worldentities/Backlight.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Backlight.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/Backlight.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include <string>
-#include "interfaces/TimeFactorListener.h"
+#include "tools/interfaces/TimeFactorListener.h"
 #include "FadingBillboard.h"
 
Index: code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/BlinkingBillboard.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include "util/Math.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "Billboard.h"
 
Index: code/trunk/src/orxonox/objects/worldentities/Camera.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/Camera.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/Camera.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include "util/OgreForwardRefs.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/worldentities/StaticEntity.h"
 
Index: code/trunk/src/orxonox/objects/worldentities/FadingBillboard.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/FadingBillboard.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/FadingBillboard.h	(revision 5693)
@@ -34,5 +34,5 @@
 #include "util/Math.h"
 #include "tools/Timer.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "Billboard.h"
 
Index: code/trunk/src/orxonox/objects/worldentities/ForceField.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/ForceField.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/ForceField.h	(revision 5693)
@@ -33,5 +33,5 @@
 #include "OrxonoxPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "StaticEntity.h"
 
@@ -43,13 +43,13 @@
         ForceField(BaseObject* creator);
         virtual ~ForceField();
-        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a CheckPoint object through XML.
+        virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
         virtual void tick(float dt);
 
         inline void setVelocity(float vel)
             { this->velocity_ = vel; }
-    
+
         inline float getVelocity()
             { return velocity_; }
-    
+
         inline void setDiameter(float diam)
             { this->diameter_ = diam; }
@@ -57,5 +57,5 @@
         inline float getDiameter()
             { return diameter_; }
- 
+
         inline void setLength(float l)
             { this->length_ = l; }
Index: code/trunk/src/orxonox/objects/worldentities/MobileEntity.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/MobileEntity.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/MobileEntity.h	(revision 5693)
@@ -33,5 +33,5 @@
 
 #include "util/Math.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "WorldEntity.h"
 
Index: code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/PlayerTrigger.h	(revision 5693)
@@ -52,7 +52,7 @@
         PlayerTrigger(BaseObject* creator);
         virtual ~PlayerTrigger();
-        
+
         virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a PlayerTrigger object through XML.
-        
+
         /**
         @brief Returns the player that triggered the PlayerTrigger.
@@ -61,5 +61,5 @@
         inline Pawn* getTriggeringPlayer(void) const
             { return this->player_; }
-        
+
         /**
         @brief Checks whether the PlayerTrigger normally returns a ControllableEntity.
@@ -68,8 +68,8 @@
         inline bool isForPlayer(void) const
            { return this->isForPlayer_; }
-            
+
     protected:
         virtual bool isTriggered(TriggerMode::Value mode) = 0;
-        
+
         /**
         @brief Set the player that triggered the PlayerTrigger. This is normally done by classes inheriting vom PlayerTrigger.
@@ -81,13 +81,13 @@
             /**
             @brief Set whether the PlayerTrigger normally is triggered by ControllableEntities.
-            @param isForPlayer Should be true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities, false if not.
+            @param isForPlayer Should be true when the PlayerTrigger should be set to normally be triggered by ControllableEntities, false if not.
             */
         inline void setForPlayer(bool isForPlayer)
            { this->isForPlayer_ = isForPlayer; }
-        
+
     private:
         Pawn* player_; //!< The player that triggered the PlayerTrigger.
-        bool isForPlayer_; //!< Is true when the PlayerTrigger schould be set to normally be triggered by ControllableEntities.
-    
+        bool isForPlayer_; //!< Is true when the PlayerTrigger should be set to normally be triggered by ControllableEntities.
+
     };
 
Index: code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h
===================================================================
--- code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 5692)
+++ code/trunk/src/orxonox/objects/worldentities/triggers/Trigger.h	(revision 5693)
@@ -36,5 +36,5 @@
 
 #include "tools/BillboardSet.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "objects/worldentities/StaticEntity.h"
 
Index: code/trunk/src/orxonox/orxonox-main.vcproj.user.in
===================================================================
--- code/trunk/src/orxonox/orxonox-main.vcproj.user.in	(revision 5693)
+++ code/trunk/src/orxonox/orxonox-main.vcproj.user.in	(revision 5693)
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioUserFile
+	ProjectType="Visual C++"
+	Version="${VISUAL_STUDIO_VERSION_SIMPLE}.00"
+	ShowAllFiles="false"
+	>
+	<Configurations>
+		<Configuration
+			Name="Debug|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="MinSizeRel|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+		<Configuration
+			Name="RelWithDebInfo|${MSVC_PLATFORM}"
+			>
+			<DebugSettings
+				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
+				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
+				EnvironmentMerge="true"
+			/>
+		</Configuration>
+	</Configurations>
+</VisualStudioUserFile>
Index: code/trunk/src/orxonox/orxonox.vcproj.user.in
===================================================================
--- code/trunk/src/orxonox/orxonox.vcproj.user.in	(revision 5692)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioUserFile
-	ProjectType="Visual C++"
-	Version="${VISUAL_STUDIO_VERSION_SIMPLE}.00"
-	ShowAllFiles="false"
-	>
-	<Configurations>
-		<Configuration
-			Name="Debug|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="Release|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="MinSizeRel|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-		<Configuration
-			Name="RelWithDebInfo|${MSVC_PLATFORM}"
-			>
-			<DebugSettings
-				WorkingDirectory="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(OutDir)"
-				Environment="Path=${ORXONOX_RUNTIME_LIBRARY_DIRECTORY}"
-				EnvironmentMerge="true"
-			/>
-		</Configuration>
-	</Configurations>
-</VisualStudioUserFile>
Index: code/trunk/src/orxonox/overlays/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/overlays/CMakeLists.txt	(revision 5693)
@@ -2,4 +2,7 @@
   OrxonoxOverlay.cc
   OverlayGroup.cc
+)
+
+SET_SOURCE_FILES(OVERLAYS_SRC_FILES
   OverlayText.cc
   FadeoutText.cc
@@ -7,9 +10,17 @@
 )
 
-ADD_SUBDIRECTORY(console)
 ADD_SUBDIRECTORY(debug)
 ADD_SUBDIRECTORY(hud)
-ADD_SUBDIRECTORY(map)
-ADD_SUBDIRECTORY(notifications)
 ADD_SUBDIRECTORY(stats)
 
+ORXONOX_ADD_LIBRARY(overlays
+  MODULE
+  FIND_HEADER_FILES
+  DEFINE_SYMBOL
+    "OVERLAYS_SHARED_BUILD"
+  PCH_FILE
+    ../OrxonoxPrecompiledHeaders.h
+  LINK_LIBRARIES
+    orxonox
+  SOURCE_FILES ${OVERLAYS_SRC_FILES}
+)
Index: code/trunk/src/orxonox/overlays/FadeoutText.h
===================================================================
--- code/trunk/src/orxonox/overlays/FadeoutText.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/FadeoutText.h	(revision 5693)
@@ -30,13 +30,13 @@
 #define _FadeoutText_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "tools/Timer.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport FadeoutText : public OverlayText, public Tickable
+    class _OverlaysExport FadeoutText : public OverlayText, public Tickable
     {
         public:
Index: code/trunk/src/orxonox/overlays/GUIOverlay.cc
===================================================================
--- code/trunk/src/orxonox/overlays/GUIOverlay.cc	(revision 5692)
+++ code/trunk/src/orxonox/overlays/GUIOverlay.cc	(revision 5693)
@@ -36,4 +36,5 @@
 #include "core/GUIManager.h"
 #include "core/XMLPort.h"
+#include "objects/infos/PlayerInfo.h"
 
 namespace orxonox
@@ -79,3 +80,8 @@
     }
 
+    void GUIOverlay::setGUIName(const std::string& name)
+    {
+        this->guiName_ = name;
+        GUIManager::getInstance().setPlayer(name, orxonox_cast<PlayerInfo*>(this->getOwner()));
+    }
 }
Index: code/trunk/src/orxonox/overlays/GUIOverlay.h
===================================================================
--- code/trunk/src/orxonox/overlays/GUIOverlay.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/GUIOverlay.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _GUIOverlay_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <string>
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport GUIOverlay : public OrxonoxOverlay
+    class _OverlaysExport GUIOverlay : public OrxonoxOverlay
     {
         public:
@@ -46,5 +46,5 @@
             virtual void XMLPort(Element& xmlElement, XMLPort::Mode mode);
 
-            inline void setGUIName(const std::string& name) { this->guiName_ = name; }
+            void setGUIName(const std::string& name);
             inline const std::string& getGUIName() const { return this->guiName_; }
 
Index: code/trunk/src/orxonox/overlays/OverlayText.h
===================================================================
--- code/trunk/src/orxonox/overlays/OverlayText.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/OverlayText.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _OverlayText_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <string>
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport OverlayText : public OrxonoxOverlay
+    class _OverlaysExport OverlayText : public OrxonoxOverlay
     {
     public:
Index: code/trunk/src/orxonox/overlays/OverlaysPrereqs.h
===================================================================
--- code/trunk/src/orxonox/overlays/OverlaysPrereqs.h	(revision 5693)
+++ code/trunk/src/orxonox/overlays/OverlaysPrereqs.h	(revision 5693)
@@ -0,0 +1,88 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _OverlaysPrereqs_H__
+#define _OverlaysPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef OVERLAYS_SHARED_BUILD
+#    define _OverlaysExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _OverlaysExport
+#    else
+#      define _OverlaysExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _OverlaysExport  __attribute__ ((visibility("default")))
+#else
+#  define _OverlaysExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class BarColour;
+    class DebugFPSText;
+    class DebugRTRText;
+    class GUIOverlay;
+    class HUDBar;
+    class HUDNavigation;
+    class HUDRadar;
+    class HUDSpeedBar;
+    class HUDHealthBar;
+    class HUDTimer;
+    class OrxonoxOverlay;
+    class OverlayGroup;
+    class OverlayText;
+    class FadeoutText;
+    class GametypeStatus;
+    class AnnounceMessage;
+    class KillMessage;
+    class DeathMessage;
+
+    class CreateLines;
+    class Scoreboard;
+    class Stats;
+}
+
+#endif /* _OverlaysPrereqs_H__ */
Index: code/trunk/src/orxonox/overlays/debug/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/debug/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/overlays/debug/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(OVERLAYS_SRC_FILES
   DebugFPSText.cc
   DebugRTRText.cc
Index: code/trunk/src/orxonox/overlays/debug/DebugFPSText.h
===================================================================
--- code/trunk/src/orxonox/overlays/debug/DebugFPSText.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/debug/DebugFPSText.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _DebugFPSText_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport DebugFPSText : public OverlayText, public Tickable
+    class _OverlaysExport DebugFPSText : public OverlayText, public Tickable
     {
     public:
Index: code/trunk/src/orxonox/overlays/debug/DebugRTRText.h
===================================================================
--- code/trunk/src/orxonox/overlays/debug/DebugRTRText.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/debug/DebugRTRText.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _DebugRTRText_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport DebugRTRText : public OverlayText, public Tickable
+    class _OverlaysExport DebugRTRText : public OverlayText, public Tickable
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/AnnounceMessage.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _AnnounceMessage_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "interfaces/GametypeMessageListener.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport AnnounceMessage : public FadeoutText, public GametypeMessageListener
+    class _OverlaysExport AnnounceMessage : public FadeoutText, public GametypeMessageListener
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/hud/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(OVERLAYS_SRC_FILES
   HUDBar.cc
   HUDNavigation.cc
Index: code/trunk/src/orxonox/overlays/hud/ChatOverlay.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/ChatOverlay.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/ChatOverlay.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _ChatOverlay_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <list>
@@ -40,5 +40,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport ChatOverlay : public OverlayText, public ChatListener
+    class _OverlaysExport ChatOverlay : public OverlayText, public ChatListener
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/DeathMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/DeathMessage.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/DeathMessage.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _DeathMessage_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "interfaces/GametypeMessageListener.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport DeathMessage : public FadeoutText, public GametypeMessageListener
+    class _OverlaysExport DeathMessage : public FadeoutText, public GametypeMessageListener
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/GametypeStatus.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/GametypeStatus.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/GametypeStatus.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _GametypeStatus_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport GametypeStatus : public OverlayText, public Tickable
+    class _OverlaysExport GametypeStatus : public OverlayText, public Tickable
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/HUDBar.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDBar.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDBar.h	(revision 5693)
@@ -32,5 +32,5 @@
 #define _HUDBar_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <map>
@@ -44,5 +44,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport BarColour : public BaseObject
+    class _OverlaysExport BarColour : public BaseObject
     {
     public:
@@ -64,5 +64,5 @@
 
 
-    class _OrxonoxExport HUDBar : public OrxonoxOverlay
+    class _OverlaysExport HUDBar : public OrxonoxOverlay
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/HUDHealthBar.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDHealthBar.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDHealthBar.h	(revision 5693)
@@ -30,8 +30,8 @@
 #define _HUDHealthBar_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "util/Math.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 #include "HUDBar.h"
@@ -39,5 +39,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport HUDHealthBar : public HUDBar, public Tickable
+    class _OverlaysExport HUDHealthBar : public HUDBar, public Tickable
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/HUDNavigation.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDNavigation.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDNavigation.h	(revision 5693)
@@ -30,13 +30,13 @@
 #define _HUDNavigation_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "util/OgreForwardRefs.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport HUDNavigation : public OrxonoxOverlay, public Tickable
+    class _OverlaysExport HUDNavigation : public OrxonoxOverlay, public Tickable
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/HUDRadar.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDRadar.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDRadar.h	(revision 5693)
@@ -31,5 +31,5 @@
 #define _HUDRadar_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <map>
@@ -43,5 +43,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport HUDRadar : public OrxonoxOverlay, public RadarListener
+    class _OverlaysExport HUDRadar : public OrxonoxOverlay, public RadarListener
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDSpeedBar.h	(revision 5693)
@@ -31,12 +31,12 @@
 #define _HUDSpeedBar_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "HUDBar.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport HUDSpeedBar : public HUDBar, public Tickable
+    class _OverlaysExport HUDSpeedBar : public HUDBar, public Tickable
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/HUDTimer.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/HUDTimer.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/HUDTimer.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _HUDTimer_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport HUDTimer : public OverlayText, public Tickable
+    class _OverlaysExport HUDTimer : public OverlayText, public Tickable
     {
     public:
Index: code/trunk/src/orxonox/overlays/hud/KillMessage.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/KillMessage.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/KillMessage.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _KillMessage_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "interfaces/GametypeMessageListener.h"
@@ -37,5 +37,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport KillMessage : public FadeoutText, public GametypeMessageListener
+    class _OverlaysExport KillMessage : public FadeoutText, public GametypeMessageListener
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/PongScore.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/PongScore.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/PongScore.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _PongScore_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport PongScore : public OverlayText, public Tickable
+    class _OverlaysExport PongScore : public OverlayText, public Tickable
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/TeamBaseMatchScore.h	(revision 5693)
@@ -30,12 +30,12 @@
 #define _TeamBaseMatchScore_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OverlayText.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport TeamBaseMatchScore : public OverlayText, public Tickable
+    class _OverlaysExport TeamBaseMatchScore : public OverlayText, public Tickable
     {
         public:
Index: code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.h
===================================================================
--- code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/hud/UnderAttackHealthBar.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _UnderAttackHealthBar_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "util/Math.h"
@@ -38,5 +38,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport UnderAttackHealthBar : public HUDHealthBar
+    class _OverlaysExport UnderAttackHealthBar : public HUDHealthBar
     {
         public:
Index: code/trunk/src/orxonox/overlays/stats/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/overlays/stats/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/overlays/stats/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(OVERLAYS_SRC_FILES
   CreateLines.cc
   Scoreboard.cc
Index: code/trunk/src/orxonox/overlays/stats/CreateLines.h
===================================================================
--- code/trunk/src/orxonox/overlays/stats/CreateLines.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/stats/CreateLines.h	(revision 5693)
@@ -28,9 +28,9 @@
 #define _CreateLines_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport CreateLines
+    class _OverlaysExport CreateLines
     {
 
Index: code/trunk/src/orxonox/overlays/stats/Scoreboard.h
===================================================================
--- code/trunk/src/orxonox/overlays/stats/Scoreboard.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/stats/Scoreboard.h	(revision 5693)
@@ -29,14 +29,14 @@
 
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include <string>
 #include <vector>
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Scoreboard : public OrxonoxOverlay, public Tickable
+    class _OverlaysExport Scoreboard : public OrxonoxOverlay, public Tickable
     {
     public: // functions
Index: code/trunk/src/orxonox/overlays/stats/Stats.h
===================================================================
--- code/trunk/src/orxonox/overlays/stats/Stats.h	(revision 5692)
+++ code/trunk/src/orxonox/overlays/stats/Stats.h	(revision 5693)
@@ -30,13 +30,13 @@
 #define _Stats_H__
 
-#include "OrxonoxPrereqs.h"
+#include "overlays/OverlaysPrereqs.h"
 
 #include "util/OgreForwardRefs.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 #include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Stats : public OrxonoxOverlay, public Tickable
+    class _OverlaysExport Stats : public OrxonoxOverlay, public Tickable
     {
     public: // functions
Index: code/trunk/src/orxonox/sound/SoundBase.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundBase.h	(revision 5692)
+++ code/trunk/src/orxonox/sound/SoundBase.h	(revision 5693)
@@ -35,5 +35,5 @@
 {
     /**
-     * The SoudBase class is the base class for all sound file loader classes.
+     * The SoundBase class is the base class for all sound file loader classes.
      * It server as main interface to the OpenAL library.
      *
Index: code/trunk/src/orxonox/sound/SoundManager.h
===================================================================
--- code/trunk/src/orxonox/sound/SoundManager.h	(revision 5692)
+++ code/trunk/src/orxonox/sound/SoundManager.h	(revision 5693)
@@ -33,5 +33,5 @@
 #include <list>
 #include "util/Singleton.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 namespace orxonox
Index: code/trunk/src/orxonox/tools/BillboardSet.h
===================================================================
--- code/trunk/src/orxonox/tools/BillboardSet.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/BillboardSet.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _BillboardSet_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 #include "util/OgreForwardRefs.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport BillboardSet
+    class _ToolsExport BillboardSet
     {
         public:
Index: code/trunk/src/orxonox/tools/BulletConversions.h
===================================================================
--- code/trunk/src/orxonox/tools/BulletConversions.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/BulletConversions.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _BulletConversions_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include "util/Convert.h"
Index: code/trunk/src/orxonox/tools/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/tools/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/orxonox/tools/CMakeLists.txt	(revision 5693)
@@ -1,3 +1,3 @@
-ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+ADD_SOURCE_FILES(TOOLS_SRC_FILES
   BillboardSet.cc
   DynamicLines.cc
@@ -9,2 +9,11 @@
   Timer.cc
 )
+ADD_SUBDIRECTORY(interfaces)
+
+ORXONOX_ADD_LIBRARY(tools
+  DEFINE_SYMBOL
+    "TOOLS_SHARED_BUILD"
+  LINK_LIBRARIES
+    core
+  SOURCE_FILES ${TOOLS_SRC_FILES}
+)
Index: code/trunk/src/orxonox/tools/DynamicLines.h
===================================================================
--- code/trunk/src/orxonox/tools/DynamicLines.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/DynamicLines.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _DynamicLines_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include <vector>
@@ -37,5 +37,5 @@
 namespace Ogre
 {
-    class DynamicLines : public DynamicRenderable
+    class _ToolsExport DynamicLines : public DynamicRenderable
     {
         typedef RenderOperation::OperationType OperationType;
Index: code/trunk/src/orxonox/tools/DynamicRenderable.h
===================================================================
--- code/trunk/src/orxonox/tools/DynamicRenderable.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/DynamicRenderable.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _DynamicRenderable_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include <OgreSimpleRenderable.h>
@@ -37,5 +37,5 @@
 {
     /// Abstract base class providing mechanisms for dynamically growing hardware buffers.
-    class DynamicRenderable : public SimpleRenderable
+    class _ToolsExport DynamicRenderable : public SimpleRenderable
     {
     public:
Index: code/trunk/src/orxonox/tools/Mesh.h
===================================================================
--- code/trunk/src/orxonox/tools/Mesh.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/Mesh.h	(revision 5693)
@@ -30,10 +30,10 @@
 #define _Mesh_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 #include "util/OgreForwardRefs.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Mesh
+    class _ToolsExport Mesh
     {
         public:
Index: code/trunk/src/orxonox/tools/ParticleInterface.h
===================================================================
--- code/trunk/src/orxonox/tools/ParticleInterface.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/ParticleInterface.h	(revision 5693)
@@ -30,8 +30,8 @@
 #define _ParticleInterface_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include "util/OgreForwardRefs.h"
-#include "interfaces/TimeFactorListener.h"
+#include "tools/interfaces/TimeFactorListener.h"
 
 #define getAllEmitters() \
@@ -42,5 +42,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport ParticleInterface : public TimeFactorListener
+    class _ToolsExport ParticleInterface : public TimeFactorListener
     {
         public:
Index: code/trunk/src/orxonox/tools/Shader.h
===================================================================
--- code/trunk/src/orxonox/tools/Shader.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/Shader.h	(revision 5693)
@@ -30,5 +30,5 @@
 #define _Shader_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include <map>
@@ -37,9 +37,9 @@
 
 #include "util/OgreForwardRefs.h"
-#include "interfaces/Tickable.h"
+#include "tools/interfaces/Tickable.h"
 
 namespace orxonox
 {
-    class _OrxonoxExport Shader : public Tickable
+    class _ToolsExport Shader : public Tickable
     {
         typedef std::pair<bool, void*>                  ParameterPointer;
Index: code/trunk/src/orxonox/tools/TextureGenerator.h
===================================================================
--- code/trunk/src/orxonox/tools/TextureGenerator.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/TextureGenerator.h	(revision 5693)
@@ -35,5 +35,5 @@
 #define _TextureGenerator_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include <map>
@@ -43,5 +43,5 @@
 namespace orxonox
 {
-    class _OrxonoxExport TextureGenerator
+    class _ToolsExport TextureGenerator
     {
     public:
Index: code/trunk/src/orxonox/tools/Timer.h
===================================================================
--- code/trunk/src/orxonox/tools/Timer.h	(revision 5692)
+++ code/trunk/src/orxonox/tools/Timer.h	(revision 5693)
@@ -61,9 +61,9 @@
 #define _Timer_H__
 
-#include "OrxonoxPrereqs.h"
+#include "tools/ToolsPrereqs.h"
 
 #include "core/Executor.h"
 #include "core/OrxonoxClass.h"
-#include "interfaces/TimeFactorListener.h"
+#include "tools/interfaces/TimeFactorListener.h"
 
 namespace orxonox
@@ -75,5 +75,5 @@
 
     //! TimerBase is the parent of the Timer class.
-    class _OrxonoxExport TimerBase : public TimeFactorListener
+    class _ToolsExport TimerBase : public TimeFactorListener
     {
         public:
@@ -171,5 +171,5 @@
 
     //! The StaticTimer is a callback-object, calling a static function after a given time-interval.
-    class StaticTimer : public TimerBase
+    class _ToolsExport StaticTimer : public TimerBase
     {
         public:
Index: code/trunk/src/orxonox/tools/ToolsPrereqs.h
===================================================================
--- code/trunk/src/orxonox/tools/ToolsPrereqs.h	(revision 5693)
+++ code/trunk/src/orxonox/tools/ToolsPrereqs.h	(revision 5693)
@@ -0,0 +1,91 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+  @file
+  @brief Contains all the necessary forward declarations for all classes and structs.
+*/
+
+#ifndef _ToolsPrereqs_H__
+#define _ToolsPrereqs_H__
+
+#include "OrxonoxConfig.h"
+
+//-----------------------------------------------------------------------
+// Shared library settings
+//-----------------------------------------------------------------------
+#if defined(ORXONOX_PLATFORM_WINDOWS) && !defined(ORXONOX_STATIC_BUILD)
+#  ifdef TOOLS_SHARED_BUILD
+#    define _ToolsExport __declspec(dllexport)
+#  else
+#    if defined( __MINGW32__ )
+#      define _ToolsExport
+#    else
+#      define _ToolsExport __declspec(dllimport)
+#    endif
+#  endif
+#elif defined ( ORXONOX_GCC_VISIBILITY )
+#  define _ToolsExport  __attribute__ ((visibility("default")))
+#else
+#  define _ToolsExport
+#endif
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    namespace LODParticle
+    {
+        enum Value
+        {
+            Off = 0,
+            Low = 1,
+            Normal = 2,
+            High = 3
+        };
+    }
+
+    class BillboardSet;
+    class Mesh;
+    class ParticleInterface;
+    class Shader;
+    template <class T>
+    class Timer;
+    class StaticTimer;
+}
+
+namespace Ogre
+{
+    // OGRE Wiki adapted code
+    class DynamicLines;
+    class DynamicRenderable;
+}
+
+#endif /* _ToolsPrereqs_H__ */
Index: code/trunk/src/orxonox/tools/interfaces/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/tools/interfaces/CMakeLists.txt	(revision 5693)
+++ code/trunk/src/orxonox/tools/interfaces/CMakeLists.txt	(revision 5693)
@@ -0,0 +1,3 @@
+ADD_SOURCE_FILES(TOOLS_SRC_FILES
+  ToolsInterfaceCompilation.cc
+)
Index: code/trunk/src/orxonox/tools/interfaces/Tickable.h
===================================================================
--- code/trunk/src/orxonox/tools/interfaces/Tickable.h	(revision 5693)
+++ code/trunk/src/orxonox/tools/interfaces/Tickable.h	(revision 5693)
@@ -0,0 +1,68 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/*!
+    @file
+    @brief Declaration of the Tickable interface.
+
+    The Tickable interface provides a tick(dt) function, that gets called every frame.
+    float dt is the time since the last frame in seconds.
+
+    Attention:
+    Classes derived from a Tickable that want to have a tick(dt) function on their part, MUST call the
+    parent::tick(dt) function explicitly in their implementation of tick(dt) because it's a virtual function.
+*/
+
+#ifndef _Tickable_H__
+#define _Tickable_H__
+
+#include "tools/ToolsPrereqs.h"
+
+#include "core/OrxonoxClass.h"
+#include "core/Super.h"
+
+namespace orxonox
+{
+    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
+    class _ToolsExport Tickable : virtual public OrxonoxClass
+    {
+        public:
+            /**
+                @brief Gets called every frame.
+                @param dt The time since the last frame in seconds
+            */
+            virtual void tick(float dt) { }
+
+        protected:
+            Tickable();
+    };
+
+    SUPER_FUNCTION(1, Tickable, tick, true);
+}
+
+#endif /* _Tickable_H__ */
Index: code/trunk/src/orxonox/tools/interfaces/TimeFactorListener.h
===================================================================
--- code/trunk/src/orxonox/tools/interfaces/TimeFactorListener.h	(revision 5693)
+++ code/trunk/src/orxonox/tools/interfaces/TimeFactorListener.h	(revision 5693)
@@ -0,0 +1,55 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _TimeFactorListener_H__
+#define _TimeFactorListener_H__
+
+#include "tools/ToolsPrereqs.h"
+#include "core/OrxonoxClass.h"
+
+namespace orxonox
+{
+    class _ToolsExport TimeFactorListener : virtual public OrxonoxClass
+    {
+        friend class GSRoot;
+
+        public:
+            TimeFactorListener();
+            virtual ~TimeFactorListener() {}
+
+        protected:
+            virtual void changedTimeFactor(float factor_new, float factor_old) {}
+            inline float getTimeFactor() const
+                { return TimeFactorListener::timefactor_s; }
+
+        private:
+            static float timefactor_s;
+    };
+}
+
+#endif /* _TimeFactorListener_H__ */
Index: code/trunk/src/orxonox/tools/interfaces/ToolsInterfaceCompilation.cc
===================================================================
--- code/trunk/src/orxonox/tools/interfaces/ToolsInterfaceCompilation.cc	(revision 5693)
+++ code/trunk/src/orxonox/tools/interfaces/ToolsInterfaceCompilation.cc	(revision 5693)
@@ -0,0 +1,62 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Compiles all the interfaces in the tools library with mostly just a constructor.
+*/
+
+#include "Tickable.h"
+#include "TimeFactorListener.h"
+
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    //----------------------------
+    // TimeFactorListener
+    //----------------------------
+    float TimeFactorListener::timefactor_s = 1.0f;
+
+    TimeFactorListener::TimeFactorListener()
+    {
+        RegisterRootObject(TimeFactorListener);
+    }
+
+    //----------------------------
+    // Tickable
+    //----------------------------
+    /**
+        @brief Constructor: Registers the object in the Tickable-list
+    */
+    Tickable::Tickable()
+    {
+        RegisterRootObject(Tickable);
+    }
+}
Index: code/trunk/src/util/CMakeLists.txt
===================================================================
--- code/trunk/src/util/CMakeLists.txt	(revision 5692)
+++ code/trunk/src/util/CMakeLists.txt	(revision 5693)
@@ -27,4 +27,5 @@
   OutputBuffer.cc
   OutputHandler.cc
+  Scope.cc
   SignalHandler.cc
   Sleep.cc
Index: code/trunk/src/util/Scope.cc
===================================================================
--- code/trunk/src/util/Scope.cc	(revision 5693)
+++ code/trunk/src/util/Scope.cc	(revision 5693)
@@ -0,0 +1,35 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "Scope.h"
+
+namespace orxonox
+{
+    std::map<ScopeID::Value, int> ScopeManager::instanceCounts_s;
+    std::map<ScopeID::Value, std::set<ScopeListener*> > ScopeManager::listeners_s;
+}
Index: code/trunk/src/util/Scope.h
===================================================================
--- code/trunk/src/util/Scope.h	(revision 5693)
+++ code/trunk/src/util/Scope.h	(revision 5693)
@@ -0,0 +1,141 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef __Util_Scope_H__
+#define __Util_Scope_H__
+
+#include "UtilPrereqs.h"
+#include <cassert>
+#include <set>
+#include <map>
+#include "Debug.h"
+
+namespace orxonox
+{
+    namespace ScopeID
+    {
+        /**
+            @brief A list of available scopes for the Scope template.
+        */
+        enum Value
+        {
+            GSRoot,
+            GSGraphics,
+            GSLevel
+        };
+    }
+
+    class ScopeListener; // Forward declaration
+
+    /**
+        @brief The ScopeManager stores the variables of the scope templates in a statically linked context.
+    */
+    class _UtilExport ScopeManager
+    {
+        template <ScopeID::Value scope>
+        friend class Scope;
+        friend class ScopeListener;
+
+        private:
+            static std::map<ScopeID::Value, int> instanceCounts_s;                  //!< Counts the number of active instances (>0 means active) for a scope
+            static std::map<ScopeID::Value, std::set<ScopeListener*> > listeners_s; //!< Stores all listeners for a scope
+    };
+
+    /**
+        @brief ScopeListeners register themselves in the corresponding scope and wait for notifications.
+    */
+    class _UtilExport ScopeListener
+    {
+        template <ScopeID::Value scope>
+        friend class Scope;
+
+        protected:
+            //! Constructor: Registers the instance.
+            ScopeListener(ScopeID::Value scope) : scope_(scope)
+                { ScopeManager::listeners_s[this->scope_].insert(this); }
+            //! Destructor: Unregisters the instance.
+            virtual ~ScopeListener()
+                { ScopeManager::listeners_s[this->scope_].erase(this); }
+
+            //! Gets called if the scope is activated
+            virtual void activated() = 0;
+            //! Gets called if the scope is deactivated
+            virtual void deactivated() = 0;
+
+        private:
+            ScopeID::Value scope_; //!< Store the scope to unregister on destruction
+    };
+
+    /**
+        @brief A scope for a given template argument is either active or not.
+
+        Objects inheriting from a ScopeListener are registered in a list (different for each scope).
+        If the scope gets activated or deactivated, all objects in this list are notified.
+    */
+    template <ScopeID::Value scope>
+    class Scope
+    {
+        public:
+            //! Constructor: Increases the instance counter and activates the scope if the count went from 0 to 1. Counts >1 don't change anything.
+            Scope()
+            {
+                ScopeManager::instanceCounts_s[scope]++;
+                assert(ScopeManager::instanceCounts_s[scope] > 0);
+                if (ScopeManager::instanceCounts_s[scope] == 1)
+                {
+                    for (typename std::set<ScopeListener*>::iterator it = ScopeManager::listeners_s[scope].begin(); it != ScopeManager::listeners_s[scope].end(); )
+                        (*(it++))->activated();
+                }
+            }
+
+            //! Destructor: Decreases the instance counter and deactivates the scope if the count went from 1 to 0. Counts >0 don't change anything.
+            ~Scope()
+            {
+                ScopeManager::instanceCounts_s[scope]--;
+
+                // This shouldn't happen but just to be sure: check if the count is positive
+                assert(ScopeManager::instanceCounts_s[scope] >= 0);
+                if (ScopeManager::instanceCounts_s[scope] < 0)
+                    ScopeManager::instanceCounts_s[scope] = 0;
+
+                if (ScopeManager::instanceCounts_s[scope] == 0)
+                {
+                    for (typename std::set<ScopeListener*>::iterator it = ScopeManager::listeners_s[scope].begin(); it != ScopeManager::listeners_s[scope].end(); )
+                        (*(it++))->deactivated();
+                }
+            }
+
+            //! Returns true if the scope is active.
+            static bool isActive()
+            {
+                return (ScopeManager::instanceCounts_s[scope] > 0);
+            }
+    };
+}
+
+#endif /* __Util_Scope_H__ */
Index: code/trunk/src/util/ScopedSingleton.h
===================================================================
--- code/trunk/src/util/ScopedSingleton.h	(revision 5693)
+++ code/trunk/src/util/ScopedSingleton.h	(revision 5693)
@@ -0,0 +1,102 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   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 2
+ *   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, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Fabian 'x3n' Landau
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef __Util_ScopedSingleton_H__
+#define __Util_ScopedSingleton_H__
+
+#include "UtilPrereqs.h"
+#include <cassert>
+
+#include "Scope.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Base for scoped singleton classes.
+        A Scoped singleton creates itself if the scope is active and getInstance() is called.
+        Destroys itself if the scope is deactivated.
+
+        Usage:
+        Inherit publicly from ScopedSingleton<MyClass, scope> and provide access to
+        MyClass::singletonPtr_s.
+        This can easily be done with a friend declaration.
+
+        See @ref UtilPrereqs.h for a list of scopes (ScopeID::Value).
+    */
+    template <class T, ScopeID::Value scope>
+    class ScopedSingleton : public ScopeListener
+    {
+        public:
+            //! Returns a reference to the singleton instance
+            static T& getInstance()
+            {
+                assert(Scope<scope>::isActive());
+
+                if (!T::singletonPtr_s && Scope<scope>::isActive())
+                    T::singletonPtr_s = new T();
+
+                return *T::singletonPtr_s;
+            }
+
+        protected:
+            //! Constructor sets the singleton instance pointer
+            ScopedSingleton() : ScopeListener(scope)
+            {
+                assert(T::singletonPtr_s == 0);
+                T::singletonPtr_s = static_cast<T*>(this);
+            }
+
+            //! Constructor resets the singleton instance pointer
+            ~ScopedSingleton()
+            {
+                assert(T::singletonPtr_s != 0);
+                T::singletonPtr_s = 0;
+            }
+
+        private:
+            //! Called if the Scope of this Singleton gets active (no instance should be active then)
+            void activated()
+            {
+                // The ScopedSingleton shouldn't be active bevor the scope is activated -> always assertion failed
+                assert(T::singletonPtr_s == 0 && false);
+            }
+
+            //! Called if the Scope of this Singleton gets deactivated (destroys the instance)
+            void deactivated()
+            {
+                if (T::singletonPtr_s)
+                {
+                    delete T::singletonPtr_s;
+                    T::singletonPtr_s = 0;
+                }
+            }
+    };
+}
+
+#endif /* __Util_ScopedSingleton_H__ */
