Ignore:
Timestamp:
01/12/17 13:16:48 (8 years ago)
Author:
epyon
Message:
  • getting rid of size_t
  • datatypes now restricted to uint32 size
  • 64-bit compatibility
  • copyright updates where modified
File:
1 edited

Legend:

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

    r471 r533  
    1111using namespace nv;
    1212
    13 texture_atlas::texture_atlas( ivec2 size, nv::size_t depth, nv::size_t border /*= 1*/ )
     13texture_atlas::texture_atlas( ivec2 size, uint32 depth, uint32 border /*= 1*/ )
    1414        : image( size, depth ), m_used( 0 ), m_border( border )
    1515{
     
    2626        int best_width  = nv::limits::si_max;
    2727
    28         for( size_t i=0; i < m_nodes.size(); ++i )
     28        for( uint32 i=0; i < m_nodes.size(); ++i )
    2929        {
    3030                int y = fit( i, size );
     
    5151        m_nodes.insert( m_nodes.begin() + best_index, ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
    5252
    53         for( size_t i = static_cast<size_t>( best_index )+1; i < m_nodes.size(); ++i )
     53        for( uint32 i = static_cast<uint32>( best_index )+1; i < m_nodes.size(); ++i )
    5454        {
    5555                ivec3 node = m_nodes[ i ];
     
    8282}
    8383
    84 int texture_atlas::fit( nv::size_t index, ivec2 size )
     84int texture_atlas::fit( uint32 index, ivec2 size )
    8585{
    8686        ivec3 node = m_nodes[ index ];
     
    113113void texture_atlas::merge()
    114114{
    115         for ( size_t i=0; i < m_nodes.size()-1; ++i )
     115        for ( uint32 i=0; i < m_nodes.size()-1; ++i )
    116116    {
    117117                if ( m_nodes[ i ].y == m_nodes[ i+1 ].y )
Note: See TracChangeset for help on using the changeset viewer.