Index: trunk/src/formats/md3_loader.cc
===================================================================
--- trunk/src/formats/md3_loader.cc	(revision 319)
+++ trunk/src/formats/md3_loader.cc	(revision 323)
@@ -234,5 +234,5 @@
 
 md3_loader::md3_loader( bool merge_all )
-	: m_md3( nullptr ), m_merge_all( merge_all )
+	: m_merge_all( merge_all ), m_md3( nullptr )
 {
 	if ( !s_normal_ready )
@@ -286,5 +286,5 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	key_raw_channel* result = key_raw_channel::create<md3_key>( md3->header.num_frames );
+	key_raw_channel* result = key_raw_channel::create<md3_key>( (uint32)md3->header.num_frames );
 	// TODO: is this brain damaged in efficiency (loop nest order) or what?
 	for ( sint32 f = 0; f < md3->header.num_frames; ++f )
@@ -322,5 +322,5 @@
 {
 	mesh_data* data = new mesh_data;
-	release_mesh_frame( data, -1, index );
+	release_mesh_frame( data, -1, (sint32)index );
 	return data;
 }
@@ -329,22 +329,22 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	sint32 num_surfaces  = md3->header.num_surfaces;
-	sint32 num_verts     = 0;
-	sint32 current_frame = ( frame == -1 ? 0 : frame );
-	sint32 frame_count   = ( frame == -1 ? md3->header.num_frames : 1 );
-	sint32 current_surf  = ( surface == -1 ? 0 : surface );
-	sint32 surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
-	sint32 index_count   = 0;
+	uint32 num_surfaces  = (uint32)md3->header.num_surfaces;
+	uint32 num_verts     = 0;
+	uint32 current_frame = ( frame == -1 ? 0 : (uint32)frame );
+	uint32 frame_count   = ( frame == -1 ? (uint32)md3->header.num_frames : 1 );
+	uint32 current_surf  = ( surface == -1 ? 0 : (uint32)surface );
+	uint32 surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
+	uint32 index_count   = 0;
 
 	if ( surface >= 0 )
 	{
-		index_count = md3->surfaces[surface].header.num_triangles * 3;
-		num_verts   = md3->surfaces[surface].header.num_verts;
+		index_count = (uint32)md3->surfaces[(uint32)surface].header.num_triangles * 3;
+		num_verts   = (uint32)md3->surfaces[(uint32)surface].header.num_verts;
 	}
 	else
-		for ( sint32 i = 0; i < num_surfaces; ++i )
-		{
-			index_count += md3->surfaces[i].header.num_triangles * 3;
-			num_verts   += md3->surfaces[i].header.num_verts;
+		for ( uint32 i = 0; i < num_surfaces; ++i )
+		{
+			index_count += (uint32)md3->surfaces[i].header.num_triangles * 3;
+			num_verts   += (uint32)md3->surfaces[i].header.num_verts;
 		}
 
@@ -362,21 +362,21 @@
 	while ( surf_count > 0 )
 	{
-		const md3_surface_t& surface = md3->surfaces[ current_surf ];
-		const uint32         vcount  = static_cast< uint32 >( surface.header.num_verts );
-		const uint32         tcount  = static_cast< uint32 >( surface.header.num_triangles );
+		const md3_surface_t& sface  = md3->surfaces[ current_surf ];
+		const uint32         vcount = static_cast< uint32 >( sface.header.num_verts );
+		const uint32         tcount = static_cast< uint32 >( sface.header.num_triangles );
 
 		for (uint32 j = 0; j < vcount; ++j )
 		{
-			vtx_t[index++].texcoord = md3_texcoord( surface.st[j] );
+			vtx_t[index++].texcoord = md3_texcoord( sface.st[j] );
 		}
 
 		for (size_t j = 0; j < tcount; ++j )
 		{
-			const md3_triangle_t& t = surface.triangles[j];
+			const md3_triangle_t& t = sface.triangles[j];
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[0] );
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[1] );
 			icp[iindex++] = static_cast< uint16 >( index_base + t.indexes[2] );
 		}
-		index_base += surface.header.num_verts;
+		index_base += sface.header.num_verts;
 		++current_surf;
 		--surf_count;
@@ -386,16 +386,16 @@
 	while ( frame_count > 0 )
 	{
-		current_surf  = ( surface == -1 ? 0 : surface );
-		surf_count    = ( surface == -1 ? md3->header.num_surfaces : 1 );
+		current_surf  = ( surface == -1 ? 0 : (uint32)surface );
+		surf_count    = ( surface == -1 ? (uint32)md3->header.num_surfaces : 1 );
 
 		while ( surf_count > 0 )
 		{
-			md3_surface_t& surface = md3->surfaces[current_surf];
-			sint32         vcount  = surface.header.num_verts;
-			sint32         offset  = vcount * current_frame;
-			sint32         limit   = vcount + offset;
-			for (sint32 j = offset; j < limit; ++j )
+			md3_surface_t& sface  = md3->surfaces[current_surf];
+			uint32         vcount = (uint32)sface.header.num_verts;
+			uint32         offset = vcount * current_frame;
+			uint32         limit  = vcount + offset;
+			for (uint32 j = offset; j < limit; ++j )
 			{
-				md3_vertex_t& v = surface.vertices[j];
+				md3_vertex_t& v = sface.vertices[j];
 				vtx_pn[index].position = vec3( v.x * MD3_XYZ_SCALE, v.z * MD3_XYZ_SCALE, v.y * MD3_XYZ_SCALE );
 				vtx_pn[index].normal   = s_normal_cache[ v.normal ];
@@ -418,5 +418,5 @@
 {
 	md3_t* md3 = (md3_t*)m_md3;
-	uint32 node_count = md3->header.num_tags;
+	uint32 node_count = (uint32)md3->header.num_tags;
 	if ( node_count == 0 ) return nullptr;;
 	mesh_node_data* nodes = new mesh_node_data[ node_count ];
@@ -451,9 +451,9 @@
 	else
 	{
-		count = md3->header.num_surfaces;
+		count = (uint32)md3->header.num_surfaces;
 		data = new mesh_data[ count ];
 		for ( uint32 i = 0; i < count; ++i )
 		{
-			release_mesh_frame( &data[i], -1, i );
+			release_mesh_frame( &data[i], -1, (sint32)i );
 			data[i].set_name( (char*)md3->surfaces[i].header.name );
 		}
