minor cleanup

Fri, 06 Dec 2013 21:06:48 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 06 Dec 2013 21:06:48 +0200
changeset 544
a52cfa218780
parent 543
7029f7938dae
child 545
3e789c989225

minor cleanup

src/gldraw.cpp file | annotate | diff | comparison | revisions
src/misc.cpp file | annotate | diff | comparison | revisions
--- a/src/gldraw.cpp	Fri Dec 06 20:54:34 2013 +0200
+++ b/src/gldraw.cpp	Fri Dec 06 21:06:48 2013 +0200
@@ -1433,7 +1433,9 @@
 			elif (g_RingFinder (dist0, dist1))
 			{	// The ring finder found a solution, use that. Add the component rings to the file.
 				for (const RingFinder::Component& cmp : g_RingFinder.bestSolution()->getComponents())
-				{	if ((refFile = ::getFile (radialFileName (::Ring, lores, lores, cmp.num))) == null)
+				{	// Get a ref file for this primitive. If we cannot find it in the
+					// LDraw library, generate it.
+					if ((refFile = ::getFile (radialFileName (::Ring, lores, lores, cmp.num))) == null)
 					{	refFile = generatePrimitive (::Ring, lores, lores, cmp.num);
 						refFile->setImplicit (false);
 					}
@@ -1447,7 +1449,7 @@
 				}
 			}
 			else
-			{	// Last resort: draw the ring with quads
+			{	// Ring finder failed, last resort: draw the ring with quads
 				QList<QLineF> c0, c1;
 				Axis relX, relY, relZ;
 				getRelativeAxes (relX, relY);
@@ -1498,7 +1500,8 @@
 		} break;
 
 		case Select:
-		{	assert (false);
+		{	// this shouldn't happen
+			assert (false);
 			return;
 		} break;
 	}
--- a/src/misc.cpp	Fri Dec 06 20:54:34 2013 +0200
+++ b/src/misc.cpp	Fri Dec 06 21:06:48 2013 +0200
@@ -284,11 +284,7 @@
 // as it would fall into an infinite recursion.
 // -----------------------------------------------------------------------------
 bool RingFinder::findRingsRecursor (double r0, double r1, Solution& currentSolution)
-{	char tabs[64];
-	memset (tabs, '\t', m_stack);
-	tabs[m_stack] = '\0';
-
-	// Don't recurse too deep.
+{	// Don't recurse too deep.
 	if (m_stack >= 5)
 		return false;
 

mercurial