Changeset 441
- Timestamp:
- 07/24/15 11:13:32 (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/base/capi.hh
r436 r441 102 102 inline void* nvmemcpy( void *dest, const void *src, size_t count ) 103 103 { 104 if ( dest == src ) return dest; 104 105 return NV_CAPI_CALL( memcpy )( dest, src, count ); 105 106 } … … 107 108 inline void* nvmemmove( void *dest, const void *src, size_t count ) 108 109 { 110 if ( dest == src ) return dest; 109 111 return NV_CAPI_CALL( memmove )( dest, src, count ); 110 112 } -
trunk/nv/gfx/skeletal_mesh.hh
r431 r441 11 11 #include <nv/interface/context.hh> 12 12 #include <nv/interface/animated_mesh.hh> 13 #include <nv/formats/md5_loader.hh>14 13 #include <nv/formats/nmd_loader.hh> 14 #include <nv/stl/array.hh> 15 15 16 16 namespace nv 17 17 { 18 19 // TODO: remove or make generic 20 struct md5_vtx_pnt 21 { 22 vec3 position; 23 vec3 normal; 24 vec3 tangent; 25 }; 26 27 // TODO: remove or make generic 28 struct md5_key_t 29 { 30 transform tform; 31 }; 32 33 // TODO: remove or make generic 34 struct md5_vtx_t 35 { 36 vec2 texcoord; 37 }; 38 39 // TODO: remove or make generic 40 struct md5_vtx_pntiw 41 { 42 vec3 position; 43 vec3 normal; 44 vec3 tangent; 45 ivec4 boneindex; 46 vec4 boneweight; 47 }; 48 49 18 50 class skeletal_mesh : public animated_mesh 19 51 { -
trunk/nv/lua/lua_raw.hh
r437 r441 29 29 } 30 30 31 // TODO: this is not thread safe! 32 nv::string_view nlua_typecontent( lua_State* L, int idx ); 31 nv::string64 nlua_typecontent( lua_State* L, int idx ); 33 32 void nlua_shallowmerge( lua_State *L, int index ); 34 33 void nlua_shallowcopy( lua_State *L, int index ); -
trunk/nv/stl/algorithm/raw.hh
r403 r441 34 34 T* raw_copy( const T* first, const T* last, T* out ) 35 35 { 36 NV_ASSERT_DEBUG( last - first > 0, "raw_copy range fail!" );36 NV_ASSERT_DEBUG( last - first >= 0, "raw_copy range fail!" ); 37 37 return static_cast<T*>( nvmemcpy( out, first, detail::byte_distance( first, last ) ) ) + ( last - first ); 38 38 } … … 47 47 T* raw_alias_copy( const T* first, const T* last, T* out ) 48 48 { 49 NV_ASSERT_DEBUG( last - first > 0, "raw_alias_copy range fail!" );49 NV_ASSERT_DEBUG( last - first >= 0, "raw_alias_copy range fail!" ); 50 50 return static_cast<T*>( nvmemmove( out, first, detail::byte_distance( first, last ) ) ) + ( last - first ); 51 51 } … … 60 60 T* raw_zero( T* first, T* last ) 61 61 { 62 NV_ASSERT_DEBUG( last - first > 0, "raw_zero range fail!" );62 NV_ASSERT_DEBUG( last - first >= 0, "raw_zero range fail!" ); 63 63 return static_cast<T*>( nvmemset( first, 0, detail::byte_distance( first, last ) ) ) + ( last - first ); 64 64 } … … 73 73 T* raw_fill( T* first, T* last, unsigned char value ) 74 74 { 75 NV_ASSERT_DEBUG( last - first > 0, "raw_fill range fail!" );75 NV_ASSERT_DEBUG( last - first >= 0, "raw_fill range fail!" ); 76 76 return static_cast<T*>( nvmemset( first, value, detail::byte_distance( first, last ) ) ) + ( last - first ); 77 77 } -
trunk/nv/stl/string/short_string.hh
r440 r441 145 145 } 146 146 147 iterator erase( iterator position ) 148 { 149 iterator result = Storage::erase( position ); 150 this->data()[this->size()] = 0; 151 return result; 152 } 153 154 iterator erase( iterator first, iterator last ) 155 { 156 iterator result = Storage::erase( first, last ); 157 this->data()[this->size()] = 0; 158 return result; 159 } 160 147 161 protected: 148 162 … … 163 177 using Storage::assign; 164 178 using Storage::insert; 165 using Storage::erase;166 179 using Storage::pop_back; 167 180 using Storage::push_back; -
trunk/src/lua/lua_map_tile.cc
r440 r441 17 17 #include "nv/lua/lua_raw.hh" 18 18 19 // TODO: REMOVE20 #include <string>21 22 19 static const char* NLUA_MAP_TILE_METATABLE = "map_tile"; 23 20 … … 58 55 nv::map_area* map_area = nv::lua::detail::to_map_area( L, 3 ); 59 56 lua_settop( L, 2 ); 60 nv::string_view lts = nv::trimmed( lua_tostring( L, 1 ) ); 61 std::string code( lts.data(), lts.size() ); 62 std::string chars( " \r\t" ); 57 nv::string_buffer code( nv::trimmed( lua_tostring( L, 1 ) ) ); 58 nv::string_view chars( " \r\t" ); 63 59 code.erase( nv::remove_if( code.begin(), code.end(), 64 60 [&chars] ( const char& c ) 65 61 { 66 return chars.find( c ) != std::string::npos;62 return chars.find( c ) != nv::string_view::npos; 67 63 } ), code.end() ); 68 64 -
trunk/src/lua/lua_raw.cc
r438 r441 7 7 #include "nv/lua/lua_raw.hh" 8 8 9 nv::string _viewnlua_typecontent( lua_State* L, int idx )9 nv::string64 nlua_typecontent( lua_State* L, int idx ) 10 10 { 11 11 int type = lua_type( L, idx ); 12 12 switch ( type ) 13 13 { 14 case LUA_TNONE : return "NONE"; 15 case LUA_TNIL : return "NIL"; 16 case LUA_TBOOLEAN : return lua_toboolean( L, idx ) == 0 ? "false" : "true"; 17 //case LUA_TLIGHTUSERDATA : return std::to_string( nv::uint64( lua_touserdata( L, idx ) ) ); 18 //case LUA_TNUMBER : return std::to_string( lua_tonumber( L, idx ) ); 19 // TODO: copy to buffer? 20 case LUA_TSTRING : return nlua_tostringview( L, idx ); 21 case LUA_TTABLE : return "TABLE"; 22 case LUA_TFUNCTION : return "FUNCTION"; 23 // case LUA_TUSERDATA : return std::to_string( nv::uint64( lua_touserdata( L, idx ) ) ); 24 case LUA_TTHREAD : return "THREAD"; 14 case LUA_TNONE : return nv::string64( "NONE" ); 15 case LUA_TNIL : return nv::string64( "NIL" ); 16 case LUA_TBOOLEAN : return nv::string64( lua_toboolean( L, idx ) == 0 ? "false" : "true" ); 17 case LUA_TSTRING : return nv::string64( nlua_tostringview( L, idx ) ); 18 case LUA_TTABLE : return nv::string64( "TABLE" ); 19 case LUA_TFUNCTION : return nv::string64( "FUNCTION" ); 20 case LUA_TTHREAD : return nv::string64( "THREAD" ); 25 21 default : break; 26 22 } 27 static char buffer_data[64];28 nv::array_ref< char > buffer( buffer_data, 64 );29 23 if ( type == LUA_TLIGHTUSERDATA || type == LUA_TUSERDATA ) 30 24 { 25 nv::string64 buffer; 31 26 size_t l = nv::uint64_to_buffer( buffer, nv::uint64( lua_touserdata( L, idx ) ) ); 32 return nv::string_view( buffer.data(), l );27 return buffer; 33 28 } 34 29 else if ( type == LUA_TNUMBER ) 35 30 { 31 nv::string64 buffer; 36 32 size_t l = nv::f64_to_buffer( buffer, lua_tonumber( L, idx ) ); 37 return nv::string_view( buffer.data(), l );38 } 39 return "UNKNOWN!";33 return buffer; 34 } 35 return nv::string64( "UNKNOWN!" ); 40 36 } 41 37
Note: See TracChangeset
for help on using the changeset viewer.