[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42270] trunk/blender/source/blender/ editors/space_node/drawnode.c: Added comments to the workaround made in r42266 ( node line drawing bug on Intel hardware).

Lukas Toenne lukas.toenne at googlemail.com
Tue Nov 29 21:35:37 CET 2011


Revision: 42270
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42270
Author:   lukastoenne
Date:     2011-11-29 20:35:30 +0000 (Tue, 29 Nov 2011)
Log Message:
-----------
Added comments to the workaround made in r42266 (node line drawing bug on Intel hardware). Also did the same workaround to straight line drawing (currently not in use).

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42266

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/drawnode.c

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2011-11-29 20:22:35 UTC (rev 42269)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2011-11-29 20:35:30 UTC (rev 42270)
@@ -2595,6 +2595,10 @@
 			glEnd();
 		}
 		
+		/* XXX using GL_LINES for shaded node lines is a workaround
+		 * for Intel hardware, this breaks with GL_LINE_STRIP and
+		 * changing color in begin/end blocks.
+		 */
 		glLineWidth(1.5f);
 		if(do_shaded) {
 			glBegin(GL_LINES);
@@ -2673,14 +2677,31 @@
 	UI_ThemeColor(th_col1);
 	glLineWidth(1.5f);
 	
-	glBegin(GL_LINE_STRIP);
-	for (i=0; i < LINK_RESOL; ++i) {
-		float t= (float)i/(float)(LINK_RESOL-1);
-		if(do_shaded)
+	/* XXX using GL_LINES for shaded node lines is a workaround
+	 * for Intel hardware, this breaks with GL_LINE_STRIP and
+	 * changing color in begin/end blocks.
+	 */
+	if(do_shaded) {
+		glBegin(GL_LINES);
+		for (i=0; i < LINK_RESOL-1; ++i) {
+			float t= (float)i/(float)(LINK_RESOL-1);
 			UI_ThemeColorBlend(th_col1, th_col2, t);
-		glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+			glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+			
+			t= (float)(i+1)/(float)(LINK_RESOL-1);
+			UI_ThemeColorBlend(th_col1, th_col2, t);
+			glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+		}
+		glEnd();
 	}
-	glEnd();
+	else {
+		glBegin(GL_LINE_STRIP);
+		for (i=0; i < LINK_RESOL; ++i) {
+			float t= (float)i/(float)(LINK_RESOL-1);
+			glVertex2f((1.0f-t)*coord_array[0][0]+t*coord_array[1][0], (1.0f-t)*coord_array[0][1]+t*coord_array[1][1]);
+		}
+		glEnd();
+	}
 	
 	glDisable(GL_LINE_SMOOTH);
 	




More information about the Bf-blender-cvs mailing list