Three important DIB fixes for x11drv [second try]

Michael Kaufmann hallo at michael-kaufmann.ch
Sun Sep 26 11:47:30 CDT 2004


Please disregard my first try ( 
http://www.winehq.org/hypermail/wine-patches/2004/09/0483.html ), it 
will break more things than it fixes ;-)
But please look at it for a description of the problem.

My new patch is basically a check-out of this patch by Guy Albertelli: 
http://cvs.winehq.org/cvsweb/wine/graphics/x11drv/Attic/dib.c?rev=1.85&content-type=text/x-cvsweb-markup


Changelog:
 - Add as many entries to the color map as specified by the DIB
 - Support bitmaps with a BITMAPV{4,5}HEADER

-------------- next part --------------
Index: dlls/x11drv/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/dib.c,v
retrieving revision 1.17
diff -u -r1.17 dib.c
--- dlls/x11drv/dib.c	16 Sep 2004 19:10:14 -0000	1.17
+++ dlls/x11drv/dib.c	26 Sep 2004 16:18:51 -0000
@@ -231,10 +231,6 @@
 
     if (coloruse == DIB_RGB_COLORS)
     {
-	int max = 1 << depth;
-
-	if (end > max) end = max;
-
         if (quads)
         {
             RGBQUAD * rgb = (RGBQUAD *)colorPtr;
@@ -294,15 +290,16 @@
     const void *colorPtr;
     int *colorMapping;
 
-    if ((isInfo = (info->bmiHeader.biSize == sizeof(BITMAPINFOHEADER))))
+    if ((isInfo = (info->bmiHeader.biSize != sizeof(BITMAPCOREHEADER))))
     {
+        /* assume BITMAPINFOHEADER */
         colors = info->bmiHeader.biClrUsed;
         if (!colors) colors = 1 << info->bmiHeader.biBitCount;
         colorPtr = info->bmiColors;
     }
-    else  /* assume BITMAPCOREINFO */
+    else  /* BITMAPCOREHEADER */
     {
-        colors = 1 << ((BITMAPCOREHEADER *)&info->bmiHeader)->bcBitCount;
+        colors = 1 << ((BITMAPCOREHEADER *)info)->bcBitCount;
         colorPtr = (WORD *)((BITMAPCOREINFO *)info)->bmciColors;
     }
 


More information about the wine-patches mailing list