Index: trunk/nv/io_event.hh
===================================================================
--- trunk/nv/io_event.hh	(revision 77)
+++ trunk/nv/io_event.hh	(revision 78)
@@ -27,6 +27,5 @@
 #	undef NV_KEY
 	};
-	NV_REGISTER_NAME( key_code );
-
+	
 	// Generate the mouse_code enum
 	enum mouse_code
@@ -36,5 +35,4 @@
 #	undef NV_MOUSE
 	};
-	NV_REGISTER_NAME( mouse_code );
 
 	// Generate the io_event_code enum
@@ -45,5 +43,4 @@
 #	undef NV_IO_EVENT
 	};
-	NV_REGISTER_NAME( io_event_code );
 
 	struct key_event
@@ -67,5 +64,4 @@
 		bool pressed;
 	};
-	NV_REGISTER_NAME( key_event );
 
 	struct mouse_button_event
@@ -80,5 +76,4 @@
 		mouse_code code;
 	};
-	NV_REGISTER_NAME( mouse_button_event );
 
 	struct mouse_move_event
@@ -93,5 +88,4 @@
 		mouse_code code;
 	};
-	NV_REGISTER_NAME( mouse_move_event );
 
 	struct system_event
@@ -101,5 +95,4 @@
 		uint32 param2;
 	};
-	NV_REGISTER_NAME( system_event );
 
 	struct io_event
@@ -114,5 +107,4 @@
 		};
 	};
-	NV_REGISTER_NAME( io_event );
 
 	const char* get_key_name( key_code key );
Index: trunk/nv/types.hh
===================================================================
--- trunk/nv/types.hh	(revision 77)
+++ trunk/nv/types.hh	(revision 78)
@@ -16,6 +16,4 @@
 #include <vector>
 #include <string>
-
-#define NV_REGISTER_NAME( s ) template <> inline const char* nv::get_type_name<s>   () { return #s; }
 
 namespace nv
@@ -147,47 +145,4 @@
 	template <> struct type_to_enum< mat4 > { static const datatype type = FLOAT_MATRIX_4; };
 
-	template <typename TYPE>
-    inline const char* get_type_name()
-    {
-        static_assert(sizeof(TYPE) == 0, "Type not implemented!");
-        return NULL;
-    }
-
-	template <> inline const char* get_type_name<int>   () { return "sint"; }
-    template <> inline const char* get_type_name<sint8> () { return "sint8"; }
-    template <> inline const char* get_type_name<sint16>() { return "sint16"; }
-    template <> inline const char* get_type_name<sint32>() { return "sint32"; }
-    template <> inline const char* get_type_name<sint64>() { return "sint64"; }
-
-	template <> inline const char* get_type_name<unsigned int>() { return "uint"; }
-	template <> inline const char* get_type_name<uint8> ()       { return "uint8"; }
-    template <> inline const char* get_type_name<uint16>()       { return "uint16"; }
-    template <> inline const char* get_type_name<uint32>()       { return "uint32"; }
-    template <> inline const char* get_type_name<uint64>()       { return "uint64"; }
-
-	template <> inline const char* get_type_name<f32> () { return "f32"; }
-	template <> inline const char* get_type_name<f64> () { return "f64"; }
-
-	template <> inline const char* get_type_name< vec2 > () { return "vec2"; }
-	template <> inline const char* get_type_name< vec3 > () { return "vec3"; }
-	template <> inline const char* get_type_name< vec4 > () { return "vec4"; }
-
-	template <> inline const char* get_type_name< ivec2 > () { return "ivec2"; }
-	template <> inline const char* get_type_name< ivec3 > () { return "ivec3"; }
-	template <> inline const char* get_type_name< ivec4 > () { return "ivec4"; }
-
-	template <> inline const char* get_type_name< i8vec2 > () { return "i8vec2"; }
-	template <> inline const char* get_type_name< i8vec3 > () { return "i8vec3"; }
-	template <> inline const char* get_type_name< i8vec4 > () { return "i8vec4"; }
-
-	template <> inline const char* get_type_name< mat2 > () { return "mat2"; }
-	template <> inline const char* get_type_name< mat3 > () { return "mat3"; }
-	template <> inline const char* get_type_name< mat4 > () { return "mat4"; }
-
-	template <> inline const char* get_type_name<bool> () { return "bool"; }
-
-	template <> inline const char* get_type_name<std::string> () { return "string"; }
-	template <> inline const char* get_type_name<object>      () { return "object"; }
-
 	template<typename T>
 	struct is_container
@@ -207,42 +162,4 @@
 	};
 
-
-	template <typename TYPE>
-    std::size_t get_type_id()
-    {
-        static std::size_t type_id = std::hash<std::string>()(std::string(get_type_name<TYPE>()));
-        return type_id;
-    };
-
-	struct hash_string
-    {
-        std::size_t hash;
-        const char* text;
-		hash_string() {}
-		hash_string( const char* a_text ) : 
-			text( a_text ) 
-		{
-			hash = std::hash<std::string>()( std::string( a_text ) ); 
-		}
-		inline bool operator == (const hash_string& hs ) const
-		{
-			return hs.hash == hash;
-		}
-    };
-
-}
-
-namespace std {
-	template<>
-	struct hash<nv::hash_string> {
-		size_t operator()(const nv::hash_string &hs) const 
-		{
-			return hs.hash;
-		}
-	};
-}
-
-namespace nv
-{
 	struct type_entry;
 
@@ -260,14 +177,16 @@
 	struct type_field
 	{
-		hash_string  name;      //< name of the field
-		hash_string  type_name; //< name of the type of the field
-		type_entry*  type;      //< pointer to field type
-		unsigned int flags;     //< flags 
-		size_t       offset;
+		std::string      name;      //< name of the field
+		std::string      type_name; //< name of the type of the field
+		const type_info* type_inf;  //< typeinfo for later retrieval of type
+		type_entry*      type;      //< pointer to field type
+		unsigned int     flags;     //< flags 
+		size_t           offset;
 
 		template< typename TOBJECT, typename TFIELD >
-		type_field( hash_string name, TFIELD TOBJECT::*field, typename std::enable_if< is_container<TFIELD>::value, void* >::type = nullptr )
+		type_field( const char* name, TFIELD TOBJECT::*field, typename std::enable_if< is_container<TFIELD>::value, void* >::type = nullptr )
 			: name(name)
-			, type_name( get_type_name< std::remove_pointer<typename TFIELD::value_type>::type >() )
+			, type_name()
+			, type_inf( &typeid( std::remove_pointer<typename TFIELD::value_type>::type ) )
 			, type( nullptr )
 			, flags( 0 )
@@ -281,7 +200,8 @@
 
 		template< typename TOBJECT, typename TFIELD >
-		type_field( hash_string name, TFIELD TOBJECT::*field, typename std::enable_if< !is_container<TFIELD>::value, void* >::type = nullptr )
+		type_field( const char* name, TFIELD TOBJECT::*field, typename std::enable_if< !is_container<TFIELD>::value, void* >::type = nullptr )
 			: name(name)
-			, type_name( get_type_name< std::remove_pointer<TFIELD>::type >() )
+			, type_name()
+			, type_inf( &typeid( std::remove_pointer<TFIELD>::type ) )
 			, type( nullptr )
 			, flags( 0 )
@@ -303,7 +223,7 @@
 	struct type_enum
 	{
-		hash_string name;
+		std::string name;
 		int         value;
-		type_enum( hash_string name, int value ) : name(name), value(value) {}
+		type_enum( const char* name, int value ) : name(name), value(value) {}
 	};
 
@@ -318,5 +238,5 @@
 
         // Scoped C++ name of the type
-        hash_string name;
+        std::string name;
  
         // Pointers to the constructor and destructor functions
@@ -339,5 +259,5 @@
 		type_entry& base()
 		{
-			base_type = type_db->get_type( get_type_name<TYPE>() )
+			base_type = type_db->get_type( typeid(TYPE) );
 		}
 
@@ -348,5 +268,6 @@
 			{
 				type_field f = init_fields[i];
-				f.type = type_db->get_type(f.type_name);
+				f.type = type_db->get_type(*(f.type_inf));
+				f.type_name = f.type->name;
 				field_list.push_back(f);
 			}
@@ -371,10 +292,9 @@
     public:
 		template< typename TYPE >
-        type_entry& create_type()
-		{
-			hash_string name( get_type_name<TYPE>() );
+        type_entry& create_type( const char* name )
+		{
 			type_entry* i_type = nullptr;
-			type_map::iterator it = m_types.find( name );
-			if ( it != m_types.end() ) 
+			type_name_map::iterator it = m_name_types.find( name );
+			if ( it != m_name_types.end() ) 
 			{
 				return *(it->second);
@@ -388,13 +308,13 @@
 			i_type->destructor  = DestructObject<TYPE>;
 
-			m_types[name]             = i_type;
+			m_name_types[name]        = i_type;
 			m_idx_types[typeid(TYPE)] = i_type;
 			return *i_type;
 		}
-		// TODO: delete?
-        type_entry* get_type( hash_string name )
-		{
-			type_map::iterator it = m_types.find( name );
-			if ( it != m_types.end() ) 
+
+		type_entry* get_type( const std::string name )
+		{
+			type_name_map::iterator it = m_name_types.find( name );
+			if ( it != m_name_types.end() ) 
 			{
 				return it->second;
@@ -402,4 +322,5 @@
 			return nullptr;
 		}
+
 		type_entry* get_type( const type_info& t )
 		{
@@ -418,7 +339,7 @@
 		};
 
-        typedef std::unordered_map<hash_string, type_entry*>     type_map;
+        typedef std::unordered_map<std::string, type_entry*>     type_name_map;
 		typedef std::unordered_map<std::type_index, type_entry*> type_info_map;
-        type_map      m_types;
+        type_name_map m_name_types;
 		type_info_map m_idx_types;
 	};
Index: trunk/src/io_event.cc
===================================================================
--- trunk/src/io_event.cc	(revision 77)
+++ trunk/src/io_event.cc	(revision 78)
@@ -49,5 +49,5 @@
 #	undef NV_KEY
 	};
-	db->create_type<key_code>().enums( key_enums );
+	db->create_type<key_code>("key_code").enums( key_enums );
 
 	type_enum mouse_enums[] = {
@@ -56,5 +56,5 @@
 #	undef NV_MOUSE
 	};
-	db->create_type<mouse_code>().enums( mouse_enums );
+	db->create_type<mouse_code>("mouse_code").enums( mouse_enums );
 
 	type_enum io_event_enums[] = {
@@ -63,5 +63,5 @@
 #	undef NV_IO_EVENT
 	};
-	db->create_type<io_event_code>().enums( io_event_enums );
+	db->create_type<io_event_code>("event_code").enums( io_event_enums );
 
 	type_field key_fields[] = {
@@ -73,5 +73,5 @@
 		type_field( "pressed", &key_event::pressed ),
 	};
-	db->create_type<key_event>().fields( key_fields );
+	db->create_type<key_event>("key_event").fields( key_fields );
 
 	type_field mouse_button_fields[] = {
@@ -82,5 +82,5 @@
 		type_field( "code",    &mouse_button_event::code ),
 	};
-	db->create_type<mouse_button_event>().fields( mouse_button_fields );
+	db->create_type<mouse_button_event>("mouse_button_event").fields( mouse_button_fields );
 
 	type_field mouse_move_fields[] = {
@@ -92,5 +92,5 @@
 		type_field( "code",    &mouse_move_event::code ),
 	};
-	db->create_type<mouse_move_event>().fields( mouse_move_fields );
+	db->create_type<mouse_move_event>("mouse_move_event").fields( mouse_move_fields );
 
 	type_field system_fields[] = {
@@ -99,4 +99,4 @@
 		type_field( "param2",   &system_event::param2 ),
 	};
-	db->create_type<system_event>().fields( system_fields );
+	db->create_type<system_event>("system_event").fields( system_fields );
 }
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 77)
+++ trunk/src/lua/lua_state.cc	(revision 78)
@@ -296,8 +296,8 @@
 	if (!t) return ref_none;
 	stack_guard guard( this );
-	lua_getglobal( L, t->name.text );
+	lua_getglobal( L, t->name.c_str() );
 	if ( lua_isnil( L, -1 ) )
 	{
-		NV_THROW( runtime_error, std::string( t->name.text ) + " type not registered!" );
+		NV_THROW( runtime_error, std::string( t->name ) + " type not registered!" );
 	}
 	deep_pointer_copy( -1, o );
Index: trunk/src/object.cc
===================================================================
--- trunk/src/object.cc	(revision 77)
+++ trunk/src/object.cc	(revision 78)
@@ -192,4 +192,4 @@
 		type_field("children"   , &object::m_children).flag( TF_READONLY ),
 	};
-	db->create_type<object>().fields(fields);
+	db->create_type<object>("object").fields(fields);
 }
Index: trunk/tests/lualib_test/lualib_test.cc
===================================================================
--- trunk/tests/lualib_test/lualib_test.cc	(revision 77)
+++ trunk/tests/lualib_test/lualib_test.cc	(revision 78)
@@ -17,19 +17,6 @@
 };
 
-NV_REGISTER_NAME( test_struct )
-
 int main(int, char* [])
 {
-	nv::type_database db;
-	nv::object::register_type( &db );
-
-	db.create_type<int>();
-	db.create_type<std::string>();
-	nv::type_field fields[] = { 
-		nv::type_field("f", &test_struct::f ),
-		nv::type_field("i", &test_struct::i ),
-	};
-	db.create_type<test_struct>().fields( fields );
-
 	nv::logger log(nv::LOG_TRACE);
 	log.add_sink( new nv::log_file_sink("log.txt"), nv::LOG_TRACE );
