Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 17, 2009, 4:37:10 PM (15 years ago)
Author:
rgrieder
Message:
  • Implemented file management via resource manager and loading of resource locations via XML. Changes made:
    • SoundManager loads via memory stream rather than via file
    • Loader uses LuaState::includeFile() to load an XML file and passes the lua tag remover function to its LuaState.
    • ConfigFileManager still loads with hard paths because the files are required before Ogre gets created
  • Renamed LuaBind to LuaState, deSingletonised it and added new features:
    • doFile(), doString(), includeFile(), includeString() where include will preparse the string with a function provided with LuaState::setIncludeParser
    • Moved lua tags replace function to Loader (since it's actually an XML related task)
    • Using data_path/lua/LuaInitScript.lua to provide the following functions
      • logMessage(level, message)
      • doFile, dofile, include (all working with relative paths but within the same resource group)
  • Modified Script class to work with LuaState and fixed its XML Loader
  • Adjusted all level and include files (both "include" and "dofile" lua commands)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/Core.cc

    r5645 r5654  
    7474#include "Identifier.h"
    7575#include "Language.h"
    76 #include "LuaBind.h"
     76#include "LuaState.h"
    7777#include "Shell.h"
    7878#include "TclBind.h"
    7979#include "TclThreadManager.h"
     80#include "ToluaBindCore.h"
    8081#include "input/InputManager.h"
    8182
     
    266267            setThreadAffinity(static_cast<unsigned int>(limitToCPU));
    267268#endif
     269        // Add tolua interface
     270        LuaState::addToluaInterface(&tolua_Core_open, "Core");
    268271
    269272        // Manage ini files and set the default settings file (usually orxonox.ini)
     
    275278        this->languageInstance_.reset(new Language());
    276279
     280        // creates the class hierarchy for all classes with factories
     281        Factory::createClassHierarchy();
     282
    277283        // Do this soon after the ConfigFileManager has been created to open up the
    278284        // possibility to configure everything below here
    279285        this->configuration_->initialise();
    280286
    281         // Create the lua interface
    282         this->luaBind_.reset(new LuaBind());
     287        // Load OGRE excluding the renderer and the render window
     288        this->graphicsManager_.reset(new GraphicsManager(false));
    283289
    284290        // initialise Tcl
     
    288294        // create a shell
    289295        this->shell_.reset(new Shell());
    290 
    291         // creates the class hierarchy for all classes with factories
    292         Factory::createClassHierarchy();
    293 
    294         // Load OGRE excluding the renderer and the render window
    295         this->graphicsManager_.reset(new GraphicsManager(false));
    296296    }
    297297
    298298    /**
    299299    @brief
    300         All destruction code is handled by scoped_ptrs and SimpleScopeGuards.
     300        All destruction code is handled by scoped_ptrs and ScopeGuards.
    301301    */
    302302    Core::~Core()
     
    561561            COUT(1) << "Running from the build tree." << std::endl;
    562562            Core::bDevRun_ = true;
    563             configuration_->dataPath_  = specialConfig::dataDevDirectory;
     563            configuration_->dataPath_   = specialConfig::dataDevDirectory;
    564564            configuration_->externalDataPath_ = specialConfig::externalDataDevDirectory;
    565565            configuration_->configPath_ = specialConfig::configDevDirectory;
     
    579579
    580580            // Using paths relative to the install prefix, complete them
    581             configuration_->dataPath_  = configuration_->rootPath_ / specialConfig::defaultDataPath;
     581            configuration_->dataPath_   = configuration_->rootPath_ / specialConfig::defaultDataPath;
    582582            configuration_->configPath_ = configuration_->rootPath_ / specialConfig::defaultConfigPath;
    583583            configuration_->logPath_    = configuration_->rootPath_ / specialConfig::defaultLogPath;
Note: See TracChangeset for help on using the changeset viewer.