[PATCH] DrawDibDraw flag handling
Peter Riocreux
par+wine_devel at silistix.com
Thu Oct 14 09:53:41 CDT 2004
I got a lot of messages from this function about a particular flag
(DDF_BACKGROUNDPAL) not being handled, so I tried to handle it.
The MSDN docs are at
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_drawdibdraw.asp>
I am coming to this completely cold, so I may be completely off target
here, so if anyone can comment on whether I have done this right. I
suspect that there needs to be explicit support for DDF_SAME_HDC, but
I didn't really understand what it was wanting ....
(Patch is against CVS from this AM (GMT)
Index: dlls/msvideo/drawdib.c
===================================================================
RCS file: /home/wine/wine/dlls/msvideo/drawdib.c,v
retrieving revision 1.21
diff -u -r1.21 drawdib.c
--- dlls/msvideo/drawdib.c 3 Jun 2004 23:19:51 -0000 1.21
+++ dlls/msvideo/drawdib.c 14 Oct 2004 14:46:47 -0000
@@ -311,7 +311,7 @@
whdd = MSVIDEO_GetHddPtr(hdd);
if (!whdd) return FALSE;
- if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | DDF_UPDATE | DDF_DONTDRAW))
+ if (wFlags & ~(DDF_SAME_HDC | DDF_SAME_DRAW | DDF_NOTKEYFRAME | DDF_UPDATE | DDF_DONTDRAW | DDF_BACKGROUNDPAL))
FIXME("wFlags == 0x%08lx not handled\n", (DWORD)wFlags);
if (!lpBits)
@@ -362,7 +362,10 @@
}
}
if (!(wFlags & DDF_DONTDRAW) && whdd->hpal)
- SelectPalette(hdc, whdd->hpal, FALSE);
+ if ((wFlags & DDF_BACKGROUNDPAL) && ! (wFlags & DDF_SAME_HDC))
+ SelectPalette(hdc, whdd->hpal, TRUE);
+ else
+ SelectPalette(hdc, whdd->hpal, FALSE);
if (!(StretchBlt(whdd->hdc, xDst, yDst, dxDst, dyDst, whdd->hMemDC, xSrc, ySrc, dxSrc, dySrc, SRCCOPY)))
ret = FALSE;
More information about the wine-devel
mailing list