Selaa lähdekoodia

Same as before

Panagiotis Christopoulos Charitos 14 vuotta sitten
vanhempi
sitoutus
536ab3f053

+ 1 - 1
anki/resource/MaterialProperties.h

@@ -11,7 +11,7 @@ namespace anki {
 
 /// Contains a few properties that other classes may use. For an explanation of
 /// the variables refer to Material class documentation
-struct MaterialProperties
+class MaterialProperties
 {
 	public:
 		/// Initialize with default values

+ 6 - 7
anki/resource/Model.cpp

@@ -1,6 +1,5 @@
 #include <boost/property_tree/ptree.hpp>
 #include <boost/property_tree/xml_parser.hpp>
-#include <boost/foreach.hpp>
 #include <boost/lexical_cast.hpp>
 #include <boost/assign.hpp>
 #include <boost/range/iterator_range.hpp>
@@ -46,15 +45,15 @@ void Model::load(const char* filename)
 			throw ANKI_EXCEPTION("Zero number of model patches");
 		}
 
-		// Bounding volume
+		// Calculate compound bounding volume
 		visibilityShape = modelPatches[0].getMesh().getVisibilityShape();
-		BOOST_FOREACH(
-			const ModelPatch& patch,
-			boost::make_iterator_range(modelPatches.begin() + 1,
-			modelPatches.end()))
+
+		for(ModelPatchesContainer::const_iterator it = modelPatches.begin() + 1;
+			it != modelPatches.end();
+			++it)
 		{
 			visibilityShape = visibilityShape.getCompoundShape(
-				patch.getMesh().getVisibilityShape());
+				(*it).getMesh().getVisibilityShape());
 		}
 	}
 	catch(std::exception& e)

+ 4 - 2
anki/resource/Model.h

@@ -35,11 +35,13 @@ namespace anki {
 class Model
 {
 	public:
+		typedef boost::ptr_vector<ModelPatch> ModelPatchesContainer;
+
 		void load(const char* filename);
 
 		/// @name Accessors
 		/// @{
-		const boost::ptr_vector<ModelPatch>& getModelPatches() const
+		const ModelPatchesContainer& getModelPatches() const
 		{
 			return modelPatches;
 		}
@@ -52,7 +54,7 @@ class Model
 
 	private:
 		/// The vector of ModelPatch
-		boost::ptr_vector<ModelPatch> modelPatches;
+		ModelPatchesContainer modelPatches;
 		Obb visibilityShape;
 };
 

+ 1 - 1
anki/scene/MaterialRuntime.h

@@ -130,7 +130,7 @@ class MaterialRuntime: public MaterialProperties
 
 		bool variableExists(const char* name) const
 		{
-			return varNameToVar.find(name) != vars.end();
+			return varNameToVar.find(name) != varNameToVar.end();
 		}
 
 	private:

+ 2 - 2
anki/scene/RenderableNode.h

@@ -22,10 +22,10 @@ class RenderableNode: public SceneNode
 		virtual ~RenderableNode();
 
 		/// Get VAO depending the rendering pass
-		virtual const Vao& getVao(PassType p) const = 0;
+		virtual const Vao& getVao(const PassLevelKey& k) const = 0;
 
 		/// Get vert ids number for rendering
-		virtual uint getVertIdsNum() const = 0;
+		virtual uint getVertIdsNum(const PassLevelKey& k) const = 0;
 
 		/// Get the material resource
 		virtual const Material& getMaterial() const = 0;