Commit 54be3001 authored by Michael Kaufmann's avatar Michael Kaufmann Committed by Alexandre Julliard

- Add as many entries to the color map as specified by the DIB.

- Support bitmaps with a BITMAPV{4,5}HEADER.
parent 5539e288
......@@ -231,10 +231,6 @@ int *X11DRV_DIB_GenColorMap( X11DRV_PDEVICE *physDev, int *colorMapping,
if (coloruse == DIB_RGB_COLORS)
{
int max = 1 << depth;
if (end > max) end = max;
if (quads)
{
RGBQUAD * rgb = (RGBQUAD *)colorPtr;
......@@ -294,15 +290,16 @@ int *X11DRV_DIB_BuildColorMap( X11DRV_PDEVICE *physDev, WORD coloruse, WORD dept
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment