[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48677] trunk/blender/source/blender: use icons for rgb colors

Campbell Barton ideasman42 at gmail.com
Fri Jul 6 13:24:43 CEST 2012


Revision: 48677
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48677
Author:   campbellbarton
Date:     2012-07-06 11:24:43 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
use icons for rgb colors

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/makesrna/intern/rna_space.c

Modified: trunk/blender/source/blender/editors/space_node/drawnode.c
===================================================================
--- trunk/blender/source/blender/editors/space_node/drawnode.c	2012-07-06 10:03:27 UTC (rev 48676)
+++ trunk/blender/source/blender/editors/space_node/drawnode.c	2012-07-06 11:24:43 UTC (rev 48677)
@@ -2954,14 +2954,16 @@
 				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;
+#endif
 
-					if (ENDIAN_ORDER == B_ENDIAN) {
-						ofs = 3 - ofs;
-					}
-
 					glPixelZoom(snode->zoom, snode->zoom);
 					/* swap bytes, so alpha is most significant one, then just draw it as luminance int */
 
@@ -2972,12 +2974,14 @@
 				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) {

Modified: trunk/blender/source/blender/makesrna/intern/rna_space.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-07-06 10:03:27 UTC (rev 48676)
+++ trunk/blender/source/blender/makesrna/intern/rna_space.c	2012-07-06 11:24:43 UTC (rev 48677)
@@ -2852,9 +2852,10 @@
 		{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}
 	};
 




More information about the Bf-blender-cvs mailing list