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 */
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) {
{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}
};