The Sims - some hacks
Stefan Dösinger
stefandoesinger at gmx.at
Wed Sep 5 08:47:03 CDT 2007
Hi,
First, thank you for all the debugging work with the game. This is exactly
what we need, people who debug their favorite apps and find out what is going
wrong.
> First, there's the easy problem of the cursors not working. This is
> because Sims.exe calls LoadCursorFromFile on a bunch of files that
> contain icons, not cursors. As the only difference between the two is
> that the cursor has a hotspot in front of it, I added some code to
> treat the icon as a cursor with no hotspot. Other programs may
> benefit from this patch, as it seems it is something you can get away
> with on Windows.
I do not know this Function, but you can find out what really happens on
windows by writing a test app that does the same with this function as The
Sims. The test should be included in dlls/user32/tests/.
> Then there's the problem of the actual crash. This is caused by
> CreateSurface in ddraw returning an error and Sims.exe doesn't check
> for the error. It is returning an error because Sims.exe is trying to
> create a depth buffer without specifying a valid pixelformat. Note
> that it actually does pass a pixelformat, it's just all zeros, except
> for the dwSize member. Again, this appears to be something you can
> get away with on Windows.. the pixelformat defaults to the current
> screen format.
Also here a test will be helpfull, and here I know the Function. I suspect
that Windows overwrites the pixelformat. In older DirectDraw versions, a z
buffer bit depth is set in the dwMipmapCount member in the surface
description. A test could be included in dlls/ddraw/tests/dsurface.c. You can
copy one of the existing tests to create a surface with the same properties
The Sims sets. Then check the returned value, perhaps it should fail, but
with a different error code. If it succeeds, call GetSurfaceDesc on the new
surface and check the pixelformat.
More information about the wine-devel
mailing list