Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 8, 2006, 4:50:50 PM (19 years ago)
Author:
bensch
Message:

merge

File:
1 edited

Legend:

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

    r8057 r8271  
    1818#include "executor_lua.h"
    1919
    20 template<> bool fromLua<bool>(lua_state* state, int index) { return lua_toboolean(state, index); };
    21 template<> int fromLua<int>(lua_state* state, int index) { return (int)lua_toumber(state, index); };
    22 template<> unsigned int fromLua<unsigned int>(lua_state* state, int index) { return (unsigned int)lua_tonumber(state, index); };
    23 template<> float fromLua<float>(lua_state* state, int index) { return (float)lua_tonumber(state, index); };
    24 template<> char fromLua<char>(lua_state* state, int index) { reutnr (char)lua_tonumber(state, index); };
    25 template<> const std::string& fromLua<const std::string&>(lua_state* state, int index) { return lua_tostring(state, index); };
     20std::string temp;
     21
     22template<> bool fromLua<bool>(lua_State* state, int index) { return lua_toboolean(state, index); };
     23template<> int fromLua<int>(lua_State* state, int index) { return (int)lua_tonumber(state, index); };
     24template<> unsigned int fromLua<unsigned int>(lua_State* state, int index) { return (unsigned int)lua_tonumber(state, index); };
     25template<> float fromLua<float>(lua_State* state, int index) { return (float)lua_tonumber(state, index); };
     26template<> char fromLua<char>(lua_State* state, int index) { return (char)lua_tonumber(state, index); };
     27template<> const std::string& fromLua<const std::string&>(lua_State* state, int index) { temp = lua_tostring(state, index); return temp; };
    2628
    2729
    2830
    29 template<> void toLua<bool>(lua_state* state, bool value) { lua_pushboolean(state, (int) value); };
    30 template<> void toLua<int>(lua_state* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
    31 template<> void toLua<unsigned int>(lua_state* state, unsigned int value){ lua_pushnumber(state, (lua_Number) value); };
    32 template<> void toLua<float>(lua_state* state, float value) { lua_pushnumber(state, (lua_Number) value); };
    33 template<> void toLua<char>(lua_state* state, char value) { lua_pushnumber(state, (lua_Number) value); };
    34 template<> void toLua<const std::string&>(lua_state* state, const std::string& value) {lua_pushstring (state, value.c_str()); }
     31template<> void toLua<bool>(lua_State* state, bool value) { lua_pushboolean(state, (int) value); };
     32template<> void toLua<int>(lua_State* state, int value)  { lua_pushnumber(state, (lua_Number) value); };
     33template<> void toLua<unsigned int>(lua_State* state, unsigned int value){ lua_pushnumber(state, (lua_Number) value); };
     34template<> void toLua<float>(lua_State* state, float value) { lua_pushnumber(state, (lua_Number) value); };
     35template<> void toLua<char>(lua_State* state, char value) { lua_pushnumber(state, (lua_Number) value); };
     36template<> 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.