Commit cb93943b authored by Matthias Möller's avatar Matthias Möller
Browse files

fix: pointclouds will not be rebuild all the time

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17952 383ad7c9-94d9-4d36-a494-682f7c89f535
parent c74b8f1a
...@@ -179,7 +179,6 @@ DrawMeshT<Mesh>::rebuild() ...@@ -179,7 +179,6 @@ DrawMeshT<Mesh>::rebuild()
verticesTmp_ = new Vertex[numVerts_]; verticesTmp_ = new Vertex[numVerts_];
invVertexMap_ = new unsigned int[mesh_.n_vertices()]; invVertexMap_ = new unsigned int[mesh_.n_vertices()];
} }
numVerts_ = mesh_.n_vertices(); numVerts_ = mesh_.n_vertices();
// read all vertices // read all vertices
...@@ -192,7 +191,7 @@ DrawMeshT<Mesh>::rebuild() ...@@ -192,7 +191,7 @@ DrawMeshT<Mesh>::rebuild()
} }
createVBO(); createVBO();
rebuild_ = REBUILD_NONE;
return; return;
} }
...@@ -1058,7 +1057,10 @@ template <class Mesh> ...@@ -1058,7 +1057,10 @@ template <class Mesh>
void DrawMeshT<Mesh>::updateGPUBuffers() void DrawMeshT<Mesh>::updateGPUBuffers()
{ {
// rebuild if necessary // rebuild if necessary
if (!numTris_ || ! numVerts_ || !subsets_) rebuild_ = REBUILD_FULL; if ((!numTris_ && mesh_.n_faces())|| ! numVerts_ || (!subsets_ && mesh_.n_faces()))
{
rebuild_ = REBUILD_FULL;
}
if (bVBOinHalfedgeNormalMode_ != halfedgeNormalMode_) rebuild_ = REBUILD_FULL; if (bVBOinHalfedgeNormalMode_ != halfedgeNormalMode_) rebuild_ = REBUILD_FULL;
...@@ -1070,7 +1072,9 @@ void DrawMeshT<Mesh>::updateGPUBuffers() ...@@ -1070,7 +1072,9 @@ void DrawMeshT<Mesh>::updateGPUBuffers()
createVBO(); createVBO();
} }
else else
{
rebuild(); rebuild();
}
} }
......
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