Index: trunk/nv/core/logger.hh
===================================================================
--- trunk/nv/core/logger.hh	(revision 533)
+++ trunk/nv/core/logger.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/core/random.hh
===================================================================
--- trunk/nv/core/random.hh	(revision 533)
+++ trunk/nv/core/random.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -470,5 +470,4 @@
 	};
 
-
 	class random : public random_mersenne
 	{
Index: trunk/nv/formats/assimp_loader.hh
===================================================================
--- trunk/nv/formats/assimp_loader.hh	(revision 533)
+++ trunk/nv/formats/assimp_loader.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd
+// Copyright (C) 2014-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -24,11 +24,11 @@
 		explicit assimp_loader( string_table* strings, const string_view& a_ext, uint32 a_assimp_flags = 0 );
 		virtual bool load( stream& source );
-		virtual data_channel_set* release_mesh_data( size_t index, data_node_info& info );
-		virtual size_t get_mesh_count() const { return m_mesh_count; }
+		virtual data_channel_set* release_mesh_data( uint32 index, data_node_info& info );
+		virtual uint32 get_mesh_count() const { return m_mesh_count; }
 		virtual ~assimp_loader();
-		virtual size_t get_nodes_data_count() const;
-		virtual mesh_nodes_data* release_mesh_nodes_data( size_t index = 0 );
-		virtual data_node_list* release_data_node_list( size_t = 0 );
-		virtual bool is_animated( size_t = 0 );
+		virtual uint32 get_nodes_data_count() const;
+		virtual mesh_nodes_data* release_mesh_nodes_data( uint32 index = 0 );
+		virtual data_node_list* release_data_node_list( uint32 = 0 );
+		virtual bool is_animated( uint32 = 0 );
 		void scene_report() const;
 	private:
@@ -36,5 +36,5 @@
 		void build_skeleton( vector< data_node_info >& skeleton, const void* node, sint16 parent_id );
 		data_node_list* release_merged_bones();
-		void load_mesh_data( data_channel_set* data, size_t index, data_node_info& info );
+		void load_mesh_data( data_channel_set* data, uint32 index, data_node_info& info );
 		sint16 load_node( uint32 anim_id, array_ref< data_channel_set* > nodes, array_ref< data_node_info > infos, const void* vnode, sint16 this_id, sint16 parent_id );
 		void scan_nodes( const void* node ) const;
@@ -51,5 +51,5 @@
 		const_string m_ext;
 		uint32 m_assimp_flags;
-		size_t m_mesh_count;
+		uint32 m_mesh_count;
 	};
 
Index: trunk/nv/formats/nmd_loader.hh
===================================================================
--- trunk/nv/formats/nmd_loader.hh	(revision 533)
+++ trunk/nv/formats/nmd_loader.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd
+// Copyright (C) 2014-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -84,10 +84,10 @@
 		explicit nmd_loader( string_table* strings ) : mesh_loader( strings ), /*m_node_data( nullptr ), */m_bone_data( nullptr ), m_pose_data_set( nullptr ) {}
 		virtual bool load( stream& source );
-		virtual data_channel_set* release_mesh_data( size_t index, data_node_info& info );
-		virtual size_t get_nodes_data_count() const { return 1; }
-		virtual mesh_nodes_data* release_mesh_nodes_data( size_t = 0 );
-		virtual data_node_list* release_data_node_list( size_t = 0 );
-		virtual bool is_animated( size_t = 0 );
-		virtual size_t get_mesh_count() const { return m_meshes.size(); }
+		virtual data_channel_set* release_mesh_data( uint32 index, data_node_info& info );
+		virtual uint32 get_nodes_data_count() const { return 1; }
+		virtual mesh_nodes_data* release_mesh_nodes_data( uint32 = 0 );
+		virtual data_node_list* release_data_node_list( uint32 = 0 );
+		virtual bool is_animated( uint32 = 0 );
+		virtual uint32 get_mesh_count() const { return m_meshes.size(); }
 		virtual ~nmd_loader();
 
Index: trunk/nv/formats/obj_loader.hh
===================================================================
--- trunk/nv/formats/obj_loader.hh	(revision 533)
+++ trunk/nv/formats/obj_loader.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -27,6 +27,6 @@
 		obj_loader( string_table* strings, bool normals = true, bool tangents = false );
 		virtual bool load( stream& source );
-		virtual data_channel_set* release_mesh_data( size_t index, data_node_info& info );
-		virtual size_t get_mesh_count() const { return m_meshes.size(); }
+		virtual data_channel_set* release_mesh_data( uint32 index, data_node_info& info );
+		virtual uint32 get_mesh_count() const { return m_meshes.size(); }
 		~obj_loader();
 	private:
Index: trunk/nv/gfx/image.hh
===================================================================
--- trunk/nv/gfx/image.hh	(revision 533)
+++ trunk/nv/gfx/image.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -42,5 +42,5 @@
 		 * @arg[in] depth :  Depth of the image.
 		 */
-		image( ivec2 size, size_t depth );
+		image( ivec2 size, uint32 depth );
 		/**
 		 * Constructor
@@ -61,5 +61,5 @@
 		 * 	reversed or not.
 		 */
-		image( ivec2 size, size_t depth, const uint8 * data, bool reversed = false );
+		image( ivec2 size, uint32 depth, const uint8 * data, bool reversed = false );
 		/**
 		 * Fills the image with a given value.
@@ -114,8 +114,8 @@
 		 * @return Returns depth of the image.
 		 */
-		size_t get_depth() const { return m_depth; }
+		uint32 get_depth() const { return m_depth; }
 	protected:
 		ivec2  m_size;  //!< Defines the size of the image as a vector.
-		size_t m_depth; //!< Defines the depth of the image
+		uint32 m_depth; //!< Defines the depth of the image
 		uint8* m_data;  //!< Holder for data
 	};
Index: trunk/nv/gfx/skeleton_instance.hh
===================================================================
--- trunk/nv/gfx/skeleton_instance.hh	(revision 533)
+++ trunk/nv/gfx/skeleton_instance.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -106,5 +106,5 @@
 		skeleton_transforms() {}
 		const transform* xforms() const { return m_transforms.data(); }
-		size_t size() const { return m_transforms.size(); }
+		uint32 size() const { return m_transforms.size(); }
 		void assign( const data_node_list* node_data );
 		void assign( const skeleton_transforms& other );
@@ -149,5 +149,5 @@
 		skeleton_instance() {}
 		const mat4* xforms() const { return m_matrix.data(); }
-		size_t size() const { return m_matrix.size(); }
+		uint32 size() const { return m_matrix.size(); }
 		void assign( const skeleton_transforms& skeleton, const skeleton_binding& binding, const bone_transforms< value_type >& bones )
 		{
Index: trunk/nv/gfx/sliced_buffer.hh
===================================================================
--- trunk/nv/gfx/sliced_buffer.hh	(revision 533)
+++ trunk/nv/gfx/sliced_buffer.hh	(revision 534)
@@ -26,5 +26,5 @@
 		typedef sliced_buffer<T> cache_type;
 		typedef vector<T>        vector_type;
-		typedef size_t           size_type;
+		typedef uint32           uint32ype;
 
 		buffer_slice( cache_type* c ) 
@@ -60,5 +60,5 @@
 		}
 
-		size_t get_offset() const
+		uint32 get_offset() const
 		{
 			return m_offset;
@@ -81,6 +81,6 @@
 		vector_type m_data;
 		cache_type* m_cache;
-		size_type   m_offset;
-		size_type   m_cached_size;
+		uint32ype   m_offset;
+		uint32ype   m_cached_size;
 		bool        m_locked;
 	};
@@ -92,7 +92,7 @@
 		typedef vector<T>  vector_type;
 		typedef T          value_type;
-		static const size_t value_type_size = sizeof(T);
-
-		sliced_buffer( context* ctx, buffer_type type, buffer_hint hint, size_t initial_size ) 
+		static const uint32 value_type_size = sizeof(T);
+
+		sliced_buffer( context* ctx, buffer_type type, buffer_hint hint, uint32 initial_size ) 
 			: m_context( ctx )
 			, m_buffer()
@@ -108,10 +108,10 @@
 		}
 
-		bool commit( const vector_type& bv, bool updated, bool resized, size_t& offset )
+		bool commit( const vector_type& bv, bool updated, bool resized, uint32& offset )
 		{
 			if ( !m_full_update && resized )
 			{
 				m_data.erase( m_data.begin() + static_cast<int>( offset ), m_data.end() );
-				m_min = nv::min<size_t>( m_min, offset );
+				m_min = nv::min<uint32>( m_min, offset );
 				m_full_update = true;
 			}
@@ -125,6 +125,6 @@
 //				raw_copy( bv.cbegin(), bv.cend(), m_data.begin() + (int)offset );
 				raw_copy( bv.data(), bv.data() + bv.size(), m_data.data() + static_cast<int>( offset ) );
-				m_min = nv::min<size_t>( m_min, offset );
-				m_max = nv::max<size_t>( m_max, offset + bv.size() );
+				m_min = nv::min<uint32>( m_min, offset );
+				m_max = nv::max<uint32>( m_max, offset + bv.size() );
 			}
 			return m_full_update;
@@ -132,5 +132,5 @@
 
 		template < typename V > 
-		void add_offset( size_t size, size_t offset, V value )
+		void add_offset( uint32 size, uint32 offset, V value )
 		{
 			if ( size == 0 ) return;
@@ -157,5 +157,5 @@
 		{
 			bool result = false;
-			size_t bsize = get_max_size();
+			uint32 bsize = get_max_size();
 
 			if ( m_data.size() > bsize )
@@ -170,6 +170,6 @@
 			if ( m_max > 0 )
 			{
-				size_t offset = m_min * value_type_size;
-				size_t size   = (m_max-m_min) * value_type_size;
+				uint32 offset = m_min * value_type_size;
+				uint32 size   = (m_max-m_min) * value_type_size;
 				m_context->update( m_buffer, m_data.data() + m_min, offset, size );
 			}
@@ -180,10 +180,10 @@
 		}
 
-		size_t get_max_size() const
+		uint32 get_max_size() const
 		{ 
 			return m_capacity;
 		}
 
-		size_t get_size() const
+		uint32 get_size() const
 		{ 
 			return m_data.size(); 
@@ -200,5 +200,5 @@
 		}
 	private:
-		void create_buffer( size_t size )
+		void create_buffer( uint32 size )
 		{
 			m_capacity = size;
@@ -217,6 +217,6 @@
 		uint32      m_capacity;
 
-		size_t      m_min;
-		size_t      m_max;
+		uint32      m_min;
+		uint32      m_max;
 	};
 
Index: trunk/nv/gfx/texture_atlas.hh
===================================================================
--- trunk/nv/gfx/texture_atlas.hh	(revision 533)
+++ trunk/nv/gfx/texture_atlas.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/gl/gl_context.hh
===================================================================
--- trunk/nv/gl/gl_context.hh	(revision 533)
+++ trunk/nv/gl/gl_context.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -49,6 +49,6 @@
 		virtual texture create_texture( texture_type type, ivec3 size, image_format aformat, sampler asampler, const void* data = nullptr );
 
-		virtual buffer create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source = nullptr );
-		virtual void create_buffer( buffer, size_t, const void* = nullptr );
+		virtual buffer create_buffer( buffer_type type, buffer_hint hint, uint32 size, const void* source = nullptr );
+		virtual void create_buffer( buffer, uint32, const void* = nullptr );
 
 		virtual void set_draw_buffers( uint32 count, const output_slot* slots );
@@ -66,19 +66,19 @@
 		virtual void bind( framebuffer f, framebuffer_slot ft = FRAMEBUFFER );
 		virtual void bind( texture t, texture_slot slot );
-		virtual void bind( buffer b, uint32 index, size_t offset = 0, size_t size = 0 );
+		virtual void bind( buffer b, uint32 index, uint32 offset = 0, uint32 size = 0 );
 		virtual void bind( buffer b, texture t );
 
 
 		virtual void update( texture t, const void* data );
-		virtual void update( buffer b, const void* data, size_t offset, size_t size );
-		virtual void* map_buffer( buffer, buffer_access, size_t /*offset*/, size_t /*length*/ );
+		virtual void update( buffer b, const void* data, uint32 offset, uint32 size );
+		virtual void* map_buffer( buffer, buffer_access, uint32 /*offset*/, uint32 /*length*/ );
 		virtual void unmap_buffer( buffer );
 
-		//		virtual void update( buffer b, uint32 index, const void* data, size_t offset, size_t size );
+		//		virtual void update( buffer b, uint32 index, const void* data, uint32 offset, uint32 size );
 
 		virtual void clear( const clear_state& cs );
 		// temporary
-		virtual void draw( primitive prim, const render_state& rs, program p, vertex_array va, size_t count, size_t first = 0 );
-		virtual void draw_instanced( primitive prim, const render_state& rs, program p, size_t instances, vertex_array va, size_t count, size_t first = 0 );
+		virtual void draw( primitive prim, const render_state& rs, program p, vertex_array va, uint32 count, uint32 first = 0 );
+		virtual void draw_instanced( primitive prim, const render_state& rs, program p, uint32 instances, vertex_array va, uint32 count, uint32 first = 0 );
 
 		virtual const ivec4& get_viewport();
Index: trunk/nv/gui/gui_gfx_renderer.hh
===================================================================
--- trunk/nv/gui/gui_gfx_renderer.hh	(revision 533)
+++ trunk/nv/gui/gui_gfx_renderer.hh	(revision 534)
@@ -55,11 +55,11 @@
 			virtual ~gfx_renderer();
 		private:
-			texture_font* get_font( size_t name ) const;
-			const image_info* get_image( size_t name ) const;
+			texture_font* get_font( uint32 name ) const;
+			const image_info* get_image( uint32 name ) const;
 
-			size_t load_font( const string_view& filename, size_t size );
-			size_t load_image( const string_view& filename );
+			uint32 load_font( const string_view& filename, uint32 size );
+			uint32 load_image( const string_view& filename );
 
-			typedef hash_store< shash64, size_t > names;
+			typedef hash_store< shash64, uint32 > names;
 			typedef vector< texture_font* >              font_vector;
 			typedef vector< image_info >                 image_vector;
Index: trunk/nv/image/miniz.hh
===================================================================
--- trunk/nv/image/miniz.hh	(revision 533)
+++ trunk/nv/image/miniz.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2015-2015 ChaosForge Ltd
+// Copyright (C) 2015-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/interface/context.hh
===================================================================
--- trunk/nv/interface/context.hh	(revision 533)
+++ trunk/nv/interface/context.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -107,5 +107,5 @@
 
 		// TODO: should be private
-		void add_vertex_buffer( slot location, buffer buf, datatype datatype, size_t components, size_t offset = 0, size_t stride = 0, bool owner = true )
+		void add_vertex_buffer( slot location, buffer buf, datatype datatype, uint32 components, uint32 offset = 0, uint32 stride = 0, bool owner = true )
 		{
 			NV_ASSERT( count < uint16( MAX_ATTRIBUTES ), "MAX_ATTRIBUTES reached!" );
@@ -184,6 +184,6 @@
 			return create_program( vs, fs );
 		}
-		virtual buffer create_buffer( buffer_type type, buffer_hint hint, size_t size, const void* source = nullptr ) = 0;
-		virtual void   create_buffer( buffer, size_t, const void* = nullptr ) = 0;
+		virtual buffer create_buffer( buffer_type type, buffer_hint hint, uint32 size, const void* source = nullptr ) = 0;
+		virtual void   create_buffer( buffer, uint32, const void* = nullptr ) = 0;
 
 
@@ -204,21 +204,21 @@
 		virtual void bind( framebuffer f, framebuffer_slot slot = FRAMEBUFFER ) = 0;
 		virtual void bind( texture, texture_slot ) = 0;
-		virtual void bind( buffer, uint32 /*index*/, size_t /*offset*/ = 0, size_t /*size */= 0 ) = 0;
+		virtual void bind( buffer, uint32 /*index*/, uint32 /*offset*/ = 0, uint32 /*size */= 0 ) = 0;
 		virtual void bind( buffer, texture ) = 0;
 
 		virtual void update( texture, const void* ) = 0;
-		virtual void update( buffer, const void*, size_t /*offset*/, size_t /*size*/ ) = 0;
-		virtual void* map_buffer( buffer, buffer_access, size_t /*offset*/, size_t /*length*/ ) = 0;
+		virtual void update( buffer, const void*, uint32 /*offset*/, uint32 /*size*/ ) = 0;
+		virtual void* map_buffer( buffer, buffer_access, uint32 /*offset*/, uint32 /*length*/ ) = 0;
 		virtual void unmap_buffer( buffer ) = 0;
 
 
-//		virtual void update( buffer, uint32 /*index*/, const void* , size_t /*offset*/, size_t /*size*/ ) = 0;
+//		virtual void update( buffer, uint32 /*index*/, const void* , uint32 /*offset*/, uint32 /*size*/ ) = 0;
 
 		virtual void clear( const clear_state& cs ) = 0;
 		// temporary
-		virtual void draw( primitive prim, const render_state& rs, program p, vertex_array va, size_t count, size_t first = 0 ) = 0;
-		virtual void draw_instanced( primitive prim, const render_state& rs, program p, size_t instances, vertex_array va, size_t count, size_t first = 0 ) = 0;
-
-		void draw( primitive prim, const render_state& rs, const scene_state& s, program p, vertex_array va, size_t count, size_t first = 0 )
+		virtual void draw( primitive prim, const render_state& rs, program p, vertex_array va, uint32 count, uint32 first = 0 ) = 0;
+		virtual void draw_instanced( primitive prim, const render_state& rs, program p, uint32 instances, vertex_array va, uint32 count, uint32 first = 0 ) = 0;
+
+		void draw( primitive prim, const render_state& rs, const scene_state& s, program p, vertex_array va, uint32 count, uint32 first = 0 )
 		{
 			apply_engine_uniforms(p,s);
@@ -250,5 +250,5 @@
 
 		template < typename VTX >
-		vertex_array create_vertex_array( const VTX* v, size_t count, buffer_hint hint )
+		vertex_array create_vertex_array( const VTX* v, uint32 count, buffer_hint hint )
 		{
 			buffer       vb = create_buffer( VERTEX_BUFFER, hint, count * sizeof( VTX ), v );
@@ -259,5 +259,5 @@
 
 		template < typename VTX, typename IDX >
-		vertex_array create_vertex_array( const VTX* v, size_t vcount, const IDX* i, size_t icount, buffer_hint hint )
+		vertex_array create_vertex_array( const VTX* v, uint32 vcount, const IDX* i, uint32 icount, buffer_hint hint )
 		{
 			buffer       vb = this->create_buffer( VERTEX_BUFFER, hint, count * sizeof( VTX ), v );
Index: trunk/nv/interface/data_channel.hh
===================================================================
--- trunk/nv/interface/data_channel.hh	(revision 533)
+++ trunk/nv/interface/data_channel.hh	(revision 534)
@@ -120,7 +120,7 @@
 		}
 
-		size_t size() const { return m_size; }
-
-		const raw_data_channel* get_channel( size_t index ) const
+		uint32 size() const { return m_size; }
+
+		const raw_data_channel* get_channel( uint32 index ) const
 		{
 			if ( m_size > index ) return &m_channels[index];
Index: trunk/nv/interface/image_data.hh
===================================================================
--- trunk/nv/interface/image_data.hh	(revision 533)
+++ trunk/nv/interface/image_data.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -75,5 +75,5 @@
 		void fill( uint8 value = 0 )
 		{
-			size_t bsize = static_cast<size_t>( m_size.x * m_size.y ) * get_depth();
+			uint32 bsize = static_cast<uint32>( m_size.x * m_size.y ) * get_depth();
 			raw_fill_n( m_data, bsize, value );
 		}
@@ -82,5 +82,5 @@
 		const ivec2 get_size() const { return m_size; }
 		// TODO : better depth check (template?)
-		size_t get_depth() const { return m_format.format == RGB || m_format.format == BGR ? 3 : ( m_format.format == RED || m_format.format == R32F || m_format.format == R16F ? 1 : 4 ); }
+		uint32 get_depth() const { return m_format.format == RGB || m_format.format == BGR ? 3 : ( m_format.format == RED || m_format.format == R32F || m_format.format == R16F ? 1 : 4 ); }
 		image_format get_format() const { return m_format; }
 		~image_data() {	if (m_data) delete[] m_data; }
@@ -88,5 +88,5 @@
 		void initialize( const uint8* data )
 		{
-			size_t bsize = static_cast<size_t>(m_size.x * m_size.y) * get_depth();
+			uint32 bsize = static_cast<uint32>(m_size.x * m_size.y) * get_depth();
 			m_data = new uint8[ bsize ]; 
 			if ( data )
Index: trunk/nv/interface/mesh_loader.hh
===================================================================
--- trunk/nv/interface/mesh_loader.hh	(revision 533)
+++ trunk/nv/interface/mesh_loader.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -31,10 +31,10 @@
 		virtual ~mesh_loader() {}
 		virtual bool load( stream& source ) = 0;
-		virtual data_channel_set* release_mesh_data( size_t index, data_node_info& ) = 0;
-		virtual size_t get_mesh_count() const = 0;
-		virtual size_t get_nodes_data_count() const { return 0; }
-		virtual mesh_nodes_data* release_mesh_nodes_data( size_t = 0 ) { return nullptr; }
-		virtual data_node_list* release_data_node_list( size_t = 0 ) { return nullptr; }
-		virtual bool is_animated( size_t = 0 ) { return false; }
+		virtual data_channel_set* release_mesh_data( uint32 index, data_node_info& ) = 0;
+		virtual uint32 get_mesh_count() const = 0;
+		virtual uint32 get_nodes_data_count() const { return 0; }
+		virtual mesh_nodes_data* release_mesh_nodes_data( uint32 = 0 ) { return nullptr; }
+		virtual data_node_list* release_data_node_list( uint32 = 0 ) { return nullptr; }
+		virtual bool is_animated( uint32 = 0 ) { return false; }
 	protected:
 		inline shash64 make_name( const string_view& name )
Index: trunk/nv/lib/assimp.hh
===================================================================
--- trunk/nv/lib/assimp.hh	(revision 533)
+++ trunk/nv/lib/assimp.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2014-2015 ChaosForge Ltd 
+// Copyright (C) 2014-2017 ChaosForge Ltd 
 // http://chaosforge.org/
 //
Index: trunk/nv/lib/freetype2.hh
===================================================================
--- trunk/nv/lib/freetype2.hh	(revision 533)
+++ trunk/nv/lib/freetype2.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/lua/lua_state.hh
===================================================================
--- trunk/nv/lua/lua_state.hh	(revision 533)
+++ trunk/nv/lua/lua_state.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/lua/lua_values.hh
===================================================================
--- trunk/nv/lua/lua_values.hh	(revision 533)
+++ trunk/nv/lua/lua_values.hh	(revision 534)
@@ -131,4 +131,22 @@
 		};
 
+#if NV_ARCHITECTURE == NV_64BIT
+		template <>
+		struct pass_traits<sint32>
+		{
+			static void push( lua_State *L, sint32 s ) { detail::push_integer( L, s ); }
+			static sint32 to( lua_State *L, int index ) { return static_cast< sint32 >( detail::to_integer( L, index ) ); }
+			static sint32 to( lua_State *L, int index, linteger def ) { return static_cast< sint32 >( detail::to_integer( L, index, def ) ); }
+		};
+
+		template <>
+		struct pass_traits<uint32>
+		{
+			static void push( lua_State *L, uint32 s ) { detail::push_unsigned( L, s ); }
+			static uint32 to( lua_State *L, int index ) { return static_cast< uint32 >( detail::to_unsigned( L, index ) ); }
+			static uint32 to( lua_State *L, int index, lunsigned def ) { return static_cast< uint32 >( detail::to_unsigned( L, index, def ) ); }
+		};
+#endif
+
 		template <>
 		struct pass_traits<lnumber>
@@ -213,15 +231,23 @@
 			};
 
-			template <typename T>
-			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_signed< T >::value > >
-			{
-				typedef linteger type;
-			};
-
-			template <typename T>
-			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_unsigned< T >::value > >
-			{
-				typedef lunsigned type;
-			};
+#if NV_ARCHITECTURE == NV_64BIT
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_signed< T >::value && sizeof( T ) < 8 > > { typedef sint32 type; };
+
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_unsigned< T >::value && sizeof( T ) < 8 > > { typedef uint32 type; };
+
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_signed< T >::value && sizeof( T ) >= 8 > > { typedef linteger type; };
+
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_unsigned< T >::value && sizeof( T ) >= 8 > > { typedef lunsigned type; };
+#else
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_signed< T >::value > > { typedef linteger type; };
+
+			template <typename T>
+			struct lua_type_impl< T, enable_if_t< is_integral< T >::value && is_unsigned< T >::value > > { typedef lunsigned type; };
+#endif
 
 			template <typename T>
Index: trunk/nv/stl/math/mat2.hh
===================================================================
--- trunk/nv/stl/math/mat2.hh	(revision 533)
+++ trunk/nv/stl/math/mat2.hh	(revision 534)
@@ -28,5 +28,5 @@
 			typedef tvec2<T> row_type;
 			typedef tmat2<T> this_type;
-			typedef size_t   size_type;
+			typedef uint32   size_type;
 			typedef T        value_type;
 
Index: trunk/nv/stl/math/mat3.hh
===================================================================
--- trunk/nv/stl/math/mat3.hh	(revision 533)
+++ trunk/nv/stl/math/mat3.hh	(revision 534)
@@ -27,5 +27,5 @@
 			typedef tvec3<T> row_type;
 			typedef tmat3<T> type;
-			typedef size_t   size_type;
+			typedef uint32   size_type;
 			typedef T        value_type;
 
Index: trunk/nv/stl/math/mat4.hh
===================================================================
--- trunk/nv/stl/math/mat4.hh	(revision 533)
+++ trunk/nv/stl/math/mat4.hh	(revision 534)
@@ -28,5 +28,5 @@
 			typedef tvec4<T> row_type;
 			typedef tmat4<T> this_type;
-			typedef size_t   size_type;
+			typedef uint32   size_type;
 			typedef T        value_type;
 
Index: trunk/nv/stl/math/relational.hh
===================================================================
--- trunk/nv/stl/math/relational.hh	(revision 533)
+++ trunk/nv/stl/math/relational.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2015-2015 ChaosForge Ltd
+// Copyright (C) 2015-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
@@ -59,5 +59,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] < rhs[i];
 
@@ -69,5 +69,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] <= rhs[i];
 			return result;
@@ -78,5 +78,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] > rhs[i];
 			return result;
@@ -87,5 +87,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] >= rhs[i];
 			return result;
@@ -96,5 +96,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] == rhs[i];
 			return result;
@@ -105,5 +105,5 @@
 		{
 			bool_vec_t<T> result( no_init );
-			for ( size_t i = 0; i < nv::size( lhs ); ++i )
+			for ( uint32 i = 0; i < nv::size( lhs ); ++i )
 				result[i] = lhs[i] != rhs[i];
 			return result;
@@ -114,5 +114,5 @@
 		{
 			bool result = false;
-			for ( size_t i = 0; i < nv::size( v ); ++i )
+			for ( uint32 i = 0; i < nv::size( v ); ++i )
 				result = result || v[i];
 			return result;
@@ -123,5 +123,5 @@
 		{
 			bool result = true;
-			for ( size_t i = 0; i < nv::size( v ); ++i )
+			for ( uint32 i = 0; i < nv::size( v ); ++i )
 				result = result && v[i];
 			return result;
@@ -132,5 +132,5 @@
 		{
 			T result( no_init );
-			for ( size_t i = 0; i < nv::size( v ); ++i )
+			for ( uint32 i = 0; i < nv::size( v ); ++i )
 				result[i] = !v[i];
 			return result;
Index: trunk/nv/stl/math/vec2.hh
===================================================================
--- trunk/nv/stl/math/vec2.hh	(revision 533)
+++ trunk/nv/stl/math/vec2.hh	(revision 534)
@@ -28,5 +28,5 @@
 			typedef T value_type;
 
-			static constexpr size_t SIZE = 2;
+			static constexpr uint32 SIZE = 2;
 
 			union
@@ -37,5 +37,5 @@
 			};
 
-			typedef size_t size_type;
+			typedef uint32 size_type;
 			inline constexpr size_type size() const { return 2; }
 
Index: trunk/nv/stl/math/vec3.hh
===================================================================
--- trunk/nv/stl/math/vec3.hh	(revision 533)
+++ trunk/nv/stl/math/vec3.hh	(revision 534)
@@ -26,5 +26,5 @@
 			typedef tvec3<T> type;
 			typedef T value_type;
-			static constexpr size_t SIZE = 3;
+			static constexpr uint32 SIZE = 3;
 
 			union
@@ -35,5 +35,5 @@
 			};
 
-			typedef size_t size_type;
+			typedef uint32 size_type;
 			inline constexpr size_type size() const { return 3; }
 
Index: trunk/nv/stl/math/vec4.hh
===================================================================
--- trunk/nv/stl/math/vec4.hh	(revision 533)
+++ trunk/nv/stl/math/vec4.hh	(revision 534)
@@ -27,5 +27,5 @@
 			typedef tvec4<T> type;
 			typedef T value_type;
-			static constexpr size_t SIZE = 4;
+			static constexpr uint32 SIZE = 4;
 
 			union
@@ -36,5 +36,5 @@
 			};
 
-			typedef size_t size_type;
+			typedef uint32 size_type;
 			inline constexpr size_type size() const { return 4; }
 
Index: trunk/nv/stl/string/string_base.hh
===================================================================
--- trunk/nv/stl/string/string_base.hh	(revision 533)
+++ trunk/nv/stl/string/string_base.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2012-2015 ChaosForge Ltd
+// Copyright (C) 2012-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
Index: trunk/nv/stl/string/string_twine.hh
===================================================================
--- trunk/nv/stl/string/string_twine.hh	(revision 533)
+++ trunk/nv/stl/string/string_twine.hh	(revision 534)
@@ -1,3 +1,3 @@
-// Copyright (C) 2015-2015 ChaosForge Ltd
+// Copyright (C) 2015-2017 ChaosForge Ltd
 // http://chaosforge.org/
 //
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/
 //
