Fix for monochrome device independent bitmaps with inverted colors

Oldrich Jedlicka oldium.pro at seznam.cz
Sat Oct 8 05:26:08 CDT 2005


Hi,

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.

ChangeLog
----------

Oldrich Jedlicka <oldium.pro at seznam.cz>

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 
palette.

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 
created.

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.

Regards,

  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 : http://www.winehq.org/pipermail/wine-patches/attachments/20051008/2c913ec7/dib.c.patch


More information about the wine-patches mailing list