Index: trunk/src/engine/particle_manager.cc
===================================================================
--- trunk/src/engine/particle_manager.cc	(revision 520)
+++ trunk/src/engine/particle_manager.cc	(revision 539)
@@ -61,9 +61,9 @@
 	data->emitter_count   = 0;
 	data->affector_count  = 0;
-	data->orientation     = particle_orientation( table.get_unsigned("orientation", 0) );
-	data->origin          = particle_origin( table.get_unsigned( "origin",0  ) );
+	data->orientation     = particle_orientation( table["orientation"].get_uint32() );
+	data->origin          = particle_origin( table["origin"].get_uint32() );
 
-	data->common_up  = math::normalize( table.get<vec3>("common_up",  vec3(1,0,0) ) );
-	data->common_dir = math::normalize( table.get<vec3>("common_dir", vec3(0,1,0) ) );
+	data->common_up  = math::normalize( table["common_up"].as( vec3(1,0,0) ) );
+	data->common_dir = math::normalize( table["common_dir"].as( vec3(0,1,0) ) );
 
 	vec2 def_size        = table.get<vec2>("size", vec2(0.1,0.1) );
@@ -72,6 +72,6 @@
 	{
 		lua::table_guard element( table, i+1 );
-		const_string type     = element.get_string( "type" );
-		const_string sub_type = element.get_string( "sub_type" );
+		const_string type     = element["type"].get_string();
+		const_string sub_type = element["sub_type"].get_string();
 		if ( type == "emitter" )
 		{
@@ -86,41 +86,41 @@
 				}
 
-				edata.position     = element.get<vec3>("position", vec3() );
-				edata.extents      = element.get<vec3>("extents", vec3(1,1,1) );
-				edata.extents[0]   = element.get<float>("width",  edata.extents[0] );
-				edata.extents[1]   = element.get<float>("depth",  edata.extents[1] );
-				edata.extents[2]   = element.get<float>("height", edata.extents[2] );
-				edata.extents[0]   = element.get<float>("radius",  edata.extents[0] );
-				edata.iextents     = element.get<vec3>("inner_extents", vec3() );
-				edata.iextents[0]  = element.get<float>("inner_width",  edata.iextents[0] );
-				edata.iextents[1]  = element.get<float>("inner_depth",  edata.iextents[1] );
-				edata.iextents[2]  = element.get<float>("inner_height", edata.iextents[2] );
-				edata.iextents[0]  = element.get<float>("inner_radius",  edata.iextents[0] );
+				edata.position     = element["position"].as( vec3() );
+				edata.extents      = element["extents"].as( vec3(1,1,1) );
+				edata.extents[0]   = element["width"].as( edata.extents[0] );
+				edata.extents[1]   = element["depth"].as( edata.extents[1] );
+				edata.extents[2]   = element["height"].as( edata.extents[2] );
+				edata.extents[0]   = element["radius"].as( edata.extents[0] );
+				edata.iextents     = element["inner_extents"].as( vec3() );
+				edata.iextents[0]  = element["inner_width"].as( edata.iextents[0] );
+				edata.iextents[1]  = element["inner_depth"].as( edata.iextents[1] );
+				edata.iextents[2]  = element["inner_height"].as( edata.iextents[2] );
+				edata.iextents[0]  = element["inner_radius"].as( edata.iextents[0] );
 				edata.hextents     = 0.5f * edata.extents;
 				edata.ihextents    = 0.5f * edata.iextents;
-				edata.precise      = element.get<bool>("precise", false );
-				edata.square       = element.get<bool>("square", true );
-				vec4 color         = element.get<vec4>("color", vec4(1,1,1,1) );
-				edata.color_min    = element.get<vec4>("color_min", color );
-				edata.color_max    = element.get<vec4>("color_max", color );
-				vec2 size          = element.get<vec2>("size", def_size );
-				edata.size_min     = element.get<vec2>("size_min", size );
-				edata.size_max     = element.get<vec2>("size_max", size );
-				edata.angle        = element.get<float>("angle", 0.0f );
-				float velocity     = element.get<float>("velocity", 0.0f );
-				edata.velocity_min = element.get<float>("velocity_min", velocity );
-				edata.velocity_max = element.get<float>("velocity_max", velocity );
-				float lifetime     = element.get<float>("lifetime", 1.0f );
-				edata.lifetime_min = element.get<float>("lifetime_min", lifetime );
-				edata.lifetime_max = element.get<float>("lifetime_max", lifetime );
-				float duration     = element.get<float>("duration", 0.0f );
-				edata.duration_min = element.get<float>("duration_min", duration );
-				edata.duration_max = element.get<float>("duration_max", duration );
-				float repeat       = element.get<float>("repeat_delay", 0.0f );
-				edata.repeat_min   = element.get<float>("repeat_delay_min", repeat );
-				edata.repeat_max   = element.get<float>("repeat_delay_max", repeat );
+				edata.precise      = element["precise"].as( false );
+				edata.square       = element["square"].as( true );
+				vec4 color         = element["color"].as( vec4(1,1,1,1) );
+				edata.color_min    = element["color_min"].as( color );
+				edata.color_max    = element["color_max"].as( color );
+				vec2 size          = element["size"].as( def_size );
+				edata.size_min     = element["size_min"].as( size );
+				edata.size_max     = element["size_max"].as( size );
+				edata.angle        = element["angle"].as( 0.0f );
+				float velocity     = element["velocity"].as( 0.0f );
+				edata.velocity_min = element["velocity_min"].as( velocity );
+				edata.velocity_max = element["velocity_max"].as( velocity );
+				float lifetime     = element["lifetime"].as( 1.0f );
+				edata.lifetime_min = element["lifetime_min"].as( lifetime );
+				edata.lifetime_max = element["lifetime_max"].as( lifetime );
+				float duration     = element["duration"].as( 0.0f );
+				edata.duration_min = element["duration_min"].as( duration );
+				edata.duration_max = element["duration_max"].as( duration );
+				float repeat       = element["repeat_delay"].as( 0.0f );
+				edata.repeat_min   = element["repeat_delay_min"].as( repeat );
+				edata.repeat_max   = element["repeat_delay_max"].as( repeat );
 
-				edata.rate         = element.get<float>("rate", 1.0f );
-				edata.dir          = math::normalize( element.get<vec3>("direction", vec3(0,1,0) ) );
+				edata.rate         = element["rate"].as( 1.0f );
+				edata.dir          = math::normalize( element["direction"].as( vec3(0,1,0) ) );
 				
 				edata.odir = vec3( 0, 0, 1 );
