diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-03 20:21:14 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-04-03 20:21:14 +0400 |
commit | e6a16e585cd30aa540550b9ac76ba630daf03fe8 (patch) | |
tree | b2b47b2da6f4e92625d9c6d7833225cfacc857b0 /source/blender/editors/screen/glutil.c | |
parent | 743552ff2a4c1ce057934e0c5b22a0e48d08c749 (diff) |
Apparently zoom in clip editor was broken
Also silenced some warnings in glutil.
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index ec1a085f9da..3469604b3dd 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -533,8 +533,10 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, 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 @@ void glaDrawImBuf_glsl_ctx(const bContext *C, ImBuf *ibuf, float x, float y, int 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 @@ void glaDrawImBuf_glsl_ctx(const bContext *C, ImBuf *ibuf, float x, float y, int 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 */ |