[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21420] branches/soc-2009-imbusy/source/ blender/editors/space_view3d/drawobject.c: fixed a bug with vertex paint mode, should work just fine

Lukas Steiblys imbusy at imbusy.org
Wed Jul 8 12:27:18 CEST 2009


Revision: 21420
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21420
Author:   imbusy
Date:     2009-07-08 12:27:18 +0200 (Wed, 08 Jul 2009)

Log Message:
-----------
fixed a bug with vertex paint mode, should work just fine

Modified Paths:
--------------
    branches/soc-2009-imbusy/source/blender/editors/space_view3d/drawobject.c

Modified: branches/soc-2009-imbusy/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2009-imbusy/source/blender/editors/space_view3d/drawobject.c	2009-07-08 09:23:49 UTC (rev 21419)
+++ branches/soc-2009-imbusy/source/blender/editors/space_view3d/drawobject.c	2009-07-08 10:27:18 UTC (rev 21420)
@@ -5620,16 +5620,16 @@
 	colors = MEM_mallocN(dm->getNumFaces(dm)*sizeof(MCol)*4,"bbs_mesh_solid");
 	for(i=0;i<dm->getNumFaces(dm);i++) {
 		if (!(me->mface[i].flag&ME_HIDE)) {
-			unsigned int fbindex = index_to_framebuffer(i);
+			unsigned int fbindex = index_to_framebuffer(i+1);
 			for(j=0;j<4;j++) {
 				colors[i*4+j].b = ((fbindex)&0xFF);
 				colors[i*4+j].g = (((fbindex)>>8)&0xFF);
 				colors[i*4+j].r = (((fbindex)>>16)&0xFF);
-				colors[i*4+j].a = 255;
+				//colors[i*4+j].a = 255;
 			}
 		}
 		else {
-			memset(&colors[i*4],0,sizeof(MCol));
+			memset(&colors[i*4],0,sizeof(MCol)*4);
 		}
 	}
 		
@@ -5637,7 +5637,7 @@
 	GPU_buffer_free(dm->drawObject->colors,0);
 	dm->drawObject->colors = 0;
 	dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, me, 1);
-	CustomData_free_layer( &dm->faceData, CD_WEIGHT_MCOL, dm->numFaceData, 0 );
+	CustomData_free_layer( &dm->faceData, CD_WEIGHT_MCOL, dm->getNumFaces(dm), 0 );
 
 	dm->release(dm);
 }





More information about the Bf-blender-cvs mailing list