Changeset 487 for trunk/src/gfx


Ignore:
Timestamp:
03/08/16 08:05:51 (9 years ago)
Author:
epyon
Message:
 
Location:
trunk/src/gfx
Files:
3 edited

Legend:

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

    r406 r487  
    2626        : m_size( size ), m_depth( depth ), m_data( nullptr )
    2727{
     28        NV_ASSERT( size.x >= 0 && size.y >= 0, "bad parameters passed to image!" );
    2829        sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth );
    29         m_data = new uint8[ bsize ];
     30        m_data = new uint8[ size_t( bsize ) ];
    3031
    3132        if ( reversed )
  • trunk/src/gfx/mesh_creator.cc

    r482 r487  
    265265        delete[] tangents2;
    266266
    267         uint32 n_channel_index = m_data->get_channel_index( slot::NORMAL );
    268         data_channel_set_creator( m_data ).set_channel( n_channel_index, merge_channels( *m_nrm_channel, g_channel ) );
     267        int n_channel_index = m_data->get_channel_index( slot::NORMAL );
     268        NV_ASSERT( n_channel_index >= 0, "Normal channel not found!" );
     269        data_channel_set_creator( m_data ).set_channel( uint32( n_channel_index ), merge_channels( *m_nrm_channel, g_channel ) );
    269270        initialize();
    270271}
  • trunk/src/gfx/texture_font.cc

    r471 r487  
    8080static uint8* convert_to_rgba(uint8* rgb, const int lines, const int line_count, const int line_bpitch )
    8181{
    82         uint8* result = new uint8[ lines * line_count * 4 ];
     82        uint8* result = new uint8[ static_cast< uint32 >( lines * line_count * 4 ) ];
    8383        uint8* rgba   = result;
    8484        for(int l=0; l<lines; ++l)
Note: See TracChangeset for help on using the changeset viewer.