Getting DXBall to run

Hans Leidekker hans at
Fri May 16 10:02:35 CDT 2003


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:

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?


    Remove superfluous NULL check
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ddraw-dib.diff
Type: text/x-diff
Size: 705 bytes
Desc: not available
Url :

More information about the wine-devel mailing list