Changeset 8271 in orxonox.OLD for trunk/src/lib/script_engine/lunar.h
- Timestamp:
- Jun 8, 2006, 4:50:50 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/script_engine/lunar.h
r8061 r8271 3 3 4 4 #include <string> 5 #include "Script.h" 5 #include <cassert> 6 #include "script.h" 6 7 7 8 #include "luaincl.h" 9 #include "executor/executor_lua.h" 8 10 9 11 … … 12 14 typedef struct { T *pT; } userdataType; 13 15 public: 14 typedef int (T::*mfp)(lua_State *L);16 typedef Executor* mfp; 15 17 typedef struct { const char *name; mfp mfunc; } RegType; 16 18 … … 139 141 static int insertObject(Script* script, T* obj, const std::string& name, bool gc=false) 140 142 { 141 if(script != NULL) 142 return insertObject(script->getLuaState(), obj, name, gc); 143 144 143 assert (script != NULL); 144 return insertObject(script->getLuaState(), obj, name, gc); 145 145 } 146 146 … … 163 163 // get member function from upvalue 164 164 RegType *l = static_cast<RegType*>(lua_touserdata(L, lua_upvalueindex(1))); 165 return (obj->*(l->mfunc))(L); // call member function 165 int value; 166 (*l->mfunc)(obj, value, L); // call member function 167 return value; 166 168 } 167 169
Note: See TracChangeset
for help on using the changeset viewer.