35 |
|
if (!XMatchVisualInfo(disp,scrn,8,PseudoColor,&ourvinfo)) |
36 |
|
return(NULL); |
37 |
|
} else if (depth == 24) { |
38 |
< |
if (!XMatchVisualInfo(disp,scrn,24,TrueColor,&ourvinfo)) |
38 |
> |
if (!XMatchVisualInfo(disp,scrn,24,TrueColor,&ourvinfo) && |
39 |
> |
!XMatchVisualInfo(disp,scrn,24,DirectColor,&ourvinfo)) |
40 |
|
return(NULL); |
41 |
|
} else |
42 |
|
return(NULL); |
49 |
|
depth==1 ? XYBitmap : ZPixmap, |
50 |
|
0,data,width,height,bm_pad,0); |
51 |
|
xr->image->bitmap_bit_order = MSBFirst; |
52 |
+ |
if (xr->image->bits_per_pixel == 32) { |
53 |
+ |
xr->image->bytes_per_line = xr->image->bytes_per_line*24/32; |
54 |
+ |
xr->image->bits_per_pixel = 24; |
55 |
+ |
} |
56 |
|
xr->gc = XCreateGC(disp, RootWindow(disp,scrn), 0, 0); |
57 |
|
XSetState(disp, xr->gc, BlackPixel(disp,scrn), WhitePixel(disp,scrn), |
58 |
|
GXcopy, AllPlanes); |