[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16219] branches/apricot/source/blender/ src/drawmesh.c: missing NULL check when game text meshes had no vertex colors

Campbell Barton ideasman42 at gmail.com
Fri Aug 22 02:54:35 CEST 2008


Revision: 16219
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16219
Author:   campbellbarton
Date:     2008-08-22 02:54:22 +0200 (Fri, 22 Aug 2008)

Log Message:
-----------
missing NULL check when game text meshes had no vertex colors

Modified Paths:
--------------
    branches/apricot/source/blender/src/drawmesh.c

Modified: branches/apricot/source/blender/src/drawmesh.c
===================================================================
--- branches/apricot/source/blender/src/drawmesh.c	2008-08-22 00:35:14 UTC (rev 16218)
+++ branches/apricot/source/blender/src/drawmesh.c	2008-08-22 00:54:22 UTC (rev 16219)
@@ -484,7 +484,7 @@
 
 	ddm = mesh_get_derived_deform(ob, CD_MASK_BAREMESH);
 
-	for(a=0, mf=mface; a<totface; a++, tface++, mcol+=4, mf++) {
+	for(a=0, mf=mface; a<totface; a++, tface++, mf++) {
 		int mode= tface->mode;
 		int matnr= mf->mat_nr;
 		int mf_smooth= mf->flag & ME_SMOOTH;
@@ -506,8 +506,10 @@
 			}
 			else {
 				badtex = set_draw_settings_cached(0, Gtexdraw.istex, tface, Gtexdraw.islit, Gtexdraw.ob, matnr, TF_TWOSIDE);
-				if (badtex)
+				if (badtex) {
+					mcol+=4;
 					continue;
+				}
 			}
 
 			ddm->getVertCo(ddm, mf->v1, v1);
@@ -535,6 +537,9 @@
 			GPU_render_text(tface, tface->mode, string, characters,
 				(unsigned int*)mcol, v1, v2, v3, (mf->v4? v4: NULL), glattrib);
 		}
+		if (mcol) {
+			mcol+=4;
+		}
 	}
 
 	ddm->release(ddm);





More information about the Bf-blender-cvs mailing list