Changeset 383 for trunk/src/lua
- Timestamp:
- 06/02/15 20:56:15 (10 years ago)
- Location:
- trunk/src/lua
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_map_tile.cc
r378 r383 118 118 new_tile->ascii = new nv::uchar8[ size ]; 119 119 } 120 std::copy( old_tile->data, old_tile->data +size, new_tile->data );121 if ( old_tile->ascii ) std::copy( old_tile->ascii, old_tile->ascii +size, new_tile->ascii );120 nv::raw_copy_n( old_tile->data, size, new_tile->data ); 121 if ( old_tile->ascii ) nv::raw_copy_n( old_tile->ascii, size, new_tile->ascii ); 122 122 123 123 luaL_getmetatable( L, NLUA_MAP_TILE_METATABLE ); … … 237 237 map_tile* tile = nlua_to_pmap_tile( L, 1 ); 238 238 // assert( tile^.ascii == nullptr ); 239 std::vector< nv::uint8 > sizes_x = nlua_tobytearray( L, 2 ); 240 std::vector< nv::uint8 > sizes_y = ( lua_istable( L, 3 ) ? nlua_tobytearray( L, 3 ) : sizes_x ); 239 nv::vector< nv::uint8 > sizes_x = nlua_tobytearray( L, 2 ); 240 nv::vector< nv::uint8 > sizes_y; 241 if ( lua_istable( L, 3 ) ) 242 sizes_y = nlua_tobytearray( L, 2 ); 243 else 244 sizes_y.assign( sizes_x ); 241 245 242 246 nv::uint16 org_x = tile->size_x; -
trunk/src/lua/lua_raw.cc
r380 r383 262 262 } 263 263 264 std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index )265 { 266 index = lua_absindex( L, index ); 267 std::vector<nv::uint8> result;264 nv::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index ) 265 { 266 index = lua_absindex( L, index ); 267 nv::vector<nv::uint8> result; 268 268 if ( lua_istable( L, index ) ) 269 269 {
Note: See TracChangeset
for help on using the changeset viewer.