Getting DXBall to run

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have this old breakout style game called DXBall (I think 
it's a DirectX 2 game) that runs flawlessly but for one
page fault after the second startup screen, right before
the first level starts. You can download the game here:

  http://www.magicwandsoft.com/games/dxball/download.html

I traced it down to dlls/ddraw/dsurface/dib.c:create_dib where
it says:

    if (!This->surface_desc.lpSurface) {
        This->surface_desc.lpSurface = priv->dib.bitmap_data;
        This->surface_desc.dwFlags |= DDSD_LPSURFACE;
    }

I don't see why This->surface_desc.lpSurface is being tested
here before doing the assignment since up in the function 
there's this assert statement:

    assert(This->surface_desc.lpSurface != NULL);

And as far as I can tell there's nothing in between that could
change the value of This->surface_desc.lpSurface, so this code
will never be reached. Some extra traces confirm that this is 
the case.

If I make the assignment unconditional the game starts to run, 
but I'm not really sure if this fix hides another bug or not. 
Maybe some DirectX guru can tell right away?

 -Hans

Changelog:
    Remove superfluous NULL check
Index: dlls/ddraw/dsurface/dib.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/dsurface/dib.c,v
retrieving revision 1.27
diff -u -r1.27 dib.c
--- dlls/ddraw/dsurface/dib.c	11 Feb 2003 21:58:07 -0000	1.27
+++ dlls/ddraw/dsurface/dib.c	16 May 2003 14:50:42 -0000
@@ -165,10 +165,8 @@
 	This->surface_desc.dwFlags |= DDSD_PITCH;
     }
 
-    if (!This->surface_desc.lpSurface) {
-	This->surface_desc.lpSurface = priv->dib.bitmap_data;
-	This->surface_desc.dwFlags |= DDSD_LPSURFACE;
-    }
+    This->surface_desc.lpSurface = priv->dib.bitmap_data;
+    This->surface_desc.dwFlags |= DDSD_LPSURFACE;
 
     HeapFree(GetProcessHeap(), 0, b_info);
 

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux