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

Never use a local variable for an instance that should be used after...

Never use a local variable for an instance that should be used after destruction at the end of the function

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18088 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0088c988
......@@ -489,13 +489,13 @@ DrawMeshT<Mesh>::rebuild()
// pass face data to mesh compiler
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 );
faceInput.attributeStoredPerHalfedge_[attrIDTexC] = ( mesh_.has_halfedge_texcoords2D() ? 1 : 0);
DrawMeshFaceInput<Mesh>* faceInput = new DrawMeshFaceInput<Mesh>(mesh_);
faceInput->attributeStoredPerHalfedge_.resize(meshComp_->getVertexDeclaration()->getNumElements(), 0);
faceInput->attributeStoredPerHalfedge_[attrIDPos] = 0;
faceInput->attributeStoredPerHalfedge_[attrIDNorm] = ( (halfedgeNormalMode_ && mesh_.has_halfedge_normals()) ? 1 : 0 );
faceInput->attributeStoredPerHalfedge_[attrIDTexC] = ( mesh_.has_halfedge_texcoords2D() ? 1 : 0);
meshComp_->setFaceInput(&faceInput);
meshComp_->setFaceInput(faceInput);
// set textures
for (int i = 0; i < mesh_.n_faces(); ++i)
......
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