Colour problems with latest DIB fix

François Gouget fgouget at
Mon Oct 29 14:53:51 CST 2001

Gerard Patel wrote:
> At 02:18 PM 21/10/2001 -0700, you wrote:
> >
> >Johan Gill wrote:
> >>
> >> Since the big DIB fix, red and blue are exchanged in some cases,
> >> for example in the install program for The Sims.
> >>
> >> This happens in both depth 16 and depth 24.
> >
> >   Could you give me some more information about your X server (version,
> >driver)?
> I see a very similar problem with my X server : 4.03 that comes with my
> Mandrake 8, graphic card is a Sis 6326.
> I had tested your patch before it was committed BTW but I failed to notice
> the problem :-/
> Anyway, the attached patch is displaying the failing picture correctly.
> What do you think ?

   If I apply your patch, then I see that the red and blue are exchanged
when I run vnc as:
   vncserver :1 -geometry 800x600 -depth 16 -pixelformat bgr565

   Without the patch everything is fine. I also checked the formula and
I see nothing wrong with it (as long as you are on a little endian
computer, but you don't have a big endian x86, do you? ;-).

   So the question is why doesn't it work on your system. Can you run
The Sims (I assume it's with that the problem happens) with a +bitmap
trace? Then look for cases where either the bmp or the dib has
"depth=24". Then check the masks to see if they make sense. For example,
do they match what you know of your X server. You may also put a trace
in Convert_888_to_565_reverse and check that it is invoked at the right
time. Do they have a bgr888 dib (unsupported in windows AFAIK, but,
except for 1 or 2 shortcuts, supported in Wine)? Maybe it is the DIB
masks that are wrong.

   Also it would be great if you could run my test application and check
whether it displays fine. The line to watch for is the sixth line
(rgb888 dib to 565 rgb/bgr bmp and back).
   I attached it to this email. Here is how to compile and run it:
   mkdir dib
   cp dib.c dib
   cd dib
   ~/wine/tools/winemaker .
   ./configure --with-wine=$HOME/wine

   (note: don't run winemaker . in your home directory!)

   As for The Sims, if you can also check the -debugmsg +bitmap output
and make sure it's coherent.

François Gouget
fgouget at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dib.c
Type: text/x-csrc
Size: 12390 bytes
Desc: not available
Url :

More information about the wine-devel mailing list