Panagiotis Christopoulos Charitos 15 anos atrás
pai
commit
83a003e7de

+ 1 - 1
src/Core/Logger.h

@@ -52,7 +52,7 @@ class Logger
 	private:
 		static const int STREAM_SIZE = 2048;
 		boost::array<char, STREAM_SIZE> streamBuf;
-		char* sptr; ///< Pointer to @ref streamBuf
+		char* sptr; ///< Pointer to streamBuf
 		Signal sig; ///< The signal
 		const char* func; ///< Sender info
 		const char* file; ///< Sender info

+ 1 - 1
src/Renderer/BufferObjects/Vao.h

@@ -30,7 +30,7 @@ class Vao
 		/// Destroy
 		void destroy();
 
-		/// Attach an array buffer VBO. See @link http://www.opengl.org/sdk/docs/man3/xhtml/glVertexAttribPointer.xml
+		/// Attach an array buffer VBO. See @link http://www.opengl.org/sdk/docs/man3/xhtml/glVertexAttribPointer.xml 
 		/// @endlink
 		/// @param vbo The VBO to attach
 		/// @param attribVar For the shader attribute location

+ 70 - 50
src/Resources/Helpers/ShaderPrePreprocessor.cpp

@@ -2,13 +2,14 @@
 #include <cstring>
 #include <iostream>
 #include <boost/lexical_cast.hpp>
+#include <boost/foreach.hpp>
 #include "ShaderPrePreprocessor.h"
 #include "Parser.h"
 #include "Util.h"
 #include "Exception.h"
 
 
-const char* MULTIPLE_DEF_MSG = " already defined in the same place. Check for circular or multiple includance";
+static const char* MULTIPLE_DEF_MSG = " already defined in the same place. Check for circular or multiple includance";
 
 
 //======================================================================================================================
@@ -16,9 +17,9 @@ const char* MULTIPLE_DEF_MSG = " already defined in the same place. Check for ci
 //======================================================================================================================
 void ShaderPrePreprocessor::printSourceLines() const
 {
-	for(uint i=0; i<sourceLines.size(); ++i)
+	for(uint i = 0; i < sourceLines.size(); ++i)
 	{
-		std::cout << std::setw(3) << i+1 << ": " << sourceLines[i] << std::endl;
+		std::cout << std::setw(3) << (i + 1) << ": " << sourceLines[i] << std::endl;
 	}
 }
 
@@ -29,7 +30,7 @@ void ShaderPrePreprocessor::printSourceLines() const
 void ShaderPrePreprocessor::printShaderVars() const
 {
 	std::cout << "TYPE" << std::setw(20) << "NAME" << std::setw(4) << "LOC" << std::endl;
-	for(uint i=0; i<output.attributes.size(); ++i)
+	for(uint i = 0; i < output.attributes.size(); ++i)
 	{
 		std::cout << std::setw(4) << "A" << std::setw(20) << output.attributes[i].name << std::setw(4) <<
 		             output.attributes[i].customLoc << std::endl;
@@ -95,7 +96,8 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						// play
 
 						// its defined in same place so there is probable circular includance
-						if(vertShaderBegins.definedInLine==scanner.getLineNumber() && vertShaderBegins.definedInFile==filename)
+						if(vertShaderBegins.definedInLine == scanner.getLineNumber() &&
+						   vertShaderBegins.definedInFile == filename)
 						{
 							throw PARSER_EXCEPTION("vertShaderBegins" + MULTIPLE_DEF_MSG);
 						}
@@ -103,43 +105,46 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						// already defined elsewhere => error
 						if(vertShaderBegins.definedInLine != -1)
 						{
-							throw PARSER_EXCEPTION("vertShaderBegins already defined at " + vertShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(vertShaderBegins.definedInLine));
+							throw PARSER_EXCEPTION("vertShaderBegins already defined at " +
+							                       vertShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(vertShaderBegins.definedInLine));
 						}
 
 						// vert shader should be before frag
 						if(fragShaderBegins.definedInLine != -1)
 						{
 							throw PARSER_EXCEPTION("vertShaderBegins must precede fragShaderBegins defined at " +
-																		 fragShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
+							                       fragShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
 						}
 
 						// vert shader should be before geom
 						if(geomShaderBegins.definedInLine != -1)
 						{
 							throw PARSER_EXCEPTION("vertShaderBegins must precede geomShaderBegins defined at " +
-																		 geomShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(geomShaderBegins.definedInLine));
+							                       geomShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(geomShaderBegins.definedInLine));
 						}
 
 						vertShaderBegins.definedInFile = filename;
 						vertShaderBegins.definedInLine = scanner.getLineNumber();
 						vertShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) + ' ' +
-																	boost::lexical_cast<std::string>(depth) + " // " + lines[scanner.getLineNumber()-1]);
+						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) +
+						                      ' ' + boost::lexical_cast<std::string>(depth) + " // " +
+						                      lines[scanner.getLineNumber()-1]);
 						// stop play
 					}
 					//
 					// geomShaderBegins
 					//
 					else if(token->getCode() == Scanner::TC_IDENTIFIER &&
-									strcmp(token->getValue().getString(), "geomShaderBegins") == 0)
+					        strcmp(token->getValue().getString(), "geomShaderBegins") == 0)
 					{
 						// play
 
 						// its defined in same place so there is probable circular includance
-						if(geomShaderBegins.definedInLine==scanner.getLineNumber() && geomShaderBegins.definedInFile==filename)
+						if(geomShaderBegins.definedInLine == scanner.getLineNumber() &&
+						   geomShaderBegins.definedInFile == filename)
 						{
 							throw PARSER_EXCEPTION("geomShaderBegins" + MULTIPLE_DEF_MSG);
 						}
@@ -147,8 +152,9 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						// already defined elsewhere => error
 						if(geomShaderBegins.definedInLine != -1)
 						{
-							throw PARSER_EXCEPTION("geomShaderBegins already defined at " + geomShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(geomShaderBegins.definedInLine));
+							throw PARSER_EXCEPTION("geomShaderBegins already defined at " +
+							                       geomShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(geomShaderBegins.definedInLine));
 						}
 
 						// vert shader entry point not defined => error
@@ -161,15 +167,16 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						if(fragShaderBegins.definedInLine != -1)
 						{
 							throw PARSER_EXCEPTION("geomShaderBegins must precede fragShaderBegins defined at " +
-																		 fragShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
+							                       fragShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
 						}
 
 						geomShaderBegins.definedInFile = filename;
 						geomShaderBegins.definedInLine = scanner.getLineNumber();
 						geomShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) + ' ' +
-																	boost::lexical_cast<std::string>(depth) + " // " + lines[scanner.getLineNumber()-1]);
+						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) +
+						                      ' ' + boost::lexical_cast<std::string>(depth) + " // " +
+						                      lines[scanner.getLineNumber()-1]);
 						// stop play
 					}
 					//
@@ -181,15 +188,17 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						// play
 
 						// its defined in same place so there is probable circular includance
-						if(fragShaderBegins.definedInLine==scanner.getLineNumber() && fragShaderBegins.definedInFile==filename)
+						if(fragShaderBegins.definedInLine == scanner.getLineNumber() &&
+						   fragShaderBegins.definedInFile == filename)
 						{
 							throw PARSER_EXCEPTION("fragShaderBegins" + MULTIPLE_DEF_MSG);
 						}
 
 						if(fragShaderBegins.definedInLine != -1) // if already defined elsewhere throw error
 						{
-							throw PARSER_EXCEPTION("fragShaderBegins already defined at " + fragShaderBegins.definedInFile + ":" +
-																		 boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
+							throw PARSER_EXCEPTION("fragShaderBegins already defined at " +
+							                       fragShaderBegins.definedInFile + ":" +
+							                       boost::lexical_cast<std::string>(fragShaderBegins.definedInLine));
 						}
 
 						// vert shader entry point not defined
@@ -201,25 +210,29 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 						fragShaderBegins.definedInFile = filename;
 						fragShaderBegins.definedInLine = scanner.getLineNumber();
 						fragShaderBegins.globalLine = sourceLines.size() + 1;
-						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) + ' ' +
-																	boost::lexical_cast<std::string>(depth) + " // " + lines[scanner.getLineNumber()-1]);
+						sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) +
+						                      ' ' + boost::lexical_cast<std::string>(depth) + " // " +
+						                      lines[scanner.getLineNumber()-1]);
 						// stop play
 					}
 					//
 					// include
 					//
-					else if(token->getCode() == Scanner::TC_IDENTIFIER && strcmp(token->getValue().getString(), "include") == 0)
+					else if(token->getCode() == Scanner::TC_IDENTIFIER &&
+					        strcmp(token->getValue().getString(), "include") == 0)
 					{
 						token = &scanner.getNextToken();
 						if(token->getCode() == Scanner::TC_STRING)
 						{
 							// play
 							//int line = sourceLines.size();
-							sourceLines.push_back("#line 0 " + boost::lexical_cast<std::string>(depth+1) + " // " +
-																		lines[scanner.getLineNumber()-1]);
-							parseFileForPragmas(token->getValue().getString(), depth+1);
-							sourceLines.push_back("#line " + boost::lexical_cast<std::string>(scanner.getLineNumber()) + ' ' +
-																		boost::lexical_cast<std::string>(depth) +  " // end of " + lines[scanner.getLineNumber()-1]);
+							sourceLines.push_back("#line 0 " + boost::lexical_cast<std::string>(depth + 1) + " // " +
+							                      lines[scanner.getLineNumber() - 1]);
+							parseFileForPragmas(token->getValue().getString(), depth + 1);
+							sourceLines.push_back("#line " +
+							                      boost::lexical_cast<std::string>(scanner.getLineNumber()) + ' ' +
+							                      boost::lexical_cast<std::string>(depth) +  " // end of " +
+							                      lines[scanner.getLineNumber() - 1]);
 							// stop play
 						}
 						else
@@ -231,7 +244,7 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 					// transformFeedbackVarying
 					//
 					else if(token->getCode() == Scanner::TC_IDENTIFIER &&
-									strcmp(token->getValue().getString(), "transformFeedbackVarying") == 0)
+							strcmp(token->getValue().getString(), "transformFeedbackVarying") == 0)
 					{
 						token = &scanner.getNextToken();
 						if(token->getCode() == Scanner::TC_IDENTIFIER)
@@ -247,13 +260,15 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 								}
 								else
 								{
-									throw PARSER_EXCEPTION("Varying \"" + varName + "\" already defined at " + var->definedInFile +
-																				 ":" + boost::lexical_cast<std::string>(var->definedInLine));
+									throw PARSER_EXCEPTION("Varying \"" + varName + "\" already defined at " +
+									                       var->definedInFile + ":" +
+									                       boost::lexical_cast<std::string>(var->definedInLine));
 								}
 							}
 
 							// all ok, push it back
-							output.trffbVaryings.push_back(TrffbVaryingPragma(filename, scanner.getLineNumber(), varName));
+							output.trffbVaryings.push_back(TrffbVaryingPragma(filename, scanner.getLineNumber(),
+							                                                  varName));
 							sourceLines.push_back(lines[scanner.getLineNumber() - 1]);
 						}
 						else
@@ -264,7 +279,8 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 					//
 					// attribute
 					//
-					else if(token->getCode() == Scanner::TC_IDENTIFIER && strcmp(token->getValue().getString(), "attribute") == 0)
+					else if(token->getCode() == Scanner::TC_IDENTIFIER &&
+					        strcmp(token->getValue().getString(), "attribute") == 0)
 					{
 						token = &scanner.getNextToken();
 						if(token->getCode() == Scanner::TC_IDENTIFIER)
@@ -279,31 +295,34 @@ void ShaderPrePreprocessor::parseFileForPragmas(const std::string& filename, int
 								Vec<ShaderVarPragma>::const_iterator attrib = findNamed(output.attributes, varName);
 								if(attrib != output.attributes.end())
 								{
-									if(attrib->definedInLine==scanner.getLineNumber() && attrib->definedInFile==filename)
+									if(attrib->definedInLine == scanner.getLineNumber() &&
+									   attrib->definedInFile == filename)
 									{
 										throw PARSER_EXCEPTION("\"" + varName + "\"" + MULTIPLE_DEF_MSG);
 									}
 									else
 									{
 										throw PARSER_EXCEPTION("Attribute \"" + varName + "\" already defined at " +
-																					 attrib->definedInFile + ":" +
-																					 boost::lexical_cast<std::string>(attrib->definedInLine));
+										                       attrib->definedInFile + ":" +
+										                       boost::lexical_cast<std::string>(attrib->definedInLine));
 									}
 								}
 								// search if another var has the same loc
-								for(attrib = output.attributes.begin(); attrib!=output.attributes.end(); ++attrib)
+								for(attrib = output.attributes.begin(); attrib != output.attributes.end(); ++attrib)
 								{
 									if(attrib->customLoc == loc)
 									{
-										throw PARSER_EXCEPTION("The attributes \"" + attrib->name + "\" (" + attrib->definedInFile + ":" +
-																					 boost::lexical_cast<std::string>(attrib->definedInLine) + ") and \"" +
-																					 varName + "\" share the same location");
+										throw PARSER_EXCEPTION("The attributes \"" + attrib->name + "\" (" +
+										                       attrib->definedInFile + ":" +
+										                       boost::lexical_cast<std::string>(attrib->definedInLine) +
+										                       ") and \"" + varName + "\" share the same location");
 									}
 								}
 
 								// all ok, push it back
-								output.attributes.push_back(ShaderVarPragma(filename, scanner.getLineNumber(), varName, loc));
-								sourceLines.push_back(lines[scanner.getLineNumber()-1]);
+								output.attributes.push_back(ShaderVarPragma(filename, scanner.getLineNumber(),
+								                                            varName, loc));
+								sourceLines.push_back(lines[scanner.getLineNumber() - 1]);
 							}
 							else
 							{
@@ -406,8 +425,9 @@ void ShaderPrePreprocessor::parseFile(const char* filename)
 			}
 
 			// vert shader code
-			int limit = (geomShaderBegins.definedInLine != -1) ? geomShaderBegins.globalLine-1 : fragShaderBegins.globalLine-1;
-			for(int i=vertShaderBegins.globalLine-1; i<limit; ++i)
+			int limit = (geomShaderBegins.definedInLine != -1) ? geomShaderBegins.globalLine-1 :
+			                                                     fragShaderBegins.globalLine-1;
+			for(int i = vertShaderBegins.globalLine - 1; i < limit; ++i)
 			{
 				output.vertShaderSource += sourceLines[i] + "\n";
 			}
@@ -415,14 +435,14 @@ void ShaderPrePreprocessor::parseFile(const char* filename)
 			// geom shader code
 			if(geomShaderBegins.definedInLine != -1)
 			{
-				for(int i=geomShaderBegins.globalLine-1; i<fragShaderBegins.globalLine-1; ++i)
+				for(int i = geomShaderBegins.globalLine - 1; i < fragShaderBegins.globalLine - 1; ++i)
 				{
 					output.geomShaderSource += sourceLines[i] + "\n";
 				}
 			}
 
 			// frag shader code
-			for(int i=fragShaderBegins.globalLine-1; i<int(sourceLines.size()); ++i)
+			for(int i = fragShaderBegins.globalLine - 1; i < int(sourceLines.size()); ++i)
 			{
 				output.fragShaderSource += sourceLines[i] + "\n";
 			}

+ 18 - 12
src/Resources/Helpers/ShaderPrePreprocessor.h

@@ -33,7 +33,7 @@ class ShaderPrePreprocessor
 		struct Pragma
 		{
 			std::string definedInFile;
-			int    definedInLine;
+			int definedInLine;
 			Pragma(): definedInLine(-1) {}
 			Pragma(const std::string& definedInFile_, int definedInLine_);
 		};
@@ -70,18 +70,21 @@ class ShaderPrePreprocessor
 		{
 			friend class ShaderPrePreprocessor;
 
-			PROPERTY_R(Vec<ShaderVarPragma>, attributes, getAttribLocs) ///< It holds the name and the custom location
-			/// Names and and ids for transform feedback varyings
-			PROPERTY_R(Vec<TrffbVaryingPragma>, trffbVaryings, getTrffbVaryings)
-			PROPERTY_R(std::string, vertShaderSource, getVertShaderSource) ///< The vert shader source
-			PROPERTY_R(std::string, geomShaderSource, getGeomShaderSource) ///< The geom shader source
-			PROPERTY_R(std::string, fragShaderSource, getFragShaderSource) ///< The frag shader source
+			public:
+				GETTER_R(Vec<ShaderVarPragma>, attributes, getAttribLocs)
+				GETTER_R(Vec<TrffbVaryingPragma>, trffbVaryings, getTrffbVaryings)
+				GETTER_R(std::string, vertShaderSource, getVertShaderSource)
+				GETTER_R(std::string, geomShaderSource, getGeomShaderSource)
+				GETTER_R(std::string, fragShaderSource, getFragShaderSource)
+			
+			private:
+				Vec<ShaderVarPragma> attributes; ///< It holds the name and the custom location
+				Vec<TrffbVaryingPragma> trffbVaryings; ///< Names and and ids for transform feedback varyings
+				std::string vertShaderSource; ///< The vert shader source
+				std::string geomShaderSource; ///< The geom shader source
+				std::string fragShaderSource; ///< The frag shader source
 		};
-
-	//====================================================================================================================
-	// Properties                                                                                                        =
-	//====================================================================================================================
-	PROPERTY_R(Output, output, getOutput) ///< The one and only public property
+		
 
 	//====================================================================================================================
 	// Public                                                                                                            =
@@ -94,11 +97,14 @@ class ShaderPrePreprocessor
 
 		/// Destructor does nothing
 		~ShaderPrePreprocessor() {}
+		
+		GETTER_R(Output, output, getOutput)
 
 	//====================================================================================================================
 	// Protected                                                                                                         =
 	//====================================================================================================================
 	protected:
+		Output output; ///< The most important variable
 		Vec<std::string> sourceLines;  ///< The parseFileForPragmas fills this
 		CodeBeginningPragma vertShaderBegins;
 		CodeBeginningPragma geomShaderBegins;

+ 88 - 89
src/Resources/Material.cpp

@@ -132,72 +132,72 @@ void Material::load(const char* filename)
 	{
 		using namespace boost::property_tree;
 		ptree rpt;
-  	read_xml(filename, rpt);
+		read_xml(filename, rpt);
 
-  	const ptree& pt = rpt.get_child("material");
+		const ptree& pt = rpt.get_child("material");
 
-  	//
-  	// shaderProg
-  	//
-  	const ptree& shaderProgTree = pt.get_child("shaderProg");
+		//
+		// shaderProg
+		//
+		const ptree& shaderProgTree = pt.get_child("shaderProg");
 
-  	boost::optional<std::string> file = shaderProgTree.get_optional<std::string>("file");
-  	boost::optional<const ptree&> customMsSProgTree = shaderProgTree.get_child_optional("customMsSProg");
+		boost::optional<std::string> file = shaderProgTree.get_optional<std::string>("file");
+		boost::optional<const ptree&> customMsSProgTree = shaderProgTree.get_child_optional("customMsSProg");
 		boost::optional<const ptree&> customDpSProgTree = shaderProgTree.get_child_optional("customDpSProg");
 
-  	// Just file
-  	if(file)
-  	{
-  		shaderProg.loadRsrc(file.get().c_str());
-  	}
-  	// customMsSProg
-  	else if(customMsSProgTree)
-  	{
-  		std::string source;
-  		std::string prefix;
-
-  		parseCustomShader(msGenericDefines, customMsSProgTree.get(), source, prefix);
-  		std::string shaderFilename = ShaderProg::createSrcCodeToCache("shaders/MsMpGeneric.glsl",
-  		                                                              source.c_str(), prefix.c_str());
-  		shaderProg.loadRsrc(shaderFilename.c_str());
+		// Just file
+		if(file)
+		{
+			shaderProg.loadRsrc(file.get().c_str());
+		}
+		// customMsSProg
+		else if(customMsSProgTree)
+		{
+			std::string source;
+			std::string prefix;
+
+			parseCustomShader(msGenericDefines, customMsSProgTree.get(), source, prefix);
+			std::string shaderFilename = ShaderProg::createSrcCodeToCache("shaders/MsMpGeneric.glsl",
+																		  source.c_str(), prefix.c_str());
+			shaderProg.loadRsrc(shaderFilename.c_str());
 		}
 		// customDpSProg
-  	else if(customDpSProgTree)
-  	{
-  		std::string source;
-  		std::string prefix;
-
-  		parseCustomShader(dpGenericDefines, customDpSProgTree.get(), source, prefix);
-  		std::string shaderFilename = ShaderProg::createSrcCodeToCache("shaders/DpGeneric.glsl",
-  		                                                              source.c_str(), prefix.c_str());
-  		shaderProg.loadRsrc(shaderFilename.c_str());
-  	}
-  	// Error
+		else if(customDpSProgTree)
+		{
+			std::string source;
+			std::string prefix;
+
+			parseCustomShader(dpGenericDefines, customDpSProgTree.get(), source, prefix);
+			std::string shaderFilename = ShaderProg::createSrcCodeToCache("shaders/DpGeneric.glsl",
+																		  source.c_str(), prefix.c_str());
+			shaderProg.loadRsrc(shaderFilename.c_str());
+		}
+		// Error
 		else
 		{
 			throw EXCEPTION("Expected file or customMsSProg or customDpSProg");
 		}
 
-  	//
-  	// blendingStage
-  	//
-  	boost::optional<bool> blendingStage_ = PropertyTree::getBoolOptional(pt, "blendingStage");
-  	if(blendingStage_)
-  	{
-  		blendingStage = blendingStage_.get();
-  	}
-
-  	//
-  	// blendFuncs
-  	//
-  	boost::optional<const ptree&> blendFuncsTree = pt.get_child_optional("blendFuncs");
-  	if(blendFuncsTree)
-  	{
-  		int glEnum;
-
-  		// sFactor
-  		std::string sFactor_ = blendFuncsTree.get().get<std::string>("sFactor");
-  		if(!searchBlendEnum(sFactor_.c_str(), glEnum))
+		//
+		// blendingStage
+		//
+		boost::optional<bool> blendingStage_ = PropertyTree::getBoolOptional(pt, "blendingStage");
+		if(blendingStage_)
+		{
+			blendingStage = blendingStage_.get();
+		}
+
+		//
+		// blendFuncs
+		//
+		boost::optional<const ptree&> blendFuncsTree = pt.get_child_optional("blendFuncs");
+		if(blendFuncsTree)
+		{
+			int glEnum;
+
+			// sFactor
+			std::string sFactor_ = blendFuncsTree.get().get<std::string>("sFactor");
+			if(!searchBlendEnum(sFactor_.c_str(), glEnum))
 			{
 				throw EXCEPTION("Incorrect blending factor \"" + sFactor_ + "\"");
 			}
@@ -210,41 +210,41 @@ void Material::load(const char* filename)
 				throw EXCEPTION("Incorrect blending factor \"" + dFactor_ + "\"");
 			}
 			blendingDfactor = glEnum;
-  	}
-
-  	//
-  	// depthTesting
-  	//
-  	boost::optional<bool> depthTesting_ = PropertyTree::getBoolOptional(pt, "depthTesting");
-  	if(depthTesting_)
-  	{
-  		depthTesting = depthTesting_.get();
-  	}
-
-  	//
-  	// wireframe
-  	//
-  	boost::optional<bool> wireframe_ = PropertyTree::getBoolOptional(pt, "wireframe");
-  	if(wireframe_)
-  	{
-  		wireframe = wireframe_.get();
-  	}
-
-  	//
-  	// userDefinedVars
-  	//
-  	boost::optional<const ptree&> userDefinedVarsTree = pt.get_child_optional("userDefinedVars");
-  	if(userDefinedVarsTree)
-  	{
-  		BOOST_FOREACH(const ptree::value_type& v, userDefinedVarsTree.get())
+		}
+
+		//
+		// depthTesting
+		//
+		boost::optional<bool> depthTesting_ = PropertyTree::getBoolOptional(pt, "depthTesting");
+		if(depthTesting_)
+		{
+			depthTesting = depthTesting_.get();
+		}
+
+		//
+		// wireframe
+		//
+		boost::optional<bool> wireframe_ = PropertyTree::getBoolOptional(pt, "wireframe");
+		if(wireframe_)
+		{
+			wireframe = wireframe_.get();
+		}
+
+		//
+		// userDefinedVars
+		//
+		boost::optional<const ptree&> userDefinedVarsTree = pt.get_child_optional("userDefinedVars");
+		if(userDefinedVarsTree)
+		{
+			BOOST_FOREACH(const ptree::value_type& v, userDefinedVarsTree.get())
 			{
-  			if(v.first != "userDefinedVar")
-  			{
-  				throw EXCEPTION("Expected userDefinedVar and not " + v.first);
-  			}
+				if(v.first != "userDefinedVar")
+				{
+					throw EXCEPTION("Expected userDefinedVar and not " + v.first);
+				}
 
-  			const ptree& userDefinedVarTree = v.second;
-  			std::string varName = userDefinedVarTree.get<std::string>("name");
+				const ptree& userDefinedVarTree = v.second;
+				std::string varName = userDefinedVarTree.get<std::string>("name");
 
 				// check if the uniform exists
 				if(!shaderProg->uniVarExists(varName.c_str()))
@@ -317,8 +317,7 @@ void Material::load(const char* filename)
 						break;
 				};
 			} // end for all userDefinedVars
-  	} // end userDefinedVars
-
+		} // end userDefinedVars
 		initStdShaderVars();
 	}
 	catch(std::exception& e)

+ 2 - 2
src/Scene/Camera.h

@@ -34,7 +34,7 @@ class Camera: public SceneNode
 		~Camera() {}
 
 		/// @name Accessors
-		//// @{
+		/// @{
 		void setFovX(float fovx);
 		void setFovY(float fovy);
 		void setZNear(float znear);
@@ -54,7 +54,7 @@ class Camera: public SceneNode
 		GETTER_RW(std::deque<const RenderableNode*>, bsRenderableNodes, getVisibleBsRenderableNodes)
 		GETTER_RW(Vec<const PointLight*>, pointLights, getVisiblePointLights)
 		GETTER_RW(Vec<SpotLight*>, spotLights, getVisibleSpotLights)
-		//// @}
+		/// @}
 
 		void lookAtPoint(const Vec3& point);
 

+ 4 - 1
src/Scene/SkinNode.h

@@ -32,7 +32,7 @@ class SkinNode: public SceneNode
 
 		void init(const char* filename);
 
-		/// Update boundingShapeWSpace from bone tails (not bone and heads cause its faster that way). The tails come
+		/// Update boundingShapeWSpace from bone tails (not heads as well cause its faster that way). The tails come
 		/// from the previous frame
 		void moveUpdate();
 
@@ -41,10 +41,13 @@ class SkinNode: public SceneNode
 		Vec<SkinPatchNode*> patches;
 		Obb visibilityShapeWSpace;
 
+		/// @name Bone data
+		/// @{
 		Vec<Vec3> heads;
 		Vec<Vec3> tails;
 		Vec<Mat3> boneRotations;
 		Vec<Vec3> boneTranslations;
+		/// @}
 };