Index: /trunk/nv/gfx/animation.hh
===================================================================
--- /trunk/nv/gfx/animation.hh	(revision 280)
+++ /trunk/nv/gfx/animation.hh	(revision 281)
@@ -49,5 +49,9 @@
 			return interpolate( m_keys[index].value, m_keys[index + 1].value, factor );
 		}
-		virtual void dump( stream* out_stream )
+		virtual uint32 raw_size() const 
+		{
+			return sizeof( size_t ) + m_keys.size() * sizeof( key );
+		}
+		virtual void dump( stream* out_stream ) const 
 		{
 			size_t sz = m_keys.size();
@@ -77,7 +81,8 @@
 		virtual mat4 get_matrix( float time ) const = 0;
 		virtual transform get_transform( float time ) const = 0;
-		virtual void dump( stream* out_stream ) = 0;
+		virtual void dump( stream* out_stream ) const = 0;
 		virtual void load( stream* in_stream ) = 0;
 		virtual bool empty() const = 0;
+		virtual uint32 raw_size() const = 0;
 		virtual ~key_animation_data() {}
 	};
@@ -111,5 +116,9 @@
 			return result;
 		}
-		virtual void dump( stream* out_stream )
+		virtual uint32 raw_size() const 
+		{
+			return m_positions.raw_size() + m_rotations.raw_size() + m_scales.raw_size();
+		}
+		virtual void dump( stream* out_stream ) const 
 		{
 			m_positions.dump( out_stream );
@@ -140,5 +149,10 @@
 		const transform* data() const { return m_keys.data(); }
 
-		virtual void dump( stream* out_stream )
+		virtual uint32 raw_size() const 
+		{
+			return sizeof( size_t ) + m_keys.size() * sizeof( transform );
+		}
+
+		virtual void dump( stream* out_stream ) const 
 		{
 			size_t sz = m_keys.size();
Index: /trunk/nv/interface/mesh_data.hh
===================================================================
--- /trunk/nv/interface/mesh_data.hh	(revision 280)
+++ /trunk/nv/interface/mesh_data.hh	(revision 281)
@@ -32,5 +32,5 @@
 		}
 
-		bool is_index() const { return count > 0 && desc.slots[0].vslot == INDEX; }
+		bool is_index() const { return count > 0 && desc.slots[0].vslot == slot::INDEX; }
 
 		uint32 size() const { return count * desc.size; }
Index: /trunk/nv/interface/vertex.hh
===================================================================
--- /trunk/nv/interface/vertex.hh	(revision 280)
+++ /trunk/nv/interface/vertex.hh	(revision 281)
@@ -16,5 +16,5 @@
 {
 
-	enum slot
+	enum class slot : uint8
 	{
 		POSITION       = 0,
@@ -31,28 +31,14 @@
 	};
 
-// 	struct vertex_descriptor
-// 	{
-// 		static const datatype position_etype   = NONE;
-// 		static const datatype normal_etype     = NONE;
-// 		static const datatype texcoord_etype   = NONE;
-// 		static const datatype tangent_etype    = NONE;
-// 		static const datatype boneindex_etype  = NONE;
-// 		static const datatype boneweight_etype = NONE;
-// 		static const datatype color_etype      = NONE;
-// 	};
-// 
-// 	template < typename VD >
-// 	struct vertex_type 
-// 		: public VD
-// 
-// 	{
-// 		typedef typename enum_to_type< VD::position_etype >::type    position_type;
-// 		typedef typename enum_to_type< VD::normal_etype >::type      normal_type;
-// 		typedef typename enum_to_type< VD::texcoord_etype >::type    texcoord_type;
-// 		typedef typename enum_to_type< VD::tangent_etype >::type     tangent_type;
-// 		typedef typename enum_to_type< VD::boneindex_etype >::type   boneindex_type;
-// 		typedef typename enum_to_type< VD::boneweight_etype >::type  boneweight_type;
-// 		typedef typename enum_to_type< VD::color_etype >::type       color_type;
-// 	};
+	enum animation_slot
+	{
+// 		TIME     = 0,
+// 		POSITION = 1,
+// 		ROTATION = 2,
+// 		SCALE    = 3,
+// 		MATRIX   = 4,
+// 		ANIM_SLOT_MAX       = 4,
+// 		ANIM_SLOT_MAX_STORE = 5,
+	};
 
 	namespace detail
@@ -66,5 +52,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, POSITION >
+		struct vertex_has_slot_impl< VT, slot::POSITION >
 		{
 		private:
@@ -79,5 +65,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, NORMAL >
+		struct vertex_has_slot_impl< VT, slot::NORMAL >
 		{
 		private:
@@ -92,5 +78,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, TEXCOORD >
+		struct vertex_has_slot_impl< VT, slot::TEXCOORD >
 		{
 		private:
@@ -105,5 +91,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, TANGENT >
+		struct vertex_has_slot_impl< VT, slot::TANGENT >
 		{
 		private:
@@ -118,5 +104,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, BONEINDEX >
+		struct vertex_has_slot_impl< VT, slot::BONEINDEX >
 		{
 		private:
@@ -131,5 +117,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, BONEWEIGHT >
+		struct vertex_has_slot_impl< VT, slot::BONEWEIGHT >
 		{
 		private:
@@ -144,5 +130,5 @@
 
 		template < typename VT >
-		struct vertex_has_slot_impl< VT, COLOR >
+		struct vertex_has_slot_impl< VT, slot::COLOR >
 		{
 		private:
@@ -170,5 +156,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, POSITION, true >
+		struct vertex_slot_info_impl< VT, slot::POSITION, true >
 		{
 			typedef decltype( VT::position ) value_type;
@@ -178,5 +164,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, TEXCOORD, true >
+		struct vertex_slot_info_impl< VT, slot::TEXCOORD, true >
 		{
 			typedef decltype( VT::texcoord ) value_type;
@@ -186,5 +172,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, NORMAL, true >
+		struct vertex_slot_info_impl< VT, slot::NORMAL, true >
 		{
 			typedef decltype( VT::normal ) value_type;
@@ -194,5 +180,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, TANGENT, true >
+		struct vertex_slot_info_impl< VT, slot::TANGENT, true >
 		{
 			typedef decltype( VT::tangent ) value_type;
@@ -202,5 +188,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, BONEINDEX, true >
+		struct vertex_slot_info_impl< VT, slot::BONEINDEX, true >
 		{
 			typedef decltype( VT::boneindex ) value_type;
@@ -210,5 +196,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, BONEWEIGHT, true >
+		struct vertex_slot_info_impl< VT, slot::BONEWEIGHT, true >
 		{
 			typedef decltype( VT::boneweight ) value_type;
@@ -218,5 +204,5 @@
 
 		template < typename VT >
-		struct vertex_slot_info_impl< VT, COLOR, true >
+		struct vertex_slot_info_impl< VT, slot::COLOR, true >
 		{
 			typedef decltype( VT::color ) value_type;
@@ -224,5 +210,11 @@
 			static const int      offset = offsetof( VT, color );
 		};
-	
+
+		template < typename KEY, animation_slot SLOT >
+		struct key_has_slot_impl
+		{
+			static bool const value = false;
+		};
+
 	}
 
@@ -243,11 +235,14 @@
 		uint32   offset;
 		slot     vslot;
+		vertex_descriptor_slot() : etype(NONE), offset(0), vslot(slot::POSITION) {}
 	};
 
 	struct vertex_descriptor
 	{
-		vertex_descriptor_slot slots[ SLOT_MAX_STORE ];
+		vertex_descriptor_slot slots[ slot::SLOT_MAX_STORE ];
 		uint32                 count;
 		uint32                 size;
+
+		vertex_descriptor() : count(0), size(0) {}
 
 		template < typename IDX >
Index: /trunk/nv/interface/vertex_buffer.hh
===================================================================
--- /trunk/nv/interface/vertex_buffer.hh	(revision 280)
+++ /trunk/nv/interface/vertex_buffer.hh	(revision 281)
@@ -100,4 +100,8 @@
 			m_map[ location ] = p;
 		}
+		void add_vertex_buffer( slot location, vertex_buffer* buffer, datatype datatype, size_t components, size_t offset = 0, size_t stride = 0, bool owner = true ) 
+		{
+			add_vertex_buffer( (int)location, buffer, datatype, components, offset, stride, owner );
+		}
 
 		void add_vertex_buffers( vertex_buffer* buffer, const mesh_raw_channel* channel )
@@ -131,4 +135,7 @@
 			}
 		}
+		void update_vertex_buffer( slot location, vertex_buffer* b, bool owner ) 
+		{update_vertex_buffer( (int)location, b, owner ); }
+		void update_vertex_buffer( slot location, size_t offset ) {update_vertex_buffer( (int)location, offset );	}
 		void set_index_buffer( index_buffer* buffer, datatype datatype, bool owner ) 
 		{ 
@@ -152,4 +159,5 @@
 			return nullptr;
 		}
+		vertex_buffer* find_buffer( slot location ) { return find_buffer((int)location); }
 		bool has_index_buffer() const { return m_index != nullptr; }
 		datatype get_index_buffer_type() const { return m_index_type; }
Index: /trunk/nv/io/string_table.hh
===================================================================
--- /trunk/nv/io/string_table.hh	(revision 280)
+++ /trunk/nv/io/string_table.hh	(revision 281)
@@ -60,5 +60,5 @@
 			in->read( &m_size, sizeof( m_size ), 1 );
 			m_offsets = new offset[ m_count ];
-			m_data    = new char[ m_count ];
+			m_data    = new char[ m_size ];
 			in->read( m_offsets, sizeof( offset ), m_count );
 			in->read( m_data,    sizeof( char ), m_size );
@@ -80,4 +80,5 @@
 		index insert( const std::string& s );
 		string_table* create_table() const;
+		uint32 dump_size() const;
 		void dump( nv::stream* out ) const;
 		const char* get( index i ) const;
Index: /trunk/src/gfx/keyframed_mesh.cc
===================================================================
--- /trunk/src/gfx/keyframed_mesh.cc	(revision 280)
+++ /trunk/src/gfx/keyframed_mesh.cc	(revision 281)
@@ -139,8 +139,8 @@
 	m_loc_next_position = a_program->get_attribute( "nv_next_position" )->get_location();
 	m_loc_next_normal   = a_program->get_attribute( "nv_next_normal" )->get_location();
-	m_va = a_device->create_vertex_array( a_data, nv::STATIC_DRAW );
-	vertex_buffer* vb = m_va->find_buffer( nv::POSITION );
-	m_va->add_vertex_buffer( m_loc_next_position, vb, nv::FLOAT, 3, 0,              sizeof( vertex_pn ), false );
-	m_va->add_vertex_buffer( m_loc_next_normal,   vb, nv::FLOAT, 3, sizeof( vec3 ), sizeof( vertex_pn ), false );
+	m_va = a_device->create_vertex_array( a_data, STATIC_DRAW );
+	vertex_buffer* vb = m_va->find_buffer( slot::POSITION );
+	m_va->add_vertex_buffer( m_loc_next_position, vb, FLOAT, 3, 0,              sizeof( vertex_pn ), false );
+	m_va->add_vertex_buffer( m_loc_next_normal,   vb, FLOAT, 3, sizeof( vec3 ), sizeof( vertex_pn ), false );
 }
 
Index: /trunk/src/gfx/skeletal_mesh.cc
===================================================================
--- /trunk/src/gfx/skeletal_mesh.cc	(revision 280)
+++ /trunk/src/gfx/skeletal_mesh.cc	(revision 281)
@@ -43,5 +43,5 @@
 		m_animation->update_skeleton( m_transform.data(), (float)m_animation_time * 0.001f );
 		m_mesh_data->apply( m_transform.data() );
-		vertex_buffer* vb = m_va->find_buffer( nv::POSITION );
+		vertex_buffer* vb = m_va->find_buffer( nv::slot::POSITION );
 		vb->bind();
 		vb->update( m_mesh_data->data(), 0, m_mesh_data->size() );
Index: /trunk/src/gui/gui_renderer.cc
===================================================================
--- /trunk/src/gui/gui_renderer.cc	(revision 280)
+++ /trunk/src/gui/gui_renderer.cc	(revision 281)
@@ -268,7 +268,7 @@
 	{
 		nv::vertex_buffer* vb = (nv::vertex_buffer*)sr->buffer.get_buffer();
-		sr->varray->update_vertex_buffer( nv::POSITION, vb, false );
-		sr->varray->update_vertex_buffer( nv::TEXCOORD, vb, false );
-		sr->varray->update_vertex_buffer( nv::COLOR,    vb, false );
+		sr->varray->update_vertex_buffer( nv::slot::POSITION, vb, false );
+		sr->varray->update_vertex_buffer( nv::slot::TEXCOORD, vb, false );
+		sr->varray->update_vertex_buffer( nv::slot::COLOR,    vb, false );
 	}
 	sr->texture->bind( nv::TEX_DIFFUSE );
Index: /trunk/src/io/string_table.cc
===================================================================
--- /trunk/src/io/string_table.cc	(revision 280)
+++ /trunk/src/io/string_table.cc	(revision 281)
@@ -70,2 +70,9 @@
 }
 
+nv::uint32 nv::string_table_creator::dump_size() const
+{
+	return sizeof( index ) + sizeof( uint32 ) +
+		sizeof( offset ) * m_offsets.size() +
+		sizeof( char ) * m_data.size();
+}
+
