src/gldraw.cpp

changeset 442
4852e815df29
parent 441
a958f6925088
child 443
a70dd25dd4bb
--- a/src/gldraw.cpp	Fri Aug 09 03:09:08 2013 +0300
+++ b/src/gldraw.cpp	Fri Aug 09 04:29:37 2013 +0300
@@ -295,8 +295,6 @@
 		glRotatef (m_rotZ, 0.0f, 0.0f, 1.0f);
 	}
 	
-	const GL::ListType list = (!drawOnly() && m_picking) ? PickList : NormalList;
-	
 	// Draw the polygons
 	glEnableClientState (GL_VERTEX_ARRAY);
 	glEnableClientState (GL_COLOR_ARRAY);
@@ -309,13 +307,17 @@
 		glDisable (GL_CULL_FACE);
 	
 	VertexCompiler::Array* array = g_vertexCompiler.getMergedBuffer (
-		(gl_colorbfc) ? VertexCompiler::BFCArray : VertexCompiler::MainArray);
+		(m_picking) ? VertexCompiler::PickArray :
+		(gl_colorbfc) ? VertexCompiler::BFCArray :
+			VertexCompiler::MainArray);
 	glVertexPointer (3, GL_FLOAT, sizeof (VertexCompiler::Vertex), &array->data()[0].x);
 	glColorPointer (4, GL_UNSIGNED_BYTE, sizeof (VertexCompiler::Vertex), &array->data()[0].color);
 	glDrawArrays (GL_TRIANGLES, 0, array->writtenSize() / sizeof (VertexCompiler::Vertex));
 	
 	// Draw edge lines
-	array = g_vertexCompiler.getMergedBuffer (VertexCompiler::EdgeArray);
+	array = g_vertexCompiler.getMergedBuffer (
+		(m_picking) ? VertexCompiler::EdgePickArray :
+			VertexCompiler::EdgeArray);
 	glVertexPointer (3, GL_FLOAT, sizeof (VertexCompiler::Vertex), &array->data()[0].x);
 	glColorPointer (4, GL_UNSIGNED_BYTE, sizeof (VertexCompiler::Vertex), &array->data()[0].color);
 	glDrawArrays (GL_LINES, 0, array->writtenSize() / sizeof (VertexCompiler::Vertex));
@@ -886,6 +888,7 @@
 			(*(pixelptr + 0) * 0x10000) +
 			(*(pixelptr + 1) * 0x00100) +
 			(*(pixelptr + 2) * 0x00001);
+		
 		pixelptr += 4;
 		
 		if (idx == 0xFFFFFF)

mercurial