summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-04-29 20:20:09 +0000
committerAlexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de>2004-04-29 20:20:09 +0000
commit2ef4fc498bc0b0d10aa2fe72b75141a8ad2a52aa (patch)
tree499660666c77acfab27545d26d121d32104f328d
parent8a073b2292bedcd480bc57bb566ac3acf52441e1 (diff)
make shadow GDI work with wine
-rw-r--r--hw/xwin/winshadgdi.c71
1 files changed, 52 insertions, 19 deletions
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index ee0e82826..fdb0fdbc7 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -226,27 +226,53 @@ winQueryRGBBitsAndMasks (ScreenPtr pScreen)
pdw = (DWORD*) ((CARD8*)pbmih + sizeof (BITMAPINFOHEADER));
#if CYGDEBUG
- ErrorF ("winQueryRGBBitsAndMasks - Masks: %08x %08x %08x\n",
+ ErrorF ("%s - Masks: %08x %08x %08x\n", __FUNCTION__,
pdw[0], pdw[1], pdw[2]);
+ ErrorF ("%s - Bitmap: %dx%d %d bpp %d planes\n", __FUNCTION__,
+ pbmih->biWidth, pbmih->biHeight, pbmih->biBitCount, pbmih->biPlanes);
+ ErrorF ("%s - Compression: %d %s\n", __FUNCTION__,
+ pbmih->biCompression,
+ (pbmih->biCompression == BI_RGB?"(BI_RGB)":
+ (pbmih->biCompression == BI_RLE8?"(BI_RLE8)":
+ (pbmih->biCompression == BI_RLE4?"(BI_RLE4)":
+ (pbmih->biCompression == BI_BITFIELDS?"(BI_BITFIELDS)":""
+ )))));
#endif
- /* Count the number of bits in each mask */
- dwRedBits = winCountBits (pdw[0]);
- dwGreenBits = winCountBits (pdw[1]);
- dwBlueBits = winCountBits (pdw[2]);
+ /* Wine returns this */
+ if (pbmih->biCompression == BI_RGB)
+ {
+ dwRedBits = 15;
+ dwGreenBits = 10;
+ dwBlueBits = 5;
- /* Find maximum bits per red, green, blue */
- if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwRedBits;
- else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
- pScreenPriv->dwBitsPerRGB = dwGreenBits;
- else
- pScreenPriv->dwBitsPerRGB = dwBlueBits;
-
- /* Set screen privates masks */
- pScreenPriv->dwRedMask = pdw[0];
- pScreenPriv->dwGreenMask = pdw[1];
- pScreenPriv->dwBlueMask = pdw[2];
+ pScreenPriv->dwBitsPerRGB = 15;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = 0x7c00;
+ pScreenPriv->dwGreenMask = 0x03e0;
+ pScreenPriv->dwBlueMask = 0x001f;
+ }
+ else
+ {
+ /* Count the number of bits in each mask */
+ dwRedBits = winCountBits (pdw[0]);
+ dwGreenBits = winCountBits (pdw[1]);
+ dwBlueBits = winCountBits (pdw[2]);
+
+ /* Find maximum bits per red, green, blue */
+ if (dwRedBits > dwGreenBits && dwRedBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwRedBits;
+ else if (dwGreenBits > dwRedBits && dwGreenBits > dwBlueBits)
+ pScreenPriv->dwBitsPerRGB = dwGreenBits;
+ else
+ pScreenPriv->dwBitsPerRGB = dwBlueBits;
+
+ /* Set screen privates masks */
+ pScreenPriv->dwRedMask = pdw[0];
+ pScreenPriv->dwGreenMask = pdw[1];
+ pScreenPriv->dwBlueMask = pdw[2];
+ }
}
else
{
@@ -356,7 +382,7 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
0);
if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL)
{
- ErrorF ("winAllocateFBShadowGDI - CreateDIBSection failed\n");
+ winW32Error (2, "winAllocateFBShadowGDI - CreateDIBSection failed:");
return FALSE;
}
else
@@ -403,8 +429,15 @@ winAllocateFBShadowGDI (ScreenPtr pScreen)
}
else
{
- ErrorF ("winAllocateFBShadowGDI - Shadow blit failure\n");
+ winW32Error (2, "winAllocateFBShadowGDI - Shadow blit failure\n");
+ /* ago: ignore this error. The blit fails with wine, but does not
+ * cause any problems later. */
+
+#if 0
return FALSE;
+#else
+ fReturn = TRUE;
+#endif
}
/* Look for height weirdness */