Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8408 in orxonox.OLD for trunk/src/lib/util/executor/executor_lua.cc


Ignore:
Timestamp:
Jun 14, 2006, 5:50:18 PM (19 years ago)
Author:
bensch
Message:

trunk: merged the script_engine branche back here
merged with command
svn merge https://svn.orxonox.net/orxonox/branches/script_engine . -r8284:HEAD
no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/executor/executor_lua.cc

    r8271 r8408  
    1818#include "executor_lua.h"
    1919
    20 std::string temp;
     20#include "lunar.h"
    2121
     22std::string temp[5];
     23
     24template<typename type> type* fromLua(lua_State* state, int index) { type *obj = Lunar<type>::check(state, 1); lua_remove(state, 1); return obj;};
    2225template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); };
    2326template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); };
     
    2528template<> float fromLua<float>(lua_State* state, int index) { return (float)lua_tonumber(state, index); };
    2629template<> 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; };
     30template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp[index] = lua_tostring(state, index); return temp[index]; };
    2831
    2932
    30 
     33template<typename type> void toLua(lua_State* state, type value) { Lunar<type>::push(state, value, false); };
    3134template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); };
    3235template<> void toLua<int>(lua_State* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
Note: See TracChangeset for help on using the changeset viewer.