Commit in reactos/subsys/win32k/objects on MAIN
dc.c+6-71.140 -> 1.141
dib.c+7-71.54 -> 1.55
+13-14
2 modified files
Use DIB bitfields to create palette at > 8 bpp

reactos/subsys/win32k/objects
dc.c 1.140 -> 1.141
diff -u -r1.140 -r1.141
--- dc.c	28 Jun 2004 17:03:35 -0000	1.140
+++ dc.c	29 Jun 2004 21:09:16 -0000	1.141
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: dc.c,v 1.140 2004/06/28 17:03:35 navaraf Exp $
+/* $Id: dc.c,v 1.141 2004/06/29 21:09:16 gvg Exp $
  *
  * DC.C - Device context functions
  *
@@ -1904,13 +1904,12 @@
           if(pb->dib->dsBmih.biBitCount == 8) { NumColors = 256; }
           dc->w.hPalette = PALETTE_AllocPaletteIndexedRGB(NumColors, pb->ColorMap);
         }
-        else if ( 16 == pb->dib->dsBmih.biBitCount )
-        {
-          dc->w.hPalette = PALETTE_AllocPalette(PAL_BITFIELDS, pb->dib->dsBmih.biClrUsed, NULL, 0x7c00, 0x03e0, 0x001f);
-        }
-        else if(pb->dib->dsBmih.biBitCount >= 24)
+        else
         {
-          dc->w.hPalette = PALETTE_AllocPalette(PAL_RGB, pb->dib->dsBmih.biClrUsed, NULL, 0, 0, 0);
+          dc->w.hPalette = PALETTE_AllocPalette(PAL_BITFIELDS, 0, NULL,
+                                                pb->dib->dsBitfields[0],
+                                                pb->dib->dsBitfields[1],
+                                                pb->dib->dsBitfields[2]);
         }
       }
       else

reactos/subsys/win32k/objects
dib.c 1.54 -> 1.55
diff -u -r1.54 -r1.55
--- dib.c	28 Jun 2004 17:03:35 -0000	1.54
+++ dib.c	29 Jun 2004 21:09:16 -0000	1.55
@@ -1,5 +1,5 @@
 /*
- * $Id: dib.c,v 1.54 2004/06/28 17:03:35 navaraf Exp $
+ * $Id: dib.c,v 1.55 2004/06/29 21:09:16 gvg Exp $
  *
  * ReactOS W32 Subsystem
  * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
@@ -1115,15 +1115,15 @@
         dib->dsBitfields[2] = (bi->biCompression == BI_BITFIELDS) ? *((DWORD *)bmi->bmiColors + 2) : 0x001f;        break;
 
       case 24:
-        dib->dsBitfields[0] = 0xff;
-        dib->dsBitfields[1] = 0xff00;
-        dib->dsBitfields[2] = 0xff0000;
+        dib->dsBitfields[0] = 0xff0000;
+        dib->dsBitfields[1] = 0x00ff00;
+        dib->dsBitfields[2] = 0x0000ff;
         break;
 
       case 32:
-        dib->dsBitfields[0] = (bi->biCompression == BI_BITFIELDS) ? *(DWORD *)bmi->bmiColors : 0xff;
-        dib->dsBitfields[1] = (bi->biCompression == BI_BITFIELDS) ? *((DWORD *)bmi->bmiColors + 1) : 0xff00;
-        dib->dsBitfields[2] = (bi->biCompression == BI_BITFIELDS) ? *((DWORD *)bmi->bmiColors + 2) : 0xff0000;
+        dib->dsBitfields[0] = (bi->biCompression == BI_BITFIELDS) ? *(DWORD *)bmi->bmiColors : 0xff0000;
+        dib->dsBitfields[1] = (bi->biCompression == BI_BITFIELDS) ? *((DWORD *)bmi->bmiColors + 1) : 0x00ff00;
+        dib->dsBitfields[2] = (bi->biCompression == BI_BITFIELDS) ? *((DWORD *)bmi->bmiColors + 2) : 0x0000ff;
         break;
     }
     dib->dshSection = section;
CVSspam 0.2.8