diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-06 13:24:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-06 13:24:47 +0400 |
commit | cf369c5e1345fce3d810363fc16235edd7f315a8 (patch) | |
tree | d3d40b5da3e6ea2afbbb747423fad9fb16da9f37 /source/blender/editors | |
parent | f5fe447e0094385e0b41c83666c210d13b7720b3 (diff) | |
parent | 3b559c8cc86fab02609556d2bbdd92aa3d1c3cba (diff) |
svn merge ^/trunk/blender -r48658:48674
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index d28e3ac5507..31485463f4f 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2992,7 +2992,25 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode) display_buffer = IMB_display_buffer_acquire(ibuf, view_settings, &win->display_settings, &cache_handle); if (display_buffer) { - if (snode->flag & SNODE_SHOW_ALPHA) { + if (snode->flag & (SNODE_SHOW_R | SNODE_SHOW_G | SNODE_SHOW_B)) { + int ofs; + + if (snode->flag & SNODE_SHOW_R) ofs = 1; + else if (snode->flag & SNODE_SHOW_G) ofs = 2; + else ofs = 3; + + if (ENDIAN_ORDER == B_ENDIAN) { + ofs = 3 - ofs; + } + + glPixelZoom(snode->zoom, snode->zoom); + /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ + + glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ((unsigned char *)ibuf->rect) + ofs); + + glPixelZoom(1.0f, 1.0f); + } + else if (snode->flag & SNODE_SHOW_ALPHA) { glPixelZoom(snode->zoom, snode->zoom); /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ if (ENDIAN_ORDER == B_ENDIAN) |