Index: code/trunk/src/core/ArgumentCompletionFunctions.cc
===================================================================
--- code/trunk/src/core/ArgumentCompletionFunctions.cc	(revision 3103)
+++ code/trunk/src/core/ArgumentCompletionFunctions.cc	(revision 3196)
@@ -29,15 +29,13 @@
 #include "ArgumentCompletionFunctions.h"
 
-#include <iostream>
 #include <map>
 #include <boost/version.hpp>
 #include <boost/filesystem.hpp>
 
-#include "CoreIncludes.h"
+#include "util/Convert.h"
+#include "util/String.h"
 #include "Identifier.h"
 #include "ConfigValueContainer.h"
 #include "TclThreadManager.h"
-#include "util/Convert.h"
-#include "util/String.h"
 
 // Boost 1.36 has some issues with deprecated functions that have been omitted
Index: code/trunk/src/core/ArgumentCompletionListElement.h
===================================================================
--- code/trunk/src/core/ArgumentCompletionListElement.h	(revision 3103)
+++ code/trunk/src/core/ArgumentCompletionListElement.h	(revision 3196)
@@ -32,7 +32,6 @@
 #include "CorePrereqs.h"
 
+#include <list>
 #include <string>
-#include <list>
-
 
 namespace orxonox
Index: code/trunk/src/core/BaseObject.cc
===================================================================
--- code/trunk/src/core/BaseObject.cc	(revision 3103)
+++ code/trunk/src/core/BaseObject.cc	(revision 3196)
@@ -36,13 +36,14 @@
 #include <tinyxml/tinyxml.h>
 
+#include "util/String.h"
 #include "CoreIncludes.h"
+#include "Event.h"
 #include "EventIncludes.h"
 #include "Functor.h"
-#include "XMLPort.h"
+#include "Iterator.h"
+#include "Template.h"
 #include "XMLFile.h"
 #include "XMLNameListener.h"
-#include "Template.h"
-#include "util/String.h"
-#include "util/mbool.h"
+#include "XMLPort.h"
 
 namespace orxonox
@@ -293,6 +294,6 @@
     void BaseObject::processEvent(Event& event)
     {
-        SetEvent(BaseObject, "activity", setActive, event);
-        SetEvent(BaseObject, "visibility", setVisible, event);
+        ORXONOX_SET_EVENT(BaseObject, "activity", setActive, event);
+        ORXONOX_SET_EVENT(BaseObject, "visibility", setVisible, event);
     }
 
Index: code/trunk/src/core/BaseObject.h
===================================================================
--- code/trunk/src/core/BaseObject.h	(revision 3103)
+++ code/trunk/src/core/BaseObject.h	(revision 3196)
@@ -44,13 +44,13 @@
     }
 
+
+#include "CorePrereqs.h"
+
 #include <map>
-
-#include "CorePrereqs.h"
-
+#include <list>
+
+#include "util/mbool.h"
+#include "OrxonoxClass.h"
 #include "Super.h"
-#include "OrxonoxClass.h"
-#include "XMLIncludes.h"
-#include "Event.h"
-#include "util/mbool.h"
 
 namespace orxonox
Index: code/trunk/src/core/CMakeLists.txt
===================================================================
--- code/trunk/src/core/CMakeLists.txt	(revision 3103)
+++ code/trunk/src/core/CMakeLists.txt	(revision 3196)
@@ -63,26 +63,28 @@
 )
 ADD_SUBDIRECTORY(input)
-GET_ALL_HEADER_FILES(CORE_HDR_FILES)
-SET(CORE_FILES ${CORE_SRC_FILES} ${CORE_HDR_FILES})
 
-GENERATE_SOURCE_GROUPS(${CORE_FILES})
-GENERATE_TOLUA_BINDINGS(Core CORE_FILES INPUTFILES LuaBind.h CommandExecutor.h Game.h)
-
-ADD_LIBRARY(core SHARED ${CORE_FILES})
-
-SET_TARGET_PROPERTIES(core PROPERTIES DEFINE_SYMBOL "CORE_SHARED_BUILD")
-TARGET_LINK_LIBRARIES(core
-  ${OGRE_LIBRARY}
-  ${Boost_THREAD_LIBRARY}
-  ${Boost_FILESYSTEM_LIBRARY}
-  ${Boost_SYSTEM_LIBRARY}
-  ${Boost_DATE_TIME_LIBRARY} # MSVC only
-  ${LUA_LIBRARIES}
-  cpptcl_orxonox
-  ois_orxonox
-  tinyxml++_orxonox
-  tolua++_orxonox
-  util
+ORXONOX_ADD_LIBRARY(core
+  FIND_HEADER_FILES
+  TOLUA_FILES
+    CommandExecutor.h
+    Game.h
+    LuaBind.h
+  DEFINE_SYMBOL
+    "CORE_SHARED_BUILD"
+  PCH_FILE
+    CorePrecompiledHeaders.h
+  LINK_LIBRARIES
+    ${OGRE_LIBRARY}
+    ${Boost_THREAD_LIBRARY}
+    ${Boost_FILESYSTEM_LIBRARY}
+    ${Boost_SYSTEM_LIBRARY}
+    ${Boost_DATE_TIME_LIBRARY} # MSVC only
+    ${LUA_LIBRARIES}
+    cpptcl_orxonox
+    ois_orxonox
+    tinyxml++_orxonox
+    tolua++_orxonox
+    util
+  SOURCE_FILES
+    ${CORE_SRC_FILES}
 )
-
-ORXONOX_INSTALL(core)
Index: code/trunk/src/core/ClassFactory.h
===================================================================
--- code/trunk/src/core/ClassFactory.h	(revision 3103)
+++ code/trunk/src/core/ClassFactory.h	(revision 3196)
@@ -41,7 +41,7 @@
 #include <string>
 
+#include "util/Debug.h"
 #include "Factory.h"
 #include "Identifier.h"
-#include "util/Debug.h"
 
 namespace orxonox
@@ -88,5 +88,5 @@
     */
     template <class T>
-    BaseObject* ClassFactory<T>::fabricate(BaseObject* creator)
+    inline BaseObject* ClassFactory<T>::fabricate(BaseObject* creator)
     {
         return ClassFactory<T>::createNewObject(creator);
@@ -98,5 +98,5 @@
     */
     template <class T>
-    T* ClassFactory<T>::createNewObject(BaseObject* creator)
+    inline T* ClassFactory<T>::createNewObject(BaseObject* creator)
     {
         return new T(creator);
Index: code/trunk/src/core/ClassTreeMask.cc
===================================================================
--- code/trunk/src/core/ClassTreeMask.cc	(revision 3103)
+++ code/trunk/src/core/ClassTreeMask.cc	(revision 3196)
@@ -34,5 +34,4 @@
 #include "ClassTreeMask.h"
 #include "Identifier.h"
-#include "BaseObject.h"
 
 namespace orxonox
Index: code/trunk/src/core/ClassTreeMask.h
===================================================================
--- code/trunk/src/core/ClassTreeMask.h	(revision 3103)
+++ code/trunk/src/core/ClassTreeMask.h	(revision 3196)
@@ -75,7 +75,6 @@
 #include <list>
 #include <stack>
-
+#include "BaseObject.h"
 #include "Iterator.h"
-#include "BaseObject.h"
 
 namespace orxonox
Index: code/trunk/src/core/Clock.cc
===================================================================
--- code/trunk/src/core/Clock.cc	(revision 3103)
+++ code/trunk/src/core/Clock.cc	(revision 3196)
@@ -57,5 +57,5 @@
         tickTime_ = storedTime_ + timersTime;
         tickDt_ = timersTime - lastTimersTime_;
-        tickDtFloat_ = (float)tickDt_ / 1000000.0f;
+        tickDtFloat_ = static_cast<float>(tickDt_) / 1000000.0f;
 
         if (timersTime > 0x7FFFFFF0)
Index: code/trunk/src/core/Clock.h
===================================================================
--- code/trunk/src/core/Clock.h	(revision 3103)
+++ code/trunk/src/core/Clock.h	(revision 3196)
@@ -39,5 +39,5 @@
 
 #include "CorePrereqs.h"
-#include <OgrePrerequisites.h>
+#include "util/OgreForwardRefs.h"
 
 namespace orxonox
@@ -53,9 +53,9 @@
         unsigned long long getMicroseconds()   const { return tickTime_; }
         unsigned long long getMilliseconds()   const { return tickTime_ / 1000; }
-        int                getSeconds()        const { return tickTime_ / 1000000; }
-        float              getSecondsPrecise() const { return (float)tickTime_ / 1000000.0f; }
+        unsigned long      getSeconds()        const { return static_cast<long> (tickTime_ / 1000000); }
+        float              getSecondsPrecise() const { return static_cast<float>(tickTime_ / 1000000.0f); }
 
         float              getDeltaTime()      const { return tickDtFloat_; }
-        int                getDeltaTimeMicroseconds() const { return tickDt_; }
+        long               getDeltaTimeMicroseconds() const { return tickDt_; }
 
         unsigned long long getRealMicroseconds() const;
@@ -67,5 +67,5 @@
         unsigned long long storedTime_;
         unsigned long long tickTime_;
-        int                tickDt_;
+        long               tickDt_;
         float              tickDtFloat_;
         unsigned long      lastTimersTime_;
Index: code/trunk/src/core/CommandEvaluation.cc
===================================================================
--- code/trunk/src/core/CommandEvaluation.cc	(revision 3103)
+++ code/trunk/src/core/CommandEvaluation.cc	(revision 3196)
@@ -28,8 +28,9 @@
 
 #include "CommandEvaluation.h"
+
+#include "util/Debug.h"
+#include "util/String.h"
 #include "ConsoleCommand.h"
 #include "Identifier.h"
-#include "util/Debug.h"
-#include "util/String.h"
 
 namespace orxonox
Index: code/trunk/src/core/CommandExecutor.cc
===================================================================
--- code/trunk/src/core/CommandExecutor.cc	(revision 3103)
+++ code/trunk/src/core/CommandExecutor.cc	(revision 3196)
@@ -28,7 +28,8 @@
 
 #include "CommandExecutor.h"
+
+#include "util/Debug.h"
+#include "util/String.h"
 #include "ConsoleCommand.h"
-#include "util/String.h"
-#include "util/Debug.h"
 #include "Identifier.h"
 #include "Language.h"
Index: code/trunk/src/core/CommandExecutor.h
===================================================================
--- code/trunk/src/core/CommandExecutor.h	(revision 3103)
+++ code/trunk/src/core/CommandExecutor.h	(revision 3196)
@@ -33,5 +33,8 @@
 
 #include <map>
+#include <set>
+#include <string>
 
+#include "util/MultiType.h"
 #include "CommandEvaluation.h"
 
Index: code/trunk/src/core/CommandLine.cc
===================================================================
--- code/trunk/src/core/CommandLine.cc	(revision 3103)
+++ code/trunk/src/core/CommandLine.cc	(revision 3196)
@@ -30,4 +30,8 @@
 
 #include <boost/filesystem.hpp>
+
+#include "util/Convert.h"
+#include "util/Debug.h"
+#include "util/Exception.h"
 #include "util/String.h"
 #include "util/SubString.h"
Index: code/trunk/src/core/CommandLine.h
===================================================================
--- code/trunk/src/core/CommandLine.h	(revision 3103)
+++ code/trunk/src/core/CommandLine.h	(revision 3196)
@@ -31,8 +31,7 @@
 
 #include "CorePrereqs.h"
+
 #include <map>
-#include "util/Convert.h"
-#include "util/Debug.h"
-#include "util/Exception.h"
+#include "util/OrxAssert.h"
 #include "util/MultiType.h"
 
Index: code/trunk/src/core/ConfigFileManager.cc
===================================================================
--- code/trunk/src/core/ConfigFileManager.cc	(revision 3103)
+++ code/trunk/src/core/ConfigFileManager.cc	(revision 3196)
@@ -29,8 +29,8 @@
 #include "ConfigFileManager.h"
 
-#include <cassert>
 #include <boost/filesystem.hpp>
 
 #include "util/Convert.h"
+#include "util/Math.h"
 #include "util/String.h"
 #include "ConsoleCommand.h"
@@ -312,5 +312,5 @@
                                 // There might be an array index
                                 unsigned int index = 0;
-                                if (ConvertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
+                                if (convertValue(&index, line.substr(pos2 + 1, pos3 - pos2 - 1)))
                                 {
                                     // New array
Index: code/trunk/src/core/ConfigFileManager.h
===================================================================
--- code/trunk/src/core/ConfigFileManager.h	(revision 3103)
+++ code/trunk/src/core/ConfigFileManager.h	(revision 3196)
@@ -32,10 +32,9 @@
 #include "CorePrereqs.h"
 
-#include <iostream>
+#include <cassert>
 #include <string>
 #include <list>
 #include <map>
 
-#include "util/Math.h"
 #include "util/OrxEnum.h"
 
Index: code/trunk/src/core/ConfigValueContainer.cc
===================================================================
--- code/trunk/src/core/ConfigValueContainer.cc	(revision 3103)
+++ code/trunk/src/core/ConfigValueContainer.cc	(revision 3196)
@@ -34,12 +34,7 @@
 #include "ConfigValueContainer.h"
 
-#include <fstream>
-
+#include "util/Convert.h"
 #include "util/SubString.h"
-#include "util/Convert.h"
 #include "Language.h"
-#include "Identifier.h"
-
-
 
 namespace orxonox
@@ -303,5 +298,5 @@
 
         if (token.size() > 0)
-            success = ConvertValue(&index, token[0]);
+            success = convertValue(&index, token[0]);
 
         if (!success || index < 0 || index > (signed int)MAX_VECTOR_INDEX)
Index: code/trunk/src/core/ConfigValueContainer.h
===================================================================
--- code/trunk/src/core/ConfigValueContainer.h	(revision 3103)
+++ code/trunk/src/core/ConfigValueContainer.h	(revision 3196)
@@ -49,5 +49,4 @@
 #include <vector>
 
-#include "util/Math.h"
 #include "util/MultiType.h"
 #include "ConfigFileManager.h"
Index: code/trunk/src/core/ConsoleCommand.h
===================================================================
--- code/trunk/src/core/ConsoleCommand.h	(revision 3103)
+++ code/trunk/src/core/ConsoleCommand.h	(revision 3196)
@@ -32,8 +32,8 @@
 #include "CorePrereqs.h"
 
+#include "ArgumentCompletionFunctions.h"
+#include "CommandExecutor.h"
 #include "Executor.h"
 #include "Identifier.h"
-#include "CommandExecutor.h"
-#include "ArgumentCompletionFunctions.h"
 
 
Index: code/trunk/src/core/ConsoleCommandCompilation.cc
===================================================================
--- code/trunk/src/core/ConsoleCommandCompilation.cc	(revision 3103)
+++ code/trunk/src/core/ConsoleCommandCompilation.cc	(revision 3196)
@@ -28,7 +28,12 @@
 
 #include "ConsoleCommandCompilation.h"
-#include "ConsoleCommand.h"
+
+#include <fstream>
+#include <set>
+#include <string>
+
 #include "util/Debug.h"
 #include "util/ExprParser.h"
+#include "ConsoleCommand.h"
 
 namespace orxonox
@@ -165,5 +170,5 @@
                 COUT(2) << "Warning: Expression could not be parsed to the end! Remains: '" << expr.getRemains() << "'" << std::endl;
             }
-            return expr.getResult();
+            return static_cast<float>(expr.getResult());
         }
         else
Index: code/trunk/src/core/ConsoleCommandCompilation.h
===================================================================
--- code/trunk/src/core/ConsoleCommandCompilation.h	(revision 3103)
+++ code/trunk/src/core/ConsoleCommandCompilation.h	(revision 3196)
@@ -32,6 +32,4 @@
 #include "CorePrereqs.h"
 
-#include <string>
-
 namespace orxonox
 {
Index: code/trunk/src/core/Core.cc
===================================================================
--- code/trunk/src/core/Core.cc	(revision 3103)
+++ code/trunk/src/core/Core.cc	(revision 3196)
@@ -29,6 +29,7 @@
 
 /**
-    @file
-    @brief Implementation of the Core class.
+@file
+@brief
+    Implementation of the Core singleton with its global variables (avoids boost include)
 */
 
@@ -81,4 +82,5 @@
     static boost::filesystem::path logPath_g;                   //!< Path to the log file folder
 
+    //! Static pointer to the singleton
     Core* Core::singletonRef_s  = 0;
 
@@ -365,5 +367,5 @@
         if (!bInitialized && this->bInitializeRandomNumberGenerator_)
         {
-            srand(time(0));
+            srand(static_cast<unsigned int>(time(0)));
             rand();
             bInitialized = true;
@@ -472,4 +474,6 @@
         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()
@@ -532,12 +536,12 @@
         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()
     {
         std::vector<std::pair<boost::filesystem::path, std::string> > directories;
-        directories.push_back(std::pair<boost::filesystem::path, std::string>
-            (boost::filesystem::path(configPath_g), "config"));
-        directories.push_back(std::pair<boost::filesystem::path, std::string>
-            (boost::filesystem::path(logPath_g),    "log"));
+        directories.push_back(std::make_pair(boost::filesystem::path(configPath_g), "config"));
+        directories.push_back(std::make_pair(boost::filesystem::path(logPath_g), "log"));
 
         for (std::vector<std::pair<boost::filesystem::path, std::string> >::iterator it = directories.begin();
Index: code/trunk/src/core/Core.h
===================================================================
--- code/trunk/src/core/Core.h	(revision 3103)
+++ code/trunk/src/core/Core.h	(revision 3196)
@@ -29,7 +29,8 @@
 
 /**
-    @file
-    @brief Declaration of the Core class.
-
+@file
+@brief
+    Declaration of the Core class.
+@details
     The Core class is a singleton, only used to configure some variables
     in the core through the config-file.
@@ -45,18 +46,23 @@
 #include "util/OutputHandler.h"
 
-// boost::filesystem header has quite a large tail, use forward declaration
-namespace boost { namespace filesystem
-{
-    struct path_traits;
-    template<class String, class Traits> class basic_path;
-    typedef basic_path< std::string, path_traits> path;
-} }
-
 namespace orxonox
 {
-    //! The Core class is a singleton, only used to configure some config-values.
+    /**
+    @brief
+        The Core class is a singleton used to configure the program basics.
+    @details
+        The class provides information about the media, config and log path.
+        It determines those by the use of platform specific functions.
+    */
     class _CoreExport Core : public OrxonoxClass
     {
         public:
+            /**
+            @brief
+                Determines the executable path, checks for build directory runs, creates
+                the output directories and sets up the other core library singletons.
+            @throws
+                GeneralException
+            */
             Core();
             ~Core();
@@ -76,13 +82,19 @@
             static void tsetMediaPath(const std::string& path)
             { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
+            //! Returns the path to the config files as boost::filesystem::path
             static const boost::filesystem::path& getMediaPath();
+            //! Returns the path to the config files as boost::filesystem::path
             static const boost::filesystem::path& getConfigPath();
+            //! Returns the path to the log files as boost::filesystem::path
             static const boost::filesystem::path& getLogPath();
+            //! Returns the path to the data files as std::string
             static std::string getMediaPathString();
+            //! Returns the path to the config files as std::string
             static std::string getConfigPathString();
+            //! Returns the path to the log files as std::string
             static std::string getLogPathString();
 
         private:
-            Core(const Core&);
+            Core(const Core&); //!< Don't use (undefined symbol)
 
             void checkDevBuild();
Index: code/trunk/src/core/CoreIncludes.h
===================================================================
--- code/trunk/src/core/CoreIncludes.h	(revision 3103)
+++ code/trunk/src/core/CoreIncludes.h	(revision 3196)
@@ -43,9 +43,9 @@
 #include "CorePrereqs.h"
 
+#include "util/Debug.h"
 #include "Identifier.h"
 #include "Factory.h"
 #include "ClassFactory.h"
-#include "Functor.h"
-#include "util/Debug.h"
+#include "ObjectList.h"
 
 
@@ -129,11 +129,3 @@
     orxonox::Factory::getIdentifier(networkID)
 
-/**
-    @brief Registers a member function as callback when an object of 'type' is created.
-    @param
-*/
-#define RegisterConstructionCallback(ThisClassName, TargetClassName, FunctionName) \
-    orxonox::ClassIdentifier<TargetClassName>::getIdentifier()->addConstructionCallback( \
-        orxonox::createFunctor(&ThisClassName::FunctionName)->setObject(this))
-
 #endif /* _CoreIncludes_H__ */
Index: code/trunk/src/core/CorePrecompiledHeaders.h
===================================================================
--- code/trunk/src/core/CorePrecompiledHeaders.h	(revision 3196)
+++ code/trunk/src/core/CorePrecompiledHeaders.h	(revision 3196)
@@ -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:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Compilation of the most often used header files in the core library for MSVC
+*/
+
+#include "CorePrereqs.h"
+
+#include <fstream>
+#include <iostream>
+#include <list>
+#include <map>
+#include <set>
+#include <sstream>
+#include <string>
+#include <vector>
+
+
+#ifdef ORXONOX_COMPILER_MSVC
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#undef max
+#undef min
+
+#include <ois/OISKeyboard.h>
+#include <ois/OISMouse.h>
+#include <ois/OISJoyStick.h>
+#include <tinyxml/ticpp.h>
+// Included by both filesystem and thread but still relatively small
+#include <boost/iterator/iterator_facade.hpp>
+
+#endif /* ORXONOX_COMPILER_MSVC */
+
+
+#include "util/Convert.h"
+#include "util/Debug.h"
+#include "util/Exception.h"
+#include "util/Math.h"
+#include "util/mbool.h"
+#include "util/MultiType.h"
+#include "util/OrxAssert.h"
+#include "util/OrxEnum.h"
+#include "util/String.h"
+#include "util/SubString.h"
+
+
+#ifdef ORXONOX_COMPILER_MSVC
+
+// A change would trigger an 80% Core rebuild anyway
+#include "Identifier.h"
+
+#endif /*ORXONOX_COMPILER_MSVC */
Index: code/trunk/src/core/CorePrereqs.h
===================================================================
--- code/trunk/src/core/CorePrereqs.h	(revision 3103)
+++ code/trunk/src/core/CorePrereqs.h	(revision 3196)
@@ -36,6 +36,4 @@
 
 #include "OrxonoxConfig.h"
-
-#include <string>
 
 //-----------------------------------------------------------------------
@@ -64,129 +62,179 @@
 namespace orxonox
 {
-  namespace XMLPort
-  {
-    enum Mode
+    namespace XMLPort
     {
-      LoadObject,
-      SaveObject,
-      ExpandObject
+        enum Mode
+        {
+            LoadObject,
+            SaveObject,
+            ExpandObject
+        };
+    }
+
+    namespace KeybindMode
+    {
+        enum Enum
+        {
+            OnPress,
+            OnHold,
+            OnRelease,
+            None
+        };
     };
-  }
-
-  namespace KeybindMode
-  {
-    enum Enum
-    {
-      OnPress,
-      OnHold,
-      OnRelease,
-      None
-    };
-  };
-
-  typedef std::string LanguageEntryLabel;
-
-  class ArgumentCompleter;
-  class ArgumentCompletionListElement;
-  class BaseFactory;
-  class BaseMetaObjectListElement;
-  class BaseObject;
-  template <class T>
-  class ClassFactory;
-  template <class T>
-  class ClassIdentifier;
-  class ClassTreeMask;
-  class ClassTreeMaskIterator;
-  class ClassTreeMaskNode;
-  class ClassTreeMaskObjectIterator;
-  class Clock;
-  class CommandEvaluation;
-  class CommandExecutor;
-  class CommandLine;
-  class CommandLineArgument;
-  class ConfigFile;
-  class ConfigFileEntry;
-  class ConfigFileEntryComment;
-  class ConfigFileEntryValue;
-  class ConfigFileManager;
-  class ConfigFileSection;
-  class ConfigValueContainer;
-  class ConsoleCommand;
-  class Core;
-  struct Event;
-  class EventContainer;
-  class Executor;
-  template <class T>
-  class ExecutorMember;
-  class ExecutorStatic;
-  class Factory;
-  class Functor;
-  template <class T>
-  class FunctorMember;
-  class FunctorStatic;
-  class Identifier;
-  class IRC;
-  template <class T>
-  class Iterator;
-  class IteratorBase;
-  class Language;
-  class LanguageEntry;
-  class Loader;
-  class LuaBind;
-  class MetaObjectList;
-  class MetaObjectListElement;
-  class Namespace;
-  class NamespaceNode;
-  template <class T>
-  class ObjectList;
-  class ObjectListBase;
-  class ObjectListBaseElement;
-  template <class T>
-  class ObjectListElement;
-  template <class T>
-  class ObjectListIterator;
-  class OrxonoxClass;
-  class Shell;
-  class ShellListener;
-  template <class T>
-  class SubclassIdentifier;
-  class TclBind;
-  struct TclInterpreterBundle;
-  class TclThreadManager;
-  class Template;
-  class Tickable;
-  class XMLFile;
-  class XMLNameListener;
-  template <class T, class O>
-  class XMLPortClassObjectContainer;
-  template <class T>
-  class XMLPortClassParamContainer;
-  class XMLPortObjectContainer;
-  class XMLPortParamContainer;
-
-  // game states
-  class Game;
-  class GameState;
-  struct GameStateTreeNode;
-
-  // input
-  class BaseCommand;
-  class BufferedParamCommand;
-  class Button;
-  class CalibratorCallback;
-  class ExtendedInputState;
-  class HalfAxis;
-  class InputBuffer;
-  class InputManager;
-  class InputState;
-  class JoyStickHandler;
-  class MouseHandler;
-  class KeyBinder;
-  class KeyDetector;
-  class KeyHandler;
-  class ParamCommand;
-  class SimpleCommand;
-  class SimpleInputState;
-}
+
+    typedef std::string LanguageEntryLabel;
+
+    class ArgumentCompleter;
+    class ArgumentCompletionListElement;
+    class BaseFactory;
+    class BaseMetaObjectListElement;
+    class BaseObject;
+    template <class T>
+    class ClassFactory;
+    template <class T>
+    class ClassIdentifier;
+    class ClassTreeMask;
+    class ClassTreeMaskIterator;
+    class ClassTreeMaskNode;
+    class ClassTreeMaskObjectIterator;
+    class Clock;
+    class CommandEvaluation;
+    class CommandExecutor;
+    class CommandLine;
+    class CommandLineArgument;
+    class ConfigFile;
+    class ConfigFileEntry;
+    class ConfigFileEntryComment;
+    class ConfigFileEntryValue;
+    class ConfigFileManager;
+    class ConfigFileSection;
+    class ConfigValueContainer;
+    class ConsoleCommand;
+    class Core;
+    struct Event;
+    class EventContainer;
+    class Executor;
+    template <class T>
+    class ExecutorMember;
+    class ExecutorStatic;
+    class Factory;
+    class Functor;
+    template <class T>
+    class FunctorMember;
+    class FunctorStatic;
+    class Identifier;
+    class IRC;
+    template <class T>
+    class Iterator;
+    class IteratorBase;
+    class Language;
+    class LanguageEntry;
+    class Loader;
+    class LuaBind;
+    class MetaObjectList;
+    class MetaObjectListElement;
+    class Namespace;
+    class NamespaceNode;
+    template <class T>
+    class ObjectList;
+    class ObjectListBase;
+    class ObjectListBaseElement;
+    template <class T>
+    class ObjectListElement;
+    template <class T>
+    class ObjectListIterator;
+    class OrxonoxClass;
+    class Shell;
+    class ShellListener;
+    template <class T>
+    class SubclassIdentifier;
+    class TclBind;
+    struct TclInterpreterBundle;
+    class TclThreadManager;
+    class Template;
+    class Tickable;
+    class XMLFile;
+    class XMLNameListener;
+    template <class T, class O>
+    class XMLPortClassObjectContainer;
+    template <class T>
+    class XMLPortClassParamContainer;
+    class XMLPortObjectContainer;
+    class XMLPortParamContainer;
+
+    // game states
+    class Game;
+    class GameState;
+    struct GameStateTreeNode;
+
+    // input
+    class BaseCommand;
+    class BufferedParamCommand;
+    class Button;
+    class CalibratorCallback;
+    class ExtendedInputState;
+    class HalfAxis;
+    class InputBuffer;
+    class InputManager;
+    class InputState;
+    class JoyStickHandler;
+    class MouseHandler;
+    class KeyBinder;
+    class KeyDetector;
+    class KeyHandler;
+    class ParamCommand;
+    class SimpleCommand;
+    class SimpleInputState;
+}
+
+// CppTcl
+namespace Tcl
+{
+    class interpreter;
+    class object;
+}
+
+// Boost
+namespace boost { namespace filesystem
+{
+    struct path_traits;
+    template <class String, class Traits> class basic_path;
+    typedef basic_path<std::string, path_traits> path;
+} }
+
+// TinyXML and TinyXML++
+class TiXmlString;
+class TiXmlOutStream;
+class TiXmlNode;
+class TiXmlHandle;
+class TiXmlDocument;
+class TiXmlElement;
+class TiXmlComment;
+class TiXmlUnknown;
+class TiXmlAttribute;
+class TiXmlText;
+class TiXmlDeclaration;
+class TiXmlParsingData;
+namespace ticpp
+{
+    class Document;
+    class Element;
+    class Declaration;
+    class StylesheetReference;
+    class Text;
+    class Comment;
+    class Attribute;
+}
+namespace orxonox
+{
+    using ticpp::Document;
+    using ticpp::Element;
+    using ticpp::Declaration;
+    using ticpp::StylesheetReference;
+    using ticpp::Text;
+    using ticpp::Comment;
+    using ticpp::Attribute;
+}
+
 
 #endif /* _CorePrereqs_H__ */
Index: code/trunk/src/core/Event.cc
===================================================================
--- code/trunk/src/core/Event.cc	(revision 3103)
+++ code/trunk/src/core/Event.cc	(revision 3196)
@@ -28,4 +28,5 @@
 
 #include "Event.h"
+
 #include "BaseObject.h"
 #include "Executor.h"
Index: code/trunk/src/core/Event.h
===================================================================
--- code/trunk/src/core/Event.h	(revision 3103)
+++ code/trunk/src/core/Event.h	(revision 3196)
@@ -31,4 +31,5 @@
 
 #include "CorePrereqs.h"
+#include <string>
 
 namespace orxonox
Index: code/trunk/src/core/EventIncludes.h
===================================================================
--- code/trunk/src/core/EventIncludes.h	(revision 3103)
+++ code/trunk/src/core/EventIncludes.h	(revision 3196)
@@ -33,17 +33,17 @@
 #include "Executor.h"
 
-#define SetEvent(classname, eventname, functionname, event) \
-    SetEventGeneric(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject)
+#define ORXONOX_SET_EVENT(classname, eventname, functionname, event) \
+    ORXONOX_SET_EVENT_GENERIC(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject)
 
-#define SetEventTemplate(classname, eventname, functionname, event, ...) \
-    SetEventGenericTemplate(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject, __VA_ARGS__)
+#define ORXONOX_SET_EVENT_TEMPLATE(classname, eventname, functionname, event, ...) \
+    ORXONOX_SET_EVENT_GENERIC_TEMPLATE(eventcontainer##classname##functionname, classname, eventname, functionname, event, BaseObject, __VA_ARGS__)
 
-#define SetSubclassEvent(classname, eventname, functionname, event, subclassname) \
-    SetEventGeneric(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname)
+#define ORXONOX_SET_SUBCLASS_EVENT(classname, eventname, functionname, event, subclassname) \
+    ORXONOX_SET_EVENT_GENERIC(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname)
 
-#define SetSubclassEventTemplate(classname, eventname, functionname, event, subclassname, ...) \
-    SetEventGenericTemplate(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname, __VA_ARGS__)
+#define ORXONOX_SET_SUBCLASS_EVENT_TEMPLATE(classname, eventname, functionname, event, subclassname, ...) \
+    ORXONOX_SET_EVENT_GENERIC_TEMPLATE(eventcontainer##classname##functionname, classname, eventname, functionname, event, subclassname, __VA_ARGS__)
 
-#define SetEventGeneric(containername, classname, eventname, functionname, event, subclassname) \
+#define ORXONOX_SET_EVENT_GENERIC(containername, classname, eventname, functionname, event, subclassname) \
     orxonox::EventContainer* containername = this->getEventContainer(eventname); \
     if (!containername) \
@@ -57,5 +57,5 @@
     containername->process(this, event)
 
-#define SetEventGenericTemplate(containername, classname, eventname, functionname, event, subclassname, ...) \
+#define ORXONOX_SET_EVENT_GENERIC_TEMPLATE(containername, classname, eventname, functionname, event, subclassname, ...) \
     orxonox::EventContainer* containername = this->getEventContainer(eventname); \
     if (!containername) \
Index: code/trunk/src/core/Executor.cc
===================================================================
--- code/trunk/src/core/Executor.cc	(revision 3103)
+++ code/trunk/src/core/Executor.cc	(revision 3196)
@@ -29,5 +29,5 @@
 
 #include "Executor.h"
-#include "util/Math.h"
+
 #include "util/Convert.h"
 #include "Language.h"
Index: code/trunk/src/core/Executor.h
===================================================================
--- code/trunk/src/core/Executor.h	(revision 3103)
+++ code/trunk/src/core/Executor.h	(revision 3196)
@@ -33,9 +33,9 @@
 #include "CorePrereqs.h"
 
+#include "util/Debug.h"
+#include "util/Math.h"
+#include "util/String.h"
 #include "util/SubString.h"
-#include "util/String.h"
-#include "util/Math.h"
 #include "Functor.h"
-#include "util/Debug.h"
 
 
Index: code/trunk/src/core/Factory.cc
===================================================================
--- code/trunk/src/core/Factory.cc	(revision 3103)
+++ code/trunk/src/core/Factory.cc	(revision 3196)
@@ -33,7 +33,8 @@
 
 #include "Factory.h"
+
+#include "util/Debug.h"
 #include "Identifier.h"
 #include "BaseObject.h"
-#include "util/Debug.h"
 
 namespace orxonox
Index: code/trunk/src/core/Functor.h
===================================================================
--- code/trunk/src/core/Functor.h	(revision 3103)
+++ code/trunk/src/core/Functor.h	(revision 3196)
@@ -33,8 +33,7 @@
 #include "CorePrereqs.h"
 
+#include "util/Debug.h"
 #include "util/MultiType.h"
 #include "util/String.h"
-#include "util/Debug.h"
-
 
 namespace orxonox
Index: code/trunk/src/core/Game.cc
===================================================================
--- code/trunk/src/core/Game.cc	(revision 3103)
+++ code/trunk/src/core/Game.cc	(revision 3196)
@@ -36,5 +36,5 @@
 
 #include <exception>
-#include <cassert>
+#include <boost/weak_ptr.hpp>
 
 #include "util/Debug.h"
@@ -51,4 +51,7 @@
 namespace orxonox
 {
+    using boost::shared_ptr;
+    using boost::weak_ptr;
+
     static void stop_game()
         { Game::getInstance().stop(); }
@@ -57,7 +60,7 @@
     struct _CoreExport GameStateTreeNode
     {
-        GameState*                      state_;
-        GameStateTreeNode*              parent_;
-        std::vector<GameStateTreeNode*> children_;
+        GameState* state_;
+        weak_ptr<GameStateTreeNode> parent_;
+        std::vector<shared_ptr<GameStateTreeNode> > children_;
     };
 
@@ -73,7 +76,4 @@
         assert(singletonRef_s == 0);
         singletonRef_s = this;
-
-        this->rootStateNode_ = 0;
-        this->activeStateNode_ = 0;
 
         this->abort_ = false;
@@ -105,8 +105,4 @@
         // Destroy pretty much everyhting left
         delete this->core_;
-
-        // Delete all the created nodes
-        for (std::vector<GameStateTreeNode*>::const_iterator it = this->allStateNodes_.begin(); it != this->allStateNodes_.end(); ++it)
-            delete *it;
 
         delete this->gameClock_;
@@ -172,6 +168,6 @@
             {
                 // Note: this->requestedStateNodes_.front() is the currently active state node
-                std::vector<GameStateTreeNode*>::iterator it = this->requestedStateNodes_.begin() + 1;
-                if (*it == this->activeStateNode_->parent_)
+                std::vector<shared_ptr<GameStateTreeNode> >::iterator it = this->requestedStateNodes_.begin() + 1;
+                if (*it == this->activeStateNode_->parent_.lock())
                     this->unloadState(this->activeStateNode_->state_);
                 else // has to be child
@@ -194,5 +190,5 @@
 
                 if ((*it)->getCountTickTime())
-                    this->addTickTime(this->gameClock_->getRealMicroseconds() - timeBeforeTick);
+                    this->addTickTime(static_cast<uint32_t>(this->gameClock_->getRealMicroseconds() - timeBeforeTick));
             }
 
@@ -216,6 +212,6 @@
 
                 uint32_t framesPerPeriod = this->statisticsTickTimes_.size();
-                this->avgFPS_ = (float)framesPerPeriod / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0;
-                this->avgTickTime_ = (float)this->periodTickTime_ / framesPerPeriod / 1000.0;
+                this->avgFPS_ = static_cast<float>(framesPerPeriod) / (currentTime - this->statisticsTickTimes_.front().tickTime) * 1000000.0f;
+                this->avgTickTime_ = static_cast<float>(this->periodTickTime_) / framesPerPeriod / 1000.0f;
 
                 this->periodTime_ -= this->statisticsRefreshCycle_;
@@ -226,5 +222,5 @@
         while (!this->activeStates_.empty())
             this->unloadState(this->activeStates_.back());
-        this->activeStateNode_ = 0;
+        this->activeStateNode_.reset();
         this->requestedStateNodes_.clear();
     }
@@ -251,8 +247,8 @@
             return;
 
-        GameStateTreeNode* requestedNode = 0;
+        shared_ptr<GameStateTreeNode> requestedNode;
 
         // this->requestedStateNodes_.back() is the currently active state
-        GameStateTreeNode* lastRequestedNode = this->requestedStateNodes_.back();
+        shared_ptr<GameStateTreeNode> lastRequestedNode = this->requestedStateNodes_.back();
 
         // Already the active node?
@@ -274,10 +270,10 @@
 
         // Check parent and all its grand parents
-        GameStateTreeNode* currentNode = lastRequestedNode;
+        shared_ptr<GameStateTreeNode> currentNode = lastRequestedNode;
         while (requestedNode == NULL && currentNode != NULL)
         {
             if (currentNode->state_ == state)
                 requestedNode = currentNode;
-            currentNode = currentNode->parent_;
+            currentNode = currentNode->parent_.lock();
         }
 
@@ -297,6 +293,6 @@
     void Game::popState()
     {
-        if (this->activeStateNode_ != NULL && this->requestedStateNodes_.back()->parent_)
-            this->requestState(this->requestedStateNodes_.back()->parent_->state_->getName());
+        if (this->activeStateNode_ != NULL && this->requestedStateNodes_.back()->parent_.lock())
+            this->requestState(this->requestedStateNodes_.back()->parent_.lock()->state_->getName());
         else
             COUT(2) << "Warning: Could not pop GameState. Ignoring." << std::endl;
@@ -333,5 +329,5 @@
         }
         unsigned int currentLevel = 0;
-        GameStateTreeNode* currentNode = 0;
+        shared_ptr<GameStateTreeNode> currentNode;
         for (std::vector<std::pair<std::string, unsigned> >::const_iterator it = stateStrings.begin(); it != stateStrings.end(); ++it)
         {
@@ -346,8 +342,6 @@
                 if (this->rootStateNode_ != NULL)
                     ThrowException(GameState, "No two root GameStates are allowed!");
-                GameStateTreeNode* newNode = new GameStateTreeNode;
-                this->allStateNodes_.push_back(newNode);
+                shared_ptr<GameStateTreeNode> newNode(new GameStateTreeNode);
                 newNode->state_ = newState;
-                newNode->parent_ = 0;
                 this->rootStateNode_ = newNode;
                 currentNode = this->rootStateNode_;
@@ -355,6 +349,5 @@
             else if (currentNode)
             {
-                GameStateTreeNode* newNode = new GameStateTreeNode;
-                this->allStateNodes_.push_back(newNode);
+                shared_ptr<GameStateTreeNode> newNode(new GameStateTreeNode);
                 newNode->state_ = newState;
                 if (newLevel < currentLevel)
@@ -362,5 +355,5 @@
                     // Get down the hierarchy
                     do
-                        currentNode = currentNode->parent_;
+                        currentNode = currentNode->parent_.lock();
                     while (newLevel < --currentLevel);
                 }
@@ -369,5 +362,5 @@
                     // same level
                     newNode->parent_ = currentNode->parent_;
-                    newNode->parent_->children_.push_back(newNode);
+                    newNode->parent_.lock()->children_.push_back(newNode);
                 }
                 else if (newLevel == currentLevel + 1)
Index: code/trunk/src/core/Game.h
===================================================================
--- code/trunk/src/core/Game.h	(revision 3103)
+++ code/trunk/src/core/Game.h	(revision 3196)
@@ -37,8 +37,13 @@
 
 #include "CorePrereqs.h"
+
 #include <cassert>
 #include <list>
 #include <map>
+#include <string>
 #include <vector>
+#include <boost/shared_ptr.hpp>
+#include <boost/preprocessor/cat.hpp>
+
 #include "OrxonoxClass.h"
 
@@ -49,5 +54,5 @@
 */
 #define AddGameState(classname, ...) \
-    static bool MACRO_CONCATENATE(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
+    static bool BOOST_PP_CAT(bGameStateDummy_##classname, __LINE__) = orxonox::Game::addGameState(new classname(__VA_ARGS__))
 
 // tolua_begin
@@ -106,8 +111,7 @@
 
         std::vector<GameState*>         activeStates_;
-        GameStateTreeNode*              rootStateNode_;
-        GameStateTreeNode*              activeStateNode_;
-        std::vector<GameStateTreeNode*> requestedStateNodes_;
-        std::vector<GameStateTreeNode*> allStateNodes_;
+        boost::shared_ptr<GameStateTreeNode> rootStateNode_;
+        boost::shared_ptr<GameStateTreeNode> activeStateNode_;
+        std::vector<boost::shared_ptr<GameStateTreeNode> > requestedStateNodes_;
 
         Core*                           core_;
Index: code/trunk/src/core/GameState.cc
===================================================================
--- code/trunk/src/core/GameState.cc	(revision 3103)
+++ code/trunk/src/core/GameState.cc	(revision 3196)
@@ -34,8 +34,8 @@
 
 #include "GameState.h"
-#include <cassert>
+
 #include "util/Debug.h"
 #include "util/Exception.h"
-#include "Clock.h"
+#include "util/OrxAssert.h"
 
 namespace orxonox
Index: code/trunk/src/core/GameState.h
===================================================================
--- code/trunk/src/core/GameState.h	(revision 3103)
+++ code/trunk/src/core/GameState.h	(revision 3196)
@@ -38,7 +38,6 @@
 #include "CorePrereqs.h"
 
+#include <map>
 #include <string>
-#include <map>
-#include "CorePrereqs.h"
 
 namespace orxonox
Index: code/trunk/src/core/IRC.cc
===================================================================
--- code/trunk/src/core/IRC.cc	(revision 3103)
+++ code/trunk/src/core/IRC.cc	(revision 3196)
@@ -29,10 +29,10 @@
 #include "IRC.h"
 
-#include <boost/thread/thread.hpp>
+#include <cpptcl/cpptcl.h>
+
+#include "util/Convert.h"
 #include "ConsoleCommand.h"
+#include "CoreIncludes.h"
 #include "TclThreadManager.h"
-#include "CoreIncludes.h"
-#include "util/Convert.h"
-
 
 namespace orxonox
Index: code/trunk/src/core/IRC.h
===================================================================
--- code/trunk/src/core/IRC.h	(revision 3103)
+++ code/trunk/src/core/IRC.h	(revision 3196)
@@ -32,5 +32,5 @@
 #include "CorePrereqs.h"
 
-#include <cpptcl/cpptcl.h>
+#include <string>
 #include "OrxonoxClass.h"
 
Index: code/trunk/src/core/Identifier.cc
===================================================================
--- code/trunk/src/core/Identifier.cc	(revision 3103)
+++ code/trunk/src/core/Identifier.cc	(revision 3196)
@@ -36,8 +36,8 @@
 #include <ostream>
 
-#include "Factory.h"
+#include "util/String.h"
 #include "ConfigValueContainer.h"
 #include "ConsoleCommand.h"
-#include "CommandExecutor.h"
+#include "Factory.h"
 #include "XMLPort.h"
 
@@ -63,5 +63,4 @@
         this->bHasConfigValues_ = false;
         this->bHasConsoleCommands_ = false;
-        this->bHasConstructionCallback_ = false;
 
         this->children_ = new std::set<const Identifier*>();
@@ -93,6 +92,4 @@
         for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it)
             delete (it->second);
-        for (std::vector<Functor*>::iterator it = this->constructionCallbacks_.begin(); it != this->constructionCallbacks_.end(); ++it)
-            delete *it;
     }
 
@@ -519,36 +516,4 @@
 
     /**
-        @brief Adds a construction callback functor that gets called every time an object is created.
-        @param functor Functor pointer to any function with no argument.
-    */
-    void Identifier::addConstructionCallback(Functor* functor)
-    {
-        for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
-        {
-            if (this->constructionCallbacks_[i] == functor)
-                return;
-        }
-        this->constructionCallbacks_.push_back(functor);
-        this->bHasConstructionCallback_ = true;
-    }
-
-    /**
-        @brief Removes a construction callback functor that gets called every time an object is created.
-        @param functor Functor pointer to any function with no argument.
-    */
-    void Identifier::removeConstructionCallback(Functor* functor)
-    {
-        for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
-        {
-            if (this->constructionCallbacks_[i] == functor)
-            {
-                this->constructionCallbacks_.erase(this->constructionCallbacks_.begin() + i);
-            }
-        }
-        if (constructionCallbacks_.empty())
-            this->bHasConstructionCallback_ = false;
-    }
-
-    /**
         @brief Lists the names of all Identifiers in a std::set<const Identifier*>.
         @param out The outstream
Index: code/trunk/src/core/Identifier.h
===================================================================
--- code/trunk/src/core/Identifier.h	(revision 3103)
+++ code/trunk/src/core/Identifier.h	(revision 3196)
@@ -55,19 +55,15 @@
 #include "CorePrereqs.h"
 
+#include <cassert>
+#include <map>
 #include <set>
-#include <map>
-#include <vector>
 #include <string>
-#include <utility>
 #include <typeinfo>
-#include <cstdlib>
-#include <cassert>
-
+
+#include "util/Debug.h"
 #include "MetaObjectList.h"
-#include "Iterator.h"
+#include "ObjectList.h"
+#include "ObjectListBase.h"
 #include "Super.h"
-#include "Functor.h"
-#include "util/Debug.h"
-#include "util/String.h"
 
 namespace orxonox
@@ -223,6 +219,4 @@
             /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */
             inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }
-            /** @brief Returns true if this class has at least one construction callback Functor registered. */
-            inline bool hasConstructionCallback() const { return this->bHasConstructionCallback_; }
 
             /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */
@@ -251,7 +245,4 @@
             ConsoleCommand* getConsoleCommand(const std::string& name) const;
             ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;
-
-            void addConstructionCallback(Functor* functor);
-            void removeConstructionCallback(Functor* functor);
 
             void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass);
@@ -276,7 +267,4 @@
             /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */
             inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }
-
-            bool bHasConstructionCallback_;                                //!< True if at least one Functor is registered to get informed when an object of type T is created.
-            std::vector<Functor*> constructionCallbacks_;                  //!< All construction callback Functors of this class.
 
             ObjectListBase* objects_;                                      //!< The list of all objects of this class
@@ -383,5 +371,5 @@
     */
     template <class T>
-    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
+    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier()
     {
         // check if the static field has already been filled
@@ -398,5 +386,5 @@
     */
     template <class T>
-    ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
+    inline ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier(const std::string& name)
     {
         ClassIdentifier<T>* identifier = ClassIdentifier<T>::getIdentifier();
@@ -435,15 +423,8 @@
     */
     template <class T>
-    void ClassIdentifier<T>::addObject(T* object)
+    inline void ClassIdentifier<T>::addObject(T* object)
     {
         COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;
         object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object)));
-        if (this->bHasConstructionCallback_)
-        {
-            // Call all registered callbacks that a new object of type T has been created.
-            // Do NOT deliver a T* pointer here because it's way too risky (object not yet fully created).
-            for (unsigned int i = 0; i < this->constructionCallbacks_.size(); ++i)
-                (*constructionCallbacks_[i])();
-        }
     }
 
Index: code/trunk/src/core/Iterator.h
===================================================================
--- code/trunk/src/core/Iterator.h	(revision 3103)
+++ code/trunk/src/core/Iterator.h	(revision 3196)
@@ -47,7 +47,6 @@
 #include "CorePrereqs.h"
 
+#include "Identifier.h"
 #include "ObjectListBase.h"
-#include "ObjectListIterator.h"
-#include "OrxonoxClass.h"
 
 namespace orxonox
@@ -305,6 +304,3 @@
 }
 
-// Include ObjectList.h so the user only has to include one file: Iterator.h
-#include "ObjectList.h"
-
 #endif /* _Iterator_H__ */
Index: code/trunk/src/core/Language.cc
===================================================================
--- code/trunk/src/core/Language.cc	(revision 3103)
+++ code/trunk/src/core/Language.cc	(revision 3196)
@@ -37,6 +37,6 @@
 #include <boost/filesystem.hpp>
 
+#include "util/Debug.h"
 #include "Core.h"
-#include "util/Debug.h"
 
 namespace orxonox
Index: code/trunk/src/core/Loader.cc
===================================================================
--- code/trunk/src/core/Loader.cc	(revision 3103)
+++ code/trunk/src/core/Loader.cc	(revision 3196)
@@ -32,15 +32,13 @@
 #include <boost/filesystem.hpp>
 
-#include "XMLFile.h"
+#include "util/Debug.h"
+#include "util/Exception.h"
 #include "BaseObject.h"
-#include "Identifier.h"
+#include "Core.h"
 #include "Iterator.h"
 #include "ObjectList.h"
-#include "CoreIncludes.h"
 #include "LuaBind.h"
 #include "Namespace.h"
-#include "util/Debug.h"
-#include "util/Exception.h"
-#include "Core.h"
+#include "XMLFile.h"
 
 namespace orxonox
Index: code/trunk/src/core/Loader.h
===================================================================
--- code/trunk/src/core/Loader.h	(revision 3103)
+++ code/trunk/src/core/Loader.h	(revision 3196)
@@ -33,5 +33,4 @@
 
 #include <vector>
-
 #include "ClassTreeMask.h"
 
Index: code/trunk/src/core/LuaBind.cc
===================================================================
--- code/trunk/src/core/LuaBind.cc	(revision 3103)
+++ code/trunk/src/core/LuaBind.cc	(revision 3196)
@@ -31,7 +31,5 @@
 #include <fstream>
 #include <map>
-
 extern "C" {
-#include <lua.h>
 #include <lualib.h>
 }
@@ -39,6 +37,6 @@
 #include <boost/filesystem.hpp>
 
+#include "util/Debug.h"
 #include "util/String.h"
-#include "util/Debug.h"
 #include "ToluaBindCore.h"
 #include "Core.h"
@@ -72,5 +70,5 @@
   }
 
-  void LuaBind::luaPrint(std::string str)
+  void LuaBind::luaPrint(const std::string& str)
   {
     output_ += str;
@@ -84,5 +82,5 @@
       @param luaTags if true, the loaded file gets stripped off luaTags
   */
-  void LuaBind::loadFile(std::string filename, bool luaTags)
+  void LuaBind::loadFile(const std::string& filename, bool luaTags)
   {
     boost::filesystem::path filepath(filename);
@@ -117,5 +115,5 @@
   }
 
-  void LuaBind::loadString(std::string code)
+  void LuaBind::loadString(const std::string& code)
   {
     luaSource_ = code;
Index: code/trunk/src/core/LuaBind.h
===================================================================
--- code/trunk/src/core/LuaBind.h	(revision 3103)
+++ code/trunk/src/core/LuaBind.h	(revision 3196)
@@ -38,11 +38,9 @@
 #include "CorePrereqs.h"
 
+#include <cassert>
+#include <string>
 extern "C" {
 #include <lua.h>
 }
-
-#include <cassert>
-#include <list>
-#include <string>
 
 // tolua_begin
@@ -64,10 +62,10 @@
       inline static LuaBind& getInstance() { assert(singletonRef_s); return *LuaBind::singletonRef_s; } // tolua_export
 
-    void loadFile(std::string filename, bool luaTags);
-    void loadString(std::string code);
+    void loadFile(const std::string& filename, bool luaTags);
+    void loadString(const std::string& code);
     //void init(lua_State *state_);
     //void xmlToLua();
     void run();
-    void luaPrint(std::string str); // tolua_export
+    void luaPrint(const std::string& str); // tolua_export
 
 #if LUA_VERSION_NUM != 501
@@ -76,5 +74,5 @@
 
     inline lua_State* getLuaState() { return luaState_; };
-    inline std::string getLuaOutput() { return output_; };
+    inline const std::string& getLuaOutput() { return output_; };
     //inline std::string* getFileString() { return &fileString_; };
     inline void clearLuaOutput() { output_ = ""; }
Index: code/trunk/src/core/MetaObjectList.cc
===================================================================
--- code/trunk/src/core/MetaObjectList.cc	(revision 3103)
+++ code/trunk/src/core/MetaObjectList.cc	(revision 3196)
@@ -33,7 +33,8 @@
 
 #include "MetaObjectList.h"
+
+#include "util/Debug.h"
+#include "Identifier.h"
 #include "ObjectListBase.h"
-#include "Identifier.h"
-#include "util/Debug.h"
 
 namespace orxonox
Index: code/trunk/src/core/Namespace.cc
===================================================================
--- code/trunk/src/core/Namespace.cc	(revision 3103)
+++ code/trunk/src/core/Namespace.cc	(revision 3196)
@@ -28,4 +28,7 @@
 
 #include "Namespace.h"
+
+#include <set>
+
 #include "NamespaceNode.h"
 #include "CoreIncludes.h"
Index: code/trunk/src/core/Namespace.h
===================================================================
--- code/trunk/src/core/Namespace.h	(revision 3103)
+++ code/trunk/src/core/Namespace.h	(revision 3196)
@@ -32,7 +32,6 @@
 #include "CorePrereqs.h"
 
-#include <map>
-
-#include "XMLIncludes.h"
+#include <set>
+#include <string>
 #include "BaseObject.h"
 
Index: code/trunk/src/core/ObjectListBase.cc
===================================================================
--- code/trunk/src/core/ObjectListBase.cc	(revision 3103)
+++ code/trunk/src/core/ObjectListBase.cc	(revision 3196)
@@ -35,11 +35,10 @@
 */
 
+#include "ObjectListBase.h"
+
 #include <set>
-
-#include "CorePrereqs.h"
-
-#include "ObjectListBase.h"
 #include "Identifier.h"
 #include "Iterator.h"
+#include "ObjectListIterator.h"
 
 namespace orxonox
Index: code/trunk/src/core/ObjectListBase.h
===================================================================
--- code/trunk/src/core/ObjectListBase.h	(revision 3103)
+++ code/trunk/src/core/ObjectListBase.h	(revision 3196)
@@ -38,7 +38,8 @@
 #define _ObjectListBase_H__
 
+#include "CorePrereqs.h"
+
 #include <vector>
-
-#include "CorePrereqs.h"
+#include "OrxonoxClass.h"
 
 namespace orxonox
@@ -139,7 +140,7 @@
 
         private:
-            Identifier* identifier_;               //!< The Iterator owning this list
-            ObjectListBaseElement* first_;         //!< The first element in the list
-            ObjectListBaseElement* last_;          //!< The last element in the list
+            Identifier* identifier_;                 //!< The Iterator owning this list
+            ObjectListBaseElement* first_;           //!< The first element in the list
+            ObjectListBaseElement* last_;            //!< The last element in the list
             std::vector<void*> iterators_;           //!< A list of Iterators pointing on an element in this list
             std::vector<void*> objectListIterators_; //!< A list of ObjectListIterators pointing on an element in this list
Index: code/trunk/src/core/ObjectListIterator.h
===================================================================
--- code/trunk/src/core/ObjectListIterator.h	(revision 3103)
+++ code/trunk/src/core/ObjectListIterator.h	(revision 3196)
@@ -28,5 +28,5 @@
 
 /**
-    @file Iterator.h
+    @file
     @brief Definition and implementation of the Iterator class.
 
@@ -47,5 +47,6 @@
 
 #include "CorePrereqs.h"
-#include "ObjectListBase.h"
+#include "Identifier.h"
+#include "ObjectList.h"
 
 namespace orxonox
@@ -230,6 +231,3 @@
 }
 
-// Include ObjectList.h so the user only has to include one file: Iterator.h
-#include "ObjectList.h"
-
 #endif /* _ObjectListIterator_H__ */
Index: code/trunk/src/core/OrxonoxClass.cc
===================================================================
--- code/trunk/src/core/OrxonoxClass.cc	(revision 3103)
+++ code/trunk/src/core/OrxonoxClass.cc	(revision 3196)
@@ -33,4 +33,5 @@
 
 #include "OrxonoxClass.h"
+
 #include "MetaObjectList.h"
 #include "Identifier.h"
Index: code/trunk/src/core/OrxonoxClass.h
===================================================================
--- code/trunk/src/core/OrxonoxClass.h	(revision 3103)
+++ code/trunk/src/core/OrxonoxClass.h	(revision 3196)
@@ -39,7 +39,5 @@
 
 #include "CorePrereqs.h"
-
 #include <set>
-#include <string>
 
 namespace orxonox
Index: code/trunk/src/core/Shell.cc
===================================================================
--- code/trunk/src/core/Shell.cc	(revision 3103)
+++ code/trunk/src/core/Shell.cc	(revision 3196)
@@ -28,4 +28,6 @@
 
 #include "Shell.h"
+
+#include "util/OutputHandler.h"
 #include "CommandExecutor.h"
 #include "CoreIncludes.h"
@@ -33,5 +35,4 @@
 #include "Core.h"
 #include "ConsoleCommand.h"
-#include "util/OutputHandler.h"
 
 #define SHELL_UPDATE_LISTENERS(function) \
Index: code/trunk/src/core/Shell.h
===================================================================
--- code/trunk/src/core/Shell.h	(revision 3103)
+++ code/trunk/src/core/Shell.h	(revision 3196)
@@ -32,5 +32,7 @@
 #include "CorePrereqs.h"
 
+#include <cassert>
 #include <list>
+#include <string>
 #include <vector>
 
Index: code/trunk/src/core/Super.h
===================================================================
--- code/trunk/src/core/Super.h	(revision 3103)
+++ code/trunk/src/core/Super.h	(revision 3196)
@@ -67,10 +67,7 @@
 #define _Super_H__
 
-#include <iostream>
-
 #include "CorePrereqs.h"
 
 #include "util/Debug.h"
-#include "XMLIncludes.h"
 #include "Event.h"
 
Index: code/trunk/src/core/TclBind.cc
===================================================================
--- code/trunk/src/core/TclBind.cc	(revision 3103)
+++ code/trunk/src/core/TclBind.cc	(revision 3196)
@@ -29,11 +29,13 @@
 #include "TclBind.h"
 
-#include <iostream>
+#include <exception>
 #include <string>
-#include "ConsoleCommand.h"
-#include "CommandExecutor.h"
-#include "TclThreadManager.h"
+#include <cpptcl/cpptcl.h>
+
 #include "util/Debug.h"
 #include "util/String.h"
+#include "CommandExecutor.h"
+#include "ConsoleCommand.h"
+#include "TclThreadManager.h"
 
 namespace orxonox
Index: code/trunk/src/core/TclBind.h
===================================================================
--- code/trunk/src/core/TclBind.h	(revision 3103)
+++ code/trunk/src/core/TclBind.h	(revision 3196)
@@ -32,5 +32,6 @@
 #include "CorePrereqs.h"
 
-#include <cpptcl/cpptcl.h>
+#include <cassert>
+#include <string>
 
 namespace orxonox
Index: code/trunk/src/core/TclThreadManager.cc
===================================================================
--- code/trunk/src/core/TclThreadManager.cc	(revision 3103)
+++ code/trunk/src/core/TclThreadManager.cc	(revision 3196)
@@ -29,18 +29,15 @@
 #include "TclThreadManager.h"
 
-#include <iostream>
-#include <string>
-#include <boost/thread/thread.hpp>
 #include <boost/bind.hpp>
 #include <OgreTimer.h>
-
+#include <cpptcl/cpptcl.h>
+
+#include "util/Convert.h"
+#include "util/Debug.h"
 #include "Clock.h"
+#include "CommandExecutor.h"
+#include "ConsoleCommand.h"
 #include "CoreIncludes.h"
-#include "ConsoleCommand.h"
-#include "CommandExecutor.h"
 #include "TclBind.h"
-#include "util/Debug.h"
-#include "util/Convert.h"
-
 
 namespace orxonox
Index: code/trunk/src/core/TclThreadManager.h
===================================================================
--- code/trunk/src/core/TclThreadManager.h	(revision 3103)
+++ code/trunk/src/core/TclThreadManager.h	(revision 3196)
@@ -32,13 +32,11 @@
 #include "CorePrereqs.h"
 
-#include <queue>
+#include <list>
 #include <map>
-#include <list>
-
+#include <string>
+#include <boost/thread/condition.hpp>
 #include <boost/thread/mutex.hpp>
-#include <boost/thread/condition.hpp>
 #include <boost/thread/thread.hpp>
 
-#include <cpptcl/cpptcl.h>
 #include "core/OrxonoxClass.h"
 
Index: code/trunk/src/core/Template.cc
===================================================================
--- code/trunk/src/core/Template.cc	(revision 3103)
+++ code/trunk/src/core/Template.cc	(revision 3196)
@@ -29,9 +29,10 @@
 #include "Template.h"
 
+#include <tinyxml/tinyxml.h>
 #include <tinyxml/ticpp.h>
 
+#include "util/Debug.h"
 #include "core/CoreIncludes.h"
 #include "core/XMLPort.h"
-#include "util/Debug.h"
 
 namespace orxonox
@@ -39,6 +40,8 @@
     CreateFactory(Template);
 
-    Template::Template(BaseObject* creator) : BaseObject(creator), xmlelement_("")
+    Template::Template(BaseObject* creator) : BaseObject(creator)
     {
+        this->xmlelement_ = new TiXmlElement("");
+
         RegisterObject(Template);
 
@@ -52,4 +55,5 @@
     {
         Template::getTemplateMap().erase(this->getName());
+        delete this->xmlelement_;
     }
 
@@ -90,4 +94,9 @@
     }
 
+    void Template::setXMLElement(const TiXmlElement& xmlelement)
+    {
+        *this->xmlelement_ = xmlelement;
+    }
+
     const TiXmlElement& Template::getXMLElement() const
     {
@@ -115,5 +124,5 @@
         }
 
-        return this->xmlelement_;
+        return *this->xmlelement_;
     }
 
Index: code/trunk/src/core/Template.h
===================================================================
--- code/trunk/src/core/Template.h	(revision 3103)
+++ code/trunk/src/core/Template.h	(revision 3196)
@@ -30,9 +30,8 @@
 #define _Template_H__
 
-#include <map>
-
 #include "CorePrereqs.h"
 
-#include <tinyxml/tinyxml.h>
+#include <map>
+#include <string>
 #include "BaseObject.h"
 
@@ -58,6 +57,5 @@
                 { return this->bLoadDefaults_; }
 
-            inline void setXMLElement(const TiXmlElement& xmlelement)
-                { this->xmlelement_ = xmlelement; }
+            void setXMLElement(const TiXmlElement& xmlelement);
             const TiXmlElement& getXMLElement() const;
 
@@ -75,5 +73,5 @@
 
         private:
-            TiXmlElement xmlelement_;
+            TiXmlElement* xmlelement_;
             std::string link_;
             std::string baseclass_;
Index: code/trunk/src/core/XMLFile.h
===================================================================
--- code/trunk/src/core/XMLFile.h	(revision 3103)
+++ code/trunk/src/core/XMLFile.h	(revision 3196)
@@ -33,5 +33,4 @@
 
 #include <string>
-
 #include "ClassTreeMask.h"
 
Index: code/trunk/src/core/XMLIncludes.h
===================================================================
--- code/trunk/src/core/XMLIncludes.h	(revision 3103)
+++ 	(revision )
@@ -1,73 +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 Forward declarations of some XML classes.
-*/
-
-#include "CorePrereqs.h"
-
-//-----------------------------------------------------------------------
-// Forward declarations
-//-----------------------------------------------------------------------
-
-class TiXmlString;
-class TiXmlOutStream;
-class TiXmlNode;
-class TiXmlHandle;
-class TiXmlDocument;
-class TiXmlElement;
-class TiXmlComment;
-class TiXmlUnknown;
-class TiXmlAttribute;
-class TiXmlText;
-class TiXmlDeclaration;
-class TiXmlParsingData;
-
-namespace ticpp
-{
-    class Document;
-    class Element;
-    class Declaration;
-    class StylesheetReference;
-    class Text;
-    class Comment;
-    class Attribute;
-}
-
-namespace orxonox
-{
-    using ticpp::Document;
-    using ticpp::Element;
-    using ticpp::Declaration;
-    using ticpp::StylesheetReference;
-    using ticpp::Text;
-    using ticpp::Comment;
-    using ticpp::Attribute;
-}
Index: code/trunk/src/core/XMLPort.cc
===================================================================
--- code/trunk/src/core/XMLPort.cc	(revision 3103)
+++ code/trunk/src/core/XMLPort.cc	(revision 3196)
@@ -28,8 +28,7 @@
 
 #include "XMLPort.h"
-#include "Language.h"
+
 #include "Loader.h"
 #include "Namespace.h"
-#include "CoreIncludes.h"
 
 namespace orxonox
@@ -40,5 +39,5 @@
     bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier)
     {
-        return ((!this->bApplyLoaderMask_) || identifier->isA(Class(Namespace)) || Loader::currentMask_s.isIncluded(identifier));
+        return ((!this->bApplyLoaderMask_) || identifier->isA(ClassIdentifier<Namespace>::getIdentifier()) || Loader::currentMask_s.isIncluded(identifier));
     }
 }
Index: code/trunk/src/core/XMLPort.h
===================================================================
--- code/trunk/src/core/XMLPort.h	(revision 3103)
+++ code/trunk/src/core/XMLPort.h	(revision 3196)
@@ -44,11 +44,14 @@
 
 #include <cassert>
+#include <string>
 #include <tinyxml/ticpp.h>
+
 #include "util/Debug.h"
 #include "util/Exception.h"
 #include "util/MultiType.h"
-#include "XMLIncludes.h"
+#include "util/OrxAssert.h"
+#include "Factory.h"
+#include "Identifier.h"
 #include "Executor.h"
-#include "CoreIncludes.h"
 #include "BaseObject.h"
 
@@ -176,5 +179,5 @@
 */
 #define XMLPortParamGeneric(containername, classname, objectclass, object, paramname, loadexecutor, saveexecutor, xmlelement, mode) \
-    orxonox::XMLPortClassParamContainer<objectclass>* containername = (orxonox::XMLPortClassParamContainer<objectclass>*)(ClassIdentifier<classname>::getIdentifier()->getXMLPortParamContainer(paramname)); \
+    orxonox::XMLPortClassParamContainer<objectclass>* containername = static_cast<orxonox::XMLPortClassParamContainer<objectclass>*>(ClassIdentifier<classname>::getIdentifier()->getXMLPortParamContainer(paramname)); \
     if (!containername) \
     { \
@@ -545,8 +548,8 @@
                             for (ticpp::Iterator<ticpp::Element> child = xmlsubelement->FirstChildElement(false); child != child.end(); child++)
                             {
-                                Identifier* identifier = ClassByString(child->Value());
+                                Identifier* identifier = Factory::getIdentifier(child->Value());
                                 if (identifier)
                                 {
-                                    if (identifier->isA(Class(O)))
+                                    if (identifier->isA(ClassIdentifier<O>::getIdentifier()))
                                     {
                                         if (identifier->isLoadable())
@@ -606,5 +609,5 @@
                                     else
                                     {
-                                        COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << Class(O)->getName() << "'." << std::endl;
+                                        COUT(2) << object->getLoaderIndentation() << "Warning: '" << child->Value() << "' is not a '" << ClassIdentifier<O>::getIdentifier()->getName() << "'." << std::endl;
                                     }
                                 }
@@ -626,5 +629,5 @@
                     {
                         COUT(1) << std::endl;
-                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << Class(O)->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ":" << std::endl;
+                        COUT(1) << "An error occurred in XMLPort.h while loading a '" << ClassIdentifier<O>::getIdentifier()->getName() << "' in '" << this->sectionname_ << "' of '" << this->identifier_->getName() << "' (objectname: " << object->getName() << ") in " << object->getFilename() << ":" << std::endl;
                         COUT(1) << ex.what() << std::endl;
                     }
Index: code/trunk/src/core/input/CMakeLists.txt
===================================================================
--- code/trunk/src/core/input/CMakeLists.txt	(revision 3103)
+++ code/trunk/src/core/input/CMakeLists.txt	(revision 3196)
@@ -1,5 +1,4 @@
 ADD_SOURCE_FILES(CORE_SRC_FILES
   Button.cc
-  CalibratorCallback.cc
   ExtendedInputState.cc
   HalfAxis.cc
Index: code/trunk/src/core/input/CalibratorCallback.cc
===================================================================
--- code/trunk/src/core/input/CalibratorCallback.cc	(revision 3103)
+++ 	(revision )
@@ -1,47 +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:
- *      ...
- *
- */
-
-/**
-@file
-@brief
-    Implementation of the different input handlers.
-*/
-
-#include "CalibratorCallback.h"
-#include "InputManager.h"
-
-namespace orxonox
-{
-    void CalibratorCallback::keyPressed(const orxonox::KeyEvent &evt)
-    {
-        if (evt.key == KeyCode::Return)
-        {
-            //InputManager::setInputState(InputManager::IS_NOCALIBRATE);
-        }
-    }
-}
Index: code/trunk/src/core/input/CalibratorCallback.h
===================================================================
--- code/trunk/src/core/input/CalibratorCallback.h	(revision 3103)
+++ 	(revision )
@@ -1,58 +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:
- *      ...
- *
- */
-
-/**
-@file
-@brief
-    Different definitions of input processing.
-*/
-
-#ifndef _CalibratorCallback_H__
-#define _CalibratorCallback_H__
-
-#include "core/CorePrereqs.h"
-#include "InputInterfaces.h"
-
-namespace orxonox
-{
-    class _CoreExport CalibratorCallback : public KeyHandler
-    {
-    public:
-        CalibratorCallback()  { }
-        ~CalibratorCallback() { }
-
-    private:
-        void keyPressed (const KeyEvent& evt);
-        void keyReleased(const KeyEvent& evt) { }
-        void keyHeld    (const KeyEvent& evt) { }
-
-        void updateInput(float dt) { }
-    };
-}
-
-#endif /* _CalibratorCallback_H__ */
Index: code/trunk/src/core/input/ExtendedInputState.cc
===================================================================
--- code/trunk/src/core/input/ExtendedInputState.cc	(revision 3103)
+++ code/trunk/src/core/input/ExtendedInputState.cc	(revision 3196)
@@ -36,5 +36,5 @@
 
 #include <cassert>
-#include "util/Debug.h"
+#include "core/Executor.h"
 
 namespace orxonox
@@ -457,3 +457,15 @@
         this->bHandlersChanged_ = true;
     }
+
+    void ExtendedInputState::onEnter()
+    {
+        if (executorOnEnter_)
+            (*executorOnEnter_)();
+    }
+
+    void ExtendedInputState::onLeave()
+    {
+        if (executorOnLeave_)
+            (*executorOnLeave_)();
+    }
 }
Index: code/trunk/src/core/input/ExtendedInputState.h
===================================================================
--- code/trunk/src/core/input/ExtendedInputState.h	(revision 3103)
+++ code/trunk/src/core/input/ExtendedInputState.h	(revision 3196)
@@ -38,5 +38,4 @@
 
 #include <vector>
-
 #include "InputInterfaces.h"
 #include "InputState.h"
@@ -89,4 +88,7 @@
         void update();
 
+        void onEnter();
+        void onLeave();
+
         std::vector<KeyHandler*>                    keyHandlers_;
         std::vector<MouseHandler*>                  mouseHandlers_;
Index: code/trunk/src/core/input/HalfAxis.h
===================================================================
--- code/trunk/src/core/input/HalfAxis.h	(revision 3103)
+++ code/trunk/src/core/input/HalfAxis.h	(revision 3196)
@@ -37,4 +37,5 @@
 
 #include "core/CorePrereqs.h"
+
 #include "Button.h"
 #include "InputCommands.h"
Index: code/trunk/src/core/input/InputBuffer.cc
===================================================================
--- code/trunk/src/core/input/InputBuffer.cc	(revision 3103)
+++ code/trunk/src/core/input/InputBuffer.cc	(revision 3196)
@@ -28,6 +28,4 @@
 
 #include "InputBuffer.h"
-
-#include <iostream>
 
 #include "util/Clipboard.h"
@@ -57,5 +55,5 @@
     }
 
-    InputBuffer::InputBuffer(const std::string allowedChars)
+    InputBuffer::InputBuffer(const std::string& allowedChars)
     {
         RegisterRootObject(InputBuffer);
Index: code/trunk/src/core/input/InputBuffer.h
===================================================================
--- code/trunk/src/core/input/InputBuffer.h	(revision 3103)
+++ code/trunk/src/core/input/InputBuffer.h	(revision 3196)
@@ -32,7 +32,6 @@
 #include "core/CorePrereqs.h"
 
+#include <list>
 #include <string>
-#include <list>
-
 #include "core/OrxonoxClass.h"
 #include "InputInterfaces.h"
@@ -80,5 +79,5 @@
             InputBuffer();
             ~InputBuffer();
-            InputBuffer(const std::string allowedChars);
+            InputBuffer(const std::string& allowedChars);
 
             void setConfigValues();
@@ -145,5 +144,5 @@
             void updated(const char& update, bool bSingleInput);
 
-            inline std::string get() const
+            inline const std::string& get() const
                 { return this->buffer_; }
             inline unsigned int getSize() const
Index: code/trunk/src/core/input/InputCommands.cc
===================================================================
--- code/trunk/src/core/input/InputCommands.cc	(revision 3103)
+++ code/trunk/src/core/input/InputCommands.cc	(revision 3196)
@@ -35,5 +35,4 @@
 #include "InputCommands.h"
 #include "util/Math.h"
-#include "core/CommandExecutor.h"
 
 namespace orxonox
Index: code/trunk/src/core/input/InputInterfaces.h
===================================================================
--- code/trunk/src/core/input/InputInterfaces.h	(revision 3103)
+++ code/trunk/src/core/input/InputInterfaces.h	(revision 3196)
@@ -38,7 +38,7 @@
 #include "core/CorePrereqs.h"
 
-#include "ois/OISKeyboard.h"
-#include "ois/OISMouse.h"
-#include "ois/OISJoyStick.h"
+#include <ois/OISKeyboard.h>
+#include <ois/OISMouse.h>
+#include <ois/OISJoyStick.h>
 #include "util/Math.h"
 
Index: code/trunk/src/core/input/InputManager.cc
===================================================================
--- code/trunk/src/core/input/InputManager.cc	(revision 3103)
+++ code/trunk/src/core/input/InputManager.cc	(revision 3196)
@@ -38,30 +38,27 @@
 #include <climits>
 #include <cassert>
-
-#include "ois/OISException.h"
-#include "ois/OISInputManager.h"
-#include "core/ConsoleCommand.h"
-
-// HACK
-#ifdef ORXONOX_PLATFORM_LINUX
-#  include "ois/linux/LinuxMouse.h"
-#endif
-
+#include <ois/OISException.h>
+#include <ois/OISInputManager.h>
+
+#include "util/Convert.h"
 #include "util/Exception.h"
+#include "util/Debug.h"
 #include "core/Clock.h"
 #include "core/CoreIncludes.h"
 #include "core/ConfigValueIncludes.h"
-#include "core/CommandExecutor.h"
+#include "core/ConsoleCommand.h"
 #include "core/CommandLine.h"
-#include "util/Debug.h"
 
 #include "InputBuffer.h"
-#include "KeyBinder.h"
 #include "KeyDetector.h"
-#include "CalibratorCallback.h"
 #include "InputState.h"
 #include "SimpleInputState.h"
 #include "ExtendedInputState.h"
 #include "JoyStickDeviceNumberListener.h"
+
+// HACK (include this as last, X11 seems to define some macros...)
+#ifdef ORXONOX_PLATFORM_LINUX
+#  include <ois/linux/LinuxMouse.h>
+#endif
 
 namespace orxonox
@@ -367,6 +364,6 @@
         for (unsigned int i = 0; i < configValueVectorSize; ++i)
         {
-            list[i] = omni_cast<int>(ConfigFileManager::getInstance().getValue(
-                ConfigFileType::JoyStickCalibration, sectionName, valueName, i, omni_cast<std::string>(defaultValue), false));
+            list[i] = multi_cast<int>(ConfigFileManager::getInstance().getValue(
+                ConfigFileType::JoyStickCalibration, sectionName, valueName, i, multi_cast<std::string>(defaultValue), false));
         }
 
@@ -403,9 +400,9 @@
             // Generate some sort of execution unique id per joy stick
             std::string id = "JoyStick_";
-            id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
-            id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
-            id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
-            id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
-            id += omni_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
+            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Button))  + "_";
+            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Axis))    + "_";
+            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Slider))  + "_";
+            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_POV))     + "_";
+            id += multi_cast<std::string>(joySticks_[iJoyStick]->getNumberOfComponents(OIS::OIS_Vector3)) + "_";
             id += joySticks_[iJoyStick]->vendor();
             for (unsigned int i = 0; i < iJoyStick; ++i)
@@ -414,5 +411,5 @@
                 {
                     // Two joysticks are probably equal --> add the index as well
-                    id += "_" + omni_cast<std::string>(iJoyStick);
+                    id += "_" + multi_cast<std::string>(iJoyStick);
                 }
             }
@@ -497,5 +494,5 @@
                     joyStickMinValues_[iJoyStick][i] = -32768;
                 ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                    this->joyStickIDs_[iJoyStick], "MinValue", i, omni_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
+                    this->joyStickIDs_[iJoyStick], "MinValue", i, multi_cast<std::string>(joyStickMinValues_[iJoyStick][i]), false);
 
                 // Maximum values
@@ -503,9 +500,9 @@
                     joyStickMaxValues_[iJoyStick][i] = 32767;
                 ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                    this->joyStickIDs_[iJoyStick], "MaxValue", i, omni_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
+                    this->joyStickIDs_[iJoyStick], "MaxValue", i, multi_cast<std::string>(joyStickMaxValues_[iJoyStick][i]), false);
 
                 // Middle values
                 ConfigFileManager::getInstance().setValue(ConfigFileType::JoyStickCalibration,
-                    this->joyStickIDs_[iJoyStick], "MiddleValue", i, omni_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
+                    this->joyStickIDs_[iJoyStick], "MiddleValue", i, multi_cast<std::string>(joyStickMiddleValues_[iJoyStick][i]), false);
             }
         }
@@ -1169,5 +1166,5 @@
         else
         {
-            float fValue = value - joyStickCalibrations_[iJoyStick].middleValue[axis];
+            float fValue = static_cast<float>(value - joyStickCalibrations_[iJoyStick].middleValue[axis]);
             if (fValue > 0.0f)
                 fValue *= joyStickCalibrations_[iJoyStick].positiveCoeff[axis];
Index: code/trunk/src/core/input/InputManager.h
===================================================================
--- code/trunk/src/core/input/InputManager.h	(revision 3103)
+++ code/trunk/src/core/input/InputManager.h	(revision 3196)
@@ -40,6 +40,11 @@
 
 #include <map>
+#include <set>
+#include <string>
 #include <vector>
-#include <stack>
+#include <ois/OISKeyboard.h>
+#include <ois/OISMouse.h>
+#include <ois/OISJoyStick.h>
+
 #include "util/Math.h"
 #include "util/OrxEnum.h"
Index: code/trunk/src/core/input/InputState.h
===================================================================
--- code/trunk/src/core/input/InputState.h	(revision 3103)
+++ code/trunk/src/core/input/InputState.h	(revision 3196)
@@ -39,5 +39,4 @@
 #include <string>
 #include <vector>
-#include "core/Executor.h"
 #include "InputInterfaces.h"
 
@@ -63,6 +62,6 @@
         void resetHandlersChanged() { bHandlersChanged_ = false; }
 
-        virtual void onEnter() { if (executorOnEnter_) (*executorOnEnter_)(); }
-        virtual void onLeave() { if (executorOnLeave_) (*executorOnLeave_)(); }
+        virtual void onEnter() = 0;
+        virtual void onLeave() = 0;
 
         virtual void registerOnEnter(Executor* executor)      { executorOnEnter_ = executor; }
@@ -92,9 +91,9 @@
         InputState()
             : bHandlersChanged_(false)
+            , executorOnEnter_(0)
+            , executorOnLeave_(0)
             , priority_(0)
             , bAlwaysGetsInput_(false)
             , bTransparent_(false)
-            , executorOnEnter_(0)
-            , executorOnLeave_(0)
         { }
         virtual ~InputState() { }
@@ -108,4 +107,6 @@
 
         bool bHandlersChanged_;
+        Executor*                                   executorOnEnter_;
+        Executor*                                   executorOnLeave_;
 
     private:
@@ -123,7 +124,4 @@
         bool                                        bAlwaysGetsInput_;
         bool                                        bTransparent_;
-
-        Executor*                                   executorOnEnter_;
-        Executor*                                   executorOnLeave_;
     };
 }
Index: code/trunk/src/core/input/KeyBinder.cc
===================================================================
--- code/trunk/src/core/input/KeyBinder.cc	(revision 3103)
+++ code/trunk/src/core/input/KeyBinder.cc	(revision 3196)
@@ -33,7 +33,4 @@
 
 #include "KeyBinder.h"
-
-#include <fstream>
-#include <string>
 
 #include "util/Convert.h"
@@ -320,5 +317,5 @@
                     {
                         mouseAxes_[2*i + 0].absVal_
-                            = -mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+                            = -mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
                         mouseAxes_[2*i + 1].absVal_ = 0.0f;
                     }
@@ -327,5 +324,5 @@
                         mouseAxes_[2*i + 0].absVal_ = 0.0f;
                         mouseAxes_[2*i + 1].absVal_
-                            =  mouseRelative_[i] / deriveTime_ * 0.0005 * mouseSensitivityDerived_;
+                            =  mouseRelative_[i] / deriveTime_ * 0.0005f * mouseSensitivityDerived_;
                     }
                     else
Index: code/trunk/src/core/input/KeyBinder.h
===================================================================
--- code/trunk/src/core/input/KeyBinder.h	(revision 3103)
+++ code/trunk/src/core/input/KeyBinder.h	(revision 3196)
@@ -38,6 +38,7 @@
 #include "core/CorePrereqs.h"
 
+#include <cassert>
+#include <string>
 #include <vector>
-#include <cassert>
 
 #include "InputInterfaces.h"
Index: code/trunk/src/core/input/KeyDetector.cc
===================================================================
--- code/trunk/src/core/input/KeyDetector.cc	(revision 3103)
+++ code/trunk/src/core/input/KeyDetector.cc	(revision 3196)
@@ -34,9 +34,7 @@
 
 #include "KeyDetector.h"
+
 #include "util/Debug.h"
 #include "core/CoreIncludes.h"
-#include "core/CommandExecutor.h"
-#include "core/CommandEvaluation.h"
-#include "InputCommands.h"
 #include "Button.h"
 
Index: code/trunk/src/core/input/KeyDetector.h
===================================================================
--- code/trunk/src/core/input/KeyDetector.h	(revision 3103)
+++ code/trunk/src/core/input/KeyDetector.h	(revision 3196)
@@ -38,4 +38,5 @@
 #include "core/CorePrereqs.h"
 
+#include <string>
 #include "KeyBinder.h"
 
Index: code/trunk/src/core/input/SimpleInputState.cc
===================================================================
--- code/trunk/src/core/input/SimpleInputState.cc	(revision 3103)
+++ code/trunk/src/core/input/SimpleInputState.cc	(revision 3196)
@@ -34,4 +34,5 @@
 
 #include "SimpleInputState.h"
+#include "core/Executor.h"
 
 namespace orxonox
@@ -148,3 +149,15 @@
         bHandlersChanged_ = true;
     }
+
+    void SimpleInputState::onEnter()
+    {
+        if (executorOnEnter_)
+            (*executorOnEnter_)();
+    }
+
+    void SimpleInputState::onLeave()
+    {
+        if (executorOnLeave_)
+            (*executorOnLeave_)();
+    }
 }
Index: code/trunk/src/core/input/SimpleInputState.h
===================================================================
--- code/trunk/src/core/input/SimpleInputState.h	(revision 3103)
+++ code/trunk/src/core/input/SimpleInputState.h	(revision 3196)
@@ -79,4 +79,7 @@
         void update();
         void numberOfJoySticksChanged(unsigned int n);
+
+        void onEnter();
+        void onLeave();
 
         KeyHandler*                   keyHandler_;
