Index: code/branches/core7/src/libraries/core/Core.cc
===================================================================
--- code/branches/core7/src/libraries/core/Core.cc	(revision 10382)
+++ code/branches/core7/src/libraries/core/Core.cc	(revision 10392)
@@ -70,4 +70,5 @@
 #include "class/Identifier.h"
 #include "Language.h"
+#include "Loader.h"
 #include "LuaState.h"
 #include "command/ConsoleCommandManager.h"
@@ -102,4 +103,5 @@
         , configFileManager_(NULL)
         , languageInstance_(NULL)
+        , loaderInstance_(NULL)
         , ioConsole_(NULL)
         , tclBind_(NULL)
@@ -208,4 +210,7 @@
         IdentifierManager::getInstance().createClassHierarchy();
 
+        // Loader
+        this->loaderInstance_ = new Loader();
+
         // Load OGRE excluding the renderer and the render window
         orxout(internal_info) << "creating GraphicsManager:" << endl;
@@ -253,4 +258,5 @@
         safeObjectDelete(&tclBind_);
         safeObjectDelete(&ioConsole_);
+        safeObjectDelete(&loaderInstance_);
         safeObjectDelete(&languageInstance_);
         safeObjectDelete(&configFileManager_);
Index: code/branches/core7/src/libraries/core/Core.h
===================================================================
--- code/branches/core7/src/libraries/core/Core.h	(revision 10382)
+++ code/branches/core7/src/libraries/core/Core.h	(revision 10392)
@@ -125,4 +125,5 @@
             ConfigFileManager*        configFileManager_;
             Language*                 languageInstance_;
+            Loader*                   loaderInstance_;
             IOConsole*                ioConsole_;
             TclBind*                  tclBind_;
Index: code/branches/core7/src/libraries/core/CorePrereqs.h
===================================================================
--- code/branches/core7/src/libraries/core/CorePrereqs.h	(revision 10382)
+++ code/branches/core7/src/libraries/core/CorePrereqs.h	(revision 10392)
@@ -165,4 +165,5 @@
     class Language;
     class Listable;
+    class Loader;
     class LuaFunctor;
     class LuaState;
Index: code/branches/core7/src/libraries/core/GraphicsManager.cc
===================================================================
--- code/branches/core7/src/libraries/core/GraphicsManager.cc	(revision 10382)
+++ code/branches/core7/src/libraries/core/GraphicsManager.cc	(revision 10392)
@@ -117,5 +117,5 @@
         resources_.reset(new XMLFile("DefaultResources.oxr"));
         resources_->setLuaSupport(false);
-        Loader::open(resources_.get(), ClassTreeMask(), false);
+        Loader::getInstance().open(resources_.get(), ClassTreeMask(), false);
 
         // Only for runs in the build directory (not installed)
@@ -125,5 +125,5 @@
         extResources_.reset(new XMLFile("resources.oxr"));
         extResources_->setLuaSupport(false);
-        Loader::open(extResources_.get(), ClassTreeMask(), false);
+        Loader::getInstance().open(extResources_.get(), ClassTreeMask(), false);
 
         if (bLoadRenderer)
@@ -140,5 +140,5 @@
         orxout(internal_status) << "destroying GraphicsManager..." << endl;
 
-        Loader::unload(debugOverlay_.get());
+        Loader::getInstance().unload(debugOverlay_.get());
 
         Ogre::WindowEventUtilities::removeWindowEventListener(renderWindow_, ogreWindowEventListener_);
@@ -149,6 +149,6 @@
 
         // Undeclare the resources
-        Loader::unload(resources_.get());
-        Loader::unload(extResources_.get());
+        Loader::getInstance().unload(resources_.get());
+        Loader::getInstance().unload(extResources_.get());
 
         safeObjectDelete(&ogreRoot_);
@@ -330,5 +330,5 @@
         orxout(internal_info) << "Loading Debug Overlay..." << endl;
         debugOverlay_.reset(new XMLFile("debug.oxo"));
-        Loader::open(debugOverlay_.get(), ClassTreeMask(), false);
+        Loader::getInstance().open(debugOverlay_.get(), ClassTreeMask(), false);
     }
 
Index: code/branches/core7/src/libraries/core/Loader.cc
===================================================================
--- code/branches/core7/src/libraries/core/Loader.cc	(revision 10382)
+++ code/branches/core7/src/libraries/core/Loader.cc	(revision 10392)
@@ -48,23 +48,22 @@
 namespace orxonox
 {
-    std::vector<std::pair<const XMLFile*, ClassTreeMask> > Loader::files_s;
-    ClassTreeMask Loader::currentMask_s;
+    Loader* Loader::singletonPtr_s = 0;
 
     bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
     {
-        Loader::add(file, mask);
-        return Loader::load(file, mask, bVerbose);
+        this->add(file, mask);
+        return this->load(file, mask, bVerbose);
     }
 
     void Loader::close()
     {
-        Loader::unload();
-        Loader::files_s.clear();
+        this->unload();
+        this->files_.clear();
     }
 
     void Loader::close(const XMLFile* file)
     {
-        Loader::unload(file);
-        Loader::remove(file);
+        this->unload(file);
+        this->remove(file);
     }
 
@@ -73,5 +72,5 @@
         if (!file)
             return;
-        Loader::files_s.insert(Loader::files_s.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));
+        this->files_.insert(this->files_.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));
     }
 
@@ -80,9 +79,9 @@
         if (!file)
             return;
-        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
+        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
         {
             if (it->first == file)
             {
-                Loader::files_s.erase(it);
+                this->files_.erase(it);
                 break;
             }
@@ -103,6 +102,6 @@
     {
         bool success = true;
-        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
-            if (!Loader::load(it->first, it->second * mask, bVerbose))
+        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = this->files_.begin(); it != this->files_.end(); ++it)
+            if (!this->load(it->first, it->second * mask, bVerbose))
                 success = false;
 
@@ -133,6 +132,6 @@
     bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
     {
-        Loader::unload(mask);
-        return Loader::load(mask, bVerbose);
+        this->unload(mask);
+        return this->load(mask, bVerbose);
     }
 
@@ -156,5 +155,5 @@
             return false;
 
-        Loader::currentMask_s = file->getMask() * mask;
+        this->currentMask_ = file->getMask() * mask;
 
         std::string xmlInput;
@@ -189,5 +188,5 @@
                 // start of the program.
                 // Assumption: the LevelInfo tag does not use Lua scripting
-                xmlInput = removeLuaTags(xmlInput);
+                xmlInput = Loader::removeLuaTags(xmlInput);
             }
         }
@@ -198,10 +197,10 @@
             {
                 orxout(user_info) << "Start loading " << file->getFilename() << "..." << endl;
-                orxout(internal_info, context::loader) << "Mask: " << Loader::currentMask_s << endl;
+                orxout(internal_info, context::loader) << "Mask: " << this->currentMask_ << endl;
             }
             else
             {
                 orxout(verbose, context::loader) << "Start loading " << file->getFilename() << "..." << endl;
-                orxout(verbose_more, context::loader) << "Mask: " << Loader::currentMask_s << endl;
+                orxout(verbose_more, context::loader) << "Mask: " << this->currentMask_ << endl;
             }
 
@@ -319,6 +318,6 @@
     bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
     {
-        Loader::unload(file, mask);
-        return Loader::load(file, mask, bVerbose);
+        this->unload(file, mask);
+        return this->load(file, mask, bVerbose);
     }
 
Index: code/branches/core7/src/libraries/core/Loader.h
===================================================================
--- code/branches/core7/src/libraries/core/Loader.h	(revision 10382)
+++ code/branches/core7/src/libraries/core/Loader.h	(revision 10392)
@@ -44,36 +44,42 @@
 #include <map>
 #include <vector>
+
+#include "util/Singleton.h"
 #include "ClassTreeMask.h"
 
 namespace orxonox
 {
-    class _CoreExport Loader
+    class _CoreExport Loader : public Singleton<Loader>
     {
+        friend class Singleton<Loader>;
+
         public:
-            static bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
-            static void close();
-            static void close(const XMLFile* file);
+            bool open(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
+            void close();
+            void close(const XMLFile* file);
 
-            static void add(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
-            static void remove(const XMLFile* file);
+            void add(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
+            void remove(const XMLFile* file);
 
-            static bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
-            static void unload(const ClassTreeMask& mask = ClassTreeMask());
-            static bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
+            bool load(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
+            void unload(const ClassTreeMask& mask = ClassTreeMask());
+            bool reload(const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
 
-            static bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
-                             bool bVerbose = true, bool bRemoveLuaTags = false);
-            static void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
-            static bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
+            bool load(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(),
+                      bool bVerbose = true, bool bRemoveLuaTags = false);
+            void unload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask());
+            bool reload(const XMLFile* file, const ClassTreeMask& mask = ClassTreeMask(), bool bVerbose = true);
 
             static std::string replaceLuaTags(const std::string& text);
             static std::string removeLuaTags(const std::string& text);
 
-            static ClassTreeMask currentMask_s;
+            ClassTreeMask currentMask_;
 
         private:
             static bool getLuaTags(const std::string& text, std::map<size_t, bool>& luaTags);
 
-            static std::vector<std::pair<const XMLFile*, ClassTreeMask> > files_s;
+            std::vector<std::pair<const XMLFile*, ClassTreeMask> > files_;
+
+            static Loader* singletonPtr_s;
     };
 }
Index: code/branches/core7/src/libraries/core/XMLPort.cc
===================================================================
--- code/branches/core7/src/libraries/core/XMLPort.cc	(revision 10382)
+++ code/branches/core7/src/libraries/core/XMLPort.cc	(revision 10392)
@@ -40,5 +40,5 @@
     bool XMLPortObjectContainer::identifierIsIncludedInLoaderMask(const Identifier* identifier)
     {
-        return ((!this->bApplyLoaderMask_) || identifier->isA(ClassIdentifier<Namespace>::getIdentifier()) || Loader::currentMask_s.isIncluded(identifier));
+        return ((!this->bApplyLoaderMask_) || identifier->isA(ClassIdentifier<Namespace>::getIdentifier()) || Loader::getInstance().currentMask_.isIncluded(identifier));
     }
 
