mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Another fix for forced display mode pixel format
Apparently normal surfaces can be created without any caps, or with caps that don't specify a surface type (e.g. only memory flags or completely zero). Some games even seem to use such surfaces (e.g. Planescape: Torment) and were broken by the earlier fix. Now the surface type detection is based on a lack of certain caps instead of the presence of them.
This commit is contained in:
parent
640dbf6412
commit
b71a87baea
@ -49,9 +49,8 @@ HRESULT STDMETHODCALLTYPE CompatDirectDraw<TDirectDraw>::CreateSurface(
|
||||
!(lpDDSurfaceDesc->dwFlags & DDSD_PIXELFORMAT) &&
|
||||
(lpDDSurfaceDesc->dwFlags & DDSD_WIDTH) &&
|
||||
(lpDDSurfaceDesc->dwFlags & DDSD_HEIGHT) &&
|
||||
(lpDDSurfaceDesc->dwFlags & DDSD_CAPS) &&
|
||||
(lpDDSurfaceDesc->ddsCaps.dwCaps & (DDSCAPS_3DDEVICE | DDSCAPS_BACKBUFFER | DDSCAPS_FLIP |
|
||||
DDSCAPS_FRONTBUFFER | DDSCAPS_OFFSCREENPLAIN | DDSCAPS_OVERLAY | DDSCAPS_TEXTURE)))
|
||||
!((lpDDSurfaceDesc->dwFlags & DDSD_CAPS) &&
|
||||
(lpDDSurfaceDesc->ddsCaps.dwCaps & (DDSCAPS_ALPHA | DDSCAPS_ZBUFFER))))
|
||||
{
|
||||
TSurfaceDesc desc = *lpDDSurfaceDesc;
|
||||
desc.dwFlags |= DDSD_PIXELFORMAT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user