Changeset 220
- Timestamp:
- 12/17/13 23:57:51 (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/lua/lua_raw.hh
r198 r220 11 11 #include <istream> 12 12 #include <string> 13 #include <vector> 13 14 #include <map> 14 15 … … 26 27 void nlua_tokeyset( lua_State *L, int index ); 27 28 29 std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index ); 30 28 31 void nlua_register( lua_State *L, const char* fname, lua_CFunction func, int index ); 29 32 void nlua_register( lua_State *L, const luaL_Reg *l, int index ); -
trunk/src/lua/lua_raw.cc
r162 r220 248 248 } 249 249 } 250 251 std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index ) 252 { 253 index = lua_absindex( L, index ); 254 std::vector<nv::uint8> result; 255 if ( lua_istable( L, index ) ) 256 { 257 lua_pushnil( L ); 258 while ( lua_next( L, index ) != 0 ) 259 { 260 result.push_back( (nv::uint8) lua_tointeger( L, -1 ) ); 261 lua_pop( L, 1 ); 262 } 263 } 264 return result; 265 }
Note: See TracChangeset
for help on using the changeset viewer.