Changeset 323 for trunk/src/gfx


Ignore:
Timestamp:
08/26/14 04:03:10 (11 years ago)
Author:
epyon
Message:
  • nova now compiles again under all three compilers with -Winsane and no warnings
Location:
trunk/src/gfx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gfx/image.cc

    r319 r323  
    8989        fill( r, 255 );
    9090
    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;
    9393
     94        uint32 rsizex     = static_cast< uint32 >( r.size.x );
     95        uint32 rsizey     = static_cast< uint32 >( r.size.y );
    9496        const uint8* data = idata->get_data();
    95         sint32 depth      = 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;
    9799
    98         for( int y = 0; y < r.size.y; ++y )
     100        for( uint32 y = 0; y < rsizey; ++y )
    99101        {
    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 )
    102104                {
    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 )
    105107                        {
    106108                                m_data[ xy + e ] = data[ y*dstride + x * depth + e ];
  • trunk/src/gfx/mesh_creator.cc

    r302 r323  
    128128                const vertex_descriptor& desc   = channel->desc;
    129129                uint8* raw_data = channel->data;
    130                 int vtx_size = desc.size;
     130                uint32 vtx_size = desc.size;
    131131                int p_offset = -1;
    132132                int n_offset = -1;
     
    135135                        switch ( desc.slots[i].vslot )
    136136                        {
    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;
    140140                                default             : break;
    141141                        }
     
    173173        size_t n_offset = 0;
    174174        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 ];
    176176        for ( uint32 i = 0; i < channel->desc.count; ++i )
    177177                if ( channel->desc.slots[i].vslot == slot::NORMAL )
     
    211211                                if ( desc.slots[i].etype == FLOAT_VECTOR_3 )
    212212                                {
    213                                         p_offset  = desc.slots[i].offset;
     213                                        p_offset  = (int)desc.slots[i].offset;
    214214                                        p_channel = channel;
    215215                                }
     
    217217                        case slot::NORMAL   : if ( desc.slots[i].etype == FLOAT_VECTOR_3 )
    218218                                {
    219                                         n_offset  = desc.slots[i].offset;
     219                                        n_offset  = (int)desc.slots[i].offset;
    220220                                        n_channel = m_data->m_channels[ c ];
    221221                                        n_channel_index = c;
     
    224224                        case slot::TEXCOORD : if ( desc.slots[i].etype == FLOAT_VECTOR_2 )
    225225                                {
    226                                         t_offset  = desc.slots[i].offset;
     226                                        t_offset  = (int)desc.slots[i].offset;
    227227                                        t_channel = channel;
    228228                                }
     
    420420        int och_ti = other->get_channel_index( slot::TEXCOORD );
    421421        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;
    426426        if ( count % size != 0 || ocount % osize != 0 ) return;
    427427        if ( count / size != ocount / osize ) return;
  • trunk/src/gfx/skeletal_mesh.cc

    r319 r323  
    5353                                for ( size_t j = 0; j < 4; ++j )
    5454                                {
    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];
    5757                                        const quat& orient      = m_transform[index].get_orientation();
    5858                                        const transform& offset = m_pos_offset[index];
     
    152152                if ( bi != bone_names.end() )
    153153                {
    154                         bone_id = bi->second;
     154                        bone_id = (sint16)bi->second;
    155155                }
    156156                m_bone_ids[n] = bone_id;
Note: See TracChangeset for help on using the changeset viewer.