use icons for rgb colors
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 11:24:43 +0000 (11:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 11:24:43 +0000 (11:24 +0000)
source/blender/editors/space_node/drawnode.c
source/blender/makesrna/intern/rna_space.c

index 5596e9151c7aedf464458f8929a58d67fb38b613..218d11f30359e75d974430988773dce874446fa5 100644 (file)
@@ -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) {
index 48ae6522da98f0aa134bbae7615379e86a21524c..d5bac7a8c26b284c1f1eb5ab79a10d9dc5344da9 100644 (file)
@@ -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}
        };