Disabled the indication of mirrored blit support via the driver GetCaps routine
as this may be reported as supported on modern GPUs even when it's not.
Removing this indication allows the HEL (Hardware Emulation Layer) to correctly
handle all mirrored blits. It also seems to perform better than the previous
clumsy line-by-line mirroring emulation.
This flag forces linear (non-swizzled) surface layout on Intel HD drivers.
Fixes issues with games that keep writing to unlocked surfaces (e.g. Nox)
as well as greatly increases lock performance.
This change assigns a different DirectDraw repository object for each original
DirectDraw object that requires temporary surfaces, ensuring that video memory
surfaces are created on the appropriate device on a multi-GPU system.
DirectDraw seems to assume the DDSD_CAPS flag is always set in CreateSurface.
This flag even has a comment in ddraw.h mentioning it's "default".
Some games set ddsCaps members without explicitly setting the DDSD_CAPS flag,
which causes DDrawCompat to incorrectly detect some capabilities. These checks
now always assume the ddsCaps member is valid even if DDSD_CAPS is not set.
Fixes a crash when launching Rogue Spear, mentioned in issue #2.
Legacy DirectDraw interfaces specify the z-buffer format as a single bit depth
number instead of as a DDPIXELFORMAT struct. DirectDraw seems to convert a
legacy z-buffer bit depth of N into a DDPIXELFORMAT with dwFlags = DDPF_ZBUFFER,
dwZBufferBitDepth = N and dwZBitMask set to 1s in the lowest N bits.
Some drivers (so far noticed with AMD only) report the list of supported
z-buffer bit depths incorrectly, resulting in a game potentially selecting a
bit depth that can't actually be created via the legacy interfaces.
For example, the driver may report 16 and 32 bits as supported whereas all
32 bit z-buffer pixel formats use only 24 bits for z-buffer (with the
remaining bits unused or used as stencil buffer). Meanwhile the same driver
doesn't report 24 bits as supported when it's actually supported.
This fix overrides the set of supported z-buffer bit depths in D3DDEVICEDESC
structs for HAL devices to align with the actually supported pixel formats.
Fixes a startup issue in Rainbow Six mentioned in issue #2.
When a surface is created without an explicit capability to specify the type
of surface to create, it only accepts a pixel format that matches the current
display mode. Since the display mode is forced to 32 bit color depth under
DDrawCompat, creating such surfaces could either fail if a different pixel
format is specified (even though it could match the emulated color depth),
or it could be created with the wrong color depth if no pixel format is given.
To prevent these issues, the DDSCAPS_OFFSCREENPLAIN capability is added to all
"untyped" surfaces, which accepts any color depth and already has code in place
to match the emulated display mode's color depth when no pixel format is given.
Fixes#1
Fixes an issue with Fallout's window disappearing from the taskbar every other
time it's minimized.
Also fixes StarCraft's Save Screen Capture dialog being hidden after the main
window is restored.