mirror of
https://github.com/reactos/wine.git
synced 2024-11-29 06:30:37 +00:00
- Add as many entries to the color map as specified by the DIB.
- Support bitmaps with a BITMAPV{4,5}HEADER.
This commit is contained in:
parent
5539e288a6
commit
54be3001b4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user