Index: code/branches/buildsystem3/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/src/orxonox/CMakeLists.txt	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/CMakeLists.txt	(revision 2685)
@@ -25,5 +25,4 @@
   PawnManager.cc
   PlayerManager.cc
-  Settings.cc
 )
 ADD_SUBDIRECTORY(gamestates)
@@ -43,5 +42,9 @@
 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
   # Get around displaying a few hundred lines of warning code
-  SET_SOURCE_FILES_PROPERTIES(gamestates/GSGraphics.cc PROPERTIES COMPILE_FLAGS "-w")
+  SET_SOURCE_FILES_PROPERTIES(
+    gamestates/GSGraphics.cc
+    gui/GUIManager.cc
+    PROPERTIES COMPILE_FLAGS "-Wno-sign-compare"
+  )
 ENDIF()
 
Index: code/branches/buildsystem3/src/orxonox/Main.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/Main.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/Main.cc	(revision 2685)
@@ -30,5 +30,5 @@
  /**
  @file
- @brief Entry point of the program. Platform specific code.
+ @brief Entry point of the program.
   */
 
@@ -37,4 +37,5 @@
 #include <exception>
 #include <cassert>
+#include <fstream>
 
 #include "OrxonoxConfig.h"
@@ -85,9 +86,6 @@
 
 
-//#ifdef __cplusplus
-//extern "C" {
-//#endif
-
 SetCommandLineArgument(settingsFile, "orxonox.ini");
+SetCommandLineArgument(configFileDirectory, "");
 
 int main(int argc, char** argv)
@@ -95,7 +93,17 @@
     using namespace orxonox;
 
-    // create a signal handler (only works for linux)
+    // First, determine whether we have an installed or a binary dir run
+    // The latter occurs when simply running from the build directory
+    std::ifstream probe;
+    probe.open("orxonox_dev_build.keep_me");
+    if (probe)
+    {
+        Core::setDevBuild();
+        probe.close();
+    }
+
+    // create a signal handler (only active for linux)
     SignalHandler signalHandler;
-    signalHandler.doCatch(argv[0], "orxonox.log");
+    signalHandler.doCatch(argv[0], Core::getLogPath() + "orxonox_crash.log");
 
     // Parse command line arguments
@@ -157,6 +165,2 @@
     return 0;
 }
-
-//#ifdef __cplusplus
-//}
-//#endif
Index: code/branches/buildsystem3/src/orxonox/Settings.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/Settings.cc	(revision 2673)
+++ 	(revision )
@@ -1,99 +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 Settings class.
-*/
-
-#include "OrxonoxStableHeaders.h"
-#include "Settings.h"
-
-#include "util/String.h"
-#include "core/CoreIncludes.h"
-#include "core/ConfigValueIncludes.h"
-#include "core/LuaBind.h"
-
-namespace orxonox
-{
-    Settings* Settings::singletonRef_s = 0;
-
-    /**
-    @brief
-        Constructor: Registers the object and sets the config-values.
-    */
-    Settings::Settings()
-    {
-        RegisterRootObject(Settings);
-        assert(singletonRef_s == 0);
-        singletonRef_s = this;
-        setConfigValues();
-    }
-
-    /**
-    @brief
-        Function to collect the SetConfigValue-macro calls.
-    */
-    void Settings::setConfigValues()
-    {
-        SetConfigValue(dataPath_, ORXONOX_MEDIA_PATH).description("Relative path to the game data.").callback(this, &Settings::dataPathChanged);
-    }
-
-    /**
-    @brief
-        Callback function if the datapath has changed.
-    */
-    void Settings::dataPathChanged()
-    {
-        if (dataPath_ != "" && dataPath_[dataPath_.size() - 1] != '/')
-        {
-            ModifyConfigValue(dataPath_, set, dataPath_ + "/");
-        }
-
-        if (dataPath_ == "")
-        {
-            ModifyConfigValue(dataPath_, set, "/");
-            COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
-        }
-
-        LuaBind::getInstance().setIncludePath(this->dataPath_);
-    }
-
-    /**
-    @brief
-        Temporary sets the data path
-    @param path
-        The new data path
-    */
-    void Settings::_tsetDataPath(const std::string& path)
-    {
-        ModifyConfigValue(dataPath_, tset, path);
-    }
-
-}
Index: code/branches/buildsystem3/src/orxonox/Settings.h
===================================================================
--- code/branches/buildsystem3/src/orxonox/Settings.h	(revision 2673)
+++ 	(revision )
@@ -1,77 +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 Declaration of the Settings class.
-
-    The static Settings class is only used to configure some variables
-    through the config-file.
-*/
-
-#ifndef _Settings_H__
-#define _Settings_H__
-
-#include "OrxonoxPrereqs.h"
-#include <string>
-#include "core/OrxonoxClass.h"
-#include "util/Debug.h"
-#include "util/MultiType.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport Settings : public OrxonoxClass
-    {
-        friend class ClassIdentifier<Settings>;
-        friend class GSRoot;
-
-    public:
-        static const std::string& getDataPath()
-        { assert(singletonRef_s); return singletonRef_s->dataPath_; }
-        static void tsetDataPath(const std::string& path)
-        { assert(singletonRef_s); singletonRef_s->_tsetDataPath(path); }
-
-    private:
-        Settings();
-        Settings(const Settings& instance);
-        ~Settings() { singletonRef_s = 0; }
-
-        static Settings& _getInstance() { assert(singletonRef_s); return *singletonRef_s; }
-        void _tsetDataPath(const std::string& path);
-        void dataPathChanged();
-
-        void setConfigValues();
-
-        std::string dataPath_;                                 //!< Path to the game data
-
-        static Settings* singletonRef_s;                       //!< Static pointer to the only instance.
-    };
-
-}
-
-#endif /* _Settings_H__ */
Index: code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc	(revision 2685)
@@ -61,5 +61,4 @@
 #include "gui/GUIManager.h"
 #include "tools/WindowEventListener.h"
-#include "Settings.h"
 
 // for compatibility
@@ -138,5 +137,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");
         Loader::open(debugOverlay_);
 
@@ -211,10 +210,8 @@
         delete this->ogreRoot_;
 
-//#ifdef ORXONOX_PLATFORM_WINDOWS
         // 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_;
@@ -287,7 +284,20 @@
         COUT(3) << "Setting up Ogre..." << std::endl;
 
-        // TODO: LogManager doesn't work on oli platform. The why is yet unknown.
-//#ifdef ORXONOX_PLATFORM_WINDOWS
+        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() + ogreConfigFile_);
+        boost::filesystem::path ogreLogFilepath(Core::getLogPath() + 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;
@@ -295,36 +305,20 @@
         // 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.native_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 (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());
+        probe.open(ogreConfigFilepath.native_file_string().c_str());
         if (!probe)
         {
             // create a zero sized file
             std::ofstream creator;
-            creator.open(ogreConfigFile_.c_str());
+            creator.open(ogreConfigFilepath.native_file_string().c_str());
             creator.close();
         }
@@ -333,15 +327,5 @@
 
         // Leave plugins file empty. We're going to do that part manually later
-        ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_);
-
-#if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
-#ifndef ORXONOX_PLATFORM_WINDOWS
-        // 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
+        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.native_file_string(), ogreLogFilepath.native_file_string());
 
         COUT(3) << "Ogre set up done." << std::endl;
@@ -377,5 +361,5 @@
         try
         {
-            cf.load(Settings::getDataPath() + resourceFile_);
+            cf.load(Core::getMediaPath() + resourceFile_);
         }
         catch (...)
@@ -403,5 +387,5 @@
 
                     Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
-                        std::string(Settings::getDataPath() + archName), typeName, secName);
+                        std::string(Core::getMediaPath() + archName), typeName, secName);
                 }
             }
Index: code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc	(revision 2685)
@@ -46,5 +46,4 @@
 #include "LevelManager.h"
 #include "PlayerManager.h"
-#include "Settings.h"
 
 namespace orxonox
@@ -205,5 +204,5 @@
         std::string levelName;
         CommandLine::getValue("level", &levelName);
-        startFile_ = new XMLFile(Settings::getDataPath() + std::string("levels/") + levelName);
+        startFile_ = new XMLFile(Core::getMediaPath() + std::string("levels/") + levelName);
         Loader::open(startFile_);
     }
Index: code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc	(revision 2685)
@@ -44,24 +44,11 @@
 #include "tools/Timer.h"
 #include "objects/Tickable.h"
-#include "Settings.h"
 
 #ifdef ORXONOX_PLATFORM_WINDOWS
-#  ifndef WIN32_LEAN_AND_MEAN
-#    define WIN32_LEAN_AND_MEAN
-#  endif
-#  include "windows.h"
-
-   //Get around Windows hackery
-#  ifdef max
-#    undef max
-#  endif
-#  ifdef min
-#    undef min
-#  endif
+#  include <winbase.h>
 #endif
 
 namespace orxonox
 {
-    SetCommandLineArgument(dataPath, "").information("PATH");
     SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu");
 
@@ -71,5 +58,4 @@
         , bPaused_(false)
         , timeFactorPauseBackup_(1.0f)
-        , settings_(0)
         , tclBind_(0)
         , tclThreadManager_(0)
@@ -113,18 +99,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::getMediaPath());
         this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
 
@@ -182,5 +156,4 @@
         delete this->tclBind_;
 
-        delete this->settings_;
         delete this->luaBind_;
 
Index: code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.h
===================================================================
--- code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.h	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.h	(revision 2685)
@@ -81,5 +81,4 @@
         bool                  bPaused_;
         float                 timeFactorPauseBackup_;
-        Settings*             settings_;
         TclBind*              tclBind_;
         TclThreadManager*     tclThreadManager_;
Index: code/branches/buildsystem3/src/orxonox/gui/GUIManager.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/gui/GUIManager.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gui/GUIManager.cc	(revision 2685)
@@ -36,7 +36,9 @@
 #include "GUIManager.h"
 
+#include <boost/filesystem.hpp>
 #include <OgreRenderWindow.h>
 #include <OgreRoot.h>
 #include <CEGUI.h>
+#include <CEGUIDefaultLogger.h>
 #include <ogreceguirenderer/OgreCEGUIRenderer.h>
 #ifdef CEGUILUA_USE_INTERNAL_LIBRARY
@@ -148,10 +150,14 @@
                 this->luaState_ = this->scriptModule_->getLuaState();
 
+                // Create our own logger to specify the filepath
+                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() + "cegui.log");
+                this->ceguiLogger_ = new DefaultLogger();
+                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.native_file_string());
+                // set the log level according to ours (translate by subtracting 1)
+                this->ceguiLogger_->setLoggingLevel(
+                    (LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
+
                 // create the CEGUI system singleton
                 this->guiSystem_ = new System(this->guiRenderer_, this->resourceProvider_, 0, this->scriptModule_);
-
-                // set the log level according to ours (translate by subtracting 1)
-                Logger::getSingleton().setLoggingLevel(
-                    (LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
 
                 // do this after 'new CEGUI::Sytem' because that creates the lua state in the first place
Index: code/branches/buildsystem3/src/orxonox/gui/GUIManager.h
===================================================================
--- code/branches/buildsystem3/src/orxonox/gui/GUIManager.h	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/gui/GUIManager.h	(revision 2685)
@@ -41,4 +41,7 @@
 #include <CEGUISystem.h>
 #include "core/input/InputInterfaces.h"
+
+// Forward declaration
+namespace CEGUI { class DefaultLogger; }
 
 // tolua_begin
@@ -119,4 +122,5 @@
         CEGUI::ResourceProvider*  resourceProvider_;
         CEGUI::LuaScriptModule*   scriptModule_;
+        CEGUI::DefaultLogger*     ceguiLogger_;
         CEGUI::System*            guiSystem_;
         CEGUI::Imageset*          backgroundImage_;
Index: code/branches/buildsystem3/src/orxonox/objects/Level.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/objects/Level.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/objects/Level.cc	(revision 2685)
@@ -35,6 +35,6 @@
 #include "core/XMLFile.h"
 #include "core/Template.h"
+#include "core/Core.h"
 
-#include "Settings.h"
 #include "LevelManager.h"
 #include "objects/infos/PlayerInfo.h"
@@ -55,6 +55,6 @@
         this->xmlfilename_ = this->getFilename();
 
-        if (this->xmlfilename_.length() >= Settings::getDataPath().length())
-            this->xmlfilename_ = this->xmlfilename_.substr(Settings::getDataPath().length());
+        if (this->xmlfilename_.length() >= Core::getMediaPath().length())
+            this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPath().length());
     }
 
@@ -97,5 +97,5 @@
         mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
 
-        this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
+        this->xmlfile_ = new XMLFile(Core::getMediaPath() + this->xmlfilename_, mask);
 
         Loader::open(this->xmlfile_);
Index: code/branches/buildsystem3/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- code/branches/buildsystem3/src/orxonox/objects/gametypes/Gametype.cc	(revision 2673)
+++ code/branches/buildsystem3/src/orxonox/objects/gametypes/Gametype.cc	(revision 2685)
@@ -43,5 +43,4 @@
 #include "objects/worldentities/SpawnPoint.h"
 #include "objects/worldentities/Camera.h"
-#include "Settings.h"
 
 #include "network/Host.h"
