Ignore:
Timestamp:
06/13/15 11:20:22 (10 years ago)
Author:
epyon
Message:
  • cleanup of glm usage
File:
1 edited

Legend:

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

    r395 r398  
    1111using namespace nv;
    1212
    13 texture_atlas::texture_atlas( glm::ivec2 size, nv::size_t depth, nv::size_t border /*= 1*/ )
     13texture_atlas::texture_atlas( ivec2 size, nv::size_t depth, nv::size_t border /*= 1*/ )
    1414        : image( size, depth ), m_used( 0 ), m_border( border )
    1515{
    16         m_nodes.push_back( glm::ivec3( m_border, m_border, m_size.x - 2 * static_cast<int>( m_border ) ) );
     16        m_nodes.push_back( ivec3( m_border, m_border, m_size.x - 2 * static_cast<int>( m_border ) ) );
    1717        fill( 0 );
    1818}
    1919
    20 region texture_atlas::get_region( glm::ivec2 size )
     20region texture_atlas::get_region( ivec2 size )
    2121{
    22         region r ( glm::ivec2(0,0), size );
     22        region r ( ivec2(0,0), size );
    2323
    2424        int best_height = INT_MAX;
     
    3131                if ( y >= 0 )
    3232                {
    33                         glm::ivec3 node = m_nodes[ i ];
     33                        ivec3 node = m_nodes[ i ];
    3434                        if ( ( (y + size.y) < best_height ) ||
    3535                                ( ((y + size.y) == best_height) && (node.z < best_width)) )
     
    4646        if ( best_index == -1 )
    4747        {
    48                 return region( glm::ivec2( -1, -1 ), glm::ivec2( 0, 0 ) );
     48                return region( ivec2( -1, -1 ), ivec2( 0, 0 ) );
    4949        }
    5050
    51         m_nodes.insert( m_nodes.begin() + best_index, glm::ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
     51        m_nodes.insert( m_nodes.begin() + best_index, ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
    5252
    5353        for( size_t i = static_cast<size_t>( best_index )+1; i < m_nodes.size(); ++i )
    5454        {
    55                 glm::ivec3 node = m_nodes[ i ];
    56                 glm::ivec3 prev = m_nodes[ i-1 ];
     55                ivec3 node = m_nodes[ i ];
     56                ivec3 prev = m_nodes[ i-1 ];
    5757
    5858                if ( node.x < prev.x + prev.z )
     
    8282}
    8383
    84 int texture_atlas::fit( nv::size_t index, glm::ivec2 size )
     84int texture_atlas::fit( nv::size_t index, ivec2 size )
    8585{
    86         glm::ivec3 node = m_nodes[ index ];
     86        ivec3 node = m_nodes[ index ];
    8787
    8888        if ( node.x + size.x > m_size.x - static_cast<int>( m_border ) )
     
    128128        m_nodes.clear();
    129129        m_used = 0;
    130         m_nodes.push_back( glm::ivec3( 1, 1, m_size.x - 2 ) );
     130        m_nodes.push_back( ivec3( 1, 1, m_size.x - 2 ) );
    131131        fill( 0 );
    132132}
Note: See TracChangeset for help on using the changeset viewer.