Index: trunk/src/bullet/bullet_helper.hh
===================================================================
--- trunk/src/bullet/bullet_helper.hh	(revision 533)
+++ trunk/src/bullet/bullet_helper.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2016 ChaosForge Ltd
+// Copyright (C) 2016-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/core/logger.cc
===================================================================
--- trunk/src/core/logger.cc	(revision 533)
+++ trunk/src/core/logger.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2011-2015 ChaosForge Ltd
+// Copyright (C) 2011-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/core/profiler.cc
===================================================================
--- trunk/src/core/profiler.cc	(revision 533)
+++ trunk/src/core/profiler.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2014 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/core/random.cc
===================================================================
--- trunk/src/core/random.cc	(revision 533)
+++ trunk/src/core/random.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2014 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/engine/mesh_manager.cc
===================================================================
--- trunk/src/engine/mesh_manager.cc	(revision 533)
+++ trunk/src/engine/mesh_manager.cc	(revision 534)
@@ -35,6 +35,6 @@
 	nv::string_view sub_mesh_name;
 	nv::string128 base_mesh_name( path );
-	nv::size_t sub_mesh_pos = path.find( ":" );
-	nv::size_t dot_pos = path.find( "." );
+	nv::uint32 sub_mesh_pos = path.find( ":" );
+	nv::uint32 dot_pos = path.find( "." );
 	if ( sub_mesh_pos != nv::string_view::npos )
 	{
Index: trunk/src/engine/particle_engine.cc
===================================================================
--- trunk/src/engine/particle_engine.cc	(revision 533)
+++ trunk/src/engine/particle_engine.cc	(revision 534)
@@ -196,5 +196,5 @@
 	datap->plane_normal = normalize_safe( datap->plane_normal, vec3(0.0f,1.0f,0.0f) );
 	datap->bounce       = table->get<float>("bounce", 0.0f );
-	datap->distance     = -math::dot( datap->plane_normal, datap->plane_point ) / math::sqrt( math::dot( datap->plane_normal, datap->plane_normal ) );
+	datap->distance     = -math::dot( datap->plane_normal, datap->plane_point ) / static_cast<float>( math::sqrt( math::dot( datap->plane_normal, datap->plane_normal ) ) );
 	return true;
 }
Index: trunk/src/engine/program_manager.cc
===================================================================
--- trunk/src/engine/program_manager.cc	(revision 533)
+++ trunk/src/engine/program_manager.cc	(revision 534)
@@ -50,5 +50,5 @@
 	stream* fstream = open_stream( fs, path );
 	if ( !fstream ) return const_string();
-	uint32 size = fstream->size();
+	uint32 size = static_cast< uint32 >( fstream->size() );
 	const_string result( nullptr, size );
 	fstream->read( const_cast<char*>( result.data() ), size, 1 );
Index: trunk/src/formats/assimp_loader.cc
===================================================================
--- trunk/src/formats/assimp_loader.cc	(revision 533)
+++ trunk/src/formats/assimp_loader.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd
+// Copyright (C) 2014-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -107,5 +107,5 @@
 	m_mesh_count = 0;
 	NV_LOG_NOTICE( "AssImp loading file..." );
-	size_t size = source.size();
+	uint32 size = static_cast< uint32 >( source.size() );
 	char* data  = new char[ size ];
 	source.read( data, size, 1 );
@@ -143,5 +143,5 @@
 }
 
-data_channel_set* nv::assimp_loader::release_mesh_data( size_t index, data_node_info& info )
+data_channel_set* nv::assimp_loader::release_mesh_data( uint32 index, data_node_info& info )
 {
 	if ( index >= m_mesh_count ) return nullptr;
@@ -149,5 +149,5 @@
 	return m_meshes[index];
 }
-void nv::assimp_loader::load_mesh_data( data_channel_set* data, size_t index, data_node_info& info )
+void nv::assimp_loader::load_mesh_data( data_channel_set* data, uint32 index, data_node_info& info )
 {
 	const aiMesh*  mesh  = m_data->scene->mMeshes[ index ];
@@ -161,5 +161,5 @@
 		desc.initialize< assimp_plain_vtx >();
 	data_channel_set_creator maccess( data );
-	string64 name( mesh->mName.data, mesh->mName.length );
+	string64 name( mesh->mName.data, static_cast< uint32 >( mesh->mName.length ) );
 	if ( mesh->mName.length == 0 )
 	{
@@ -170,5 +170,5 @@
 					if ( node->mMeshes[i] == index )
 					{
-						name.assign( node->mName.data, node->mName.length );
+						name.assign( node->mName.data, static_cast< uint32 >( node->mName.length ) );
 						if ( i != 0 )
 						{
@@ -215,9 +215,9 @@
 		{
 			aiBone* bone  = mesh->mBones[m];
-			for ( size_t w=0; w<bone->mNumWeights; w++)
+			for ( uint32 w=0; w<bone->mNumWeights; w++)
 			{
 				assimp_skinned_vtx& v = vtx[ bone->mWeights[w].mVertexId ];
 				bool found = false;
-				for ( size_t i = 0 ; i < 4; ++i )
+				for ( uint32 i = 0 ; i < 4; ++i )
 				{
 					if ( v.boneweight[i] <= 0.0f ) 
@@ -281,5 +281,5 @@
 			aiMesh* mesh = m_data->scene->mMeshes[mc];
 
-			NV_LOG_NOTICE( "Mesh #", mc, "   - ", string_view( static_cast<char*>( mesh->mName.data ), mesh->mName.length ) );
+			NV_LOG_NOTICE( "Mesh #", mc, "   - ", string_view( static_cast<char*>( mesh->mName.data ), static_cast< uint32 >( mesh->mName.length ) ) );
 			NV_LOG_NOTICE( "  bones   - ", mesh->mNumBones );
 			NV_LOG_NOTICE( "  uvs     - ", mesh->mNumUVComponents[0] );
@@ -303,10 +303,10 @@
 	for ( auto node : m_data->nodes )
 	{
-		NV_LOG_NOTICE( "Node : ", string_view( node->mName.data, node->mName.length ) );
+		NV_LOG_NOTICE( "Node : ", string_view( node->mName.data, static_cast< uint32 >( node->mName.length ) ) );
 	}
 
 	for ( auto skeleton : m_data->skeletons )
 	{
-		NV_LOG_NOTICE( "Skeleton : ", string_view( skeleton->mName.data, skeleton->mName.length ) );
+		NV_LOG_NOTICE( "Skeleton : ", string_view( skeleton->mName.data, static_cast< uint32 >( skeleton->mName.length ) ) );
 	}
 
@@ -353,5 +353,5 @@
 	}
 
-	string_view name( ainode->mName.data, ainode->mName.length );
+	string_view name( ainode->mName.data, static_cast< uint32 >( ainode->mName.length ) );
 	if ( name.starts_with( '_' ) ) return;
 
@@ -409,5 +409,5 @@
 			{
 				assimp_skinned_vtx& vertex = channel.data()[v];
-				for ( size_t i = 0; i < 4; ++i )
+				for ( uint32 i = 0; i < 4; ++i )
 				{
 					if ( vertex.boneweight[i] > 0.0f )
@@ -430,5 +430,5 @@
 			int pid = bone_data[i].parent_id;
 			if ( pid >= 0 )
-				bone_data[i].transform = tr * bone_data[ size_t( pid ) ].transform;
+				bone_data[i].transform = tr * bone_data[uint32( pid ) ].transform;
 			else
 				bone_data[i].transform = tr;
@@ -447,5 +447,5 @@
 }
 
-mesh_nodes_data* nv::assimp_loader::release_mesh_nodes_data( size_t index /*= 0*/ )
+mesh_nodes_data* nv::assimp_loader::release_mesh_nodes_data( uint32 index /*= 0*/ )
 {
 	if ( m_data->scene == nullptr ) return nullptr;
@@ -484,10 +484,10 @@
 }
 
-data_node_list* nv::assimp_loader::release_data_node_list( size_t /*= 0 */ )
+data_node_list* nv::assimp_loader::release_data_node_list( uint32 /*= 0 */ )
 {
 	return release_merged_bones();
 }
 
-bool nv::assimp_loader::is_animated( size_t /*= 0 */ )
+bool nv::assimp_loader::is_animated( uint32 /*= 0 */ )
 {
 	int this_is_incorrect;
@@ -623,5 +623,5 @@
 // 	bool has_bones = false;
 // 	data_channel_set* meshes = data_channel_set_creator::create_set_array( m_mesh_count, 2 );
-// 	for ( size_t m = 0; m < m_mesh_count; ++m )
+// 	for ( uint32 m = 0; m < m_mesh_count; ++m )
 // 	{
 // 		const aiMesh* mesh = scene->mMeshes[ m ];
@@ -635,5 +635,5 @@
 // }
 
-nv::size_t nv::assimp_loader::get_nodes_data_count() const
+uint32 nv::assimp_loader::get_nodes_data_count() const
 {
 	if ( m_data->scene == nullptr ) return 0;
Index: trunk/src/formats/nmd_loader.cc
===================================================================
--- trunk/src/formats/nmd_loader.cc	(revision 533)
+++ trunk/src/formats/nmd_loader.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd
+// Copyright (C) 2014-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -45,5 +45,5 @@
 }
 
-data_channel_set* nv::nmd_loader::release_mesh_data( size_t index, data_node_info& info )
+data_channel_set* nv::nmd_loader::release_mesh_data( uint32 index, data_node_info& info )
 {
 	data_channel_set* result = m_meshes[ index ];
@@ -158,10 +158,10 @@
 }
 
-mesh_nodes_data* nv::nmd_loader::release_mesh_nodes_data( size_t )
+mesh_nodes_data* nv::nmd_loader::release_mesh_nodes_data( uint32 )
 {
 	return nullptr;
 }
 
-data_node_list* nv::nmd_loader::release_data_node_list( size_t )
+data_node_list* nv::nmd_loader::release_data_node_list( uint32 )
 {
 	data_node_list* result = m_bone_data;
@@ -170,5 +170,5 @@
 }
 
-bool nv::nmd_loader::is_animated( size_t /*= 0 */ )
+bool nv::nmd_loader::is_animated( uint32 /*= 0 */ )
 {
 	return m_pose_data_set != nullptr;
Index: trunk/src/formats/obj_loader.cc
===================================================================
--- trunk/src/formats/obj_loader.cc	(revision 533)
+++ trunk/src/formats/obj_loader.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -52,11 +52,11 @@
 	string32 next_name;
 
-	nv::size_t size;
+	uint32 size;
 	bool   eof;
 
 	obj_reader();
 	bool read_stream( stream& str );
-	virtual nv::size_t add_face( uint32* vi, uint32* ti, uint32* ni, nv::size_t count ) = 0;
-	virtual nv::size_t raw_size() const = 0;
+	virtual uint32 add_face( uint32* vi, uint32* ti, uint32* ni, uint32 count ) = 0;
+	virtual uint32 raw_size() const = 0;
 	virtual void reset() = 0;
 	virtual const uint8* raw_pointer() const = 0;
@@ -126,5 +126,5 @@
 			string_view scan( cline );
 			scan.remove_prefix( 2 );
-			size_t pos = 0;
+			uint32 pos = 0;
 			while ( pos != string_view::npos )
 			{
@@ -176,5 +176,5 @@
 {
 	mesh_data_reader( bool normals ) : m_normals( normals ) {}
-	virtual nv::size_t add_face( uint32* vi, uint32* ti, uint32* ni, nv::size_t count )
+	virtual uint32 add_face( uint32* vi, uint32* ti, uint32* ni, uint32 count )
 	{
 		if ( count < 3 ) return 0; // TODO : report error?
@@ -182,10 +182,10 @@
 		// TODO : support if normals not present;
 		vec3 nullvec;
-		nv::size_t result = 0;
+		uint32 result = 0;
 		// Simple triangulation - obj's shouldn't have more than quads anyway
 
 		if ( m_normals )
 		{
-			for ( nv::size_t i = 2; i < count; ++i )
+			for ( uint32 i = 2; i < count; ++i )
 			{
 				result++;
@@ -197,5 +197,5 @@
 		else
 		{
-			for ( nv::size_t i = 2; i < count; ++i )
+			for ( uint32 i = 2; i < count; ++i )
 			{
 				result++;
@@ -210,5 +210,5 @@
 	vector< VTX > m_data;
 	virtual void reset() { m_data.clear(); }
-	virtual nv::size_t raw_size() const { return m_data.size() * sizeof( VTX ); }
+	virtual uint32 raw_size() const { return m_data.size() * sizeof( VTX ); }
 	virtual const uint8* raw_pointer() const { return reinterpret_cast< const uint8* >( m_data.data() ); }
 };
@@ -232,15 +232,15 @@
 	void calculate_tangents()
 	{
-		nv::size_t count = m_data.size();
-		nv::size_t tcount = count / 3;
+		uint32 count = m_data.size();
+		uint32 tcount = count / 3;
 
 		vector< vec3 > tan1( count );
 		vector< vec3 > tan2( count );
 
-		for ( nv::size_t a = 0; a < tcount; ++a )
-		{
-			nv::size_t i1 = a * 3;
-			nv::size_t i2 = a * 3 + 1;
-			nv::size_t i3 = a * 3 + 2;
+		for ( uint32 a = 0; a < tcount; ++a )
+		{
+			uint32 i1 = a * 3;
+			uint32 i2 = a * 3 + 1;
+			uint32 i3 = a * 3 + 2;
 			obj_vertex_vtnt& vtx1 = m_data[ i1 ];
 			obj_vertex_vtnt& vtx2 = m_data[ i2 ];
@@ -277,5 +277,5 @@
 		}
 
-		for ( nv::size_t a = 0; a < count; ++a )
+		for ( uint32 a = 0; a < count; ++a )
 		{
 			const vec3& nv = m_data[a].normal;
@@ -347,5 +347,5 @@
 }
 
-data_channel_set* nv::obj_loader::release_mesh_data( size_t index, data_node_info& info )
+data_channel_set* nv::obj_loader::release_mesh_data( uint32 index, data_node_info& info )
 {
 	data_channel_set* result = m_meshes[ index ];
Index: trunk/src/gfx/image.cc
===================================================================
--- trunk/src/gfx/image.cc	(revision 533)
+++ trunk/src/gfx/image.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2011-2015 ChaosForge Ltd
+// Copyright (C) 2011-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -10,5 +10,5 @@
 using namespace nv;
 
-image::image( ivec2 size, nv::size_t depth )
+image::image( ivec2 size, uint32 depth )
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
@@ -23,10 +23,10 @@
 
 
-image::image( ivec2 size, nv::size_t depth, const uint8 * data, bool reversed )
+image::image( ivec2 size, uint32 depth, const uint8 * data, bool reversed )
 	: m_size( size ), m_depth( depth ), m_data( nullptr )
 {
 	NV_ASSERT( size.x >= 0 && size.y >= 0, "bad parameters passed to image!" );
 	sint32 bsize = m_size.x * m_size.y * static_cast<sint32>( m_depth );
-	m_data = new uint8[ size_t( bsize ) ];
+	m_data = new uint8[ uint32( bsize ) ];
 
 	if ( reversed )
@@ -97,6 +97,6 @@
 	uint32 rsizey     = static_cast< uint32 >( r.size.y );
 	const uint8* data = idata->get_data();
-	size_t depth      = idata->get_depth();
-	size_t cdepth     = m_depth > depth ? depth : m_depth;
+	uint32 depth      = idata->get_depth();
+	uint32 cdepth     = m_depth > depth ? depth : m_depth;
 	uint32 dstride    = rsizex * depth;
 
@@ -107,5 +107,5 @@
 		{
 			uint32 xy = pos + x * m_depth;
-			for( size_t e = 0; e < cdepth; ++e )
+			for( uint32 e = 0; e < cdepth; ++e )
 			{
 				m_data[ xy + e ] = data[ y*dstride + x * depth + e ];
Index: trunk/src/gfx/mesh_creator.cc
===================================================================
--- trunk/src/gfx/mesh_creator.cc	(revision 533)
+++ trunk/src/gfx/mesh_creator.cc	(revision 534)
@@ -15,10 +15,10 @@
 void nv::mesh_nodes_creator::merge_keys()
 {
-	for ( size_t i = 0; i < m_data->size(); ++i )
+	for ( uint32 i = 0; i < m_data->size(); ++i )
 	{
 		data_channel_set* old_keys = m_data->m_data[i];
 		if ( old_keys && old_keys->size() > 0 )
 		{
-			size_t chan_count = old_keys->size();
+			uint32 chan_count = old_keys->size();
 			if ( chan_count == 1 
 				&& old_keys->get_channel(0)->descriptor().size() == 1
@@ -516,5 +516,5 @@
 	NV_ASSERT( a.size() % frame_count == 0, "Merge - append first mesh empty!" );
 	NV_ASSERT( b.size() % frame_count == 0, "Merge - append second mesh empty!" );
-	size_t vtx_size = a.element_size();
+	uint32 vtx_size = a.element_size();
 
 	raw_data_channel result = data_channel_creator::create( a.descriptor(), a.size() + b.size() );
@@ -523,5 +523,5 @@
 	if ( frame_count == 1 )
 	{
-		size_t a_size = vtx_size * a.size();
+		uint32 a_size = vtx_size * a.size();
 		raw_copy_n( a.raw_data(), a_size, rdata );
 		raw_copy_n( b.raw_data(), vtx_size * b.size(), rdata + a_size );
@@ -529,10 +529,10 @@
 	else
 	{
-		size_t frame_size_a = ( a.size() / frame_count ) * vtx_size;
-		size_t frame_size_b = ( b.size() / frame_count ) * vtx_size;
-		size_t pos_a = 0;
-		size_t pos_b = 0;
-		size_t pos   = 0;
-		for ( size_t i = 0; i < frame_count; ++i )
+		uint32 frame_size_a = ( a.size() / frame_count ) * vtx_size;
+		uint32 frame_size_b = ( b.size() / frame_count ) * vtx_size;
+		uint32 pos_a = 0;
+		uint32 pos_b = 0;
+		uint32 pos   = 0;
+		for ( uint32 i = 0; i < frame_count; ++i )
 		{
 			raw_copy_n( a.raw_data() + pos_a, frame_size_a, rdata + pos );
Index: trunk/src/gfx/skeleton_instance.cc
===================================================================
--- trunk/src/gfx/skeleton_instance.cc	(revision 533)
+++ trunk/src/gfx/skeleton_instance.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2011-2015 ChaosForge Ltd
+// Copyright (C) 2011-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/gfx/texture_atlas.cc
===================================================================
--- trunk/src/gfx/texture_atlas.cc	(revision 533)
+++ trunk/src/gfx/texture_atlas.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/gl/gl_context.cc
===================================================================
--- trunk/src/gl/gl_context.cc	(revision 533)
+++ trunk/src/gl/gl_context.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -311,5 +311,5 @@
 }
 
-void nv::gl_context::bind( buffer b, uint32 index, size_t offset /*= 0*/, size_t size /*= 0 */ )
+void nv::gl_context::bind( buffer b, uint32 index, uint32 offset /*= 0*/, uint32 size /*= 0 */ )
 {
 	const gl_buffer_info* info = static_cast< const gl_buffer_info* >( m_device->get_buffer_info( b ) );
@@ -465,5 +465,5 @@
 }
 
-void* nv::gl_context::map_buffer( buffer b, buffer_access ba, size_t offset, size_t length )
+void* nv::gl_context::map_buffer( buffer b, buffer_access ba, uint32 offset, uint32 length )
 {
 	const gl_buffer_info* info = static_cast<const gl_buffer_info*>( m_device->get_buffer_info( b ) );
@@ -492,5 +492,5 @@
 }
 
-// void nv::gl_context::update( buffer b, uint32 index, const void* data, size_t offset, size_t size )
+// void nv::gl_context::update( buffer b, uint32 index, const void* data, uint32 offset, uint32 size )
 // {
 // 	const gl_buffer_info* info = static_cast<const gl_buffer_info*>( m_device->get_buffer_info( b ) );
@@ -506,5 +506,5 @@
 // }
 
-void gl_context::update( buffer b, const void* data, nv::size_t offset, nv::size_t size )
+void gl_context::update( buffer b, const void* data, nv::uint32 offset, nv::uint32 size )
 {
 	const gl_buffer_info* info = static_cast< const gl_buffer_info* >( m_device->get_buffer_info( b ) );
@@ -1020,5 +1020,5 @@
 }
 
-nv::buffer nv::gl_context::create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source /*= nullptr */ )
+nv::buffer nv::gl_context::create_buffer( buffer_type type, buffer_hint hint, uint32 size, const void* source /*= nullptr */ )
 {
 	buffer result = static_cast<gl_device*>( m_device )->create_buffer( type, hint );
@@ -1027,5 +1027,5 @@
 }
 
-void nv::gl_context::create_buffer( buffer b, size_t size, const void* source /*= nullptr */ )
+void nv::gl_context::create_buffer( buffer b, uint32 size, const void* source /*= nullptr */ )
 {
 	gl_buffer_info* info = static_cast<gl_device*>( m_device )->get_full_buffer_info( b );
@@ -1067,5 +1067,5 @@
 }
 
-void gl_context::draw( primitive prim, const render_state& rs, program p, vertex_array va, nv::size_t count, nv::size_t first )
+void gl_context::draw( primitive prim, const render_state& rs, program p, vertex_array va, nv::uint32 count, nv::uint32 first )
 {
 	apply_render_state( rs );
@@ -1077,5 +1077,5 @@
 		if ( info->index.is_valid() )
 		{
-			glDrawElements( primitive_to_enum(prim), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast< const void* >( get_datatype_info( info->index_type ).size * first ) );
+			glDrawElements( primitive_to_enum(prim), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast< const void* >( size_t( get_datatype_info( info->index_type ).size * first ) ) );
 		}
 		else
@@ -1088,5 +1088,5 @@
 }
 
-void nv::gl_context::draw_instanced( primitive prim, const render_state& rs, program p, size_t instances, vertex_array va, size_t count, size_t first /*= 0 */ )
+void nv::gl_context::draw_instanced( primitive prim, const render_state& rs, program p, uint32 instances, vertex_array va, uint32 count, uint32 first /*= 0 */ )
 {
 	apply_render_state( rs );
@@ -1098,5 +1098,5 @@
 		if ( info->index.is_valid() )
 		{
-			glDrawElementsInstanced( primitive_to_enum( prim ), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast<const void*>( get_datatype_info( info->index_type ).size * first ), instances );
+			glDrawElementsInstanced( primitive_to_enum( prim ), static_cast<GLsizei>( count ), datatype_to_gl_enum( info->index_type ), reinterpret_cast<const void*>( size_t( get_datatype_info( info->index_type ).size * first ) ), instances );
 		}
 		else
Index: trunk/src/gl/gl_device.cc
===================================================================
--- trunk/src/gl/gl_device.cc	(revision 533)
+++ trunk/src/gl/gl_device.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/gui/gui_gfx_renderer.cc
===================================================================
--- trunk/src/gui/gui_gfx_renderer.cc	(revision 533)
+++ trunk/src/gui/gui_gfx_renderer.cc	(revision 534)
@@ -109,5 +109,5 @@
 {
 public:
-	screen_render_data( context* actx, nv::size_t initial_size )
+	screen_render_data( context* actx, nv::uint32 initial_size )
 		: buffer( actx, VERTEX_BUFFER, DYNAMIC_DRAW, initial_size ), ctx( actx ), varray(), shader()
 	{
@@ -147,5 +147,5 @@
 	m_area.dim( dimension( w->get_width(), w->get_height() ) );
 	region white = m_atlas.get_region( ivec2( 3, 3 ) );
-	size_t wsize = m_atlas.get_depth() * 4 * 4;
+	uint32 wsize = m_atlas.get_depth() * 4 * 4;
 	uint8* wfill = new uint8[m_atlas.get_depth() * 4 * 4];
 	raw_fill( wfill, wfill + wsize, 255 );
@@ -178,5 +178,5 @@
 }
 
-texture_font* gfx_renderer::get_font( nv::size_t name ) const
+texture_font* gfx_renderer::get_font( nv::uint32 name ) const
 {
 	if ( name >= m_fonts.size() ) return nullptr;
@@ -184,5 +184,5 @@
 }
 
-const image_info* gfx_renderer::get_image( nv::size_t name ) const
+const image_info* gfx_renderer::get_image( nv::uint32 name ) const
 {
 	if ( name >= m_images.size() ) return nullptr;
@@ -190,5 +190,5 @@
 }
 
-nv::size_t gfx_renderer::load_font( const string_view& filename, nv::size_t size )
+nv::uint32 gfx_renderer::load_font( const string_view& filename, nv::uint32 size )
 {
 	string128 id( filename );
@@ -199,5 +199,5 @@
 		return i->second;
 	}
-	size_t result = m_fonts.size();
+	uint32 result = m_fonts.size();
 	texture_font* f = new texture_font( &m_atlas, filename.data(), static_cast<float>( size ) );
 	f->load_glyphs( "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ " );
@@ -208,5 +208,5 @@
 }
 
-nv::size_t gfx_renderer::load_image( const string_view& filename )
+nv::uint32 gfx_renderer::load_image( const string_view& filename )
 {
 	auto i = m_image_names.find( filename );
@@ -215,5 +215,5 @@
 		return i->second;
 	}
-	size_t result = m_images.size();
+	uint32 result = m_images.size();
 	image_data* data = m_window->get_device()->create_image_data( filename );
 	// TODO: Repitching
@@ -236,5 +236,5 @@
 	}
 	element_render_data* er = reinterpret_cast< element_render_data* >( e->m_render_data );
-	size_t size_before = er->buffer.data().size();
+	uint32 size_before = er->buffer.data().size();
 
 	vector< gui_quad >& qvec = er->buffer.lock();
@@ -254,5 +254,5 @@
 		if ( m_style.get( e, "skin", selector, path ) )
 		{
-			size_t image_id = load_image( path );
+			uint32 image_id = load_image( path );
 			const image_info* image = get_image( image_id );
 			if ( image )
@@ -319,5 +319,5 @@
 			if ( m_style.get( e, "text_color", selector, color ) && m_style.get( e, "text_font", selector, path ) && m_style.get( e, "text_size", selector, border ) )
 			{
-				size_t font_id = load_font( path, size_t( border ) );
+				uint32 font_id = load_font( path, uint32( border ) );
 				texture_font* font = get_font( font_id );
 				position p = abs.ul + position( 0, border );
Index: trunk/src/gui/gui_style.cc
===================================================================
--- trunk/src/gui/gui_style.cc	(revision 533)
+++ trunk/src/gui/gui_style.cc	(revision 534)
@@ -33,5 +33,5 @@
 	if ( !resolve( e->m_id, e->m_class, cselector, centry, LUA_TTABLE ) ) return false;
 	vec = vec4();
-	for ( size_t i = 0; i < 4; ++i )
+	for ( uint32 i = 0; i < 4; ++i )
 	{
 		lua_rawgeti( m_lua, -1, int(i+1) );
Index: trunk/src/image/miniz.cc
===================================================================
--- trunk/src/image/miniz.cc	(revision 533)
+++ trunk/src/image/miniz.cc	(revision 534)
@@ -1166,5 +1166,5 @@
 			TINFL_GET_BYTE( 1, r->m_zhdr0 ); TINFL_GET_BYTE( 2, r->m_zhdr1 );
 			counter = ( ( ( r->m_zhdr0 * 256 + r->m_zhdr1 ) % 31 != 0 ) || ( r->m_zhdr1 & 32 ) || ( ( r->m_zhdr0 & 15 ) != 8 ) );
-			if ( !( decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF ) ) counter |= ( ( ( 1U << ( 8U + ( r->m_zhdr0 >> 4 ) ) ) > 32768U ) || ( ( out_buf_size_mask + 1 ) < (size_t)( 1U << ( 8U + ( r->m_zhdr0 >> 4 ) ) ) ) );
+			if ( !( decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF ) ) counter |= ( ( ( 1U << ( 8U + ( r->m_zhdr0 >> 4 ) ) ) > 32768U ) || ( ( out_buf_size_mask + 1 ) < (uint32)( 1U << ( 8U + ( r->m_zhdr0 >> 4 ) ) ) ) );
 			if ( counter ) { TINFL_CR_RETURN_FOREVER( 36, TINFL_STATUS_FAILED ); }
 		}
Index: trunk/src/image/png_loader.cc
===================================================================
--- trunk/src/image/png_loader.cc	(revision 533)
+++ trunk/src/image/png_loader.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2015-2015 ChaosForge Ltd
+// Copyright (C) 2015-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -251,5 +251,5 @@
 	int remaining()
 	{
-		return m_img_buffer_end - m_img_buffer;
+		return (int)( m_img_buffer_end - m_img_buffer );
 	}
 
@@ -865,5 +865,6 @@
 
 		case STBI__PNG_TYPE( 'I', 'E', 'N', 'D' ): {
-			uint32 raw_len, bpl;
+			size_t raw_len;
+			uint32 bpl;
 			if ( first ) return stbi__err( "first not IHDR", "Corrupt PNG" );
 			if ( scan != STBI__SCAN_load ) return 1;
@@ -882,5 +883,5 @@
 			else
 				s->img_out_n = s->img_n;
-			if ( !stbi__create_png_image( z, z->expanded, raw_len, s->img_out_n, depth, color, interlace ) ) return 0;
+			if ( !stbi__create_png_image( z, z->expanded, int( raw_len ), s->img_out_n, depth, color, interlace ) ) return 0;
 			if ( has_trans )
 				if ( !stbi__compute_transparency( z, tc, s->img_out_n ) ) return 0;
@@ -977,5 +978,5 @@
 static int stbi__stream_read( void *user, char *data, int size )
 {
-	return reinterpret_cast<stream*>( user )->read( data, 1, size );
+	return (int)reinterpret_cast<stream*>( user )->read( data, 1, size );
 }
 
@@ -1022,5 +1023,5 @@
 	if ( stbi__png_info( &s, &x, &y, &comp ) == 1 )
 	{
-		str.seek( pos, origin::SET );
+		str.seek( (long)pos, origin::SET );
 		format.type = UBYTE;
 		switch ( comp )
Index: trunk/src/image/png_writer.cc
===================================================================
--- trunk/src/image/png_writer.cc	(revision 533)
+++ trunk/src/image/png_writer.cc	(revision 534)
@@ -372,5 +372,5 @@
 	ivec2 sz = data->get_size();
 	int len = 0;
-	unsigned char* out = stbi_write_png_to_mem( data->get_data(), 0, sz.x, sz.y, data->get_depth(), &len );
+	unsigned char* out = stbi_write_png_to_mem( data->get_data(), 0, sz.x, sz.y, (int)data->get_depth(), &len );
 	if ( !out ) return false;
 	s.write( out, 1, len );
Index: trunk/src/io/c_file_system.cc
===================================================================
--- trunk/src/io/c_file_system.cc	(revision 533)
+++ trunk/src/io/c_file_system.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/src/lua/lua_math.cc
===================================================================
--- trunk/src/lua/lua_math.cc	(revision 533)
+++ trunk/src/lua/lua_math.cc	(revision 534)
@@ -11,5 +11,6 @@
 #include "nv/stl/type_traits/common.hh"
 
-static size_t nlua_swizzel_lookup[256];
+using nv::uint32;
+static nv::uint32 nlua_swizzel_lookup[256];
 
 using nv::lua::detail::is_vec;
@@ -18,5 +19,5 @@
 using nv::lua::detail::push_vec;
 
-inline bool nlua_is_swizzel( const unsigned char* str, size_t max )
+inline bool nlua_is_swizzel( const unsigned char* str, nv::uint32 max )
 {
 	while (*str)
@@ -229,5 +230,5 @@
 {
 	T v = to_vec<T>( L, 1 );
-	for ( size_t i = 0; i < v.size(); ++i )
+	for ( uint32 i = 0; i < v.size(); ++i )
 	{
 		lua_pushnumber( L, v[i] );
@@ -241,7 +242,7 @@
 	T* v = to_pvec<T>( L, 1 );
 	size_t len  = 0;
-	size_t vlen = v->size();
+	uint32 vlen = v->size();
 	const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
-	size_t idx = 255;
+	uint32 idx = 255;
 
 	if ( len == 1 )
@@ -279,7 +280,7 @@
 	T* v = to_pvec<T>( L, 1 );
 	size_t len  = 0;
-	size_t vlen = v->size();
+	uint32 vlen = v->size();
 	const unsigned char * key = reinterpret_cast<const unsigned char *>( lua_tolstring( L, 2, &len ) );
-	size_t idx = 255;
+	uint32 idx = 255;
 	if( len == 1 )
 	{
@@ -294,7 +295,7 @@
 	{
  		switch (len) {
-		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
-		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
-		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( size_t i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
+		case 2 : { vec2 v2 = to_vec<vec2>(L,3); for ( uint32 i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v2[i]; } return 0;
+		case 3 : { vec3 v3 = to_vec<vec3>(L,3); for ( uint32 i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v3[i]; } return 0;
+		case 4 : { vec4 v4 = to_vec<vec4>(L,3); for ( uint32 i = 0; i< len; ++i) (*v)[nlua_swizzel_lookup[key[i]]] = v4[i]; } return 0;
  		default: break;
 		}
@@ -405,5 +406,5 @@
 void nv::lua::register_math( lua::state* state )
 { 
-	for (size_t i = 0; i < 256; ++i ) nlua_swizzel_lookup[i] = 255;
+	for (uint32 i = 0; i < 256; ++i ) nlua_swizzel_lookup[i] = 255;
 	using nv::uchar8;
 	nlua_swizzel_lookup[uchar8( 'x' )] = 0;
Index: trunk/src/lua/lua_nova.cc
===================================================================
--- trunk/src/lua/lua_nova.cc	(revision 533)
+++ trunk/src/lua/lua_nova.cc	(revision 534)
@@ -91,5 +91,5 @@
 		if (lua_tointeger( L, itype ) != lua_type( L, ivalue ) && lua_tointeger( L, itype ) > 0)
 		{
-			luaL_error( L, "lua.nova - \"%s.%s\" - type mismatch, %s expected, %s found!", lua_tolstring( L, iid, 0 ), lua_tolstring( L, ifield, 0 ), lua_typename( L, lua_tointeger( L, itype ) ), lua_typename( L, lua_type( L, ivalue ) ) );
+			luaL_error( L, "lua.nova - \"%s.%s\" - type mismatch, %s expected, %s found!", lua_tolstring( L, iid, 0 ), lua_tolstring( L, ifield, 0 ), lua_typename( L, (int)lua_tointeger( L, itype ) ), lua_typename( L, lua_type( L, ivalue ) ) );
 		}
 		break;
@@ -296,5 +296,5 @@
 	lua_rawget( L, 1 );
 	int count = 0;
-	if ( !lua_isnil( L, -1 ) ) count = lua_tointeger( L, -1 );
+	if ( !lua_isnil( L, -1 ) ) count = (int)lua_tointeger( L, -1 );
 	lua_pop( L, 1 );
 	count++;
@@ -358,5 +358,5 @@
 static int nova_create_seq_function_closure( lua_State * L )
 {
-	int fc   = lua_tointeger( L, lua_upvalueindex( 1 ) );
+	int fc   = (int)lua_tointeger( L, lua_upvalueindex( 1 ) );
 	int args = lua_gettop( L );
 	for ( int fi = 1; fi <= fc; fi++ )
Index: trunk/src/lua/lua_path.cc
===================================================================
--- trunk/src/lua/lua_path.cc	(revision 533)
+++ trunk/src/lua/lua_path.cc	(revision 534)
@@ -16,5 +16,5 @@
 	string_view spath( m_elements[0].str, m_elements[0].length );
 	m_count = 0;
-	size_t point = spath.find( '.' );
+	uint32 point = spath.find( '.' );
 
 	while ( point != string_view::npos )
Index: trunk/src/lua/lua_raw.cc
===================================================================
--- trunk/src/lua/lua_raw.cc	(revision 533)
+++ trunk/src/lua/lua_raw.cc	(revision 534)
@@ -331,5 +331,5 @@
 int nlua_rawlen( lua_State* L, int index )
 {
-	return lua_objlen( L, index );
+	return static_cast<int>( lua_objlen( L, index ) );
 }
 
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 533)
+++ trunk/src/lua/lua_state.cc	(revision 534)
@@ -911,5 +911,5 @@
 	if ( lua_type( state->get_raw(), index ) == LUA_TBOOLEAN )
 	{
-		*value = bool( lua_toboolean( state->get_raw(), index ) );
+		*value = lua_toboolean( state->get_raw(), index ) != 0;
 		return true;
 	}
Index: trunk/src/lua/lua_types.cc
===================================================================
--- trunk/src/lua/lua_types.cc	(revision 533)
+++ trunk/src/lua/lua_types.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2016-2016 ChaosForge Ltd
+// Copyright (C) 2016-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -85,5 +85,5 @@
 		{
 			int error; // proper type instead of sint32?
-			*(sint32*)object = lua_tointeger( lstate, index );
+			*(sint32*)object = (sint32)lua_tointeger( lstate, index );
 			return true;
 		}
Index: trunk/src/lua/lua_values.cc
===================================================================
--- trunk/src/lua/lua_values.cc	(revision 533)
+++ trunk/src/lua/lua_values.cc	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
