Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 23, 2009, 8:47:55 PM (15 years ago)
Author:
rgrieder
Message:

Generalised use of tolua interfaces a bit: GSRoot now adds the interface functions to LuaBind which supports two new functions: openToluaInterfaces and closeToluaInterfaces. Both accept a lua state and can therefore be used to inject our own tolua bindings (the GUIManager makes use of that).
There's also something new: When loading a level, you could now use the tolua bindings from Orxonox as well (not just those from Core).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/orxonox/gui/GUIManager.cc

    r3339 r3340  
    5959#include "core/Core.h"
    6060#include "core/Clock.h"
    61 #include "ToluaBindCore.h"
    62 #include "ToluaBindOrxonox.h"
     61#include "core/LuaBind.h"
    6362
    6463namespace orxonox
     
    136135
    137136            // do this after 'new CEGUI::Sytem' because that creates the lua state in the first place
    138             tolua_Core_open(this->scriptModule_->getLuaState());
    139             tolua_Orxonox_open(this->scriptModule_->getLuaState());
     137            LuaBind::getInstance().openToluaInterfaces(this->luaState_);
    140138
    141139            // initialise the basic lua code
     
    162160    {
    163161        // destroy our own tolua interfaces
    164         lua_pushnil(luaState_);
    165         lua_setglobal(luaState_, "Orxonox");
    166         lua_pushnil(luaState_);
    167         lua_setglobal(luaState_, "Core");
     162        LuaBind::getInstance().closeToluaInterfaces(this->luaState_);
    168163
    169164        singletonRef_s = 0;
Note: See TracChangeset for help on using the changeset viewer.