Index: trunk/src/gl/gl_program.cc
===================================================================
--- trunk/src/gl/gl_program.cc	(revision 232)
+++ trunk/src/gl/gl_program.cc	(revision 235)
@@ -106,9 +106,11 @@
 	if (!fragment_shader.compile( fragment_program )) { return false; }
 
-	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::POSITION ), "nv_position" );
-	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TEXCOORD ), "nv_texcoord" );
-	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::NORMAL   ), "nv_normal"   );
-	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::COLOR    ), "nv_color"    );
-	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TANGENT  ), "nv_tangent"  );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::POSITION   ), "nv_position"  );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TEXCOORD   ), "nv_texcoord"  );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::NORMAL     ), "nv_normal"    );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::COLOR      ), "nv_color"     );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::TANGENT    ), "nv_tangent"   );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::BONEINDEX  ), "nv_boneindex" );
+	glBindAttribLocation( m_name.get_value(), static_cast<GLuint>( slot::BONEWEIGHT ), "nv_boneweight");
 
 	glAttachShader( m_name.get_value(), fragment_shader.get_id() );
@@ -181,5 +183,5 @@
 
 		string name( name_buffer, size_t(uni_nlen) );
-
+		
 		// skip built-ins
 		if ( name.substr(0,3) == "gl_" ) continue;
@@ -187,4 +189,12 @@
 		int uni_loc = glGetUniformLocation( m_name.get_value(), name.c_str() );
 		datatype utype = gl_enum_to_datatype( uni_type );
+		
+		// check for array
+		string::size_type arrchar = name.find('[');
+		if ( arrchar != string::npos )
+		{
+			name = name.substr( 0, arrchar );
+		}
+
 		m_uniform_map[ name ] = create_uniform( utype, name, uni_loc, uni_len );
 	}
@@ -204,15 +214,15 @@
 			switch( ubase->get_type() )
 			{
-			case FLOAT          : glUniform1f( uloc, ((uniform< enum_to_type< FLOAT >::type >*)( ubase ))->get_value() ); break;
-			case INT            : glUniform1i( uloc, ((uniform< enum_to_type< INT >::type >*)( ubase ))->get_value() ); break;
-			case FLOAT_VECTOR_2 : glUniform2fv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*)( ubase ))->get_value()) ); break;
-			case FLOAT_VECTOR_3 : glUniform3fv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*)( ubase ))->get_value()) ); break;
-			case FLOAT_VECTOR_4 : glUniform4fv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*)( ubase ))->get_value()) ); break;
-			case INT_VECTOR_2   : glUniform2iv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< INT_VECTOR_2 >::type >*)( ubase ))->get_value()) ); break;
-			case INT_VECTOR_3   : glUniform3iv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< INT_VECTOR_3 >::type >*)( ubase ))->get_value()) ); break;
-			case INT_VECTOR_4   : glUniform4iv( uloc, 1, glm::value_ptr(((uniform< enum_to_type< INT_VECTOR_4 >::type >*)( ubase ))->get_value()) ); break;
-			case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, 1, GL_FALSE, glm::value_ptr(((uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*)( ubase ))->get_value()) ); break;
-			case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, 1, GL_FALSE, glm::value_ptr(((uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*)( ubase ))->get_value()) ); break;
-			case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, 1, GL_FALSE, glm::value_ptr(((uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*)( ubase ))->get_value()) ); break;
+			case FLOAT          : glUniform1fv( uloc, ubase->get_length(), ((uniform< enum_to_type< FLOAT >::type >*)( ubase ))->get_value() ); break;
+			case INT            : glUniform1iv( uloc, ubase->get_length(), ((uniform< enum_to_type< INT >::type >*)( ubase ))->get_value() ); break;
+			case FLOAT_VECTOR_2 : glUniform2fv( uloc, ubase->get_length(), (GLfloat*)((uniform< enum_to_type< FLOAT_VECTOR_2 >::type >*)( ubase ))->get_value()); break;
+			case FLOAT_VECTOR_3 : glUniform3fv( uloc, ubase->get_length(), (GLfloat*)((uniform< enum_to_type< FLOAT_VECTOR_3 >::type >*)( ubase ))->get_value()); break;
+			case FLOAT_VECTOR_4 : glUniform4fv( uloc, ubase->get_length(), (GLfloat*)((uniform< enum_to_type< FLOAT_VECTOR_4 >::type >*)( ubase ))->get_value()); break;
+			case INT_VECTOR_2   : glUniform2iv( uloc, ubase->get_length(), (GLint*)((uniform< enum_to_type< INT_VECTOR_2 >::type >*)( ubase ))->get_value()); break;
+			case INT_VECTOR_3   : glUniform3iv( uloc, ubase->get_length(), (GLint*)((uniform< enum_to_type< INT_VECTOR_3 >::type >*)( ubase ))->get_value()); break;
+			case INT_VECTOR_4   : glUniform4iv( uloc, ubase->get_length(), (GLint*)((uniform< enum_to_type< INT_VECTOR_4 >::type >*)( ubase ))->get_value()); break;
+			case FLOAT_MATRIX_2 : glUniformMatrix2fv( uloc, ubase->get_length(), GL_FALSE, (GLfloat*)((uniform< enum_to_type< FLOAT_MATRIX_2 >::type >*)( ubase ))->get_value()); break;
+			case FLOAT_MATRIX_3 : glUniformMatrix3fv( uloc, ubase->get_length(), GL_FALSE, (GLfloat*)((uniform< enum_to_type< FLOAT_MATRIX_3 >::type >*)( ubase ))->get_value()); break;
+			case FLOAT_MATRIX_4 : glUniformMatrix4fv( uloc, ubase->get_length(), GL_FALSE, (GLfloat*)((uniform< enum_to_type< FLOAT_MATRIX_4 >::type >*)( ubase ))->get_value()); break;
 			default : break; // error?
 			}
