[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14698] branches/apricot/source/blender/ src/buttons_shading.c:

Brecht Van Lommel brechtvanlommel at pandora.be
Mon May 5 21:19:27 CEST 2008


Revision: 14698
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14698
Author:   blendix
Date:     2008-05-05 21:19:27 +0200 (Mon, 05 May 2008)

Log Message:
-----------

Apricot branch bugfix: texture slots changes had a bug that could make
drawing them crash.

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

Modified: branches/apricot/source/blender/src/buttons_shading.c
===================================================================
--- branches/apricot/source/blender/src/buttons_shading.c	2008-05-05 17:43:13 UTC (rev 14697)
+++ branches/apricot/source/blender/src/buttons_shading.c	2008-05-05 19:19:27 UTC (rev 14698)
@@ -1602,8 +1602,14 @@
 		yco= 150;
 		
 		/* APRICOT HACK */ 
-		for(a=MAX_MTEX; a>0; a--) {
-			if (ma->mtex[a]) {
+		for(a=MAX_MTEX-1; a>=0; a--) {
+			if(ma) mt= ma->mtex[a];
+			else if(wrld) mt= wrld->mtex[a];
+			else if(la) mt= la->mtex[a];
+			else if(br) mt= br->mtex[a];
+			else if(sd) mt= sd->mtex[a];
+
+			if (mt) {
 				max_mtex = a;
 				break;
 			}
@@ -3512,7 +3518,7 @@
 	
 	/* APRICOT HACK */
 	int max_mtex = 0; 
-	for(a=MAX_MTEX; a>0; a--) {
+	for(a=MAX_MTEX-1; a>=0; a--) {
 		if (ma->mtex[a]) {
 			max_mtex = a;
 			break;





More information about the Bf-blender-cvs mailing list