Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 20, 2009, 5:32:04 PM (16 years ago)
Author:
rgrieder
Message:

Fixed install target:

  • log and config file go a to separate folder each
  • The SignalHandler crash log is now "orxonox_crash.log" to avoid opening the file twice which might result in problems
  • moved tcl scripts to media/tcl8.#/ as a temporary solution. I've also created a ticket to fix this.
  • UPDATE YOUR MEDIA REPOSITORY
  • orxonox.log pre-main gets written to either %TEMP% (windows) or /tmp (Unix) and when the path was set, the content is copied.
  • removed Settings class and moved media path to Core
  • media, log and config path are now all in Core where only the media path can be configured via ini file or command line
  • Core::isDevBuild() tells whether we are running in the build or the installation directory (determined by the presence of "orxonox_dev_build.kepp_me" in the binary dir)
  • renamed Settings::getDataPath to Core::getMediaPath
Location:
code/branches/buildsystem3/src/orxonox
Files:
2 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/buildsystem3/src/orxonox/CMakeLists.txt

    r2673 r2685  
    2525  PawnManager.cc
    2626  PlayerManager.cc
    27   Settings.cc
    2827)
    2928ADD_SUBDIRECTORY(gamestates)
     
    4342IF(GCC_NO_SYSTEM_HEADER_SUPPORT)
    4443  # Get around displaying a few hundred lines of warning code
    45   SET_SOURCE_FILES_PROPERTIES(gamestates/GSGraphics.cc PROPERTIES COMPILE_FLAGS "-w")
     44  SET_SOURCE_FILES_PROPERTIES(
     45    gamestates/GSGraphics.cc
     46    gui/GUIManager.cc
     47    PROPERTIES COMPILE_FLAGS "-Wno-sign-compare"
     48  )
    4649ENDIF()
    4750
  • code/branches/buildsystem3/src/orxonox/Main.cc

    r2664 r2685  
    3030 /**
    3131 @file
    32  @brief Entry point of the program. Platform specific code.
     32 @brief Entry point of the program.
    3333  */
    3434
     
    3737#include <exception>
    3838#include <cassert>
     39#include <fstream>
    3940
    4041#include "OrxonoxConfig.h"
     
    8586
    8687
    87 //#ifdef __cplusplus
    88 //extern "C" {
    89 //#endif
    90 
    9188SetCommandLineArgument(settingsFile, "orxonox.ini");
     89SetCommandLineArgument(configFileDirectory, "");
    9290
    9391int main(int argc, char** argv)
     
    9593    using namespace orxonox;
    9694
    97     // create a signal handler (only works for linux)
     95    // First, determine whether we have an installed or a binary dir run
     96    // The latter occurs when simply running from the build directory
     97    std::ifstream probe;
     98    probe.open("orxonox_dev_build.keep_me");
     99    if (probe)
     100    {
     101        Core::setDevBuild();
     102        probe.close();
     103    }
     104
     105    // create a signal handler (only active for linux)
    98106    SignalHandler signalHandler;
    99     signalHandler.doCatch(argv[0], "orxonox.log");
     107    signalHandler.doCatch(argv[0], Core::getLogPath() + "orxonox_crash.log");
    100108
    101109    // Parse command line arguments
     
    157165    return 0;
    158166}
    159 
    160 //#ifdef __cplusplus
    161 //}
    162 //#endif
  • code/branches/buildsystem3/src/orxonox/gamestates/GSGraphics.cc

    r2664 r2685  
    6161#include "gui/GUIManager.h"
    6262#include "tools/WindowEventListener.h"
    63 #include "Settings.h"
    6463
    6564// for compatibility
     
    138137        // load debug overlay
    139138        COUT(3) << "Loading Debug Overlay..." << std::endl;
    140         this->debugOverlay_ = new XMLFile(Settings::getDataPath() + "overlay/debug.oxo");
     139        this->debugOverlay_ = new XMLFile(Core::getMediaPath() + "overlay/debug.oxo");
    141140        Loader::open(debugOverlay_);
    142141
     
    211210        delete this->ogreRoot_;
    212211
    213 //#ifdef ORXONOX_PLATFORM_WINDOWS
    214212        // delete the ogre log and the logManager (since we have created it).
    215213        this->ogreLogger_->getDefaultLog()->removeListener(this);
    216214        this->ogreLogger_->destroyLog(Ogre::LogManager::getSingleton().getDefaultLog());
    217215        delete this->ogreLogger_;
    218 //#endif
    219216
    220217        delete graphicsEngine_;
     
    287284        COUT(3) << "Setting up Ogre..." << std::endl;
    288285
    289         // TODO: LogManager doesn't work on oli platform. The why is yet unknown.
    290 //#ifdef ORXONOX_PLATFORM_WINDOWS
     286        if (ogreConfigFile_ == "")
     287        {
     288            COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
     289            ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
     290        }
     291        if (ogreLogFile_ == "")
     292        {
     293            COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
     294            ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
     295        }
     296
     297        boost::filesystem::path ogreConfigFilepath(Core::getConfigPath() + ogreConfigFile_);
     298        boost::filesystem::path ogreLogFilepath(Core::getLogPath() + ogreLogFile_);
     299
    291300        // create a new logManager
     301        // Ogre::Root will detect that we've already created a Log
    292302        ogreLogger_ = new Ogre::LogManager();
    293303        COUT(4) << "Ogre LogManager created" << std::endl;
     
    295305        // create our own log that we can listen to
    296306        Ogre::Log *myLog;
    297         if (this->ogreLogFile_ == "")
    298             myLog = ogreLogger_->createLog("ogre.log", true, false, true);
    299         else
    300             myLog = ogreLogger_->createLog(this->ogreLogFile_, true, false, false);
     307        myLog = ogreLogger_->createLog(ogreLogFilepath.native_file_string(), true, false, false);
    301308        COUT(4) << "Ogre Log created" << std::endl;
    302309
    303310        myLog->setLogDetail(Ogre::LL_BOREME);
    304311        myLog->addListener(this);
    305 //#endif
    306 
    307         // Root will detect that we've already created a Log
     312
    308313        COUT(4) << "Creating Ogre Root..." << std::endl;
    309 
    310         if (ogreConfigFile_ == "")
    311         {
    312             COUT(2) << "Warning: Ogre config file set to \"\". Defaulting to config.cfg" << std::endl;
    313             ModifyConfigValue(ogreConfigFile_, tset, "config.cfg");
    314         }
    315         if (ogreLogFile_ == "")
    316         {
    317             COUT(2) << "Warning: Ogre log file set to \"\". Defaulting to ogre.log" << std::endl;
    318             ModifyConfigValue(ogreLogFile_, tset, "ogre.log");
    319         }
    320314
    321315        // check for config file existence because Ogre displays (caught) exceptions if not
    322316        std::ifstream probe;
    323         probe.open(ogreConfigFile_.c_str());
     317        probe.open(ogreConfigFilepath.native_file_string().c_str());
    324318        if (!probe)
    325319        {
    326320            // create a zero sized file
    327321            std::ofstream creator;
    328             creator.open(ogreConfigFile_.c_str());
     322            creator.open(ogreConfigFilepath.native_file_string().c_str());
    329323            creator.close();
    330324        }
     
    333327
    334328        // Leave plugins file empty. We're going to do that part manually later
    335         ogreRoot_ = new Ogre::Root("", ogreConfigFile_, ogreLogFile_);
    336 
    337 #if 0 // Ogre 1.4.3 doesn't yet support setDebugOutputEnabled(.)
    338 #ifndef ORXONOX_PLATFORM_WINDOWS
    339         // tame the ogre ouput so we don't get all the mess in the console
    340         Ogre::Log* defaultLog = Ogre::LogManager::getSingleton().getDefaultLog();
    341         defaultLog->setDebugOutputEnabled(false);
    342         defaultLog->setLogDetail(Ogre::LL_BOREME);
    343         defaultLog->addListener(this);
    344 #endif
    345 #endif
     329        ogreRoot_ = new Ogre::Root("", ogreConfigFilepath.native_file_string(), ogreLogFilepath.native_file_string());
    346330
    347331        COUT(3) << "Ogre set up done." << std::endl;
     
    377361        try
    378362        {
    379             cf.load(Settings::getDataPath() + resourceFile_);
     363            cf.load(Core::getMediaPath() + resourceFile_);
    380364        }
    381365        catch (...)
     
    403387
    404388                    Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
    405                         std::string(Settings::getDataPath() + archName), typeName, secName);
     389                        std::string(Core::getMediaPath() + archName), typeName, secName);
    406390                }
    407391            }
  • code/branches/buildsystem3/src/orxonox/gamestates/GSLevel.cc

    r2662 r2685  
    4646#include "LevelManager.h"
    4747#include "PlayerManager.h"
    48 #include "Settings.h"
    4948
    5049namespace orxonox
     
    205204        std::string levelName;
    206205        CommandLine::getValue("level", &levelName);
    207         startFile_ = new XMLFile(Settings::getDataPath() + std::string("levels/") + levelName);
     206        startFile_ = new XMLFile(Core::getMediaPath() + std::string("levels/") + levelName);
    208207        Loader::open(startFile_);
    209208    }
  • code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.cc

    r2664 r2685  
    4444#include "tools/Timer.h"
    4545#include "objects/Tickable.h"
    46 #include "Settings.h"
    4746
    4847#ifdef ORXONOX_PLATFORM_WINDOWS
    49 #  ifndef WIN32_LEAN_AND_MEAN
    50 #    define WIN32_LEAN_AND_MEAN
    51 #  endif
    52 #  include "windows.h"
    53 
    54    //Get around Windows hackery
    55 #  ifdef max
    56 #    undef max
    57 #  endif
    58 #  ifdef min
    59 #    undef min
    60 #  endif
     48#  include <winbase.h>
    6149#endif
    6250
    6351namespace orxonox
    6452{
    65     SetCommandLineArgument(dataPath, "").information("PATH");
    6653    SetCommandLineArgument(limitToCPU, 1).information("0: off | #cpu");
    6754
     
    7158        , bPaused_(false)
    7259        , timeFactorPauseBackup_(1.0f)
    73         , settings_(0)
    7460        , tclBind_(0)
    7561        , tclThreadManager_(0)
     
    11399        this->luaBind_ = new LuaBind();
    114100
    115         // instantiate Settings class
    116         this->settings_ = new Settings();
    117 
    118         std::string dataPath = CommandLine::getValue("dataPath");
    119         if (dataPath != "")
    120         {
    121             if (*dataPath.end() != '/' && *dataPath.end() != '\\')
    122                 Settings::tsetDataPath(dataPath + "/");
    123             else
    124                 Settings::tsetDataPath(dataPath);
    125         }
    126 
    127101        // initialise TCL
    128         this->tclBind_ = new TclBind(Settings::getDataPath());
     102        this->tclBind_ = new TclBind(Core::getMediaPath());
    129103        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
    130104
     
    182156        delete this->tclBind_;
    183157
    184         delete this->settings_;
    185158        delete this->luaBind_;
    186159
  • code/branches/buildsystem3/src/orxonox/gamestates/GSRoot.h

    r2662 r2685  
    8181        bool                  bPaused_;
    8282        float                 timeFactorPauseBackup_;
    83         Settings*             settings_;
    8483        TclBind*              tclBind_;
    8584        TclThreadManager*     tclThreadManager_;
  • code/branches/buildsystem3/src/orxonox/gui/GUIManager.cc

    r2664 r2685  
    3636#include "GUIManager.h"
    3737
     38#include <boost/filesystem.hpp>
    3839#include <OgreRenderWindow.h>
    3940#include <OgreRoot.h>
    4041#include <CEGUI.h>
     42#include <CEGUIDefaultLogger.h>
    4143#include <ogreceguirenderer/OgreCEGUIRenderer.h>
    4244#ifdef CEGUILUA_USE_INTERNAL_LIBRARY
     
    148150                this->luaState_ = this->scriptModule_->getLuaState();
    149151
     152                // Create our own logger to specify the filepath
     153                boost::filesystem::path ceguiLogFilepath(Core::getLogPath() + "cegui.log");
     154                this->ceguiLogger_ = new DefaultLogger();
     155                this->ceguiLogger_->setLogFilename(ceguiLogFilepath.native_file_string());
     156                // set the log level according to ours (translate by subtracting 1)
     157                this->ceguiLogger_->setLoggingLevel(
     158                    (LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
     159
    150160                // create the CEGUI system singleton
    151161                this->guiSystem_ = new System(this->guiRenderer_, this->resourceProvider_, 0, this->scriptModule_);
    152 
    153                 // set the log level according to ours (translate by subtracting 1)
    154                 Logger::getSingleton().setLoggingLevel(
    155                     (LoggingLevel)(Core::getSoftDebugLevel(OutputHandler::LD_Logfile) - 1));
    156162
    157163                // do this after 'new CEGUI::Sytem' because that creates the lua state in the first place
  • code/branches/buildsystem3/src/orxonox/gui/GUIManager.h

    r2664 r2685  
    4141#include <CEGUISystem.h>
    4242#include "core/input/InputInterfaces.h"
     43
     44// Forward declaration
     45namespace CEGUI { class DefaultLogger; }
    4346
    4447// tolua_begin
     
    119122        CEGUI::ResourceProvider*  resourceProvider_;
    120123        CEGUI::LuaScriptModule*   scriptModule_;
     124        CEGUI::DefaultLogger*     ceguiLogger_;
    121125        CEGUI::System*            guiSystem_;
    122126        CEGUI::Imageset*          backgroundImage_;
  • code/branches/buildsystem3/src/orxonox/objects/Level.cc

    r2664 r2685  
    3535#include "core/XMLFile.h"
    3636#include "core/Template.h"
     37#include "core/Core.h"
    3738
    38 #include "Settings.h"
    3939#include "LevelManager.h"
    4040#include "objects/infos/PlayerInfo.h"
     
    5555        this->xmlfilename_ = this->getFilename();
    5656
    57         if (this->xmlfilename_.length() >= Settings::getDataPath().length())
    58             this->xmlfilename_ = this->xmlfilename_.substr(Settings::getDataPath().length());
     57        if (this->xmlfilename_.length() >= Core::getMediaPath().length())
     58            this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPath().length());
    5959    }
    6060
     
    9797        mask.include(Class(OverlayGroup)); // HACK to include the ChatOverlay
    9898
    99         this->xmlfile_ = new XMLFile(Settings::getDataPath() + this->xmlfilename_, mask);
     99        this->xmlfile_ = new XMLFile(Core::getMediaPath() + this->xmlfilename_, mask);
    100100
    101101        Loader::open(this->xmlfile_);
  • code/branches/buildsystem3/src/orxonox/objects/gametypes/Gametype.cc

    r2662 r2685  
    4343#include "objects/worldentities/SpawnPoint.h"
    4444#include "objects/worldentities/Camera.h"
    45 #include "Settings.h"
    4645
    4746#include "network/Host.h"
Note: See TracChangeset for help on using the changeset viewer.