Changeset 142 for trunk/src/gfx


Ignore:
Timestamp:
07/03/13 23:38:00 (12 years ago)
Author:
epyon
Message:
  • texture_atlas - optionally takes a border parameter (default 1)
  • texture_atlas - TODO: fix behavior for exact fits (10242 atlas only holds 9 2562 images...)
  • mesh - get_attribute fixed
File:
1 edited

Legend:

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

    r121 r142  
    1212using namespace nv;
    1313
    14 texture_atlas::texture_atlas( glm::ivec2 size, size_t depth )
     14texture_atlas::texture_atlas( glm::ivec2 size, size_t depth, size_t border /*= 1*/ )
    1515        : image( size, depth ), m_used( 0 )
    1616{
    17         m_nodes.push_back( glm::ivec3( 1, 1, m_size.x - 2 ) );
     17        m_nodes.push_back( glm::ivec3( border, border, m_size.x - 2 * border ) );
    1818        fill( 0 );
    1919}
     
    7979        }
    8080        merge();
    81         m_used += static_cast<uint16>(size.x * size.y);
     81        m_used += static_cast<uint32>(size.x * size.y);
    8282        return r;
    8383}
Note: See TracChangeset for help on using the changeset viewer.