Changeset 200
- Timestamp:
- 08/11/13 18:06:12 (12 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/array2d.hh
r162 r200 330 330 // Copy into THIS array from source the following. 331 331 // Highest row is either the size limit or the end of either array, whichever is smaller. 332 for ( i = 0; i < min( size_y , min ( m_size.y - dest_start_y, source.m_size.y - source_start_y ) ); i++ )332 for ( uint32 i = 0; i < min( size_y , min ( m_size.y - dest_start_y, source.m_size.y - source_start_y ) ); i++ ) 333 333 { 334 334 // Copy the indicated row. … … 338 338 std:copy( source.m_data + ( source_start_y + i ) * source.m_size.x + source_start_x, // Source Start 339 339 source.m_data + ( source_start_y + i ) * source.m_size.x + min( source.m_size.x, min( source_start_x + size_x, source_start_x + m_size.x - dest_start_x ) ), // Source End 340 m_data + (dest_start_y + i) * m_size.x + dest_start_x ) // Destination Start340 m_data + (dest_start_y + i) * m_size.x + dest_start_x ); // Destination Start 341 341 } 342 342 } -
trunk/nv/common.hh
r177 r200 198 198 T narrow_cast(const U& a) 199 199 { 200 return static_cast<T>(a & T( 0xFFFFFFFFFFFFFFFF) );200 return static_cast<T>(a & T(-1) ); 201 201 } 202 202 -
trunk/nv/formats/md5_loader.hh
r198 r200 31 31 int parent_id; 32 32 int flags; 33 intstart_index;33 size_t start_index; 34 34 }; 35 35 typedef std::vector<md5_joint_info> md5_joint_info_list; … … 162 162 struct md5_triangle 163 163 { 164 int indices[3];164 size_t indices[3]; 165 165 }; 166 166 typedef std::vector<md5_triangle> md5_triangle_list; … … 168 168 struct md5_weight 169 169 { 170 intjoint_id;170 size_t joint_id; 171 171 float bias; 172 172 glm::vec3 pos; -
trunk/nv/string.hh
r197 r200 135 135 }; 136 136 template< size_t S > 137 struct string_length< char[S] > 138 { 139 static size_t get( const char[S] ) { return S-1; } 140 }; 141 template< size_t S > 137 142 struct string_length< const char[S] > 138 143 { 139 static size_t get( const char *) { return S-1; }144 static size_t get( const char[S] ) { return S-1; } 140 145 }; 141 146 template<> -
trunk/src/formats/md2_loader.cc
r198 r200 8 8 9 9 #include <glm/gtc/constants.hpp> 10 #include <glm/gtx/string_cast.hpp>11 10 #include "nv/logging.hh" 12 11 #include <cstring> -
trunk/src/formats/md3_loader.cc
r198 r200 8 8 9 9 #include <glm/gtc/constants.hpp> 10 #include <glm/gtx/string_cast.hpp>11 10 #include "nv/logging.hh" 12 11 #include <cstring> … … 457 456 { 458 457 const md3_surface_t& surface = md3->surfaces[i]; 459 const sint32 vcount = surface.header.num_verts;458 const uint32 vcount = static_cast< uint32 >( surface.header.num_verts ); 460 459 t.reserve( t.size() + vcount ); 461 for ( sint32 j = 0; j < vcount; ++j )460 for (uint32 j = 0; j < vcount; ++j ) 462 461 { 463 462 t.push_back( md3_texcoord( surface.st[j] ) ); -
trunk/src/formats/md5_loader.cc
r198 r200 8 8 9 9 #include <glm/gtc/constants.hpp> 10 #include <glm/gtx/string_cast.hpp>11 10 #include "nv/logging.hh" 12 11 #include "nv/io/std_stream.hh" … … 194 193 vert.tangent = glm::vec3(0); 195 194 196 for ( int j = 0; j < vert.weight_count; ++j )195 for ( size_t j = 0; j < vert.weight_count; ++j ) 197 196 { 198 197 md5_weight& weight = mesh.weights[vert.start_weight + j]; … … 246 245 } 247 246 248 for ( unsigned int i = 0; i < mesh.verts.size(); ++i )247 for ( size_t i = 0; i < mesh.verts.size(); ++i ) 249 248 { 250 249 md5_vertex& vert = mesh.verts[i]; … … 258 257 vert.tangent = glm::vec3(0); 259 258 260 for ( int j = 0; j < vert.weight_count; ++j )259 for ( size_t j = 0; j < vert.weight_count; ++j ) 261 260 { 262 261 const md5_weight& weight = mesh.weights[vert.start_weight + j]; … … 455 454 456 455 float frame_num = m_anim_time * (float)m_frame_rate; 457 int frame0 = (int)floorf( frame_num );458 int frame1 = (int)ceilf( frame_num );456 size_t frame0 = (size_t)floorf( frame_num ); 457 size_t frame1 = (size_t)ceilf( frame_num ); 459 458 frame0 = frame0 % m_num_frames; 460 459 frame1 = frame1 % m_num_frames; … … 489 488 if ( animated_joint.parent >= 0 ) // Has a parent joint 490 489 { 491 md5_skeleton_joint& pjoint = skeleton.joints[ animated_joint.parent];490 md5_skeleton_joint& pjoint = skeleton.joints[static_cast< size_t >( animated_joint.parent ) ]; 492 491 glm::vec3 rot_pos = pjoint.orient * animated_joint.pos; 493 492 … … 553 552 tangent = glm::vec3(0); 554 553 555 for ( int j = 0; j < vert.weight_count; ++j )554 for ( size_t j = 0; j < vert.weight_count; ++j ) 556 555 { 557 556 const md5_weight& weight = mesh.weights[vert.start_weight + j];
Note: See TracChangeset
for help on using the changeset viewer.