From 7e64707fbee41def54df744850d2e32d3806fcf1 Mon Sep 17 00:00:00 2001 From: narzoul Date: Thu, 2 May 2024 16:38:14 +0200 Subject: [PATCH] Fixed resolution scaling with D24S8 format when S8D24 is not supported See issue #300. --- DDrawCompat/D3dDdi/FormatInfo.h | 1 - DDrawCompat/D3dDdi/SurfaceRepository.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/DDrawCompat/D3dDdi/FormatInfo.h b/DDrawCompat/D3dDdi/FormatInfo.h index 534f70a..73a2238 100644 --- a/DDrawCompat/D3dDdi/FormatInfo.h +++ b/DDrawCompat/D3dDdi/FormatInfo.h @@ -8,7 +8,6 @@ namespace D3dDdi { static const auto FOURCC_DF16 = static_cast(MAKEFOURCC('D', 'F', '1', '6')); - static const auto FOURCC_DF24 = static_cast(MAKEFOURCC('D', 'F', '2', '4')); static const auto FOURCC_INTZ = static_cast(MAKEFOURCC('I', 'N', 'T', 'Z')); static const auto FOURCC_NULL = static_cast(MAKEFOURCC('N', 'U', 'L', 'L')); static const auto FOURCC_RESZ = static_cast(MAKEFOURCC('R', 'E', 'S', 'Z')); diff --git a/DDrawCompat/D3dDdi/SurfaceRepository.cpp b/DDrawCompat/D3dDdi/SurfaceRepository.cpp index 1f06eea..ff1d646 100644 --- a/DDrawCompat/D3dDdi/SurfaceRepository.cpp +++ b/DDrawCompat/D3dDdi/SurfaceRepository.cpp @@ -97,7 +97,7 @@ namespace D3dDdi desc.dwBackBufferCount = surfaceCount - 1; } - if (0 == desc.ddpfPixelFormat.dwFlags) + if (0 == desc.ddpfPixelFormat.dwFlags || D3dDdi::FOURCC_INTZ == format || D3dDdi::FOURCC_DF16 == format) { desc.ddpfPixelFormat = getPixelFormat((caps & DDSCAPS_ZBUFFER) ? D3DDDIFMT_D16 : D3DDDIFMT_X8R8G8B8); D3dDdi::Resource::setFormatOverride(format);