[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55761] trunk/blender/source/blender/ editors: Apparently zoom in clip editor was broken

Sergey Sharybin sergey.vfx at gmail.com
Wed Apr 3 18:21:14 CEST 2013


Revision: 55761
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55761
Author:   nazgul
Date:     2013-04-03 16:21:14 +0000 (Wed, 03 Apr 2013)
Log Message:
-----------
Apparently zoom in clip editor was broken

Also silenced some warnings in glutil.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/screen/glutil.c
    trunk/blender/source/blender/editors/space_clip/clip_draw.c

Modified: trunk/blender/source/blender/editors/screen/glutil.c
===================================================================
--- trunk/blender/source/blender/editors/screen/glutil.c	2013-04-03 16:12:13 UTC (rev 55760)
+++ trunk/blender/source/blender/editors/screen/glutil.c	2013-04-03 16:21:14 UTC (rev 55761)
@@ -533,8 +533,10 @@
 		components = 3;
 	else if (format == GL_LUMINANCE)
 		components = 1;
-	else
+	else {
 		BLI_assert(!"Incompatible format passed to glaDrawPixelsTexScaled");
+		return;
+	}
 
 	if (type == GL_FLOAT) {
 		/* need to set internal format to higher range float */
@@ -1088,7 +1090,7 @@
 			glColor4f(1.0, 1.0, 1.0, 1.0);
 
 			if (ibuf->rect_float) {
-				int format;
+				int format = 0;
 
 				if (ibuf->channels == 3)
 					format = GL_RGB;
@@ -1097,8 +1099,10 @@
 				else
 					BLI_assert(!"Incompatible number of channels for GLSL display");
 
-				glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, format, GL_FLOAT,
-				                 zoomfilter, ibuf->rect_float);
+				if (format != 0) {
+					glaDrawPixelsTex(x, y, ibuf->x, ibuf->y, format, GL_FLOAT,
+					                 zoomfilter, ibuf->rect_float);
+				}
 			}
 			else if (ibuf->rect) {
 				/* ibuf->rect is always RGBA */

Modified: trunk/blender/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_clip/clip_draw.c	2013-04-03 16:12:13 UTC (rev 55760)
+++ trunk/blender/source/blender/editors/space_clip/clip_draw.c	2013-04-03 16:21:14 UTC (rev 55761)
@@ -279,8 +279,14 @@
 			filter = GL_NEAREST;
 		}
 
+		/* set zoom */
+		glPixelZoom(zoomx, zoomy);
+
 		glaDrawImBuf_glsl_ctx(C, ibuf, x, y, GL_NEAREST);
 
+		/* reset zoom */
+		glPixelZoom(1.0f, 1.0f);
+
 		if (ibuf->planes == 32)
 			glDisable(GL_BLEND);
 	}




More information about the Bf-blender-cvs mailing list