Index: trunk/src/gfx/image.cc
===================================================================
--- trunk/src/gfx/image.cc	(revision 114)
+++ trunk/src/gfx/image.cc	(revision 121)
@@ -12,5 +12,5 @@
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
-	m_data = new uint8[ m_size.x * m_size.y * m_depth ];
+	m_data = new uint8[ static_cast<uint16>( m_size.x * m_size.y ) * m_depth ];
 }
 
@@ -25,10 +25,10 @@
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
-	std::size_t bsize = m_size.x * m_size.y * m_depth;
-	m_data = new uint8[ m_size.x * m_size.y * m_depth ];
+	sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth );
+	m_data = new uint8[ bsize ];
 
 	if ( reversed )
 	{
-		std::size_t bline = m_size.x * m_depth;
+		sint32 bline = m_size.x * static_cast<sint32>( m_depth );
 		for( int i = 0; i < m_size.y; ++i )
 		{
@@ -45,13 +45,13 @@
 void image::fill( uint8 value )
 {
-	std::fill( m_data, m_data + m_size.x * m_size.y * m_depth, value );
+	std::fill( m_data, m_data + m_size.x * m_size.y * (int)m_depth, value );
 }
 
-void image::set_region( region r, const uint8 * data, size_t stride )
+void image::set_region( region r, const uint8 * data, int stride )
 {
-	if ( stride == 0 ) stride = r.size.x * m_depth;
+	if ( stride == 0 ) stride = r.size.x * static_cast<sint32>( m_depth );
 	
-	std::size_t bpos  = (r.pos.y*m_size.x + r.pos.x ) * m_depth;
-	std::size_t bline = m_size.x*m_depth;
+	sint32 bpos  = (r.pos.y*m_size.x + r.pos.x ) * static_cast<sint32>( m_depth );
+	sint32 bline = m_size.x*static_cast<sint32>( m_depth );
 
 	for( int i = 0; i < r.size.y; ++i )
Index: trunk/src/gfx/texture_atlas.cc
===================================================================
--- trunk/src/gfx/texture_atlas.cc	(revision 114)
+++ trunk/src/gfx/texture_atlas.cc	(revision 121)
@@ -37,5 +37,5 @@
 			{
 				best_height = y + size.y;
-				best_index = i;
+				best_index = static_cast<int>( i );
 				best_width = node.z;
 				r.pos.x = node.x;
@@ -52,5 +52,5 @@
 	m_nodes.insert( m_nodes.begin() + best_index, glm::ivec3( r.pos.x, r.pos.y + size.y, size.x ) );
 
-	for( size_t i = best_index+1; i < m_nodes.size(); ++i )
+	for( size_t i = static_cast<size_t>( best_index )+1; i < m_nodes.size(); ++i )
 	{
 		glm::ivec3 node = m_nodes[ i ];
@@ -65,5 +65,5 @@
 			if (m_nodes[ i ].z <= 0)
 			{
-				m_nodes.erase( m_nodes.begin() + i );
+				m_nodes.erase( m_nodes.begin() + static_cast<int>(i) );
 				--i;
 			}
@@ -79,5 +79,5 @@
 	}
 	merge();
-	m_used += size.x * size.y;
+	m_used += static_cast<uint16>(size.x * size.y);
 	return r;
 }
@@ -119,5 +119,5 @@
 		{
 			m_nodes[ i ].z += m_nodes[ i+1 ].z;
-            m_nodes.erase( m_nodes.begin()+i+1 );
+            m_nodes.erase( m_nodes.begin()+static_cast<int>(i+1) );
 			--i;
 		}
Index: trunk/src/gfx/texture_font.cc
===================================================================
--- trunk/src/gfx/texture_font.cc	(revision 114)
+++ trunk/src/gfx/texture_font.cc	(revision 121)
@@ -17,7 +17,7 @@
 }
 
-float texture_glyph::get_kerning( const uint16 charcode )
+float texture_glyph::get_kerning( const uint16 other )
 {
-	auto i = kerning.find( charcode );
+	auto i = kerning.find( other );
 	return i != kerning.end() ? i->second : 0.0f;
 }
@@ -118,6 +118,7 @@
 	} 
 
-	for ( char c : codes )
+	for ( char ch : codes )
 	{
+		uint16 c = static_cast<uint16>( ch );
 		FT_UInt glyph_index = FT_Get_Char_Index( face, c ); 
 		FT_Error error = FT_Load_Glyph( face, glyph_index, flags ); 
@@ -136,5 +137,5 @@
 		int ft_glyph_top    = slot->bitmap_top;
 		int ft_glyph_left   = slot->bitmap_left;
-		int reg_width       = ft_bitmap_width / (depth > 3 ? 3 : depth);
+		int reg_width       = ft_bitmap_width / (depth > 3 ? 3 : (int)depth);
 
 		glm::ivec2 gsize( reg_width + 1, ft_bitmap_rows + 1 ); 
