Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 1, 2006, 1:30:11 PM (18 years ago)
Author:
bensch
Message:

trunk: some lua-stuff

File:
1 edited

Legend:

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

    r8051 r8057  
    1818#include "executor_lua.h"
    1919
    20 template<> bool fromLua<bool>(lua_state* state) { return lua_tonumber(state); };
    21 template<> int fromLua<int>(lua_state* state);
    22 template<> unsigned int fromLua<unsigned int>(lua_state* state);
    23 template<> float fromLua<float>(lua_state* state);
    24 template<> char fromLua<char>(lua_state* state);
    25 template<> const std::string& fromLua<const std::string&>(lua_state* state);
     20template<> bool fromLua<bool>(lua_state* state, int index) { return lua_toboolean(state, index); };
     21template<> int fromLua<int>(lua_state* state, int index) { return (int)lua_toumber(state, index); };
     22template<> unsigned int fromLua<unsigned int>(lua_state* state, int index) { return (unsigned int)lua_tonumber(state, index); };
     23template<> float fromLua<float>(lua_state* state, int index) { return (float)lua_tonumber(state, index); };
     24template<> char fromLua<char>(lua_state* state, int index) { reutnr (char)lua_tonumber(state, index); };
     25template<> const std::string& fromLua<const std::string&>(lua_state* state, int index) { return lua_tostring(state, index); };
    2626
     27
     28
     29template<> void toLua<bool>(lua_state* state, bool value) { lua_pushboolean(state, (int) value); };
     30template<> void toLua<int>(lua_state* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
     31template<> void toLua<unsigned int>(lua_state* state, unsigned int value){ lua_pushnumber(state, (lua_Number) value); };
     32template<> void toLua<float>(lua_state* state, float value) { lua_pushnumber(state, (lua_Number) value); };
     33template<> void toLua<char>(lua_state* state, char value) { lua_pushnumber(state, (lua_Number) value); };
     34template<> void toLua<const std::string&>(lua_state* state, const std::string& value) {lua_pushstring (state, value.c_str()); }
Note: See TracChangeset for help on using the changeset viewer.