mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Added P8 format support for D3D9On12
This commit is contained in:
parent
0b7f4589f2
commit
a0d7cffc07
@ -129,15 +129,27 @@ namespace D3dDdi
|
|||||||
|
|
||||||
for (auto& formatOp : info.formatOps)
|
for (auto& formatOp : info.formatOps)
|
||||||
{
|
{
|
||||||
|
if (D3DDDIFMT_P8 == formatOp.first)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
auto fixedFormatOp = formatOp.second;
|
auto fixedFormatOp = formatOp.second;
|
||||||
if (isEmulatedRenderTargetFormat(formatOp.first, info.formatOps))
|
if (isEmulatedRenderTargetFormat(formatOp.first, info.formatOps))
|
||||||
{
|
{
|
||||||
fixedFormatOp.Operations |= FORMATOP_OFFSCREEN_RENDERTARGET;
|
fixedFormatOp.Operations |= FORMATOP_OFFSCREEN_RENDERTARGET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (D3DDDIFMT_P8 == formatOp.first && Config::palettizedTextures.get())
|
if (D3DDDIFMT_L8 == formatOp.first)
|
||||||
{
|
{
|
||||||
fixedFormatOp.Operations |= FORMATOP_TEXTURE | FORMATOP_CUBETEXTURE;
|
auto p8FormatOp = formatOp.second;
|
||||||
|
p8FormatOp.Format = D3DDDIFMT_P8;
|
||||||
|
p8FormatOp.Operations |= FORMATOP_OFFSCREENPLAIN;
|
||||||
|
if (!Config::palettizedTextures.get())
|
||||||
|
{
|
||||||
|
p8FormatOp.Operations &= ~(FORMATOP_TEXTURE | FORMATOP_VOLUMETEXTURE | FORMATOP_CUBETEXTURE);
|
||||||
|
}
|
||||||
|
fixedFormatOps[D3DDDIFMT_P8] = p8FormatOp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (D3DDDIFMT_D24X4S4 == formatOp.first || D3DDDIFMT_X4S4D24 == formatOp.first)
|
if (D3DDDIFMT_D24X4S4 == formatOp.first || D3DDDIFMT_X4S4D24 == formatOp.first)
|
||||||
|
@ -513,7 +513,7 @@ namespace D3dDdi
|
|||||||
|
|
||||||
if (D3DDDIFMT_P8 == m_fixedData.Format)
|
if (D3DDDIFMT_P8 == m_fixedData.Format)
|
||||||
{
|
{
|
||||||
data.Color <<= 16;
|
data.Color |= data.Color << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
prepareForBltDst(data.hResource, data.SubResourceIndex, data.DstRect);
|
prepareForBltDst(data.hResource, data.SubResourceIndex, data.DstRect);
|
||||||
|
@ -41,6 +41,11 @@ namespace D3dDdi
|
|||||||
m_releasedSurfaces.clear();
|
m_releasedSurfaces.clear();
|
||||||
CompatPtr<IDirectDrawSurface7> surface;
|
CompatPtr<IDirectDrawSurface7> surface;
|
||||||
|
|
||||||
|
if (D3DDDIFMT_P8 == format)
|
||||||
|
{
|
||||||
|
format = D3DDDIFMT_L8;
|
||||||
|
}
|
||||||
|
|
||||||
DDSURFACEDESC2 desc = {};
|
DDSURFACEDESC2 desc = {};
|
||||||
desc.dwSize = sizeof(desc);
|
desc.dwSize = sizeof(desc);
|
||||||
desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
|
desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | DDSD_CAPS;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user