Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 17, 2006, 7:55:59 PM (18 years ago)
Author:
bensch
Message:

orxonox/script_engine: namespace OrxScript introduced

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/script_engine/src/lib/script_engine/This.h

    r7645 r7653  
    66
    77// Sets the "this" global table that scripts use
     8namespace OrxScript
     9{
    810
    9 class LuaThis
    10 {
     11  class LuaThis
     12  {
    1113  public:
    1214    LuaThis (LuaVirtualMachine& vm, int iRef) : oldReference (0), virtualMachine (vm)
     
    1517      if (vm.isOk ())
    1618      {
    17          // Save the old "this" table
     19        // Save the old "this" table
    1820        lua_getglobal (state, "this");
    1921        oldReference = luaL_ref (state, LUA_REGISTRYINDEX);
    2022
    21          // replace it with our new one
     23        // replace it with our new one
    2224        lua_rawgeti(state, LUA_REGISTRYINDEX, iRef);
    2325        lua_setglobal (state, "this");
     
    3032      if (oldReference > 0 && virtualMachine.isOk ())
    3133      {
    32          // Replace the old "this" table
     34        // Replace the old "this" table
    3335        lua_rawgeti(state, LUA_REGISTRYINDEX, oldReference);
    3436        lua_setglobal (state, "this");
     
    4143    int oldReference;
    4244    LuaVirtualMachine& virtualMachine;
    43 };
    44 
     45  };
     46}
    4547#endif // __THIS_H__
Note: See TracChangeset for help on using the changeset viewer.