Bugfix: 21586 - UI problems with Tiled Textures (animatable for GE)
authorDalai Felinto <dfelinto@gmail.com>
Thu, 8 Apr 2010 20:58:18 +0000 (20:58 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Thu, 8 Apr 2010 20:58:18 +0000 (20:58 +0000)
The problem was present in Blender 2.49, but it didn't produce any side effect.
glScale was changing the texture matrix and the matrix was never been reset. That messes up with UI drawing.

source/blender/gpu/intern/gpu_draw.c

index f00126a7faba62612bbfdf2a7e0573ad01e17e11..d3a4621c79369978450e356cae5315c0f0b96576 100644 (file)
@@ -1097,6 +1097,14 @@ void GPU_end_object_materials(void)
        GMS.matbuf= NULL;
        GMS.gmatbuf= NULL;
        GMS.blendmode= NULL;
+
+       /* resetting the texture matrix after the glScale needed for tiled textures */
+       if(GTS.tilemode)
+       {
+               glMatrixMode(GL_TEXTURE);
+               glLoadIdentity();
+               glMatrixMode(GL_MODELVIEW);
+       }
 }
 
 /* Lights */