Index: code/branches/buildsystem3/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/CMakeLists.txt	(revision 2684)
+++ code/branches/buildsystem3/CMakeLists.txt	(revision 2685)
@@ -47,4 +47,7 @@
 ADD_SUBDIRECTORY(media)
 
+ADD_SUBDIRECTORY(config)
+ADD_SUBDIRECTORY(log)
+
 # Creates the actual project
 ADD_SUBDIRECTORY(src)
Index: code/branches/buildsystem3/bin/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/bin/CMakeLists.txt	(revision 2684)
+++ code/branches/buildsystem3/bin/CMakeLists.txt	(revision 2685)
@@ -21,92 +21,8 @@
  #    Reto Grieder
  #  Description:
- #    Configures the binary output directory with files required for Orxonox
- #    to run like orxonox.ini or the default keybindings.
- #    Also creates a run-script in the root directory of the build tree.
+ #    Creates a run-script in the root directory of the build tree.
  #
- 
-SET(READ_ONLY_CONFIG_FILES
-  def_keybindings.ini
-  def_masterKeybindings.ini
-  disco.txt
-  irc.tcl
-  remote.tcl
-  telnet_server.tcl
-)
 
-SET(WRITABLE_CONFIG_FILES
-)
-
-# Not getting installed
-SET(ORXONOX_INI orxonox.ini)
-
-IF(TARDIS)
-  # OGRE can't find fonts to display config screen on Tardis,
-  # so providing default config file here (bug).
-  LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
-ENDIF(TARDIS)
-
-# We need the same code for both READ_ONLY and WRITABLE config files
-MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
-  SET(_read_only ${_read_only_arg})
-  FOREACH(_build_config ${_build_configs})
-    # Is there an extra file in bin/Debug or bin/Release?
-    IF(${_build_config} MATCHES "Rel")
-      SET(_build_config_short "Release")
-    ELSE()
-      SET(_build_config_short "Debug")
-    ENDIF()
-    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
-      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
-    ELSE()
-      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
-    ENDIF()
-
-    # Copy to the folder named like the build config for Visual Studio
-    IF(CMAKE_CONFIGURATION_TYPES)
-      SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_build_config}/${_file_name})
-    ELSE()
-      SET(_out_file ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_file_name})
-    ENDIF()
-    # Only copy if target file doesn't exist. This may result in problems but
-    # otherwise we might delete a user's config
-    IF(NOT EXISTS ${_out_file} OR _read_only)
-      CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
-    ENDIF()
-  ENDFOREACH(_build_config)
-ENDMACRO(CONFIGURE_FILES)
-
-# Copy config files to all Visual Studio output directories
-IF(CMAKE_CONFIGURATION_TYPES)
-  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
-ELSE()
-  SET(CONFIG_OUT_PATHS_REL ".")
-  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
-ENDIF()
-
-FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
-  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
-ENDFOREACH(_file_name)
-FOREACH(_file_name ${WRITABLE_CONFIG_FILES} ${ORXONOX_INI})
-  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
-ENDFOREACH(_file_name)
-
-
-################ Installation #################
-
-# Not using collective call to allow configuration with CMake.
-FOREACH(_file ${READ_ONLY_CONFIG_FILES} ${WRITABLE_CONFIG_FILES})
-  IF(CMAKE_CONFIGURATION_TYPES)
-    FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
-      INSTALL(
-        FILES ${CMAKE_BINARY_DIR}/bin/${_configuration}/${_file}
-        DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH}
-        CONFIGURATIONS ${_configuration}
-      )
-    ENDFOREACH(_configuration)
-  ELSE()
-    INSTALL(FILES ${CMAKE_BINARY_DIR}/bin/${_file} DESTINATION ${ORXONOX_RUNTIME_INSTALL_PATH})
-  ENDIF()
-ENDFOREACH(_file)
+############ Configure Dev Build ##############
 
 
@@ -140,3 +56,7 @@
     CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${RUN_SCRIPT}.in ${CMAKE_BINARY_DIR}/${RUN_SCRIPT} @ONLY)
   ENDIF()
+
+  # In order to evaluate at run time whether it is a dev build in the build tree,
+  # we plant a special file
+  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/orxonox_dev_build.keep_me ${CURRENT_RUNTIME_DIR}/orxonox_dev_build.keep_me)
 ENDFOREACH(_subdir)
Index: code/branches/buildsystem3/bin/def_keybindings.ini
===================================================================
--- code/branches/buildsystem3/bin/def_keybindings.ini	(revision 2684)
+++ 	(revision )
@@ -1,167 +1,0 @@
-[Keys]
-KeyA="scale -1 moveRightLeft"
-KeyABNT_C1=
-KeyABNT_C2=
-KeyAT=
-KeyAX=
-KeyApostrophe=
-KeyApps=
-KeyB=
-KeyBack=
-KeyBackslash=
-KeyC=switchCamera
-KeyCalculator=
-KeyCapsLock=
-KeyColon=
-KeyComma=
-KeyConvert=
-KeyD="scale 1 moveRightLeft"
-KeyDelete=
-KeyDivide=
-KeyDown=
-KeyE="scale -1 rotateRoll"
-KeyEnd=
-KeyEquals=
-KeyEscape="exit"
-KeyF="scale -1 moveUpDown"
-KeyF1=
-KeyF10=
-KeyF11=
-KeyF12=
-KeyF13=
-KeyF14=
-KeyF15=
-KeyF2="OverlayGroup toggleVisibility Stats"
-KeyF3=
-KeyF4=
-KeyF5=
-KeyF6=
-KeyF7=
-KeyF8=
-KeyF9=
-KeyG=greet
-KeyGrave=
-KeyH=
-KeyHome=
-KeyI=
-KeyInsert=
-KeyJ=
-KeyK=
-KeyKana=
-KeyKanji=
-KeyL=dropItems
-KeyLeft=
-KeyLeftAlt=
-KeyLeftBracket=
-KeyLeftControl=mouseLook
-KeyLeftShift=
-KeyLeftWindows=
-KeyLessThan=
-KeyM=
-KeyMail=
-KeyMediaSelect=
-KeyMediaStop=
-KeyMinus=
-KeyMultiply=
-KeyMute=
-KeyMyComputer=
-KeyN=
-KeyNextTrack=
-KeyNoConvert=
-KeyNumLock=
-KeyNumRow0=
-KeyNumRow1=
-KeyNumRow2=
-KeyNumRow3=
-KeyNumRow4=
-KeyNumRow5=
-KeyNumRow6=
-KeyNumRow7=
-KeyNumRow8=
-KeyNumRow9=
-KeyNumpad0=
-KeyNumpad1=
-KeyNumpad2=
-KeyNumpad3=
-KeyNumpad4=
-KeyNumpad5=
-KeyNumpad6=
-KeyNumpad7=
-KeyNumpad8=
-KeyNumpad9=
-KeyNumpadAdd=
-KeyNumpadComma=
-KeyNumpadEnter=
-KeyNumpadEquals=
-KeyNumpadPeriod=
-KeyNumpadSubtract=
-KeyO=
-KeyP=
-KeyPageDown=
-KeyPageUp=
-KeyPause=pause
-KeyPeriod=
-KeyPlayPause=
-KeyPower=
-KeyPreviousTrack=
-KeyQ="scale 1 rotateRoll"
-KeyR="scale 1 moveUpDown"
-KeyReturn=
-KeyRight=
-KeyRightAlt=
-KeyRightBracket=
-KeyRightControl=
-KeyRightShift=
-KeyRightWindows=
-KeyS="scale -1 moveFrontBack"
-KeyScrollLock=
-KeySemicolon=
-KeySlash=
-KeySleep=
-KeySpace=boost
-KeyStop=
-KeySystemRequest=
-KeyT=
-KeyTab="cycleNavigationFocus"
-KeyU=
-KeyUP=
-KeyUnassigned=
-KeyUnderline=
-KeyUnlabeled=
-KeyV=
-KeyVolumeDown=
-KeyVolumeUp=
-KeyW="scale 1 moveFrontBack"
-KeyWake=
-KeyWebBack=
-KeyWebFavorites=
-KeyWebForward=
-KeyWebHome=
-KeyWebRefresh=
-KeyWebSearch=
-KeyWebStop=
-KeyX=
-KeyY=
-KeyYen=
-KeyZ=
-
-[MouseButtons]
-MouseButton3=
-MouseButton4=
-MouseButton5=
-MouseButton6=
-MouseButton7=
-MouseLeft="fire"
-MouseMiddle=
-MouseRight="altfire"
-MouseWheel1Down=
-MouseWheel1Up=
-MouseWheel2Down=
-MouseWheel2Up=
-
-[MouseAxes]
-MouseXNeg="scale -1 rotateYaw"
-MouseXPos="scale 1 rotateYaw"
-MouseYNeg="scale -1 rotatePitch"
-MouseYPos="scale 1 rotatePitch"
-
Index: code/branches/buildsystem3/bin/def_masterKeybindings.ini
===================================================================
--- code/branches/buildsystem3/bin/def_masterKeybindings.ini	(revision 2684)
+++ 	(revision )
@@ -1,260 +1,0 @@
-[Keys]
-KeyA=
-KeyABNT_C1=
-KeyABNT_C2=
-KeyAT=
-KeyAX=
-KeyApostrophe=
-KeyApps=
-KeyB=
-KeyBack=
-KeyBackslash=
-KeyC=
-KeyCalculator=
-KeyCapsLock=
-KeyColon=
-KeyComma=
-KeyConvert=
-KeyD=
-KeyDelete=
-KeyDivide=
-KeyDown=
-KeyE=
-KeyEnd=
-KeyEquals=
-KeyEscape=
-KeyF=
-KeyF1="OverlayGroup toggleVisibility Debug"
-KeyF10=
-KeyF11=
-KeyF12=
-KeyF13=
-KeyF14=
-KeyF15=
-KeyF2=
-KeyF3=
-KeyF4=
-KeyF5=
-KeyF6=
-KeyF7=
-KeyF8=
-KeyF9=
-KeyG=
-KeyGrave="openConsole"
-KeyH=
-KeyHome=
-KeyI=
-KeyInsert=
-KeyJ=
-KeyK=
-KeyKana=
-KeyKanji=
-KeyL=
-KeyLeft=
-KeyLeftAlt=
-KeyLeftBracket=
-KeyLeftControl=
-KeyLeftShift=
-KeyLeftWindows=
-KeyLessThan=
-KeyM=
-KeyMail=
-KeyMediaSelect=
-KeyMediaStop=
-KeyMinus=
-KeyMultiply=
-KeyMute=
-KeyMyComputer=
-KeyN=
-KeyNextTrack=
-KeyNoConvert=
-KeyNumLock=
-KeyNumRow0=
-KeyNumRow1=
-KeyNumRow2=
-KeyNumRow3=
-KeyNumRow4=
-KeyNumRow5=
-KeyNumRow6=
-KeyNumRow7=
-KeyNumRow8=
-KeyNumRow9=
-KeyNumpad0=
-KeyNumpad1=
-KeyNumpad2=
-KeyNumpad3=
-KeyNumpad4=
-KeyNumpad5=
-KeyNumpad6=
-KeyNumpad7=
-KeyNumpad8=
-KeyNumpad9=
-KeyNumpadAdd=
-KeyNumpadComma=
-KeyNumpadEnter=
-KeyNumpadEquals=
-KeyNumpadPeriod=
-KeyNumpadSubtract=
-KeyO=
-KeyP=
-KeyPageDown=
-KeyPageUp=
-KeyPause=
-KeyPeriod=
-KeyPlayPause=
-KeyPower=
-KeyPreviousTrack=
-KeyQ=
-KeyR=
-KeyReturn=
-KeyRight=
-KeyRightAlt=
-KeyRightBracket=
-KeyRightControl=
-KeyRightShift=
-KeyRightWindows=
-KeyS=
-KeyScrollLock=
-KeySemicolon=
-KeySlash=
-KeySleep=
-KeySpace=
-KeyStop=
-KeySystemRequest=
-KeyT=
-KeyTab=
-KeyU=
-KeyUP=
-KeyUnassigned=
-KeyUnderline=
-KeyUnlabeled=
-KeyV=
-KeyVolumeDown=
-KeyVolumeUp=
-KeyW=
-KeyWake=
-KeyWebBack=
-KeyWebFavorites=
-KeyWebForward=
-KeyWebHome=
-KeyWebRefresh=
-KeyWebSearch=
-KeyWebStop=
-KeyX=
-KeyY=
-KeyYen=
-KeyZ=
-Key_084=
-Key_085=
-Key_089=
-Key_090=
-Key_091=
-Key_092=
-Key_093=
-Key_094=
-Key_095=
-Key_096=
-Key_097=
-Key_098=
-Key_099=
-Key_103=
-Key_104=
-Key_105=
-Key_106=
-Key_107=
-Key_108=
-Key_109=
-Key_110=
-Key_111=
-Key_112=
-Key_114=
-Key_115=
-Key_117=
-Key_118=
-Key_119=
-Key_120=
-Key_121=
-Key_123=
-Key_125=
-Key_128=
-Key_129=
-Key_130=
-Key_131=
-Key_132=
-Key_133=
-Key_134=
-Key_135=
-Key_136=
-Key_137=
-Key_138=
-Key_139=
-Key_140=
-Key_141=
-Key_143=
-Key_144=
-Key_154=
-Key_155=
-Key_158=
-Key_159=
-Key_163=
-Key_165=
-Key_166=
-Key_167=
-Key_168=
-Key_169=
-Key_170=
-Key_171=
-Key_172=
-Key_173=
-Key_175=
-Key_177=
-Key_180=
-Key_182=
-Key_185=
-Key_186=
-Key_187=
-Key_188=
-Key_189=
-Key_190=
-Key_191=
-Key_192=
-Key_193=
-Key_194=
-Key_195=
-Key_196=
-Key_198=
-Key_202=
-Key_204=
-Key_206=
-Key_212=
-Key_213=
-Key_214=
-Key_215=
-Key_216=
-Key_217=
-Key_218=
-Key_224=
-Key_225=
-Key_226=
-Key_228=
-
-[MouseButtons]
-MouseButton3=
-MouseButton4=
-MouseButton5=
-MouseButton6=
-MouseButton7=
-MouseLeft=
-MouseMiddle=
-MouseRight=
-MouseWheel1Down=
-MouseWheel1Up=
-MouseWheel2Down=
-MouseWheel2Up=
-
-[MouseAxes]
-MouseXNeg=
-MouseXPos=
-MouseYNeg=
-MouseYPos=
-
Index: code/branches/buildsystem3/bin/disco.txt
===================================================================
--- code/branches/buildsystem3/bin/disco.txt	(revision 2684)
+++ 	(revision )
@@ -1,4 +1,0 @@
-delay 0 Ambient setAmbientLightTest 1,0,0,1
-delay 0.2 Ambient setAmbientLightTest 0,1,0,1
-delay 0.4 Ambient setAmbientLightTest 0,0,1,1
-delay 0.6 source disco.txt
Index: code/branches/buildsystem3/bin/irc.tcl
===================================================================
--- code/branches/buildsystem3/bin/irc.tcl	(revision 2684)
+++ 	(revision )
@@ -1,6 +1,0 @@
-proc every {ms body} { eval $body; after $ms [list every $ms $body] }
-package require irk
-set conn [irk::connect orxonox $nickname]
-irk::join $conn #orxonox
-every 25 {}
-vwait termination
Index: code/branches/buildsystem3/bin/ogre.cfg
===================================================================
--- code/branches/buildsystem3/bin/ogre.cfg	(revision 2684)
+++ 	(revision )
@@ -1,7 +1,0 @@
-Render System=OpenGL Rendering Subsystem
-
-[OpenGL Rendering Subsystem]
-FSAA=0
-Full Screen=No
-RTT Preferred Mode=FBO
-Video Mode=800 x 600
Index: code/branches/buildsystem3/bin/remote.tcl
===================================================================
--- code/branches/buildsystem3/bin/remote.tcl	(revision 2684)
+++ 	(revision )
@@ -1,2 +1,0 @@
-set telnetserverthreadid [TclThreadManager create]
-TclThreadManager execute $telnetserverthreadid source telnet_server.tcl
Index: code/branches/buildsystem3/bin/telnet_server.tcl
===================================================================
--- code/branches/buildsystem3/bin/telnet_server.tcl	(revision 2684)
+++ 	(revision )
@@ -1,213 +1,0 @@
- #!/usr/bin/env tclsh
- # Pseudo-telnet server.  Includes basic auth, but no separate identities
- # or proper multi-threaded operation, so whoever runs this had better
- # trust those he gives identities/passwords to and they had better trust
- # each other too.  Note this script does not support command-line arguments.
-
- ## The names of this array are IP addresses of hosts that are not permitted
- ## to connect to any of our services.  Admin account(s) can change this
- ## at run-time, though this info is not maintained across whole-server shutdowns.
- array set denyHosts {}
-
- ## Keep the Tcl-thread busy
- proc every {ms body} { eval $body; after $ms [list every $ms $body] }
- every 200 {}
-
- ## Create a server on the given port with the given name/password map
- ## and the given core interaction handler.
- proc telnetServer {port {passmap} {handlerCmd remoteCommand}} {
-     if {$port == 0} {
-         return -code error "Only non-zero port numbers are supported"
-     }
-     set server [socket -server [list connect $port $handlerCmd] $port]
-     global passwords services
-     foreach {id pass} $passmap {set passwords($port,$id) $pass}
-     set services($server) $handlerCmd
-     return $server
- }
-
- ## Removes the server on the given port, cleaning up the extra state too.
- proc closedownServer {server} {
-     global services passwords connections auth
-     set port [lindex [fconfigure $server -sockname] 2]
-     catch {close $server}
-     unset services($server)
-     foreach passmap [array names passwords $port,*] {
-         unset passwords($passmap)
-     }
-     # Hmph!  Have to remove unauthorized connections too, though any
-     # connection which has been authorized can continue safely.
-     foreach {client data} [array get connections] {
-         if {$port == [lindex $data 0] && !$auth($client)} {
-             disconnect $client
-         }
-     }
- }
-
- ## Handle an incoming connection to the given server
- proc connect {serverport handlerCmd client clienthost clientport} {
-     global auth cmd denyHosts connections
-     if {[info exist denyHosts($clienthost)]} {
-         puts stdout "${clienthost}:${clientport} attempted connection"
-         catch {puts $client "Connection denied"}
-         catch {close $client}
-         return
-     }
-     puts stdout "${clienthost}:${clientport} connected on $client"
-     fileevent $client readable "handle $serverport $client"
-     set auth($client) 0
-     set cmd($client) $handlerCmd
-     set connections($client) [list $serverport $clienthost $clientport]
-     fconfigure $client -buffering none
-     catch {puts -nonewline $client "Login: "}
- }
-
- ## Disconnect the given client, cleaning up any connection-specific data
- proc disconnect {client} {
-     catch {close $client}
-     global auth cmd connections
-     unset auth($client)
-     unset cmd($client)
-     unset connections($client)
-     puts stdout "$client disconnected"
- }
-
- ## Handle data sent from the client.  Log-in is handled directly by this
- ## procedure, and requires the name and password on the same line
- proc handle {serverport client} {
-     global passwords auth cmd
-     if {[gets $client line] < 0} {
-         disconnect $client
-         return
-     }
-     if {[string equal $line "logout"] || [string equal $line "quit"]} {
-         disconnect $client
-         return
-     }
-     if {[string equal $line "exit"]} {
-         set ::termination 1
-         return
-     }
-     if {$auth($client)} {
-         eval $cmd($client) [list $client $line 0]
-         eval $cmd($client) [list $client $line 1]
-         return
-     }
-     foreach {id pass} [split $line] {break}
-     if {![info exist pass]} {
-         catch {puts -nonewline $client "Login: "}
-         return
-     }
-     if {
-         [info exist passwords($serverport,$id)] &&
-         [string equal $passwords($serverport,$id) $pass]
-     } then {
-         set auth($client) 1
-         puts stdout "$id logged in on $client"
-         catch {puts $client "Welcome, $id!"}
-         eval $cmd($client) [list $client $line 1]
-         return
-     }
-     puts stdout "AUTH FAILURE ON $client"
-     catch {puts $client "Unknown name or password"}
-     disconnect $client
- }
-
- ## Standard handler for logged-in conversations and prompt-generation.
- proc execCommand {client line prompt} {
-     global tcl_platform
-     if {$prompt} {
-         catch {puts -nonewline $client "\$ "}
-         return
-     }
-     switch $tcl_platform(platform) {
-         unix {
-             catch {exec sh -c $line <@$client >@$client 2>@$client}
-         }
-         default {
-             catch {exec $line} data
-             puts $client $data
-         }
-     }
- }
-
- ## Administration service handler.  Chains to the normal handler for
- ## everything it doesn't recognise itself.
- proc admin {client line prompt} {
-     if {$prompt} {
-         catch {puts -nonewline $client "# "}
-         return
-     }
-     set cmd [split $line]
-     global denyHosts connections services
-     if {[string equal $line "shutdown"]} {
-         set ::termination 1
-         puts stdout "Shutdown requested on $client"
-         catch {puts $client "System will shut down as soon as possible"}
-         return -code return "SHUTTING DOWN"
-     } elseif {[string equal [lindex $cmd 0] "deny"]} {
-         set denyHosts([lindex $cmd 1]) 1
-     } elseif {[string equal [lindex $cmd 0] "allow"]} {
-         catch {unset denyHosts([lindex $cmd 1])}
-     } elseif {[string equal $line "denied"]} {
-         foreach host [array names denyHosts] {
-             catch {puts $client $host}
-         }
-     } elseif {[string equal $line "connections"]} {
-         set len 0
-         foreach conn [array names connections] {
-             if {$len < [string length $conn]} {
-                 set len [string length $conn]
-             }
-         }
-         foreach {conn details} [array get connections] {
-             catch {puts $client [format "%-*s = %s" $len $conn $details]}
-         }
-     } elseif {[string equal [lindex $cmd 0] "close"]} {
-         set sock [lindex $cmd 1]
-         if {[info exist connections($sock)]} {
-             disconnect $sock
-         }
-     } elseif {[string equal $line "services"]} {
-         set len 0
-         foreach serv [array names services] {
-             if {$len < [string length $serv]} {
-                 set len [string length $serv]
-             }
-         }
-         foreach {serv handler} [array get services] {
-             set port [lindex [fconfigure $serv -sockname] 2]
-             catch {puts $client [format "%-*s (port %d) = handler %s" $len $serv $port $handler]}
-         }
-     } elseif {[string equal [lindex $cmd 0] "addService"]} {
-         set service [eval telnetServer [lrange $cmd 1 end]]
-         catch {puts $client "Created service as $service"}
-     } elseif {[string equal [lindex $cmd 0] "removeService"]} {
-         set service [lindex $cmd 1]
-         if {[info exist services($service)]} {
-             closedownServer $service
-         }
-     } else {
-         # CHAIN TO DEFAULT
-         execCommand $client $line 0
-     }
- }
- 
- ## Executes a given command
- proc remoteCommand {client line prompt} {
-     global tcl_platform
-     if {$prompt} {
-         catch {puts -nonewline $client "\$ "}
-         return
-     }
-     catch {eval $line} data
-     puts $client $data
- }
-
- telnetServer 2560 {orxonox rocks} remoteCommand
- telnetServer 2561 {orxadmin *****} admin
-
- puts stdout "Ready for service"
-
- vwait termination
- execute exit
Index: code/branches/buildsystem3/cmake/BuildConfig.cmake
===================================================================
--- code/branches/buildsystem3/cmake/BuildConfig.cmake	(revision 2684)
+++ code/branches/buildsystem3/cmake/BuildConfig.cmake	(revision 2685)
@@ -123,5 +123,4 @@
   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/share/orxonox)
   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/share/doc/orxonox)
-  # Not yet used
   SET(ORXONOX_LOG_INSTALL_PATH     ~/.orxonox/log)
   SET(ORXONOX_CONFIG_INSTALL_PATH  ~/.orxonox/config)
@@ -132,5 +131,4 @@
   SET(ORXONOX_MEDIA_INSTALL_PATH   ${CMAKE_INSTALL_PREFIX}/media)
   SET(ORXONOX_DOC_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/doc)
-  # Not yet used
   SET(ORXONOX_LOG_INSTALL_PATH     ${CMAKE_INSTALL_PREFIX}/log)
   SET(ORXONOX_CONFIG_INSTALL_PATH  ${CMAKE_INSTALL_PREFIX}/config)
Index: code/branches/buildsystem3/config/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/config/CMakeLists.txt	(revision 2685)
+++ code/branches/buildsystem3/config/CMakeLists.txt	(revision 2685)
@@ -0,0 +1,96 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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.
+ #
+ 
+SET(ORXONOX_CONFIG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
+
+SET(READ_ONLY_CONFIG_FILES
+  def_keybindings.ini
+  def_masterKeybindings.ini
+)
+
+SET(WRITABLE_CONFIG_FILES
+)
+
+IF(TARDIS)
+  # OGRE can't find fonts to display config screen on Tardis,
+  # so providing default config file here (bug).
+  LIST(APPEND WRITABLE_CONFIG_FILES ogre.cfg)
+ENDIF(TARDIS)
+
+# We need the same code for both READ_ONLY and WRITABLE config files
+MACRO(CONFIGURE_FILES _file_name _build_configs _read_only_arg)
+  SET(_read_only ${_read_only_arg})
+  FOREACH(_build_config ${_build_configs})
+    # Is there an extra file in bin/Debug or bin/Release?
+    IF(${_build_config} MATCHES "Rel")
+      SET(_build_config_short "Release")
+    ELSE()
+      SET(_build_config_short "Debug")
+    ENDIF()
+    IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
+      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_build_config_short}/${_file_name})
+    ELSE()
+      SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${_file_name})
+    ENDIF()
+
+    # Copy to the folder named like the build config for Visual Studio
+    IF(CMAKE_CONFIGURATION_TYPES)
+      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_build_config}/${_file_name})
+    ELSE()
+      SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${_file_name})
+    ENDIF()
+    # Only copy if target file doesn't exist. This may result in problems but
+    # otherwise we might delete a user's config
+    IF(NOT EXISTS ${_out_file} OR _read_only)
+      CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY)
+    ENDIF()
+  ENDFOREACH(_build_config)
+ENDMACRO(CONFIGURE_FILES)
+
+# Copy config files to all Visual Studio output directories
+IF(CMAKE_CONFIGURATION_TYPES)
+  SET(BUILD_CONFIGS ${CMAKE_CONFIGURATION_TYPES})
+ELSE()
+  SET(BUILD_CONFIGS ${CMAKE_BUILD_TYPE})
+ENDIF()
+
+FOREACH(_file_name ${READ_ONLY_CONFIG_FILES})
+  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" TRUE)
+ENDFOREACH(_file_name)
+FOREACH(_file_name ${WRITABLE_CONFIG_FILES})
+  CONFIGURE_FILES("${_file_name}" "${BUILD_CONFIGS}" FALSE)
+ENDFOREACH(_file_name)
+
+
+################ Installation #################
+
+# Not using collective call to allow configuration with CMake.
+FOREACH(_file ${READ_ONLY_CONFIG_FILES} ${WRITABLE_CONFIG_FILES})
+  IF(CMAKE_CONFIGURATION_TYPES)
+    FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
+      INSTALL(
+        FILES ${CMAKE_CURRENT_BINARY_DIR}/${_configuration}/${_file}
+        DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH}
+        CONFIGURATIONS ${_configuration}
+      )
+    ENDFOREACH(_configuration)
+  ELSE()
+    INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_file} DESTINATION ${ORXONOX_CONFIG_INSTALL_PATH})
+  ENDIF()
+ENDFOREACH(_file)
Index: code/branches/buildsystem3/config/def_keybindings.ini
===================================================================
--- code/branches/buildsystem3/config/def_keybindings.ini	(revision 2685)
+++ code/branches/buildsystem3/config/def_keybindings.ini	(revision 2685)
@@ -0,0 +1,167 @@
+[Keys]
+KeyA="scale -1 moveRightLeft"
+KeyABNT_C1=
+KeyABNT_C2=
+KeyAT=
+KeyAX=
+KeyApostrophe=
+KeyApps=
+KeyB=
+KeyBack=
+KeyBackslash=
+KeyC=switchCamera
+KeyCalculator=
+KeyCapsLock=
+KeyColon=
+KeyComma=
+KeyConvert=
+KeyD="scale 1 moveRightLeft"
+KeyDelete=
+KeyDivide=
+KeyDown=
+KeyE="scale -1 rotateRoll"
+KeyEnd=
+KeyEquals=
+KeyEscape="exit"
+KeyF="scale -1 moveUpDown"
+KeyF1=
+KeyF10=
+KeyF11=
+KeyF12=
+KeyF13=
+KeyF14=
+KeyF15=
+KeyF2="OverlayGroup toggleVisibility Stats"
+KeyF3=
+KeyF4=
+KeyF5=
+KeyF6=
+KeyF7=
+KeyF8=
+KeyF9=
+KeyG=greet
+KeyGrave=
+KeyH=
+KeyHome=
+KeyI=
+KeyInsert=
+KeyJ=
+KeyK=
+KeyKana=
+KeyKanji=
+KeyL=dropItems
+KeyLeft=
+KeyLeftAlt=
+KeyLeftBracket=
+KeyLeftControl=mouseLook
+KeyLeftShift=
+KeyLeftWindows=
+KeyLessThan=
+KeyM=
+KeyMail=
+KeyMediaSelect=
+KeyMediaStop=
+KeyMinus=
+KeyMultiply=
+KeyMute=
+KeyMyComputer=
+KeyN=
+KeyNextTrack=
+KeyNoConvert=
+KeyNumLock=
+KeyNumRow0=
+KeyNumRow1=
+KeyNumRow2=
+KeyNumRow3=
+KeyNumRow4=
+KeyNumRow5=
+KeyNumRow6=
+KeyNumRow7=
+KeyNumRow8=
+KeyNumRow9=
+KeyNumpad0=
+KeyNumpad1=
+KeyNumpad2=
+KeyNumpad3=
+KeyNumpad4=
+KeyNumpad5=
+KeyNumpad6=
+KeyNumpad7=
+KeyNumpad8=
+KeyNumpad9=
+KeyNumpadAdd=
+KeyNumpadComma=
+KeyNumpadEnter=
+KeyNumpadEquals=
+KeyNumpadPeriod=
+KeyNumpadSubtract=
+KeyO=
+KeyP=
+KeyPageDown=
+KeyPageUp=
+KeyPause=pause
+KeyPeriod=
+KeyPlayPause=
+KeyPower=
+KeyPreviousTrack=
+KeyQ="scale 1 rotateRoll"
+KeyR="scale 1 moveUpDown"
+KeyReturn=
+KeyRight=
+KeyRightAlt=
+KeyRightBracket=
+KeyRightControl=
+KeyRightShift=
+KeyRightWindows=
+KeyS="scale -1 moveFrontBack"
+KeyScrollLock=
+KeySemicolon=
+KeySlash=
+KeySleep=
+KeySpace=boost
+KeyStop=
+KeySystemRequest=
+KeyT=
+KeyTab="cycleNavigationFocus"
+KeyU=
+KeyUP=
+KeyUnassigned=
+KeyUnderline=
+KeyUnlabeled=
+KeyV=
+KeyVolumeDown=
+KeyVolumeUp=
+KeyW="scale 1 moveFrontBack"
+KeyWake=
+KeyWebBack=
+KeyWebFavorites=
+KeyWebForward=
+KeyWebHome=
+KeyWebRefresh=
+KeyWebSearch=
+KeyWebStop=
+KeyX=
+KeyY=
+KeyYen=
+KeyZ=
+
+[MouseButtons]
+MouseButton3=
+MouseButton4=
+MouseButton5=
+MouseButton6=
+MouseButton7=
+MouseLeft="fire"
+MouseMiddle=
+MouseRight="altfire"
+MouseWheel1Down=
+MouseWheel1Up=
+MouseWheel2Down=
+MouseWheel2Up=
+
+[MouseAxes]
+MouseXNeg="scale -1 rotateYaw"
+MouseXPos="scale 1 rotateYaw"
+MouseYNeg="scale -1 rotatePitch"
+MouseYPos="scale 1 rotatePitch"
+
Index: code/branches/buildsystem3/config/def_masterKeybindings.ini
===================================================================
--- code/branches/buildsystem3/config/def_masterKeybindings.ini	(revision 2685)
+++ code/branches/buildsystem3/config/def_masterKeybindings.ini	(revision 2685)
@@ -0,0 +1,260 @@
+[Keys]
+KeyA=
+KeyABNT_C1=
+KeyABNT_C2=
+KeyAT=
+KeyAX=
+KeyApostrophe=
+KeyApps=
+KeyB=
+KeyBack=
+KeyBackslash=
+KeyC=
+KeyCalculator=
+KeyCapsLock=
+KeyColon=
+KeyComma=
+KeyConvert=
+KeyD=
+KeyDelete=
+KeyDivide=
+KeyDown=
+KeyE=
+KeyEnd=
+KeyEquals=
+KeyEscape=
+KeyF=
+KeyF1="OverlayGroup toggleVisibility Debug"
+KeyF10=
+KeyF11=
+KeyF12=
+KeyF13=
+KeyF14=
+KeyF15=
+KeyF2=
+KeyF3=
+KeyF4=
+KeyF5=
+KeyF6=
+KeyF7=
+KeyF8=
+KeyF9=
+KeyG=
+KeyGrave="openConsole"
+KeyH=
+KeyHome=
+KeyI=
+KeyInsert=
+KeyJ=
+KeyK=
+KeyKana=
+KeyKanji=
+KeyL=
+KeyLeft=
+KeyLeftAlt=
+KeyLeftBracket=
+KeyLeftControl=
+KeyLeftShift=
+KeyLeftWindows=
+KeyLessThan=
+KeyM=
+KeyMail=
+KeyMediaSelect=
+KeyMediaStop=
+KeyMinus=
+KeyMultiply=
+KeyMute=
+KeyMyComputer=
+KeyN=
+KeyNextTrack=
+KeyNoConvert=
+KeyNumLock=
+KeyNumRow0=
+KeyNumRow1=
+KeyNumRow2=
+KeyNumRow3=
+KeyNumRow4=
+KeyNumRow5=
+KeyNumRow6=
+KeyNumRow7=
+KeyNumRow8=
+KeyNumRow9=
+KeyNumpad0=
+KeyNumpad1=
+KeyNumpad2=
+KeyNumpad3=
+KeyNumpad4=
+KeyNumpad5=
+KeyNumpad6=
+KeyNumpad7=
+KeyNumpad8=
+KeyNumpad9=
+KeyNumpadAdd=
+KeyNumpadComma=
+KeyNumpadEnter=
+KeyNumpadEquals=
+KeyNumpadPeriod=
+KeyNumpadSubtract=
+KeyO=
+KeyP=
+KeyPageDown=
+KeyPageUp=
+KeyPause=
+KeyPeriod=
+KeyPlayPause=
+KeyPower=
+KeyPreviousTrack=
+KeyQ=
+KeyR=
+KeyReturn=
+KeyRight=
+KeyRightAlt=
+KeyRightBracket=
+KeyRightControl=
+KeyRightShift=
+KeyRightWindows=
+KeyS=
+KeyScrollLock=
+KeySemicolon=
+KeySlash=
+KeySleep=
+KeySpace=
+KeyStop=
+KeySystemRequest=
+KeyT=
+KeyTab=
+KeyU=
+KeyUP=
+KeyUnassigned=
+KeyUnderline=
+KeyUnlabeled=
+KeyV=
+KeyVolumeDown=
+KeyVolumeUp=
+KeyW=
+KeyWake=
+KeyWebBack=
+KeyWebFavorites=
+KeyWebForward=
+KeyWebHome=
+KeyWebRefresh=
+KeyWebSearch=
+KeyWebStop=
+KeyX=
+KeyY=
+KeyYen=
+KeyZ=
+Key_084=
+Key_085=
+Key_089=
+Key_090=
+Key_091=
+Key_092=
+Key_093=
+Key_094=
+Key_095=
+Key_096=
+Key_097=
+Key_098=
+Key_099=
+Key_103=
+Key_104=
+Key_105=
+Key_106=
+Key_107=
+Key_108=
+Key_109=
+Key_110=
+Key_111=
+Key_112=
+Key_114=
+Key_115=
+Key_117=
+Key_118=
+Key_119=
+Key_120=
+Key_121=
+Key_123=
+Key_125=
+Key_128=
+Key_129=
+Key_130=
+Key_131=
+Key_132=
+Key_133=
+Key_134=
+Key_135=
+Key_136=
+Key_137=
+Key_138=
+Key_139=
+Key_140=
+Key_141=
+Key_143=
+Key_144=
+Key_154=
+Key_155=
+Key_158=
+Key_159=
+Key_163=
+Key_165=
+Key_166=
+Key_167=
+Key_168=
+Key_169=
+Key_170=
+Key_171=
+Key_172=
+Key_173=
+Key_175=
+Key_177=
+Key_180=
+Key_182=
+Key_185=
+Key_186=
+Key_187=
+Key_188=
+Key_189=
+Key_190=
+Key_191=
+Key_192=
+Key_193=
+Key_194=
+Key_195=
+Key_196=
+Key_198=
+Key_202=
+Key_204=
+Key_206=
+Key_212=
+Key_213=
+Key_214=
+Key_215=
+Key_216=
+Key_217=
+Key_218=
+Key_224=
+Key_225=
+Key_226=
+Key_228=
+
+[MouseButtons]
+MouseButton3=
+MouseButton4=
+MouseButton5=
+MouseButton6=
+MouseButton7=
+MouseLeft=
+MouseMiddle=
+MouseRight=
+MouseWheel1Down=
+MouseWheel1Up=
+MouseWheel2Down=
+MouseWheel2Up=
+
+[MouseAxes]
+MouseXNeg=
+MouseXPos=
+MouseYNeg=
+MouseYPos=
+
Index: code/branches/buildsystem3/config/ogre.cfg
===================================================================
--- code/branches/buildsystem3/config/ogre.cfg	(revision 2685)
+++ code/branches/buildsystem3/config/ogre.cfg	(revision 2685)
@@ -0,0 +1,7 @@
+Render System=OpenGL Rendering Subsystem
+
+[OpenGL Rendering Subsystem]
+FSAA=0
+Full Screen=No
+RTT Preferred Mode=FBO
+Video Mode=800 x 600
Index: code/branches/buildsystem3/log/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/log/CMakeLists.txt	(revision 2685)
+++ code/branches/buildsystem3/log/CMakeLists.txt	(revision 2685)
@@ -0,0 +1,30 @@
+ #
+ #             ORXONOX - the hottest 3D action shooter ever to exist
+ #                             > www.orxonox.net <
+ #
+ #        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.
+ #
+ 
+SET(ORXONOX_LOG_DEV_PATH ${CMAKE_CURRENT_BINARY_DIR} PARENT_SCOPE)
+
+# Create some directories for the logs or CEGUI crashes when setting up the log
+IF(CMAKE_CONFIGURATION_TYPES)
+  FOREACH(_configuration ${CMAKE_CONFIGURATION_TYPES})
+    FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_configuration})
+  ENDFOREACH(_configuration)
+ENDIF()
+
+# Also create the folder when installing
+INSTALL(CODE "FILE(MAKE_DIRECTORY \"${ORXONOX_LOG_INSTALL_PATH}\")")
Index: code/branches/buildsystem3/media/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/media/CMakeLists.txt	(revision 2684)
+++ code/branches/buildsystem3/media/CMakeLists.txt	(revision 2685)
@@ -26,15 +26,14 @@
 # Specify media directory
 GET_FILENAME_COMPONENT(_search_path_1 ${CMAKE_SOURCE_DIR}/../media ABSOLUTE)
-FIND_PATH(ORXONOX_MEDIA_DIRECTORY resources.cfg
+FIND_PATH(ORXONOX_MEDIA_DEV_PATH resources.cfg
   PATHS
     ${CMAKE_CURRENT_SOURCE_DIR}
     ${_search_path_1}
-    $ENV{ORXONOX_MEDIA_DIR}
 )
-IF(NOT ORXONOX_MEDIA_DIRECTORY)
+IF(NOT ORXONOX_MEDIA_DEV_PATH)
   MESSAGE(STATUS "Warning: Media directory not found. If you want to compile while downloading the media files, you must specify the directory by Hand BEFORE compiling! Default location is orxonox_root/media")
   # Temporary override to the default location.
-  SET(ORXONOX_MEDIA_DIRECTORY ${CMAKE_SOURCE_DIR}/media)
-  SET(ORXONOX_MEDIA_DIRECTORY ${CMAKE_SOURCE_DIR}/media PARENT_SCOPE)
+  SET(ORXONOX_MEDIA_DEV_PATH ${CMAKE_SOURCE_DIR}/media)
+  SET(ORXONOX_MEDIA_DEV_PATH ${CMAKE_SOURCE_DIR}/media PARENT_SCOPE)
 ENDIF()
 
@@ -50,5 +49,5 @@
 
 INSTALL(
-  DIRECTORY ${ORXONOX_MEDIA_DIRECTORY}/
+  DIRECTORY ${ORXONOX_MEDIA_DEV_PATH}/
   DESTINATION ${ORXONOX_MEDIA_INSTALL_PATH}
   REGEX "\\.svn$|_svn$|backToPNG|${TCL_EXCLUDE_PATTERN}" EXCLUDE
Index: code/branches/buildsystem3/src/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/src/CMakeLists.txt	(revision 2684)
+++ code/branches/buildsystem3/src/CMakeLists.txt	(revision 2685)
@@ -65,4 +65,11 @@
 INCLUDE(CheckIncludeFileCXX)
 CHECK_INCLUDE_FILE_CXX(iso646.h HAVE_ISO646_H)
+
+# XCode and Visual Studio support multiple configurations. In order to tell the
+# which one we have to define the macros separately for each configuration
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=Debug"          Debug)
+ADD_COMPILER_FLAGS("-DCMAKE_BIULD_TYPE=Release"        Release)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=RelWithDebInfo" RelWithDebInfo)
+ADD_COMPILER_FLAGS("-DCMAKE_BUILD_TYPE=MinSizeRel"     MinSizeRel)
 
 SET(GENERATED_FILE_COMMENT
Index: code/branches/buildsystem3/src/OrxonoxConfig.h.in
===================================================================
--- code/branches/buildsystem3/src/OrxonoxConfig.h.in	(revision 2684)
+++ code/branches/buildsystem3/src/OrxonoxConfig.h.in	(revision 2685)
@@ -164,7 +164,9 @@
 
 #cmakedefine HAVE_STDDEF_H
+/* Quite large, do not include unless necessary
 #ifdef HAVE_STDDEF_H
 #  include <stddef.h>
 #endif
+*/
 
 /* Visual Leak Detector looks for memory leaks */
@@ -185,16 +187,29 @@
 #cmakedefine USE_DEPENDENCY_PACKAGE
 
+/* Using MSVC or XCode IDE */
+#cmakedefine CMAKE_CONFIGURATION_TYPES
+
+/* Macros used in the next section */
+#define MACRO_CONCATENATE(str1, str2) str1##str2
+#define MACRO_QUOTEME_AUX(x) #x
+#define MACRO_QUOTEME(x) MACRO_QUOTEME_AUX(x)
+
 /* Handle default ConfigValues */
 namespace orxonox
 {
-#ifdef ORXONOX_PLATFORM_WINDOWS
-    const char* const ORXONOX_MEDIA_PATH("../media");
-#elif defined(ORXONOX_PLATFORM_LINUX)
-    const char* const ORXONOX_MEDIA_PATH("../../share/orxonox");
-#else
-    /* TODO: Apple? */
-    const char* const ORXONOX_MEDIA_PATH("../../share/orxonox");
+    const char* const ORXONOX_MEDIA_INSTALL_PATH ("@ORXONOX_MEDIA_INSTALL_PATH@/");
+    const char* const ORXONOX_CONFIG_INSTALL_PATH("@ORXONOX_CONFIG_INSTALL_PATH@/");
+    const char* const ORXONOX_LOG_INSTALL_PATH   ("@ORXONOX_LOG_INSTALL_PATH@/");
+
+    const char* const ORXONOX_MEDIA_DEV_PATH     ("@ORXONOX_MEDIA_DEV_PATH@/");
+#ifdef CMAKE_CONFIGURATION_TYPES
+    const char* const ORXONOX_CONFIG_DEV_PATH    ("@ORXONOX_CONFIG_DEV_PATH@/" MACRO_QUOTEME(CMAKE_BUILD_TYPE) "/");
+    const char* const ORXONOX_LOG_DEV_PATH       ("@ORXONOX_LOG_DEV_PATH@/"    MACRO_QUOTEME(CMAKE_BUILD_TYPE) "/");
+#else
+    const char* const ORXONOX_CONFIG_DEV_PATH    ("@ORXONOX_CONFIG_DEV_PATH@/");
+    const char* const ORXONOX_LOG_DEV_PATH       ("@ORXONOX_LOG_DEV_PATH@/");
 #endif
     
+    /* OGRE Plugins */
 #ifdef NDEBUG
     const char* const ORXONOX_OGRE_PLUGINS("@OGRE_PLUGINS_RELEASE@");
@@ -214,4 +229,3 @@
 }
 
-
 #endif /* _OrxonoxConfig_H__ */
Index: code/branches/buildsystem3/src/core/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/src/core/CMakeLists.txt	(revision 2684)
+++ code/branches/buildsystem3/src/core/CMakeLists.txt	(revision 2685)
@@ -70,5 +70,12 @@
 IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
   # Get around displaying a few hundred lines of warning code
-  SET_SOURCE_FILES_PROPERTIES(ArgumentCompletionFunctions.cc PROPERTIES COMPILE_FLAGS "-w")
+  SET_SOURCE_FILES_PROPERTIES(
+    ArgumentCompletionFunctions.cc
+    CommandLine.cc
+    ConfigFileManager.cc
+    Language.cc
+    LuaBind.cc
+    input/KeyBinder.cc
+    PROPERTIES COMPILE_FLAGS "-Wno-sign-compare")
 ENDIF()
 
Index: code/branches/buildsystem3/src/core/CommandLine.cc
===================================================================
--- code/branches/buildsystem3/src/core/CommandLine.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/CommandLine.cc	(revision 2685)
@@ -29,6 +29,8 @@
 #include "CommandLine.h"
 
+#include <boost/filesystem.hpp>
 #include "util/String.h"
 #include "util/SubString.h"
+#include "Core.h"
 
 namespace orxonox
@@ -299,9 +301,12 @@
         this->_parse(args);
 
+        std::string filename = CommandLine::getValue("optionsFile").getString();
+        boost::filesystem::path folder(Core::getConfigPath());
+        boost::filesystem::path filepath(folder/filename);
+
         // look for additional arguments in given file or start.ini as default
         // They will not overwrite the arguments given directly
         std::ifstream file;
-        std::string filename = CommandLine::getValue("optionsFile").getString();
-        file.open(filename.c_str());
+        file.open(filepath.native_file_string().c_str());
         args.clear();
         if (file)
Index: code/branches/buildsystem3/src/core/ConfigFileManager.cc
===================================================================
--- code/branches/buildsystem3/src/core/ConfigFileManager.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/ConfigFileManager.cc	(revision 2685)
@@ -30,8 +30,11 @@
 
 #include <cassert>
+#include <boost/filesystem.hpp>
+
 #include "util/Convert.h"
 #include "util/String.h"
 #include "ConsoleCommand.h"
 #include "ConfigValueContainer.h"
+#include "Core.h"
 
 namespace orxonox
@@ -223,12 +226,14 @@
         this->clear();
 
+        boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
+
         // This creates the config file if it's not existing
         std::ofstream createFile;
-        createFile.open(this->filename_.c_str(), std::fstream::app);
+        createFile.open(filepath.native_file_string().c_str(), std::fstream::app);
         createFile.close();
 
         // Open the file
         std::ifstream file;
-        file.open(this->filename_.c_str(), std::fstream::in);
+        file.open(filepath.native_file_string().c_str(), std::fstream::in);
 
         if (!file.is_open())
@@ -337,6 +342,8 @@
     void ConfigFile::save() const
     {
+        boost::filesystem::path filepath(Core::getConfigPath() + "/" + this->filename_);
+
         std::ofstream file;
-        file.open(this->filename_.c_str(), std::fstream::out);
+        file.open(filepath.native_file_string().c_str(), std::fstream::out);
         file.setf(std::ios::fixed, std::ios::floatfield);
         file.precision(6);
Index: code/branches/buildsystem3/src/core/Core.cc
===================================================================
--- code/branches/buildsystem3/src/core/Core.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/Core.cc	(revision 2685)
@@ -37,4 +37,6 @@
 #include "CoreIncludes.h"
 #include "ConfigValueIncludes.h"
+#include "LuaBind.h"
+#include "CommandLine.h"
 
 namespace orxonox
@@ -46,5 +48,11 @@
     bool Core::bIsMaster_s      = false;
 
+    bool Core::isDevBuild_s     = false;
+    std::string Core::configPath_s(ORXONOX_CONFIG_INSTALL_PATH); // from OrxonoxConfig.h
+    std::string Core::logPath_s   (ORXONOX_LOG_INSTALL_PATH);    // from OrxonoxConfig.h
+
     Core* Core::singletonRef_s = 0;
+
+    SetCommandLineArgument(mediaPath, "").information("PATH");
 
     /**
@@ -58,7 +66,17 @@
         assert(Core::singletonRef_s == 0);
         Core::singletonRef_s = this;
+
         this->bInitializeRandomNumberGenerator_ = false;
-
         this->setConfigValues();
+
+        // Set the correct log path. Before this call, /tmp (Unix) or %TEMP% was used
+        OutputHandler::getOutStream().setLogPath(Core::logPath_s);
+
+        // Possible media path override by the command line
+        if (!CommandLine::getArgument("mediaPath")->hasDefaultValue())
+        {
+            std::string mediaPath = CommandLine::getValue("mediaPath");
+            Core::tsetMediaPath(mediaPath);
+        }
     }
 
@@ -77,9 +95,31 @@
     void Core::setConfigValues()
     {
-        SetConfigValue(softDebugLevelConsole_, 3).description("The maximal level of debug output shown in the console").callback(this, &Core::debugLevelChanged);
-        SetConfigValue(softDebugLevelLogfile_, 3).description("The maximal level of debug output shown in the logfile").callback(this, &Core::debugLevelChanged);
-        SetConfigValue(softDebugLevelShell_, 1).description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged);
+#ifdef NDEBUG
+        const unsigned int defaultLevelConsole = 1;
+        const unsigned int defaultLevelLogfile = 3;
+        const unsigned int defaultLevelShell   = 1;
+#else
+        const unsigned int defaultLevelConsole = 3;
+        const unsigned int defaultLevelLogfile = 4;
+        const unsigned int defaultLevelShell   = 3;
+#endif
+        SetConfigValue(softDebugLevelConsole_, defaultLevelConsole)
+            .description("The maximal level of debug output shown in the console").callback(this, &Core::debugLevelChanged);
+        SetConfigValue(softDebugLevelLogfile_, defaultLevelLogfile)
+            .description("The maximal level of debug output shown in the logfile").callback(this, &Core::debugLevelChanged);
+        SetConfigValue(softDebugLevelShell_, defaultLevelShell)
+            .description("The maximal level of debug output shown in the ingame shell").callback(this, &Core::debugLevelChanged);
+
         SetConfigValue(language_, Language::getLanguage().defaultLanguage_).description("The language of the ingame text").callback(this, &Core::languageChanged);
         SetConfigValue(bInitializeRandomNumberGenerator_, true).description("If true, all random actions are different each time you start the game").callback(this, &Core::initializeRandomNumberGenerator);
+
+        // Media path (towards config and log path) is ini-configurable
+        const char* defaultMediaPath = ORXONOX_MEDIA_INSTALL_PATH;
+        if (Core::isDevBuild())
+            defaultMediaPath = ORXONOX_MEDIA_DEV_PATH;
+
+        SetConfigValue(mediaPath_, defaultMediaPath)
+            .description("Relative path to the game data.").callback(this, &Core::mediaPathChanged);
+
     }
 
@@ -109,4 +149,22 @@
         // Read the translation file after the language was configured
         Language::getLanguage().readTranslatedLanguageFile();
+    }
+
+    /**
+    @brief
+        Callback function if the media path has changed.
+    */
+    void Core::mediaPathChanged()
+    {
+        if (mediaPath_ != "" && mediaPath_[mediaPath_.size() - 1] != '/')
+        {
+            ModifyConfigValue(mediaPath_, set, mediaPath_ + "/");
+        }
+
+        if (mediaPath_ == "")
+        {
+            ModifyConfigValue(mediaPath_, set, "/");
+            COUT(2) << "Warning: Data path set to \"/\", is that really correct?" << std::endl;
+        }
     }
 
@@ -177,4 +235,22 @@
     }
 
+    /**
+    @brief
+        Temporary sets the media path
+    @param path
+        The new media path
+    */
+    void Core::_tsetMediaPath(const std::string& path)
+    {
+        if (*path.end() != '/' && *path.end() != '\\')
+        {
+            ModifyConfigValue(mediaPath_, tset, path + "/");
+        }
+        else
+        {
+            ModifyConfigValue(mediaPath_, tset, path);
+        }
+    }
+
     void Core::initializeRandomNumberGenerator()
     {
@@ -187,3 +263,13 @@
         }
     }
+
+    /*static*/ void Core::setDevBuild()
+    {
+        // Be careful never to call this function before main()!
+
+        Core::isDevBuild_s = true;
+        // Constants taken from OrxonoxConfig.h
+        Core::configPath_s = ORXONOX_CONFIG_DEV_PATH;
+        Core::logPath_s    = ORXONOX_LOG_DEV_PATH;
+    }
 }
Index: code/branches/buildsystem3/src/core/Core.h
===================================================================
--- code/branches/buildsystem3/src/core/Core.h	(revision 2684)
+++ code/branches/buildsystem3/src/core/Core.h	(revision 2685)
@@ -44,4 +44,7 @@
 #include "util/OutputHandler.h"
 
+// Only allow main to access setDevBuild, so we need a forward declaration
+int main(int, char**);
+
 namespace orxonox
 {
@@ -49,10 +52,10 @@
     class _CoreExport Core : public OrxonoxClass
     {
+        friend int ::main(int, char**); // sets isDevBuild_s
+
         public:
             Core();
             ~Core();
             void setConfigValues();
-            void debugLevelChanged();
-            void languageChanged();
 
             static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; }
@@ -62,4 +65,13 @@
             static const std::string& getLanguage();
             static void  resetLanguage();
+
+            static bool isDevBuild() { return Core::isDevBuild_s; }
+
+            static const std::string& getMediaPath()
+            { assert(singletonRef_s); return singletonRef_s->mediaPath_; }
+            static void tsetMediaPath(const std::string& path)
+            { assert(singletonRef_s); singletonRef_s->_tsetMediaPath(path); }
+            static const std::string& getConfigPath() { return configPath_s; }
+            static const std::string& getLogPath()    { return logPath_s; }
 
             // fast access global variables.
@@ -79,4 +91,10 @@
             void resetLanguageIntern();
             void initializeRandomNumberGenerator();
+            void debugLevelChanged();
+            void languageChanged();
+            void mediaPathChanged();
+            void _tsetMediaPath(const std::string& path);
+
+            static void setDevBuild();
 
             int softDebugLevel_;                            //!< The debug level
@@ -85,5 +103,6 @@
             int softDebugLevelShell_;                       //!< The debug level for the ingame shell
             std::string language_;                          //!< The language
-            bool bInitializeRandomNumberGenerator_;          //!< If true, srand(time(0)) is called
+            bool bInitializeRandomNumberGenerator_;         //!< If true, srand(time(0)) is called
+            std::string mediaPath_;                         //!< Path to the data/media file folder
 
             static bool bShowsGraphics_s;                   //!< global variable that tells whether to show graphics
@@ -93,4 +112,8 @@
             static bool bIsMaster_s;
 
+            static bool isDevBuild_s;                       //!< True for builds in the build directory (not installed)
+            static std::string configPath_s;                //!< Path to the config file folder
+            static std::string logPath_s;                   //!< Path to the log file folder
+
             static Core* singletonRef_s;
     };
Index: code/branches/buildsystem3/src/core/Language.cc
===================================================================
--- code/branches/buildsystem3/src/core/Language.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/Language.cc	(revision 2685)
@@ -35,4 +35,5 @@
 
 #include <fstream>
+#include <boost/filesystem.hpp>
 
 #include "Core.h"
@@ -205,12 +206,15 @@
         COUT(4) << "Read default language file." << std::endl;
 
+        boost::filesystem::path folder(Core::getConfigPath());
+        boost::filesystem::path filepath(folder/getFilename(this->defaultLanguage_));
+
         // This creates the file if it's not existing
         std::ofstream createFile;
-        createFile.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::app);
+        createFile.open(filepath.native_file_string().c_str(), std::fstream::app);
         createFile.close();
 
         // Open the file
         std::ifstream file;
-        file.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::in);
+        file.open(filepath.native_file_string().c_str(), std::fstream::in);
 
         if (!file.is_open())
@@ -254,7 +258,10 @@
         COUT(4) << "Read translated language file (" << Core::getLanguage() << ")." << std::endl;
 
+        boost::filesystem::path folder(Core::getConfigPath());
+        boost::filesystem::path filepath(folder/getFilename(Core::getLanguage()));
+
         // Open the file
         std::ifstream file;
-        file.open(getFilename(Core::getLanguage()).c_str(), std::fstream::in);
+        file.open(filepath.native_file_string().c_str(), std::fstream::in);
 
         if (!file.is_open())
@@ -308,7 +315,10 @@
         COUT(4) << "Language: Write default language file." << std::endl;
 
+        boost::filesystem::path folder(Core::getConfigPath());
+        boost::filesystem::path filepath(folder/getFilename(this->defaultLanguage_));
+
         // Open the file
         std::ofstream file;
-        file.open(getFilename(this->defaultLanguage_).c_str(), std::fstream::out);
+        file.open(filepath.native_file_string().c_str(), std::fstream::out);
 
         if (!file.is_open())
Index: code/branches/buildsystem3/src/core/LuaBind.cc
===================================================================
--- code/branches/buildsystem3/src/core/LuaBind.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/LuaBind.cc	(revision 2685)
@@ -37,8 +37,10 @@
 }
 #include <tolua/tolua++.h>
-
+#include <boost/filesystem.hpp>
+
+#include "util/String.h"
+#include "util/Debug.h"
 #include "ToluaBindCore.h"
-#include "util/String.h"
-#include "CoreIncludes.h"
+#include "Core.h"
 
 namespace orxonox
@@ -50,4 +52,6 @@
     assert(LuaBind::singletonRef_s == 0);
     LuaBind::singletonRef_s = this;
+
+    this->includePath_ = Core::getMediaPath();
 
     luaState_ = lua_open();
@@ -82,7 +86,9 @@
   void LuaBind::loadFile(std::string filename, bool luaTags)
   {
+    boost::filesystem::path filepath(filename);
+
     output_ = "";
     std::ifstream file;
-    file.open(filename.c_str(), std::fstream::in);
+    file.open(filepath.native_file_string().c_str(), std::fstream::in);
 
     if (!file.is_open())
Index: code/branches/buildsystem3/src/core/input/KeyBinder.cc
===================================================================
--- code/branches/buildsystem3/src/core/input/KeyBinder.cc	(revision 2684)
+++ code/branches/buildsystem3/src/core/input/KeyBinder.cc	(revision 2685)
@@ -36,4 +36,5 @@
 #include <fstream>
 #include <string>
+#include <boost/filesystem.hpp>
 
 #include "util/Convert.h"
@@ -42,4 +43,5 @@
 #include "core/CoreIncludes.h"
 #include "core/ConfigFileManager.h"
+#include "core/Core.h"
 #include "InputCommands.h"
 #include "InputManager.h"
@@ -253,7 +255,10 @@
             return;
 
+        boost::filesystem::path folder(Core::getConfigPath());
+        boost::filesystem::path filepath(folder/filename);
+
         // get bindings from default file if filename doesn't exist.
         std::ifstream infile;
-        infile.open(filename.c_str());
+        infile.open(filepath.native_file_string().c_str());
         if (!infile)
         {
Index: code/branches/buildsystem3/src/orxonox/CMakeLists.txt
===================================================================
--- code/branches/buildsystem3/src/orxonox/CMakeLists.txt	(revision 2684)
+++ 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 2684)
+++ 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 2684)
+++ 	(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 2684)
+++ 	(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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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 2684)
+++ 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"
Index: code/branches/buildsystem3/src/util/OutputBuffer.cc
===================================================================
--- code/branches/buildsystem3/src/util/OutputBuffer.cc	(revision 2684)
+++ code/branches/buildsystem3/src/util/OutputBuffer.cc	(revision 2685)
@@ -68,7 +68,7 @@
     OutputBuffer& OutputBuffer::operator<<(std::ostream& (*manipulator)(std::ostream&))
     {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
+        this->stream_ << manipulator;
+        this->callListeners();
+        return *this;
     }
 
@@ -79,7 +79,7 @@
     OutputBuffer& OutputBuffer::operator<<(std::ios& (*manipulator)(std::ios&))
     {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
+        this->stream_ << manipulator;
+        this->callListeners();
+        return *this;
     }
 
@@ -90,7 +90,7 @@
     OutputBuffer& OutputBuffer::operator<<(std::ios_base& (*manipulator)(std::ios_base&))
     {
-                this->stream_ << manipulator;
-                this->callListeners();
-                return *this;
+        this->stream_ << manipulator;
+        this->callListeners();
+        return *this;
     }
 
Index: code/branches/buildsystem3/src/util/OutputHandler.cc
===================================================================
--- code/branches/buildsystem3/src/util/OutputHandler.cc	(revision 2684)
+++ code/branches/buildsystem3/src/util/OutputHandler.cc	(revision 2685)
@@ -33,5 +33,7 @@
 
 #include "OutputHandler.h"
-#include <time.h>
+
+#include <ctime>
+#include <cstdlib>
 
 namespace orxonox
@@ -41,9 +43,21 @@
         @param logfilename The name of the logfile
     */
-    OutputHandler::OutputHandler(const std::string& logfilename)
-    {
+    OutputHandler::OutputHandler()
+    {
+#ifdef ORXONOX_PLATFORM_WINDOWS
+        char* pTempDir = getenv("TEMP");
+        this->logfilename_ = std::string(pTempDir) + "/orxonox.log";
+#else
+        this->logfilename_ = "/tmp/orxonox.log";
+#endif
+#ifdef NDEBUG
+        this->softDebugLevel_[LD_All] = this->softDebugLevel_[LD_Logfile] = 2;
+        this->softDebugLevel_[LD_Console] = this->softDebugLevel_[LD_Shell] = 1;
+#else
+        this->softDebugLevel_[LD_All] = this->softDebugLevel_[LD_Logfile] = 3;
+        this->softDebugLevel_[LD_Console] = this->softDebugLevel_[LD_Shell] = 2;
+#endif
+
         this->outputBuffer_ = &this->fallbackBuffer_;
-        this->softDebugLevel_[0] = this->softDebugLevel_[1] = this->softDebugLevel_[2] = this->softDebugLevel_[3] = 2;
-        this->logfilename_ = logfilename;
         this->logfile_.open(this->logfilename_.c_str(), std::fstream::out);
 
@@ -53,5 +67,5 @@
         timeinfo = localtime(&rawtime);
 
-        this->logfile_ << "Started log at " << asctime(timeinfo) << std::endl;
+        this->logfile_ << "Started log on " << asctime(timeinfo) << std::endl;
         this->logfile_.flush();
     }
@@ -72,5 +86,5 @@
     OutputHandler& OutputHandler::getOutStream()
     {
-        static OutputHandler orxout("orxonox.log");
+        static OutputHandler orxout;
         return orxout;
     }
@@ -112,4 +126,21 @@
 
     /**
+        @brief Sets the path where to create orxonox.log
+        @param Path string with trailing slash
+    */
+    void OutputHandler::setLogPath(const std::string& path)
+    {
+        OutputHandler::getOutStream().logfile_.close();
+        // store old content
+        std::ifstream old;
+        old.open(OutputHandler::getOutStream().logfilename_.c_str());
+        OutputHandler::getOutStream().logfilename_ = path + "orxonox.log";
+        OutputHandler::getOutStream().logfile_.open(OutputHandler::getOutStream().logfilename_.c_str(), std::fstream::out);
+        OutputHandler::getOutStream().logfile_ << old.rdbuf();
+        old.close();
+        OutputHandler::getOutStream().logfile_.flush();
+    }
+
+    /**
         @brief Overloaded << operator, redirects the output to the console and the logfile.
         @param sb The streambuffer that should be shown in the console
Index: code/branches/buildsystem3/src/util/OutputHandler.h
===================================================================
--- code/branches/buildsystem3/src/util/OutputHandler.h	(revision 2684)
+++ code/branches/buildsystem3/src/util/OutputHandler.h	(revision 2685)
@@ -101,4 +101,6 @@
             static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All);
 
+            static void setLogPath(const std::string& path);
+
             void setOutputBuffer(OutputBuffer* buffer);
 
@@ -142,6 +144,6 @@
 
         private:
-            explicit OutputHandler(const std::string& logfilename);
-            OutputHandler(const OutputHandler& oh);  // don't copy
+            explicit OutputHandler();
+            OutputHandler(const OutputHandler& oh);
             virtual ~OutputHandler();
 
Index: code/branches/buildsystem3/src/util/SignalHandler.cc
===================================================================
--- code/branches/buildsystem3/src/util/SignalHandler.cc	(revision 2684)
+++ code/branches/buildsystem3/src/util/SignalHandler.cc	(revision 2685)
@@ -159,5 +159,5 @@
       }
 
-      COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox.log" << std::endl;
+      COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "try to write backtrace to file orxonox_crash.log" << std::endl;
 
       int sigPipe[2];
