Fix for monochrome device independent bitmaps with inverted colors

Oldrich Jedlicka at
Sat Oct 8 05:26:08 CDT 2005


I found a problem in translating XImage into DIB created by CreateDIBSection. 
All problems are in graphics/x11drv/dib.c only. It is only the case, when 
colors of DIB are inverted so color[0]=0xFFFFFF and color[1]=0x000000 (or any 
other value).

Note: This patch is very similar to one I sent to Cedega team. I release this 
patch to Wine HQ team under GNU Lesser GPL version 2.1 or higher.

This was realised in game Neighbours from Hell which workings now.


Oldrich Jedlicka < at>

Fix for monochrome device independent bitmaps with inverted colors:

1. When update XImage->DIB (monochrome images) is made, function 
X11DRV_DIB_GetImageBits_1 falls back into "notsupported" branch. The palette 
of the DIB was ignored in this case. If the colors are inverted, also image 
is inverted for updating DIB. Update DIB->XImage is not affected as it uses 

2. Used XImage (bmpImage parameter) has RGB mask corresponding to current 
visual, so it is not zero. The RGB mask was checked for zero when copying 
BMP->DIB, so new static inline function X11DRV_DIB_CheckMask has been 

3. Parameter colorMap was set to identity color map for every monochrome 
bitmap. Changed to check if colorMap is NULL or has the same colors.


  Oldrich Jedlicka.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dib.c.patch
Type: text/x-diff
Size: 8189 bytes
Desc: not available
Url :

More information about the wine-patches mailing list