ecere/gfx/3D/Object: Fixed missing mesh flags checks in Merge()
authorJerome St-Louis <jerome@ecere.com>
Fri, 22 Jan 2016 21:13:19 +0000 (16:13 -0500)
committerJerome St-Louis <jerome@ecere.com>
Sat, 2 Jul 2016 20:41:06 +0000 (16:41 -0400)
ecere/src/gfx/3D/Object.ec

index 1fed3c2..b48b955 100644 (file)
@@ -793,7 +793,7 @@ public:
          for(child = children.first; child; child = child.next)
          {
             child.Merge(displaySystem);
-            if(child.mesh)
+            if(child.flags.mesh && child.mesh)
             {
                nVertices += child.mesh.nVertices;
                flags |= child.mesh.flags;
@@ -857,7 +857,7 @@ public:
 
                if(child.flags.mesh && child.mesh)
                {
-                  for(c = 0; c<child.mesh.nVertices; c++)
+                  for(c = 0; c < child.mesh.nVertices; c++)
                   {
                      mesh.vertices[nVertices].MultMatrix(child.mesh.vertices[c], matrix);
                      if(child.mesh.normals)
@@ -1024,7 +1024,7 @@ public:
 
             for(child = children.first; child; child = child.next)
             {
-               if(child.mesh)
+               if(child.flags.mesh && child.mesh)
                   nTriangles += child.mesh.nPrimitives;
             }