From f2e8e796dddb18f0b0fada9949ef6ed88a1f9ecb Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 5 Aug 2014 20:29:06 +0200 Subject: [PATCH] ply.cpp: assertion fix when using 'maxSmoothAngle' --- src/shapes/ply.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/shapes/ply.cpp b/src/shapes/ply.cpp index bb54aab6..3cc16358 100644 --- a/src/shapes/ply.cpp +++ b/src/shapes/ply.cpp @@ -118,6 +118,9 @@ public: if (m_triangleCount == 0 || m_vertexCount == 0) Log(EError, "Unable to load \"%s\" (no triangles or vertices found)!"); + Assert(m_faceCtr == m_faceCount); + Assert(m_vertexCtr == m_vertexCount); + if (props.hasProperty("maxSmoothAngle")) { if (m_faceNormals) Log(EError, "The properties 'maxSmoothAngle' and 'faceNormals' " @@ -132,11 +135,9 @@ public: delete[] m_triangles; m_triangles = temp; } - - Assert(m_faceCtr == m_faceCount); - Assert(m_vertexCtr == m_vertexCount); } + PLYLoader(Stream *stream, InstanceManager *manager) : TriMesh(stream, manager) { } void loadPLY(const fs::path &path);