diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-03-17 15:52:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-03-17 15:52:49 +0300 |
commit | 9777c5b0cafaaffb8ef224465785081f60efa2f8 (patch) | |
tree | 220de6d37ecc08f100f379d917619ba831223460 /source/blender/editors/space_node | |
parent | 49182111fb1fc87b18ef951cd3a44b4ff22dee2f (diff) |
Fix T47827: Single Channel Preview Error
Fix by @sergey with own fix for big endian.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 623afb2ab80..1460a3a35c8 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -3237,9 +3237,9 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle); #ifdef __BIG_ENDIAN__ - if (snode->flag & SNODE_SHOW_R) ofs = 2; + if (snode->flag & SNODE_SHOW_R) ofs = 0; else if (snode->flag & SNODE_SHOW_G) ofs = 1; - else ofs = 0; + else ofs = 2; #else if (snode->flag & SNODE_SHOW_R) ofs = 1; else if (snode->flag & SNODE_SHOW_G) ofs = 2; @@ -3250,7 +3250,7 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode, b /* 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, - display_buffer + ofs); + display_buffer - (4 - ofs)); glPixelZoom(1.0f, 1.0f); } |