Fix for ddraw: CreateSurface

Sylvain Petreolle spetreolle at yahoo.fr
Wed May 28 17:12:26 CDT 2003


Since some surface types are unhandled for now, OffScreenPlain is
assumed.

Unused members of the DDSURFACEDESC2 structure are set to zero,
so the bitperpixel is zero.

DDRAW_width_bpp_to_pitch is called with bpp 0 and apps are stopping on

    assert(bpp != 0); /* keeps happening... */

At least WinDVD starts with this patch, will it be accepted until we
implement other surface types ?

Index: ddraw/main.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/ddraw/main.c,v
retrieving revision 1.40
diff -u -r1.40 main.c
--- ddraw/main.c        11 May 2003 03:46:53 -0000      1.40
+++ ddraw/main.c        28 May 2003 22:03:46 -0000
@@ -525,6 +525,9 @@
     if (!(ddsd.dwFlags & DDSD_PIXELFORMAT))
     {
        ddsd.u4.ddpfPixelFormat = This->pixelformat;
+    } else {
+       if( !GET_BPP(ddsd))
+               return DDERR_INVALIDPIXELFORMAT;
     }
  
     if (!(ddsd.dwFlags & DDSD_PITCH))


=====
Sylvain Petreolle (spetreolle at users dot sourceforge dot net) ICQ #170597259
No more War !

"What if tomorrow the War could be over ?" Morpheus, in "Reloaded".

For the Law of Oil and Fire, Im an European that lives in France.
For all my Brothers and friends, Im a human living on Earth.

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com



More information about the wine-devel mailing list