1 This fixes a byte-ordering problem when displaying 8-bit colormapped images
2 on certain 12, 15, or 16-bit displays.
4 Thanks to Mr. Ryo Shimizu for coming up with the patch, and to Yuuki Harano
9 *** xvimage.c.old Fri Jan 13 19:11:36 1995
10 --- xvimage.c Fri Oct 16 12:34:11 1998
13 if (xim->byte_order == MSBFirst) {
14 for (i=wide*high, ip=imagedata; i>0; i--,pp++) {
15 if (((i+1)&0x1ffff) == 0) WaitCursor();
17 ! *ip++ = ((*pp) ? white : black) & 0xffff;
19 ! else *ip++ = xcolors[*pp] & 0xffff;
24 if (xim->byte_order == MSBFirst) {
25 for (i=wide*high, ip=imagedata; i>0; i--,pp++) {
26 if (((i+1)&0x1ffff) == 0) WaitCursor();
28 ! if (dithpic) xcol = ((*pp) ? white : black) & 0xffff;
29 ! else xcol = xcolors[*pp] & 0xffff;
31 ! *((unsigned char *)ip)++ = (xcol>>8) & 0xff;
32 ! *((unsigned char *)ip)++ = (xcol) & 0xff;
38 if (dithpic) xcol = ((*pp) ? white : black) & 0xffff;
39 else xcol = xcolors[*pp];
41 ! /* WAS *ip++ = ((xcol>>8) & 0xff) | ((xcol&0xff) << 8); */
42 ! *ip++ = (unsigned short) (xcol);
47 if (dithpic) xcol = ((*pp) ? white : black) & 0xffff;
48 else xcol = xcolors[*pp];
50 ! *((unsigned char *)ip)++ = (xcol) & 0xff;
51 ! *((unsigned char *)ip)++ = (xcol>>8) & 0xff;