Index: trunk/src/formats/md5_loader.cc
===================================================================
--- trunk/src/formats/md5_loader.cc	(revision 397)
+++ trunk/src/formats/md5_loader.cc	(revision 398)
@@ -31,5 +31,5 @@
 }
 
-static void unit_quat_w( glm::quat& quat )
+static void unit_quat_w( nv::quat& quat )
 {
 	float t = 1.0f - ( quat.x * quat.x ) - ( quat.y * quat.y ) - ( quat.z * quat.z );
@@ -343,7 +343,7 @@
 		md5_vtx_pnt& vtc = vtcs[i];
 
-		vtc.position = glm::vec3(0);
-		vtc.normal   = glm::vec3(0);
-		vtc.tangent  = glm::vec3(0);
+		vtc.position = vec3(0);
+		vtc.normal   = vec3(0);
+		vtc.tangent  = vec3(0);
 
 		stable_sort( weights + start_weight, weights + start_weight + weight_count, [] ( const md5_weight& a, const md5_weight& b ) -> bool { return a.bias > b.bias; } );
@@ -386,5 +386,5 @@
 				const mesh_node_data&  joint = nodes[weight.joint_id];
 				const transform tr = transform( joint.transform ).inverse();
-				glm::vec3 rot_pos = tr.get_orientation() * weight.pos;
+				vec3 rot_pos = tr.get_orientation() * weight.pos;
 
 				vtc.position += ( tr.get_position() + rot_pos ) * weight.bias;
@@ -404,11 +404,11 @@
 		uint32 ti2 = idata[ i * 3 + 2 ];
  
-		glm::vec3 v1 = vtcs[ ti0 ].position;
-		glm::vec3 v2 = vtcs[ ti1 ].position;
-		glm::vec3 v3 = vtcs[ ti2 ].position;
-		glm::vec3 xyz1 = v3 - v1;
-		glm::vec3 xyz2 = v2 - v1;
-
-		glm::vec3 normal = glm::cross( xyz1, xyz2 );
+		vec3 v1 = vtcs[ ti0 ].position;
+		vec3 v2 = vtcs[ ti1 ].position;
+		vec3 v3 = vtcs[ ti2 ].position;
+		vec3 xyz1 = v3 - v1;
+		vec3 xyz2 = v2 - v1;
+
+		vec3 normal = glm::cross( xyz1, xyz2 );
 
 		vtcs[ ti0 ].normal += normal;
@@ -436,12 +436,12 @@
 		md5_vtx_pntiw& vdata = vtx_data[i];
 
-		glm::vec3 normal  = glm::normalize( vtcs[i].normal );
-		glm::vec3 tangent = glm::normalize( vtcs[i].tangent );
+		vec3 normal  = glm::normalize( vtcs[i].normal );
+		vec3 tangent = glm::normalize( vtcs[i].tangent );
 		vtcs[i].normal   = normal;
 		vtcs[i].tangent  = tangent;
 
 		vdata.position = vtcs[i].position;
-		vdata.normal   = glm::vec3(0);
- 		vdata.tangent  = glm::vec3(0);
+		vdata.normal   = vec3(0);
+ 		vdata.tangent  = vec3(0);
  
  		for ( size_t j = 0; j < 4; ++j )
@@ -484,5 +484,5 @@
 			transform ptr;
 			if ( pjoint.data->get_channel(0)->count > index ) ptr = ptv[ index ];
-			glm::vec3 rot_pos = ptr.get_orientation() * pos;
+			vec3 rot_pos = ptr.get_orientation() * pos;
 
 			pos    = ptr.get_position() + rot_pos;
Index: trunk/src/gfx/image.cc
===================================================================
--- trunk/src/gfx/image.cc	(revision 397)
+++ trunk/src/gfx/image.cc	(revision 398)
@@ -10,5 +10,5 @@
 using namespace nv;
 
-image::image( glm::ivec2 size, nv::size_t depth )
+image::image( ivec2 size, nv::size_t depth )
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
@@ -23,5 +23,5 @@
 
 
-image::image( glm::ivec2 size, nv::size_t depth, const uint8 * data, bool reversed )
+image::image( ivec2 size, nv::size_t depth, const uint8 * data, bool reversed )
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
Index: trunk/src/gfx/mesh_creator.cc
===================================================================
--- trunk/src/gfx/mesh_creator.cc	(revision 397)
+++ trunk/src/gfx/mesh_creator.cc	(revision 398)
@@ -21,5 +21,5 @@
 		size_t count     = ( keys ? keys->get_channel(0)->count : 0 );
 		size_t pcount    = ( pkeys ? pkeys->get_channel(0)->count : 0 );
-		max_frames = glm::max<uint32>( count, max_frames );
+		max_frames = nv::max<uint32>( count, max_frames );
 		if ( pkeys && pkeys->get_channel_count() > 0 && keys && keys->get_channel_count() > 0 )
 		{
@@ -28,5 +28,5 @@
 			for ( unsigned n = 0; n < count; ++n )
 			{
-				channel[n].tform = pchannel[ glm::min( n, pcount-1 ) ].tform * channel[n].tform;
+				channel[n].tform = pchannel[ nv::min( n, pcount-1 ) ].tform * channel[n].tform;
 			}
 		}
@@ -63,5 +63,5 @@
 			for ( size_t c = 0; c < chan_count; ++c )
 			{
-				max_keys = glm::max( max_keys, old_keys->get_channel(c)->count );
+				max_keys = nv::max( max_keys, old_keys->get_channel(c)->count );
 			}
 
@@ -79,5 +79,5 @@
 				for ( uint16 c = 0; c < chan_count; ++c )
 				{
-					size_t idx = glm::min( old_keys->get_channel(c)->count - 1, n );
+					size_t idx = nv::min( old_keys->get_channel(c)->count - 1, n );
 					pkey += old_keys->get_channel(c)->get_raw( idx, pkey );
 				}
@@ -119,5 +119,5 @@
 void nv::mesh_data_creator::transform( float scale, const mat3& r33 )
 {
-	vec3 vertex_offset     = glm::vec3(); 
+	vec3 vertex_offset     = vec3(); 
 	mat3 vertex_transform  = scale * r33;
 	mat3 normal_transform  = r33;
@@ -297,5 +297,5 @@
 			vec3 xyz2 = v2 - v1;
 
-			//glm::vec3 normal = glm::cross( xyz1, xyz2 );
+			//vec3 normal = glm::cross( xyz1, xyz2 );
 			//
 			//vtcs[ ti0 ].normal += normal;
Index: trunk/src/gfx/texture_atlas.cc
===================================================================
--- trunk/src/gfx/texture_atlas.cc	(revision 397)
+++ trunk/src/gfx/texture_atlas.cc	(revision 398)
@@ -11,14 +11,14 @@
 using namespace nv;
 
-texture_atlas::texture_atlas( glm::ivec2 size, nv::size_t depth, nv::size_t border /*= 1*/ )
+texture_atlas::texture_atlas( ivec2 size, nv::size_t depth, nv::size_t border /*= 1*/ )
 	: image( size, depth ), m_used( 0 ), m_border( border )
 {
-	m_nodes.push_back( glm::ivec3( m_border, m_border, m_size.x - 2 * static_cast<int>( m_border ) ) );
+	m_nodes.push_back( ivec3( m_border, m_border, m_size.x - 2 * static_cast<int>( m_border ) ) );
 	fill( 0 );
 }
 
-region texture_atlas::get_region( glm::ivec2 size )
+region texture_atlas::get_region( ivec2 size )
 {
-	region r ( glm::ivec2(0,0), size );
+	region r ( ivec2(0,0), size );
 
 	int best_height = INT_MAX;
@@ -31,5 +31,5 @@
 		if ( y >= 0 )
 		{
-			glm::ivec3 node = m_nodes[ i ];
+			ivec3 node = m_nodes[ i ];
 			if ( ( (y + size.y) < best_height ) ||
 				( ((y + size.y) == best_height) && (node.z < best_width)) )
@@ -46,13 +46,13 @@
 	if ( best_index == -1 )
 	{
-		return region( glm::ivec2( -1, -1 ), glm::ivec2( 0, 0 ) );
+		return region( ivec2( -1, -1 ), ivec2( 0, 0 ) );
 	}
 
-	m_nodes.insert( m_nodes.begin() + best_index, glm::ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
+	m_nodes.insert( m_nodes.begin() + best_index, ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
 
 	for( size_t i = static_cast<size_t>( best_index )+1; i < m_nodes.size(); ++i )
 	{
-		glm::ivec3 node = m_nodes[ i ];
-		glm::ivec3 prev = m_nodes[ i-1 ];
+		ivec3 node = m_nodes[ i ];
+		ivec3 prev = m_nodes[ i-1 ];
 
 		if ( node.x < prev.x + prev.z )
@@ -82,7 +82,7 @@
 }
 
-int texture_atlas::fit( nv::size_t index, glm::ivec2 size )
+int texture_atlas::fit( nv::size_t index, ivec2 size )
 {
-	glm::ivec3 node = m_nodes[ index ];
+	ivec3 node = m_nodes[ index ];
 
 	if ( node.x + size.x > m_size.x - static_cast<int>( m_border ) ) 
@@ -128,5 +128,5 @@
 	m_nodes.clear();
 	m_used = 0;
-	m_nodes.push_back( glm::ivec3( 1, 1, m_size.x - 2 ) );
+	m_nodes.push_back( ivec3( 1, 1, m_size.x - 2 ) );
 	fill( 0 );
 }
Index: trunk/src/gfx/texture_font.cc
===================================================================
--- trunk/src/gfx/texture_font.cc	(revision 397)
+++ trunk/src/gfx/texture_font.cc	(revision 398)
@@ -94,7 +94,7 @@
 bool texture_font::load_glyphs( string_ref codes )
 {
-	FT_Face face     = (FT_Face)(m_rface);
-	size_t depth     = m_atlas->get_depth();
-	glm::ivec2 asize = m_atlas->get_size();
+	FT_Face face = (FT_Face)(m_rface);
+	size_t depth = m_atlas->get_depth();
+	ivec2 asize  = m_atlas->get_size();
 	FT_Int32 flags = 0; 
 	flags |= FT_LOAD_RENDER; 
@@ -137,5 +137,5 @@
 		int reg_width       = ft_bitmap_width / (depth > 3 ? 3 : (int)depth);
 
-		glm::ivec2 gsize( reg_width + 1, ft_bitmap_rows + 1 ); 
+		ivec2 gsize( reg_width + 1, ft_bitmap_rows + 1 ); 
 		region r = m_atlas->get_region( gsize );
 		if ( r.pos.x < 0 ) 
@@ -164,12 +164,12 @@
 		g->charcode = c;
 		g->size     = gsize;
-		g->offset   = glm::ivec2( ft_glyph_left, ft_glyph_top );
-		g->tl       = glm::vec2( r.pos.x/(float)asize.x, r.pos.y/(float)asize.y );
-		g->br       = glm::vec2( ( r.pos.x + gsize.x )/(float)asize.x, (r.pos.y + gsize.y )/(float)asize.y );
+		g->offset   = ivec2( ft_glyph_left, ft_glyph_top );
+		g->tl       = vec2( r.pos.x/(float)asize.x, r.pos.y/(float)asize.y );
+		g->br       = vec2( ( r.pos.x + gsize.x )/(float)asize.x, (r.pos.y + gsize.y )/(float)asize.y );
 
 		// Discard hinting to get advance
 		FT_Load_Glyph( face, glyph_index, FT_LOAD_RENDER | FT_LOAD_NO_HINTING);
 		slot = face->glyph;
-		g->advance = glm::ivec2( slot->advance.x/64.0, slot->advance.y/64.0 );
+		g->advance = ivec2( slot->advance.x/64.0, slot->advance.y/64.0 );
 	}
 	generate_kerning();
Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 397)
+++ trunk/src/gl/gl_context.cc	(revision 398)
@@ -731,5 +731,5 @@
 	}
 	unsigned int buffers[8];
-	count = glm::min<uint32>( count, 8 );
+	count = nv::min<uint32>( count, 8 );
 	for ( uint32 i = 0; i < count; ++i )
 	{
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 397)
+++ trunk/src/gl/gl_device.cc	(revision 398)
@@ -53,5 +53,5 @@
 	assert( image->format->BytesPerPixel > 2 );
 	image_format format(image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE );
-	image_data* data = new image_data( format, glm::ivec2( image->w, image->h ), (nv::uint8*)image->pixels );
+	image_data* data = new image_data( format, ivec2( image->w, image->h ), (nv::uint8*)image->pixels );
 	return data;
 }
@@ -71,5 +71,5 @@
 	assert( image->format->BytesPerPixel > 2 );
 	image_format format( image->format->BytesPerPixel == 3 ? RGB : RGBA, UBYTE );
-	image_data* idata = new image_data( format, glm::ivec2( image->w, image->h ), ( nv::uint8* )image->pixels );
+	image_data* idata = new image_data( format, ivec2( image->w, image->h ), ( nv::uint8* )image->pixels );
 	return idata;
 }
Index: trunk/src/rogue/fov_recursive_shadowcasting.cc
===================================================================
--- trunk/src/rogue/fov_recursive_shadowcasting.cc	(revision 397)
+++ trunk/src/rogue/fov_recursive_shadowcasting.cc	(revision 398)
@@ -24,7 +24,6 @@
 	{
 		position max_radius = m_size-m_position;
-		max_radius.x=glm::max(max_radius.x,m_position.x);
-		max_radius.y=glm::max(max_radius.y,m_position.y);
-		m_radius = (int)glm::length((glm::vec2)max_radius)+1;
+		max_radius = glm::max(max_radius,m_position);
+		m_radius = (int)glm::length((vec2)max_radius)+1;
 	}
 	m_radius2 = m_radius * m_radius;
