summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs2 <hobbs2>2006-04-06 00:30:54 (GMT)
committerhobbs2 <hobbs2>2006-04-06 00:30:54 (GMT)
commitfc6b2526c4a7b3e77d4a65199b77d5f851666ebb (patch)
tree536bdba2bc2170c3ba19c076a21797bfb4350474
parent0e1172d951cd4a462654e6bfd6027b2f2928183d (diff)
downloadtktreectrl-fc6b2526c4a7b3e77d4a65199b77d5f851666ebb.zip
tktreectrl-fc6b2526c4a7b3e77d4a65199b77d5f851666ebb.tar.gz
tktreectrl-fc6b2526c4a7b3e77d4a65199b77d5f851666ebb.tar.bz2
* generic/tkTreeCtrl.c (LoupeCmd): correct loupe on OS X x86.
-rw-r--r--ChangeLog7
-rw-r--r--generic/tkTreeCtrl.c17
2 files changed, 23 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 28abd3c..62b77bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-04-05 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * generic/tkTreeCtrl.c (LoupeCmd): correct loupe on OS X x86.
+
+ * configure, configure.ac: add AC_C_BIGENDIAN check
+ * tclconfig/tcl.m4: TEA rcs 1.91 2006/03/28 21:07:09
+
2006-01-25 Jeff Hobbs <jeffh@ActiveState.com>
* configure, configure.ac: update to TEA 3.5
diff --git a/generic/tkTreeCtrl.c b/generic/tkTreeCtrl.c
index 3b17acd..c3aba10 100644
--- a/generic/tkTreeCtrl.c
+++ b/generic/tkTreeCtrl.c
@@ -7,7 +7,7 @@
* Copyright (c) 2002-2003 Christian Krone
* Copyright (c) 2003-2005 ActiveState, a division of Sophos
*
- * RCS: @(#) $Id: tkTreeCtrl.c,v 1.58 2005/10/15 03:05:28 treectrl Exp $
+ * RCS: @(#) $Id: tkTreeCtrl.c,v 1.59 2006/04/06 00:30:55 hobbs2 Exp $
*/
#include "tkTreeCtrl.h"
@@ -3701,20 +3701,35 @@ LoupeCmd(
thisPixel = *((unsigned short*)(screenBytes + stepSrc
+ ((grabX + xx) * byPerPixel)));
+#ifdef WORDS_BIGENDIAN
/* Transform from 0xARGB (1555) to 0xR0G0B0A0 (4444) */
newPixel = (((thisPixel & 0x8000) >> 15) * 0xF8) | /* A */
((thisPixel & 0x7C00) << 17) | /* R */
((thisPixel & 0x03E0) << 14) | /* G */
((thisPixel & 0x001F) << 11); /* B */
+#else
+ /* Transform from 0xARGB (1555) to 0xB0G0R0A0 (4444) */
+ newPixel = (((thisPixel & 0x8000) >> 15) * 0xF8) | /* A */
+ ((thisPixel & 0x7C00) << 11) | /* R */
+ ((thisPixel & 0x03E0) << 14) | /* G */
+ ((thisPixel & 0x001F) << 17); /* B */
+#endif
} else if (bPerPixel == 32) {
unsigned long thisPixel;
thisPixel = *((unsigned long*)(screenBytes + stepSrc
+ ((grabX + xx) * byPerPixel)));
+#ifdef WORDS_BIGENDIAN
/* Transformation is from 0xAARRGGBB to 0xRRGGBBAA */
newPixel = ((thisPixel & 0xFF000000) >> 24) |
((thisPixel & 0x00FFFFFF) << 8);
+#else
+ /* Transformation is from 0xAARRGGBB to 0xBBGGRRAA */
+ newPixel = (thisPixel & 0xFF00FF00) |
+ ((thisPixel & 0x00FF0000) >> 16) |
+ ((thisPixel & 0x000000FF) << 16);
+#endif
}
*((unsigned int *)(pixelPtr + stepDest + xx * 4)) = newPixel;
}