Changeset 323 for trunk/src/gfx
- Timestamp:
- 08/26/14 04:03:10 (11 years ago)
- Location:
- trunk/src/gfx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gfx/image.cc
r319 r323 89 89 fill( r, 255 ); 90 90 91 sint32 bpos = (r.pos.y*m_size.x + r.pos.x ) * static_cast<sint32>( m_depth );92 sint32 bline = m_size.x*static_cast<sint32>( m_depth );91 uint32 bpos = static_cast< uint32 >( r.pos.y*m_size.x + r.pos.x ) * m_depth; 92 uint32 bline = static_cast< uint32 >( m_size.x ) * m_depth; 93 93 94 uint32 rsizex = static_cast< uint32 >( r.size.x ); 95 uint32 rsizey = static_cast< uint32 >( r.size.y ); 94 96 const uint8* data = idata->get_data(); 95 si nt32depth = idata->get_depth();96 sint32 dstride = r.size.x * static_cast<sint32>( depth );97 size_t depth = idata->get_depth(); 98 uint32 dstride = rsizex * depth; 97 99 98 for( int y = 0; y < r.size.y; ++y )100 for( uint32 y = 0; y < rsizey; ++y ) 99 101 { 100 sint32 pos = bpos + bline * y;101 for( int x = 0; x < r.size.x; ++x )102 uint32 pos = bpos + bline * y; 103 for( uint32 x = 0; x < rsizex; ++x ) 102 104 { 103 sint32 xy = pos + x * m_depth;104 for( int e = 0; e < depth; ++e )105 uint32 xy = pos + x * m_depth; 106 for( size_t e = 0; e < depth; ++e ) 105 107 { 106 108 m_data[ xy + e ] = data[ y*dstride + x * depth + e ]; -
trunk/src/gfx/mesh_creator.cc
r302 r323 128 128 const vertex_descriptor& desc = channel->desc; 129 129 uint8* raw_data = channel->data; 130 intvtx_size = desc.size;130 uint32 vtx_size = desc.size; 131 131 int p_offset = -1; 132 132 int n_offset = -1; … … 135 135 switch ( desc.slots[i].vslot ) 136 136 { 137 case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = desc.slots[i].offset; break;138 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = desc.slots[i].offset; break;139 case slot::TANGENT : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = desc.slots[i].offset; break;137 case slot::POSITION : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) p_offset = (int)desc.slots[i].offset; break; 138 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) n_offset = (int)desc.slots[i].offset; break; 139 case slot::TANGENT : if ( desc.slots[i].etype == FLOAT_VECTOR_4 ) t_offset = (int)desc.slots[i].offset; break; 140 140 default : break; 141 141 } … … 173 173 size_t n_offset = 0; 174 174 if ( ch_n == -1 ) return; 175 mesh_raw_channel* channel = m_data->m_channels[ ch_n];175 mesh_raw_channel* channel = m_data->m_channels[ (unsigned) ch_n ]; 176 176 for ( uint32 i = 0; i < channel->desc.count; ++i ) 177 177 if ( channel->desc.slots[i].vslot == slot::NORMAL ) … … 211 211 if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 212 212 { 213 p_offset = desc.slots[i].offset;213 p_offset = (int)desc.slots[i].offset; 214 214 p_channel = channel; 215 215 } … … 217 217 case slot::NORMAL : if ( desc.slots[i].etype == FLOAT_VECTOR_3 ) 218 218 { 219 n_offset = desc.slots[i].offset;219 n_offset = (int)desc.slots[i].offset; 220 220 n_channel = m_data->m_channels[ c ]; 221 221 n_channel_index = c; … … 224 224 case slot::TEXCOORD : if ( desc.slots[i].etype == FLOAT_VECTOR_2 ) 225 225 { 226 t_offset = desc.slots[i].offset;226 t_offset = (int)desc.slots[i].offset; 227 227 t_channel = channel; 228 228 } … … 420 420 int och_ti = other->get_channel_index( slot::TEXCOORD ); 421 421 if ( ch_pi == -1 || ch_ti == -1 ) return; 422 size_t size = m_data->m_channels[ ch_ti ]->count;423 size_t osize = other->m_channels[ och_ti ]->count;424 size_t count = m_data->m_channels[ ch_pi ]->count;425 size_t ocount = other->m_channels[ och_pi ]->count;422 size_t size = m_data->m_channels[ (unsigned)ch_ti ]->count; 423 size_t osize = other->m_channels[ (unsigned)och_ti ]->count; 424 size_t count = m_data->m_channels[ (unsigned)ch_pi ]->count; 425 size_t ocount = other->m_channels[ (unsigned)och_pi ]->count; 426 426 if ( count % size != 0 || ocount % osize != 0 ) return; 427 427 if ( count / size != ocount / osize ) return; -
trunk/src/gfx/skeletal_mesh.cc
r319 r323 53 53 for ( size_t j = 0; j < 4; ++j ) 54 54 { 55 int index =vert.boneindex[j];56 float weight = vert.boneweight[j];55 unsigned index = (unsigned)vert.boneindex[j]; 56 float weight = vert.boneweight[j]; 57 57 const quat& orient = m_transform[index].get_orientation(); 58 58 const transform& offset = m_pos_offset[index]; … … 152 152 if ( bi != bone_names.end() ) 153 153 { 154 bone_id = bi->second;154 bone_id = (sint16)bi->second; 155 155 } 156 156 m_bone_ids[n] = bone_id;
Note: See TracChangeset
for help on using the changeset viewer.