Changeset 922 – HoverRace

Changeset 922

Show
Ignore:
Timestamp:
03/15/10 23:46:33 (5 months ago)
Author:
zoogie
Message:

Reimplemented Game:get_on_init() using Luabind.

Location:
trunk/client/Game2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/client/Game2/GamePeer.cpp

    r918 r922  
    5858    module(L) [ 
    5959        class_<GamePeer>("Game") 
     60            .def("get_on_init", &LGetOnInit) 
    6061            .def("on_init", &LOnInit) 
    6162    ]; 
     
    110111} 
    111112 
    112 /*TODO 
    113 int GamePeer::LGetOnInit(lua_State *state) 
     113void GamePeer::LGetOnInit() 
    114114{ 
    115115    // function get_on_init() 
    116116    // Returns the table of on_init callbacks (for debugging purposes). 
    117     SysConsole *self = static_cast<SysConsole*>(lua_touserdata(state, lua_upvalueindex(1))); 
    118117 
    119     lua_rawgeti(state, LUA_REGISTRYINDEX, self->onInitRef);  // table 
    120  
    121     return 1; 
     118    lua_rawgeti(scripting->GetState(), LUA_REGISTRYINDEX, onInitRef);  // table 
    122119} 
    123 */ 
    124120 
    125121}  // namespace Client 
  • trunk/client/Game2/GamePeer.h

    r918 r922  
    5454    public: 
    5555        void LOnInit(const luabind::object &fn); 
    56         /*TODO 
    5756        void LGetOnInit(); 
    58         */ 
    5957 
    6058    private: