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

Fixed resolution scaling with D24S8 format when S8D24 is not supported

See issue #300.
This commit is contained in:
narzoul 2024-05-02 16:38:14 +02:00
parent 574f4cdd2b
commit 7e64707fbe
2 changed files with 1 additions and 2 deletions

View File

@ -8,7 +8,6 @@
namespace D3dDdi
{
static const auto FOURCC_DF16 = static_cast<D3DDDIFORMAT>(MAKEFOURCC('D', 'F', '1', '6'));
static const auto FOURCC_DF24 = static_cast<D3DDDIFORMAT>(MAKEFOURCC('D', 'F', '2', '4'));
static const auto FOURCC_INTZ = static_cast<D3DDDIFORMAT>(MAKEFOURCC('I', 'N', 'T', 'Z'));
static const auto FOURCC_NULL = static_cast<D3DDDIFORMAT>(MAKEFOURCC('N', 'U', 'L', 'L'));
static const auto FOURCC_RESZ = static_cast<D3DDDIFORMAT>(MAKEFOURCC('R', 'E', 'S', 'Z'));

View File

@ -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);