gldraw.cpp

changeset 70
e6b8dab8f81a
parent 69
6790dea720a8
child 72
5755c02d89f0
--- a/gldraw.cpp	Mon Mar 25 16:05:03 2013 +0200
+++ b/gldraw.cpp	Mon Mar 25 17:04:18 2013 +0200
@@ -135,8 +135,8 @@
 		setMainColor ();
 		
 		// Warn about the unknown colors, but only once.
-		for (long i = 0; i < (long)g_daWarnedColors.size(); ++i)
-			if (g_daWarnedColors[i] == obj->dColor)
+		for (short i : g_daWarnedColors)
+			if (obj->dColor == i)
 				return;
 		
 		printf ("%s: Unknown color %d!\n", __func__, obj->dColor);
@@ -227,15 +227,15 @@
 		&uObjListBack,
 	};
 	
-	for (uchar j = 0; j < 2; ++j) {
-		if (j && !gl_colorbfc)
+	for (uchar i = 0; i < 2; ++i) {
+		if (i && !gl_colorbfc)
 			continue;
 		
-		*upaLists[j] = glGenLists (1);
-		glNewList (*upaLists[j], GL_COMPILE);
+		*upaLists[i] = glGenLists (1);
+		glNewList (*upaLists[i], GL_COMPILE);
 		
-		for (ulong i = 0; i < g_CurrentFile->objects.size(); i++)
-			compileOneObject (g_CurrentFile->objects[i], j);
+		for (LDObject* obj : g_CurrentFile->objects)
+			compileOneObject (obj, i);
 		
 		glEndList ();
 	}
@@ -244,7 +244,7 @@
 // =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
-template<class T>void renderer::compileSubObject (LDObject* obj,
+template<class T> void renderer::compileSubObject (LDObject* obj,
 	const bool bBackSide, const GLenum eGLType, const short dVerts)
 {
 	setObjectColor (obj, bBackSide);
@@ -292,9 +292,9 @@
 			
 			vector<LDObject*> objs = ref->inlineContents (true, true);
 			
-			for (ulong i = 0; i < (ulong)objs.size(); ++i) {
-				compileOneObject (objs[i], bBackSide);
-				delete objs[i];
+			for (LDObject* obj : objs) {
+				compileOneObject (obj, bBackSide);
+				delete obj;
 			}
 		}
 		break;

mercurial