[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34382] trunk/blender/source/blender: More fixes for bug [#25649], Image editor paint icon missing until

Nicholas Bishop nicholasbishop at gmail.com
Tue Jan 18 05:08:02 CET 2011


Revision: 34382
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34382
Author:   nicholasbishop
Date:     2011-01-18 04:08:01 +0000 (Tue, 18 Jan 2011)
Log Message:
-----------
More fixes for bug [#25649], Image editor paint icon missing until
enter weight paint, hopefully fully fixed this time

* The texture selector for brushes wasn't updating. Seems that preview
  images have two sizes, small (icon) and big, but it was only
  updating if the icon size was set to update. Now both are checked.

* Also changed the previewimage arrays to use the already-existing
  PREVIEW_MIPMAPS define, makes it a little clearer what the arrays
  are for.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_icons.c
    trunk/blender/source/blender/makesdna/DNA_ID.h

Modified: trunk/blender/source/blender/editors/interface/interface_icons.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_icons.c	2011-01-18 03:49:28 UTC (rev 34381)
+++ trunk/blender/source/blender/editors/interface/interface_icons.c	2011-01-18 04:08:01 UTC (rev 34382)
@@ -1004,17 +1004,18 @@
 void ui_id_icon_render(bContext *C, ID *id, int preview)
 {
 	PreviewImage *pi = BKE_previewimg_get(id); 
+	int i;
 		
-	if (pi) {			
-		if ((pi->changed[0] ||!pi->rect[0])) /* changed only ever set by dynamic icons */
-		{
-			/* create the preview rect if necessary */				
-			
-			icon_set_image(C, id, pi, 0);		/* icon size */
-			if (preview)
-				icon_set_image(C, id, pi, 1);	/* preview size */
-			
-			pi->changed[0] = 0;
+	if(!pi)
+		return;
+
+	for(i = 0; i < PREVIEW_MIPMAPS; i++) {
+		/* check if preview rect needs to be created; changed
+		   only set by dynamic icons */
+		if((pi->changed[i] || !pi->rect[i])) {
+			if(i == 0 || preview)
+				icon_set_image(C, id, pi, i);
+			pi->changed[i] = 0;
 		}
 	}
 }

Modified: trunk/blender/source/blender/makesdna/DNA_ID.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_ID.h	2011-01-18 03:49:28 UTC (rev 34381)
+++ trunk/blender/source/blender/makesdna/DNA_ID.h	2011-01-18 04:08:01 UTC (rev 34382)
@@ -127,11 +127,11 @@
 #define PREVIEW_MIPMAP_LARGE 1
 
 typedef struct PreviewImage {
-	unsigned int w[2];
-	unsigned int h[2];	
-	short changed[2];
-	short changed_timestamp[2];
-	unsigned int * rect[2];
+	unsigned int w[PREVIEW_MIPMAPS];
+	unsigned int h[PREVIEW_MIPMAPS];	
+	short changed[PREVIEW_MIPMAPS];
+	short changed_timestamp[PREVIEW_MIPMAPS];
+	unsigned int * rect[PREVIEW_MIPMAPS];
 } PreviewImage;
 
 /**




More information about the Bf-blender-cvs mailing list