Changeset 8408 in orxonox.OLD for trunk/src/lib/util/executor/executor_lua.cc
- Timestamp:
- Jun 14, 2006, 5:50:18 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/executor/executor_lua.cc
r8271 r8408 18 18 #include "executor_lua.h" 19 19 20 std::string temp; 20 #include "lunar.h" 21 21 22 std::string temp[5]; 23 24 template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); lua_remove(state, 1); return obj;}; 22 25 template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); }; 23 26 template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); }; … … 25 28 template<> float fromLua<float>(lua_State* state, int index) { return (float)lua_tonumber(state, index); }; 26 29 template<> char fromLua<char>(lua_State* state, int index) { return (char)lua_tonumber(state, index); }; 27 template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp = lua_tostring(state, index); return temp; };30 template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp[index] = lua_tostring(state, index); return temp[index]; }; 28 31 29 32 30 33 template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); }; 31 34 template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); }; 32 35 template<> void toLua<int>(lua_State* state, int value) { lua_pushnumber(state, (lua_Number) value); };
Note: See TracChangeset
for help on using the changeset viewer.