Index: trunk/src/gfx/texture_atlas.cc
===================================================================
--- trunk/src/gfx/texture_atlas.cc	(revision 138)
+++ trunk/src/gfx/texture_atlas.cc	(revision 142)
@@ -12,8 +12,8 @@
 using namespace nv;
 
-texture_atlas::texture_atlas( glm::ivec2 size, size_t depth )
+texture_atlas::texture_atlas( glm::ivec2 size, size_t depth, size_t border /*= 1*/ )
 	: image( size, depth ), m_used( 0 )
 {
-	m_nodes.push_back( glm::ivec3( 1, 1, m_size.x - 2 ) );
+	m_nodes.push_back( glm::ivec3( border, border, m_size.x - 2 * border ) );
 	fill( 0 );
 }
@@ -79,5 +79,5 @@
 	}
 	merge();
-	m_used += static_cast<uint16>(size.x * size.y);
+	m_used += static_cast<uint32>(size.x * size.y);
 	return r;
 }
