Changeset 8385 in orxonox.OLD for branches/script_engine/src/lib
- Timestamp:
- Jun 14, 2006, 2:21:59 PM (19 years ago)
- Location:
- branches/script_engine/src/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/script_engine/src/lib/script_engine/lunar.h
r8271 r8385 172 172 static int new_T(lua_State *L) { 173 173 lua_remove(L, 1); // use classname:new(), instead of classname.new() 174 T *obj = new T( L); // call constructor for T objects174 T *obj = new T(); // call constructor for T objects 175 175 push(L, obj, true); // gc_T will delete this object 176 176 return 1; // userdata containing pointer to T object -
branches/script_engine/src/lib/script_engine/script_manager.cc
r8289 r8385 38 38 void ScriptManager::loadParams(const TiXmlElement* root) 39 39 { 40 //BaseObject::loadParams(root);40 BaseObject::loadParams(root); 41 41 { 42 42 LoadParamXML(root, "Scripts", this, ScriptManager, createScripts); -
branches/script_engine/src/lib/util/executor/executor_lua.cc
r8271 r8385 20 20 std::string temp; 21 21 22 template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); return obj;}; 22 23 template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); }; 23 24 template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); }; … … 28 29 29 30 30 31 template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); }; 31 32 template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); }; 32 33 template<> void toLua<int>(lua_State* state, int value) { lua_pushnumber(state, (lua_Number) value); }; -
branches/script_engine/src/lib/util/executor/executor_lua.h
r8271 r8385 11 11 #include "debug.h" 12 12 #include "luaincl.h" 13 14 15 16 template<typename type> type fromLua(lua_State* state, int index) { PRINTF(1)("NOT IMPLEMENTED\n"); }; 13 #include "lunar.h" 14 15 16 17 template<typename type> type fromLua(lua_State* state, int index); 17 18 template<> bool fromLua<bool>(lua_State* state, int index); 18 19 template<> int fromLua<int>(lua_State* state, int index); … … 23 24 24 25 25 template<typename type> void toLua(lua_State* state, type value) { PRINTF(1)("NOT IMPLEMENTED\n"); };26 template<typename type> void toLua(lua_State* state, type value); 26 27 template<> void toLua<bool>(lua_State* state, bool value); 27 28 template<> void toLua<int>(lua_State* state, int value);
Note: See TracChangeset
for help on using the changeset viewer.