svn merge ^/trunk/blender -r48674:48681
[blender.git] / source / blender / editors / space_node / drawnode.c
index 8b0264da4fa9b41a0e9cbc5e6f5149220448075d..625d2343dff49fd744c838b5200a734e8d8e0cdc 100644 (file)
@@ -2996,13 +2996,15 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode)
                                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 */
@@ -3014,12 +3016,14 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode)
                                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, display_buffer);
-                                       
+
+#ifdef __BIG_ENDIAN__
                                        glPixelStorei(GL_UNPACK_SWAP_BYTES, 0);
+#endif
                                        glPixelZoom(1.0f, 1.0f);
                                }
                                else if (snode->flag & SNODE_USE_ALPHA) {