]>
Commit | Line | Data |
---|---|---|
c1f0ee65 JR |
1 | This fixes a byte-ordering problem when displaying 8-bit colormapped images |
2 | on certain 12, 15, or 16-bit displays. | |
3 | ||
4 | Thanks to Mr. Ryo Shimizu for coming up with the patch, and to Yuuki Harano | |
5 | for sending it to me. | |
6 | ||
7 | --jhb | |
8 | ||
9 | *** xvimage.c.old Fri Jan 13 19:11:36 1995 | |
10 | --- xvimage.c Fri Oct 16 12:34:11 1998 | |
11 | *************** | |
12 | *** 1736,1745 **** | |
13 | if (xim->byte_order == MSBFirst) { | |
14 | for (i=wide*high, ip=imagedata; i>0; i--,pp++) { | |
15 | if (((i+1)&0x1ffff) == 0) WaitCursor(); | |
16 | ! if (dithpic) { | |
17 | ! *ip++ = ((*pp) ? white : black) & 0xffff; | |
18 | ! } | |
19 | ! else *ip++ = xcolors[*pp] & 0xffff; | |
20 | } | |
21 | } | |
22 | else { /* LSBFirst */ | |
23 | --- 1736,1747 ---- | |
24 | if (xim->byte_order == MSBFirst) { | |
25 | for (i=wide*high, ip=imagedata; i>0; i--,pp++) { | |
26 | if (((i+1)&0x1ffff) == 0) WaitCursor(); | |
27 | ! | |
28 | ! if (dithpic) xcol = ((*pp) ? white : black) & 0xffff; | |
29 | ! else xcol = xcolors[*pp] & 0xffff; | |
30 | ! | |
31 | ! *((unsigned char *)ip)++ = (xcol>>8) & 0xff; | |
32 | ! *((unsigned char *)ip)++ = (xcol) & 0xff; | |
33 | } | |
34 | } | |
35 | else { /* LSBFirst */ | |
36 | *************** | |
37 | *** 1749,1756 **** | |
38 | if (dithpic) xcol = ((*pp) ? white : black) & 0xffff; | |
39 | else xcol = xcolors[*pp]; | |
40 | ||
41 | ! /* WAS *ip++ = ((xcol>>8) & 0xff) | ((xcol&0xff) << 8); */ | |
42 | ! *ip++ = (unsigned short) (xcol); | |
43 | } | |
44 | } | |
45 | } | |
46 | --- 1751,1758 ---- | |
47 | if (dithpic) xcol = ((*pp) ? white : black) & 0xffff; | |
48 | else xcol = xcolors[*pp]; | |
49 | ||
50 | ! *((unsigned char *)ip)++ = (xcol) & 0xff; | |
51 | ! *((unsigned char *)ip)++ = (xcol>>8) & 0xff; | |
52 | } | |
53 | } | |
54 | } |