Colour problems with latest DIB fix

François Gouget fgouget at codeweavers.com
Tue Oct 30 19:50:59 CST 2001


Gerard Patel wrote:
> 
> At 01:06 AM 30/10/2001 -0800, you wrote:
[...]
> >   Now I suspect that with your application the Dib masks don't look
> >like the above
> 
> Congratulations, you are entirely right.
> As in many cases, Wine does not work because it is not tolerant
> to strange parameters
> 
> Actually the dib masks are all equal to 0. Probably the correct fix
> is to assume an 'asis' (not reversed) conversion when the app does
> not set any mask.

   No no. Usually (0,0,0) means the default rgb layout. But if you
always go to asis in that case, then things will be wrong for users with
a bgr565 X configuration (should reverse in that case).
   SetImageBits_* and GetImageBits_* should never get (0,0,0) as the
color masks. They don't know how to handle it and should not have to,
their callers are supposed to take care of that.
   I think i found the source of the problem, some old code I had not
changed. Can you try the attached patch?

-- 
François Gouget
fgouget at codeweavers.com
-------------- next part --------------
Index: graphics/x11drv/dib.c
===================================================================
RCS file: /home/wine/wine/graphics/x11drv/dib.c,v
retrieving revision 1.81
diff -u -r1.81 dib.c
--- graphics/x11drv/dib.c	2001/10/17 19:41:54	1.81
+++ graphics/x11drv/dib.c	2001/10/31 00:21:04
@@ -4644,10 +4645,6 @@
                break;
 
        case 24:
-               descr.rMask = descr.gMask = descr.bMask = 0;
-               descr.colorMap = 0;
-               break;
-
        case 32:
                descr.rMask = (descr.compression == BI_BITFIELDS) ? *(DWORD *)info->bmiColors       : 0xff0000;
                descr.gMask = (descr.compression == BI_BITFIELDS) ? *((DWORD *)info->bmiColors + 1) : 0x00ff00;
@@ -4729,10 +4726,6 @@
                break;
 
        case 24:
-               descr.rMask = descr.gMask = descr.bMask = 0;
-               descr.colorMap = 0;
-               break;
-
        case 32:
                descr.rMask = (descr.compression == BI_BITFIELDS) ? *(DWORD *)info->bmiColors       : 0xff0000;
                descr.gMask = (descr.compression == BI_BITFIELDS) ? *((DWORD *)info->bmiColors + 1) : 0x00ff00;


More information about the wine-devel mailing list