Changeset 383 for trunk/src/lua


Ignore:
Timestamp:
06/02/15 20:56:15 (10 years ago)
Author:
epyon
Message:
  • more work on stl
  • fully working vectors!
  • copy & copy_n
  • removal of a lot of std code!
Location:
trunk/src/lua
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lua/lua_map_tile.cc

    r378 r383  
    118118                new_tile->ascii = new nv::uchar8[ size ];
    119119        }
    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 );
    122122
    123123        luaL_getmetatable( L, NLUA_MAP_TILE_METATABLE );
     
    237237        map_tile* tile = nlua_to_pmap_tile( L, 1 );
    238238        // 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 );
    241245
    242246        nv::uint16 org_x = tile->size_x;
  • trunk/src/lua/lua_raw.cc

    r380 r383  
    262262}
    263263
    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;
     264nv::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index )
     265{
     266        index = lua_absindex( L, index );
     267        nv::vector<nv::uint8> result;
    268268        if ( lua_istable( L, index ) )
    269269        {
Note: See TracChangeset for help on using the changeset viewer.