Index: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc	(revision 10278)
+++ code/trunk/src/libraries/core/Loader.cc	(revision 10624)
@@ -48,92 +48,5 @@
 namespace orxonox
 {
-    std::vector<std::pair<const XMLFile*, ClassTreeMask> > Loader::files_s;
-    ClassTreeMask Loader::currentMask_s;
-
-    bool Loader::open(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
-    {
-        Loader::add(file, mask);
-        return Loader::load(file, mask, bVerbose);
-    }
-
-    void Loader::close()
-    {
-        Loader::unload();
-        Loader::files_s.clear();
-    }
-
-    void Loader::close(const XMLFile* file)
-    {
-        Loader::unload(file);
-        Loader::remove(file);
-    }
-
-    void Loader::add(const XMLFile* file, const ClassTreeMask& mask)
-    {
-        if (!file)
-            return;
-        Loader::files_s.insert(Loader::files_s.end(), std::pair<const XMLFile*, ClassTreeMask>(file, mask));
-    }
-
-    void Loader::remove(const XMLFile* file)
-    {
-        if (!file)
-            return;
-        for (std::vector<std::pair<const XMLFile*, ClassTreeMask> >::iterator it = Loader::files_s.begin(); it != Loader::files_s.end(); ++it)
-        {
-            if (it->first == file)
-            {
-                Loader::files_s.erase(it);
-                break;
-            }
-        }
-    }
-
-    /**
-    @brief
-        Loads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
-    @param mask
-        A ClassTreeMask, which defines which types of classes are loaded and which aren't.
-    @param bVerbose
-        Whether the loader is verbose (prints its progress in a low output level) or not.
-    @return
-        Returns true if successful.
-    */
-    bool Loader::load(const ClassTreeMask& mask, bool bVerbose)
-    {
-        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))
-                success = false;
-
-        return success;
-    }
-
-    void Loader::unload(const ClassTreeMask& mask)
-    {
-        for (ObjectList<BaseObject>::iterator it = ObjectList<BaseObject>::begin(); it != ObjectList<BaseObject>::end(); )
-        {
-            if (mask.isIncluded(it->getIdentifier()))
-                (it++)->destroy();
-            else
-                ++it;
-        }
-    }
-
-    /**
-    @brief
-        Reloads all opened files, while conforming to the restrictions given by the input ClassTreeMask.
-    @param mask
-        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
-    @param bVerbose
-        Whether the loader is verbose (prints its progress in a low output level) or not.
-    @return
-        Returns true if successful.
-    */
-    bool Loader::reload(const ClassTreeMask& mask, bool bVerbose)
-    {
-        Loader::unload(mask);
-        return Loader::load(mask, bVerbose);
-    }
+    Loader* Loader::singletonPtr_s = 0;
 
     /**
@@ -156,5 +69,5 @@
             return false;
 
-        Loader::currentMask_s = file->getMask() * mask;
+        this->currentMask_ = file->getMask() * mask;
 
         std::string xmlInput;
@@ -189,5 +102,5 @@
                 // start of the program.
                 // Assumption: the LevelInfo tag does not use Lua scripting
-                xmlInput = removeLuaTags(xmlInput);
+                xmlInput = Loader::removeLuaTags(xmlInput);
             }
         }
@@ -198,10 +111,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;
             }
 
@@ -220,5 +133,4 @@
             rootNamespace->setLoaderIndentation("    ");
             rootNamespace->setFile(file);
-            rootNamespace->setNamespace(rootNamespace);
             rootNamespace->setRoot(true);
             rootNamespace->XMLPort(rootElement, XMLPort::LoadObject);
@@ -303,22 +215,4 @@
                 ++it;
         }
-    }
-
-    /**
-    @brief
-        Reloads the input file, while conforming to the restrictions given by the input ClassTreeMask.
-    @param file
-        The file to be reloaded.
-    @param mask
-        A ClassTreeMask, which defines which types of classes are reloaded and which aren't.
-    @param bVerbose
-        Whether the loader is verbose (prints its progress in a low output level) or not.
-    @return
-        Returns true if successful.
-    */
-    bool Loader::reload(const XMLFile* file, const ClassTreeMask& mask, bool bVerbose)
-    {
-        Loader::unload(file, mask);
-        return Loader::load(file, mask, bVerbose);
     }
 
