Index: code/trunk/src/orxonox/gamestates/CMakeLists.txt
===================================================================
--- code/trunk/src/orxonox/gamestates/CMakeLists.txt	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/CMakeLists.txt	(revision 2710)
@@ -1,3 +1,3 @@
-SET( SRC_FILES
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
   GSDedicated.cc
   GSClient.cc
@@ -10,4 +10,2 @@
   GSStandalone.cc
 )
-
-ADD_SOURCE_FILES(SRC_FILES)
Index: code/trunk/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.cc	(revision 2710)
@@ -31,4 +31,6 @@
 
 #include <fstream>
+#include <boost/filesystem.hpp>
+
 #include <OgreCompositorManager.h>
 #include <OgreConfigFile.h>
@@ -43,6 +45,9 @@
 #include <OgreWindowEventUtilities.h>
 
+#include "SpecialConfig.h"
 #include "util/Debug.h"
 #include "util/Exception.h"
+#include "util/String.h"
+#include "util/SubString.h"
 #include "core/ConsoleCommand.h"
 #include "core/ConfigValueIncludes.h"
@@ -57,5 +62,4 @@
 #include "gui/GUIManager.h"
 #include "tools/WindowEventListener.h"
-#include "Settings.h"
 
 // for compatibility
@@ -92,6 +96,8 @@
         SetConfigValue(ogreConfigFile_,  "ogre.cfg")
             .description("Location of the Ogre config file");
-        SetConfigValue(ogrePluginsFile_, "plugins.cfg")
-            .description("Location of the Ogre plugins file");
+        SetConfigValue(ogrePluginsFolder_, ORXONOX_OGRE_PLUGINS_FOLDER)
+            .description("Folder where the Ogre plugins are located.");
+        SetConfigValue(ogrePlugins_, ORXONOX_OGRE_PLUGINS)
+            .description("Comma separated list of all plugins to load.");
         SetConfigValue(ogreLogFile_,     "ogre.log")
             .description("Logfile for messages from Ogre. Use \"\" to suppress log file creation.");
@@ -102,6 +108,4 @@
         SetConfigValue(ogreLogLevelCritical_, 2)
             .description("Corresponding orxonox debug level for ogre Critical");
-        SetConfigValue(defaultMasterKeybindings_, "def_masterKeybindings.ini")
-            .description("Filename of default master keybindings.");
     }
 
@@ -115,6 +119,11 @@
         // Ogre setup procedure
         setupOgre();
+        // load all the required plugins for Ogre
+        loadOgrePlugins();
+        // read resource declaration file
         this->declareResources();
-        this->loadRenderer();    // creates the render window
+        // Reads ogre config and creates the render window
+        this->loadRenderer();
+
         // TODO: Spread this so that this call only initialises things needed for the Console and GUI
         this->initialiseResources();
@@ -127,5 +136,5 @@
         // load debug overlay
         COUT(3) << "Loading Debug Overlay..." << std::endl;
-        this->debugOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/debug.oxo");
+        this->debugOverlay_ = new XMLFile((Core::getMediaPath() / "overlay" / "debug.oxo").file_string());
         Loader::open(debugOverlay_);
 
@@ -138,5 +147,5 @@
         // Configure master input state with a KeyBinder
         masterKeyBinder_ = new KeyBinder();
-        masterKeyBinder_->loadBindings("masterKeybindings.ini", defaultMasterKeybindings_);
+        masterKeyBinder_->loadBindings("masterKeybindings.ini");
         inputManager_->getMasterInputState()->addKeyHandler(masterKeyBinder_);
 
@@ -200,10 +209,8 @@
         delete this->ogreRoot_;
 
-//#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
         // delete the ogre log and the logManager (since we have created it).
         this->ogreLogger_->getDefaultLog()->removeListener(this);
         this->ogreLogger_->destroyLog(Ogre::LogManager::getSingleton().getDefaultLog());
         delete this->ogreLogger_;
-//#endif
 
         delete graphicsEngine_;
@@ -276,7 +283,20 @@
         COUT(3) << "Setting up Ogre..." << std::endl;
 
-        // TODO: LogManager doesn't work on oli platform. The why is yet unknown.
-//#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+        if (ogreConfigFile_ == "")
+        {
+            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
+            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
+        }
+        if (ogreLogFile_ == "")
+        {
+            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
+            ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
+        }
+
+        boost::filesystem::path ogreConfigFilepath(Core::getConfigPath() / this->ogreConfigFile_);
+        boost::filesystem::path ogreLogFilepath(Core::getLogPath() / this->ogreLogFile_);
+
         // create a new logManager
+        // Ogre::Root will detect that we've already created a Log
         ogreLogger_ = new Ogre::LogManager();
         COUT(4) << "Ogre LogManager created" << std::endl;
@@ -284,59 +304,38 @@
         // create our own log that we can listen to
         Ogre::Log *myLog;
-        if (this->ogreLogFile_ == "")
-            myLog = ogreLogger_->createLog("ogre.log", true, false, true);
-        else
-            myLog = ogreLogger_->createLog(this->ogreLogFile_, true, false, false);
+        myLog = ogreLogger_->createLog(ogreLogFilepath.file_string(), true, false, false);
         COUT(4) << "Ogre Log created" << std::endl;
 
         myLog->setLogDetail(Ogre::LL_BOREME);
         myLog->addListener(this);
-//#endif
-
-        // Root will detect that we've already created a Log
+
         COUT(4) << "Creating Ogre Root..." << std::endl;
 
-        if (ogrePluginsFile_ == "")
-        {
-            COUT(2) << "Warning: Ogre plugins file set to \"\". Defaulting to plugins.cfg" << std::endl;
-            ModifyConfigValue(ogrePluginsFile_, tset, "plugins.cfg");
-        }
-        if (ogreConfigFile_ == "")
-        {
-            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
-            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
-        }
-        if (ogreLogFile_ == "")
-        {
-            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
-            ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
-        }
-
         // check for config file existence because Ogre displays (caught) exceptions if not
-        std::ifstream probe;
-        probe.open(ogreConfigFile_.c_str());
-        if (!probe)
+        if (!boost::filesystem::exists(ogreConfigFilepath))
         {
             // create a zero sized file
             std::ofstream creator;
-            creator.open(ogreConfigFile_.c_str());
+            creator.open(ogreConfigFilepath.file_string().c_str());
             creator.close();
         }
-        else
-            probe.close();
-
-        ogreRoot_ = new Ogre::Root(ogrePluginsFile_, ogreConfigFile_, ogreLogFile_);
-
-#if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
-#if ORXONOX_PLATFORM != ORXONOX_PLATFORM_WIN32
-        // tame the ogre ouput so we don't get all the mess in the console
-        Ogre::Log* defaultLog = Ogre::LogManager::getSingleton().getDefaultLog();
-        defaultLog->setDebugOutputEnabled(false);
-        defaultLog->setLogDetail(Ogre::LL_BOREME);
-        defaultLog->addListener(this);
-#endif
-#endif
+
+        // Leave plugins file empty. We're going to do that part manually later
+        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.file_string(), ogreLogFilepath.file_string());
 
         COUT(3) << "Ogre set up done." << std::endl;
+    }
+
+    void GSGraphics::loadOgrePlugins()
+    {
+        // just to make sure the next statement doesn't segfault
+        if (ogrePluginsFolder_ == "")
+            ogrePluginsFolder_ = ".";
+
+        boost::filesystem::path folder(ogrePluginsFolder_);
+        // Do some SubString magic to get the comma separated list of plugins
+        SubString plugins(ogrePlugins_, ",", " ", false, 92, false, 34, false, 40, 41, false, '\0');
+        for (unsigned int i = 0; i < plugins.size(); ++i)
+            ogreRoot_->loadPlugin((folder / plugins[i]).file_string());
     }
 
@@ -357,5 +356,5 @@
         try
         {
-            cf.load(Settings::getDataPath() + resourceFile_);
+            cf.load((Core::getMediaPath() / resourceFile_).file_string());
         }
         catch (...)
@@ -383,5 +382,5 @@
 
                     Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-                        std::string(Settings::getDataPath() + archName), typeName, secName);
+                        (Core::getMediaPath() / archName).directory_string(), typeName, secName);
                 }
             }
Index: code/trunk/src/orxonox/gamestates/GSGraphics.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSGraphics.h	(revision 2710)
@@ -60,4 +60,5 @@
 
         void setupOgre();
+        void loadOgrePlugins();
         void declareResources();
         void loadRenderer();
@@ -98,10 +99,10 @@
         std::string           resourceFile_;             //!< resources file name
         std::string           ogreConfigFile_;           //!< ogre config file name
-        std::string           ogrePluginsFile_;          //!< ogre plugins file name
+        std::string           ogrePluginsFolder_;        //!< Folder where the Ogre plugins are located
+        std::string           ogrePlugins_;              //!< Comma separated list of all plugins to load
         std::string           ogreLogFile_;              //!< log file name for Ogre log messages
         int                   ogreLogLevelTrivial_;      //!< Corresponding Orxonx debug level for LL_TRIVIAL
         int                   ogreLogLevelNormal_;       //!< Corresponding Orxonx debug level for LL_NORMAL
         int                   ogreLogLevelCritical_;     //!< Corresponding Orxonx debug level for LL_CRITICAL
-        std::string           defaultMasterKeybindings_; //!< Filename of default master keybindings.
 
         // console commands
Index: code/trunk/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSLevel.cc	(revision 2710)
@@ -46,5 +46,4 @@
 #include "LevelManager.h"
 #include "PlayerManager.h"
-#include "Settings.h"
 
 namespace orxonox
@@ -76,6 +75,4 @@
     {
         SetConfigValue(keyDetectorCallbackCode_, "KeybindBindingStringKeyName=");
-        SetConfigValue(defaultKeybindings_, "def_keybindings.ini")
-            .description("Filename of default keybindings.");
     }
 
@@ -86,5 +83,5 @@
             inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game", 20);
             keyBinder_ = new KeyBinder();
-            keyBinder_->loadBindings("keybindings.ini", defaultKeybindings_);
+            keyBinder_->loadBindings("keybindings.ini");
             inputState_->setHandler(keyBinder_);
 
@@ -205,5 +202,5 @@
         std::string levelName;
         CommandLine::getValue("level", &levelName);
-        startFile_ = new XMLFile(Settings::getDataPath() + std::string("levels/") + levelName);
+        startFile_ = new XMLFile(Core::getMediaPathString() + "levels" + CP_SLASH + levelName);
         Loader::open(startFile_);
     }
Index: code/trunk/src/orxonox/gamestates/GSLevel.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSLevel.h	(revision 2710)
@@ -66,6 +66,4 @@
         //##### ConfigValues #####
         std::string           keyDetectorCallbackCode_;
-        //! Filename of default keybindings.
-        std::string           defaultKeybindings_;
 
         // console commands
Index: code/trunk/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSRoot.cc	(revision 2710)
@@ -44,7 +44,6 @@
 #include "tools/Timer.h"
 #include "objects/Tickable.h"
-#include "Settings.h"
-
-#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+
+#ifdef ORXONOX_PLATFORM_WINDOWS
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN
@@ -63,5 +62,4 @@
 namespace orxonox
 {
-    SetCommandLineArgument(dataPath, "").information("PATH");
     SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu");
 
@@ -71,5 +69,4 @@
         , bPaused_(false)
         , timeFactorPauseBackup_(1.0f)
-        , settings_(0)
         , tclBind_(0)
         , tclThreadManager_(0)
@@ -113,18 +110,6 @@
         this->luaBind_ = new LuaBind();
 
-        // instantiate Settings class
-        this->settings_ = new Settings();
-
-        std::string dataPath = CommandLine::getValue("dataPath");
-        if (dataPath != "")
-        {
-            if (*dataPath.end() != '/' && *dataPath.end() != '\\')
-                Settings::tsetDataPath(dataPath + "/");
-            else
-                Settings::tsetDataPath(dataPath);
-        }
-
         // initialise TCL
-        this->tclBind_ = new TclBind(Settings::getDataPath());
+        this->tclBind_ = new TclBind(Core::getMediaPathPOSIXString());
         this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
 
@@ -182,5 +167,4 @@
         delete this->tclBind_;
 
-        delete this->settings_;
         delete this->luaBind_;
 
@@ -269,5 +253,5 @@
     void GSRoot::setThreadAffinity(unsigned int limitToCPU)
     {
-#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
+#ifdef ORXONOX_PLATFORM_WINDOWS
         // Get the current process core mask
         DWORD procMask;
Index: code/trunk/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 2662)
+++ code/trunk/src/orxonox/gamestates/GSRoot.h	(revision 2710)
@@ -81,5 +81,4 @@
         bool                  bPaused_;
         float                 timeFactorPauseBackup_;
-        Settings*             settings_;
         TclBind*              tclBind_;
         TclThreadManager*     tclThreadManager_;
