diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 5596e9151c7..218d11f3035 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -2954,13 +2954,15 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) if (snode->flag & (SNODE_SHOW_R | SNODE_SHOW_G | SNODE_SHOW_B)) { int ofs; +#ifdef __BIG_ENDIAN__ + if (snode->flag & SNODE_SHOW_R) ofs = 2; + else if (snode->flag & SNODE_SHOW_G) ofs = 1; + else ofs = 0; +#else 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; - } +#endif glPixelZoom(snode->zoom, snode->zoom); /* swap bytes, so alpha is most significant one, then just draw it as luminance int */ @@ -2972,12 +2974,14 @@ void draw_nodespace_back_pix(ARegion *ar, SpaceNode *snode, int color_manage) 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) - glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); - +#ifdef __BIG_ENDIAN__ + glPixelStorei(GL_UNPACK_SWAP_BYTES, 1); +#endif glaDrawPixelsSafe(x, y, ibuf->x, ibuf->y, ibuf->x, GL_LUMINANCE, GL_UNSIGNED_INT, ibuf->rect); - + +#ifdef __BIG_ENDIAN__ glPixelStorei(GL_UNPACK_SWAP_BYTES, 0); +#endif glPixelZoom(1.0f, 1.0f); } else if (snode->flag & SNODE_USE_ALPHA) { |