Commit 0088c988 authored by Jan Möbius's avatar Jan Möbius
Browse files

Make FaceInput use a reference to the mesh

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18087 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 935637f8
......@@ -185,8 +185,13 @@ void DrawMeshT<Mesh>::getMeshPropertyType( Prop _propData, GLuint* _outType, int
template<class Mesh>
class DrawMeshFaceInput : public MeshCompilerFaceInput
{
public:
Mesh mesh_;
DrawMeshFaceInput(Mesh& _mesh) :
mesh_(_mesh)
{
};
// map[attrID] -> use per halfedge/vertex attribute (true/false)
std::vector<int> attributeStoredPerHalfedge_;
......@@ -330,6 +335,8 @@ public:
return adj_it->idx();
}
private:
Mesh& mesh_;
};
......@@ -482,9 +489,7 @@ DrawMeshT<Mesh>::rebuild()
// pass face data to mesh compiler
DrawMeshFaceInput<Mesh> faceInput;
faceInput.mesh_ = mesh_;
DrawMeshFaceInput<Mesh> faceInput(mesh_);
faceInput.attributeStoredPerHalfedge_.resize(meshComp_->getVertexDeclaration()->getNumElements(), 0);
faceInput.attributeStoredPerHalfedge_[attrIDPos] = 0;
faceInput.attributeStoredPerHalfedge_[attrIDNorm] = ( (halfedgeNormalMode_ && mesh_.has_halfedge_normals()) ? 1 : 0 );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment