[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44098] trunk/blender/source/blender/gpu/ intern/gpu_draw.c: Fix #30170: with file saved in texture painting mode, when going to object mode

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Feb 13 22:12:14 CET 2012


Revision: 44098
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44098
Author:   blendix
Date:     2012-02-13 21:12:14 +0000 (Mon, 13 Feb 2012)
Log Message:
-----------
Fix #30170: with file saved in texture painting mode, when going to object mode
the image texture is missing. The flag to indicate that the mipmap levels were
already loaded into GPU memory was incorrectly set then.

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_draw.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_draw.c	2012-02-13 21:05:04 UTC (rev 44097)
+++ trunk/blender/source/blender/gpu/intern/gpu_draw.c	2012-02-13 21:12:14 UTC (rev 44098)
@@ -732,6 +732,8 @@
 				else
 					GPU_free_image(ima);
 			}
+			else
+				ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 		}
 
 	}
@@ -742,6 +744,8 @@
 				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
 				glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
 			}
+			else
+				ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 		}
 	}
 }
@@ -939,7 +943,6 @@
 	if(ima->bindcode) {
 		glDeleteTextures(1, (GLuint *)&ima->bindcode);
 		ima->bindcode= 0;
-		ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 	}
 
 	/* free glsl image binding */
@@ -954,8 +957,9 @@
 	
 		MEM_freeN(ima->repbind);
 		ima->repbind= NULL;
-		ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 	}
+
+	ima->tpageflag &= ~IMA_MIPMAP_COMPLETE;
 }
 
 void GPU_free_images(void)




More information about the Bf-blender-cvs mailing list