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) { diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 48ae6522da9..d5bac7a8c26 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2852,9 +2852,10 @@ static void rna_def_space_node(BlenderRNA *brna) {SNODE_USE_ALPHA, "COLOR_ALPHA", ICON_IMAGE_RGB_ALPHA, "Color and Alpha", "Draw image with RGB colors and alpha transparency"}, {SNODE_SHOW_ALPHA, "ALPHA", ICON_IMAGE_ALPHA, "Alpha", "Draw alpha transparency channel"}, - {SNODE_SHOW_R, "RED", 0, "Red", ""}, - {SNODE_SHOW_G, "GREEN", 0, "Green", ""}, - {SNODE_SHOW_B, "BLUE", 0, "Blue", ""}, + /* XXX, we could use better icons here */ + {SNODE_SHOW_R, "RED", ICON_COLOR, "Red", ""}, + {SNODE_SHOW_G, "GREEN", ICON_COLOR, "Green", ""}, + {SNODE_SHOW_B, "BLUE", ICON_COLOR, "Blue", ""}, {0, NULL, 0, NULL, NULL} };