1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

10 Commits

Author SHA1 Message Date
narzoul
640dbf6412 Added automatic surface restoration for D3D buffers
Some D3D buffers (e.g. vertex buffers) use DirectDraw surfaces for storage.
Since a previous fix for forcing the emulated pixel format on surfaces broke
Alt-Tabbing in Messiah, this fixes it by automatically restoring D3D buffers
during Lock.
If this causes other issues, the only alternative seems to be forcing these
surfaces to system memory (which was the previous broken behavior).
2015-12-30 00:46:49 +01:00
narzoul
db02afefa9 Fixed issues with making the update thread persistent
Earlier the update thread was made persistent accross multiple primary surfaces,
but some parts were not correctly updated. The update event handle was still being
closed on release of the primary surface, and the update thread still exited if
there was no primary surface immediately after it received an update event.
2015-12-30 00:46:43 +01:00
narzoul
63b3112a58 Fixed issue related to modifying the surface description in CreateSurface
When forcing the emulated pixel format to surfaces in CreateSurface,
the original surface description parameter was being modified, leading to
issues with the mouse cursor in Populous 3. Now a copy is modified instead.

Also avoided unnecessary palette update when the palette is being set to null.
2015-12-30 00:46:36 +01:00
narzoul
6b6d161190 Fixed resetting of the compatible primary surface pointers on release
The internal surface pointers to the compatible primary surface were not being reset
when the surface was released, possibly leading to other surfaces being misidentified
as the compatible primary surface.

All internal primary surface pointers are now reset to null on release.
2015-12-30 00:46:30 +01:00
narzoul
9461e7357c Fixed forced pixel format application to surfaces
Because the actual display mode is always forced to 32 bits color depth,
surfaces that would be created without a pixel format need to be explicitly
set to the emulated display mode's pixel format that the application expects,
rather than letting them use the actual display mode's pixel format.

However, the emulated pixel format was being forced on surface types that aren't
normal surfaces and shouldn't inherit the display mode's pixel format
(e.g. vertex buffers and depth buffers), which prevented some of these surfaces
from being created correctly.
Now the surface type checks are more restrictive.
2015-12-30 00:46:23 +01:00
narzoul
61efdcb438 Fixed issues with releasing the real primary surface
The palette converter surface was being released even when it was null,
leading to potential problems with releasing the primary surface.

The update thread is also no longer terminated on each release.
Termination may have been necessary more often than expected because
the thread may be waiting on the DirectDraw critical section on release.
There doesn't seem to be any issues with letting the OS clean up
the running thread on exit instead.
2015-12-30 00:46:17 +01:00
narzoul
3610edb117 Extended hooking to all methods in debug mode
All methods of all hooked interfaces are now hooked in debug mode.
This provides more function entry/exit logs.
2015-12-30 00:46:10 +01:00
narzoul
a0d3459e42 Improved debug logging
Debug logs are extended to expand DDSURFACEDESC and related structs.
Pointers to pointers are now also expanded if possible.
2015-12-30 00:46:04 +01:00
narzoul
7b8f68fe23 Create README.md 2015-12-26 21:00:32 +01:00
narzoul
2a5e699c6e Initial commit v0.1 2015-12-25 01:57:44 +01:00