Ignore:
Timestamp:
06/20/15 00:05:17 (10 years ago)
Author:
epyon
Message:
  • code compiles cleanly on maximum warning level
File:
1 edited

Legend:

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

    r395 r406  
    7171        if ( m_active )
    7272        {
    73                 float tick_time = ( (float)a_anim_time * 0.001f ) * anim->get_frame_rate();
     73                float tick_time = ( static_cast<float>( a_anim_time ) * 0.001f ) * anim->get_frame_rate();
    7474                float duration  = anim->is_looping() ? anim->get_duration() + 1.0f : anim->get_duration();
    7575                if ( tick_time >= duration )
     
    8282                        {
    8383                                m_active     = false;
    84                                 m_last_frame = (uint32)anim->get_end();
     84                                m_last_frame = static_cast<uint32>( anim->get_end() );
    8585                                m_next_frame = m_last_frame;
    8686                                m_interpolation = 0.0f;
     
    8888                        }
    8989                }
    90                 m_last_frame    = (uint32)( glm::floor( tick_time ) + anim->get_start() );
     90                m_last_frame    = static_cast<uint32>( glm::floor( tick_time ) + anim->get_start() );
    9191                m_next_frame    = m_last_frame + 1;
    92                 if ( m_next_frame > (uint32)anim->get_end() ) m_next_frame = (uint32)anim->get_start();
     92                if ( m_next_frame > static_cast<uint32>( anim->get_end() ) ) m_next_frame = static_cast<uint32>( anim->get_start() );
    9393                m_interpolation = tick_time - glm::floor( tick_time );
    9494        }
     
    152152        {
    153153                uint32 base_offset = m_next_frame * m_vertex_count * m_vsize;
    154                 m_context->update_attribute_offset( m_va, (slot)m_loc_next_position, base_offset );
    155                 m_context->update_attribute_offset( m_va, (slot)m_loc_next_normal, base_offset + sizeof( vec3 ) );
     154                m_context->update_attribute_offset( m_va, static_cast<slot>( m_loc_next_position ), base_offset );
     155                m_context->update_attribute_offset( m_va, static_cast<slot>( m_loc_next_normal ), base_offset + sizeof( vec3 ) );
    156156                if ( m_has_tangent && m_loc_next_tangent != -1 )
    157157                {
    158                         m_context->update_attribute_offset( m_va, (slot)m_loc_next_tangent, base_offset + 2*sizeof( vec3 ) );
     158                        m_context->update_attribute_offset( m_va, static_cast<slot>( m_loc_next_tangent ), base_offset + 2*sizeof( vec3 ) );
    159159                }
    160160                m_gpu_next_frame = m_next_frame;
     
    172172                        m_loc_next_tangent  = dev->get_attribute_location( a_program, "nv_next_tangent" );
    173173
    174                 m_context->add_vertex_buffer( m_va, (slot)m_loc_next_position, m_pbuffer, FLOAT, 3, 0, m_vsize, false );
    175                 m_context->add_vertex_buffer( m_va, (slot)m_loc_next_normal,   m_pbuffer, FLOAT, 3, sizeof( vec3 ), m_vsize, false );
     174                m_context->add_vertex_buffer( m_va, static_cast<slot>( m_loc_next_position ), m_pbuffer, FLOAT, 3, 0, m_vsize, false );
     175                m_context->add_vertex_buffer( m_va, static_cast<slot>( m_loc_next_normal ),   m_pbuffer, FLOAT, 3, sizeof( vec3 ), m_vsize, false );
    176176                if ( m_has_tangent )
    177                         m_context->add_vertex_buffer( m_va, (slot)m_loc_next_tangent, m_pbuffer, FLOAT, 4, 2*sizeof( vec3 ), m_vsize, false );
     177                        m_context->add_vertex_buffer( m_va, static_cast<slot>( m_loc_next_tangent ), m_pbuffer, FLOAT, 4, 2*sizeof( vec3 ), m_vsize, false );
    178178        }
    179179        keyframed_mesh::update( a_program );
     
    184184{
    185185        m_va      = m_context->create_vertex_array();
    186         m_pbuffer = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * m_vsize, (void*)m_vchannel->data );
     186        m_pbuffer = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * m_vsize, m_vchannel->data );
    187187        m_context->add_vertex_buffers( m_va, m_pbuffer, m_vchannel );
    188188
    189         buffer  vb = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * sizeof( vec2 ), (void*)m_mesh_data->get_channel<vertex_t>()->data );
     189        buffer  vb = m_context->get_device()->create_buffer( VERTEX_BUFFER, STATIC_DRAW, m_vertex_count * sizeof( vec2 ), m_mesh_data->get_channel<vertex_t>()->data );
    190190        m_context->add_vertex_buffers( m_va, vb, m_mesh_data->get_channel<vertex_t>() );
    191191
    192         buffer  ib = m_context->get_device()->create_buffer( INDEX_BUFFER, STATIC_DRAW, m_mesh_data->get_index_channel()->size(), (void*)m_mesh_data->get_index_channel()->data );
     192        buffer  ib = m_context->get_device()->create_buffer( INDEX_BUFFER, STATIC_DRAW, m_mesh_data->get_index_channel()->size(), m_mesh_data->get_index_channel()->data );
    193193
    194194        m_context->set_index_buffer( m_va, ib, m_mesh_data->get_index_channel()->desc.slots[0].etype, true );
     
    206206                const vertex_pnt* prev = data + m_vertex_count * m_last_frame;
    207207                const vertex_pnt* next = data + m_vertex_count * m_next_frame;
    208                       vertex_pnt* vtx  = (vertex_pnt*)m_data;
     208                      vertex_pnt* vtx  = reinterpret_cast<vertex_pnt*>( m_data );
    209209                for ( size_t i = 0; i < m_vertex_count; ++i )
    210210                {
     
    219219                const vertex_pn* prev = data + m_vertex_count * m_last_frame;
    220220                const vertex_pn* next = data + m_vertex_count * m_next_frame;
    221                       vertex_pn* vtx  = (vertex_pn*)m_data;
     221                      vertex_pn* vtx  = reinterpret_cast<vertex_pn*>( m_data );
    222222
    223223                for ( size_t i = 0; i < m_vertex_count; ++i )
Note: See TracChangeset for help on using the changeset viewer.