[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29656] trunk/blender/source/blender: Fix #21370: VBO does not display material colors in textured solid.

Brecht Van Lommel brecht at blender.org
Wed Jun 23 18:35:42 CEST 2010


Revision: 29656
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29656
Author:   blendix
Date:     2010-06-23 18:35:42 +0200 (Wed, 23 Jun 2010)

Log Message:
-----------
Fix #21370: VBO does not display material colors in textured solid.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
    trunk/blender/source/blender/editors/space_view3d/drawmesh.c

Modified: trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2010-06-23 15:24:44 UTC (rev 29655)
+++ trunk/blender/source/blender/blenkernel/intern/cdderivedmesh.c	2010-06-23 16:35:42 UTC (rev 29656)
@@ -744,7 +744,7 @@
 				if( flag != lastFlag ) {
 					if( startFace < i ) {
 						if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */
-							if (lastFlag==1 && mcol)
+							if (lastFlag==1 && col)
 								GPU_color_switch(1);
 							else
 								GPU_color_switch(0);
@@ -757,7 +757,7 @@
 			}
 			if( startFace < dm->drawObject->nelements/3 ) {
 				if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */
-					if (lastFlag==1 && mcol)
+					if (lastFlag==1 && col)
 						GPU_color_switch(1);
 					else
 						GPU_color_switch(0);

Modified: trunk/blender/source/blender/editors/space_view3d/drawmesh.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2010-06-23 15:24:44 UTC (rev 29655)
+++ trunk/blender/source/blender/editors/space_view3d/drawmesh.c	2010-06-23 16:35:42 UTC (rev 29656)
@@ -430,7 +430,7 @@
 	} else if (tface && tface->mode&TF_OBCOL) {
 		return 2; /* Don't set color */
 	} else if (!mcol) {
-		return 2; /* Don't set color */
+		return 1; /* Don't set color */
 	} else {
 		return 1; /* Set color from mcol */
 	}
@@ -465,9 +465,9 @@
 			}
 		} else if (tface && tface->mode&TF_OBCOL) {
 			for(j=0;j<4;j++) {
-				finalCol[i*4+j].r = Gtexdraw.obcol[0];
-				finalCol[i*4+j].g = Gtexdraw.obcol[1];
-				finalCol[i*4+j].b = Gtexdraw.obcol[2];
+				finalCol[i*4+j].r = FTOCHAR(Gtexdraw.obcol[0]);
+				finalCol[i*4+j].g = FTOCHAR(Gtexdraw.obcol[1]);
+				finalCol[i*4+j].b = FTOCHAR(Gtexdraw.obcol[2]);
 			}
 		} else if (!mcol) {
 			if (tface) {
@@ -486,9 +486,9 @@
 					else copy_v3_v3(col, &ma->r);
 					
 					for(j=0;j<4;j++) {
-						finalCol[i*4+j].b = col[2];
-						finalCol[i*4+j].g = col[1];
-						finalCol[i*4+j].r = col[0];
+						finalCol[i*4+j].b = FTOCHAR(col[2]);
+						finalCol[i*4+j].g = FTOCHAR(col[1]);
+						finalCol[i*4+j].r = FTOCHAR(col[0]);
 					}
 				}
 				else
@@ -535,7 +535,7 @@
 	mcol = CustomData_em_get(&em->fdata, efa->data, CD_MCOL);
 	matnr = efa->mat_nr;
 
-	return draw_tface__set_draw(tface, mcol, matnr);
+	return draw_tface__set_draw_legacy(tface, mcol, matnr);
 }
 
 static int wpaint__setSolidDrawOptions(void *userData, int index, int *drawSmooth_r)





More information about the Bf-blender-cvs mailing list