[D3D] Some surfaces related fixes
Christian Costa
titan.costa at wanadoo.fr
Sun Nov 14 07:40:15 CST 2004
Hi,
Changelog:
Fixed colorkey conversion.
Handle null surface pointer when creating surface.
Christian Costa titan.costa at wanadoo.fr
-------------- next part --------------
Index: mesa.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/mesa.c,v
retrieving revision 1.62
diff -u -r1.62 mesa.c
--- mesa.c 8 Sep 2004 01:37:25 -0000 1.62
+++ mesa.c 14 Nov 2004 11:26:20 -0000
@@ -1195,7 +1195,7 @@
unsigned int x, y;
BYTE *src = (BYTE *) (((BYTE *) src_d->lpSurface) + (bpp * rect->left) + (src_d->u1.lPitch * rect->top));
DWORD *dst;
-
+
if (*temp_buffer == NULL)
*temp_buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
current_tex_width * current_tex_height * sizeof(DWORD));
@@ -1205,7 +1205,7 @@
for (x = 0; x < width; x++) {
DWORD color = *((DWORD *) src) & 0x00FFFFFF;
src += 3;
- *dst = *src++ << 8;
+ *dst = color << 8;
if ((color < src_d->ddckCKSrcBlt.dwColorSpaceLowValue) ||
(color > src_d->ddckCKSrcBlt.dwColorSpaceHighValue))
*dst |= 0xFF;
Index: ddraw/main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw/main.c,v
retrieving revision 1.54
diff -u -r1.54 main.c
--- ddraw/main.c 8 Sep 2004 01:50:37 -0000 1.54
+++ ddraw/main.c 14 Nov 2004 11:26:23 -0000
@@ -658,6 +658,12 @@
pDDSD->dwFlags &= ~DDSD_LPSURFACE;
}
+ if ((pDDSD->dwFlags & DDSD_LPSURFACE) && (pDDSD->lpSurface == NULL)) {
+ /* Frank Herbert's Dune specifies a null pointer for the surface, ignore the LPSURFACE field */
+ FIXME("Null surface pointer specified, ignore it!\n");
+ pDDSD->dwFlags &= ~DDSD_LPSURFACE;
+ }
+
if (ppSurf == NULL) {
FIXME("You want to get back a surface? Don't give NULL ptrs!\n");
return E_POINTER; /* unchecked */
More information about the wine-patches
mailing list