diff --git a/Dllmain/BuildNo.rc b/Dllmain/BuildNo.rc index 9e8c5ebc..e0924c17 100644 --- a/Dllmain/BuildNo.rc +++ b/Dllmain/BuildNo.rc @@ -1 +1 @@ -#define BUILD_NUMBER 7360 +#define BUILD_NUMBER 7361 diff --git a/ddraw/IDirectDrawSurfaceX.cpp b/ddraw/IDirectDrawSurfaceX.cpp index e5118f0e..d02c23e3 100644 --- a/ddraw/IDirectDrawSurfaceX.cpp +++ b/ddraw/IDirectDrawSurfaceX.cpp @@ -4344,7 +4344,7 @@ inline LPDIRECT3DTEXTURE9 m_IDirectDrawSurfaceX::Get3DTexture() } // Prepare paletted surface for display - if (surface.IsPaletteDirty && !primary.PaletteTexture) + if (surface.IsPaletteDirty && IsUsingEmulation() && !primary.PaletteTexture) { CopyEmulatedPaletteSurface(nullptr); } @@ -4550,7 +4550,7 @@ HRESULT m_IDirectDrawSurfaceX::CreateD9AuxiliarySurfaces() } // Create palette surface - if (!primary.PaletteTexture && IsPrimarySurface() && surface.Format == D3DFMT_P8 && !IsRenderTarget()) + if (!primary.PaletteTexture && IsPrimarySurface() && surface.Format == D3DFMT_P8) { if (FAILED((*d3d9Device)->CreateTexture(MaxPaletteSize, MaxPaletteSize, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &primary.PaletteTexture, nullptr))) { @@ -4665,7 +4665,7 @@ HRESULT m_IDirectDrawSurfaceX::CreateD9Surface() // ToDo: if render surface is a texture then create as a texture (MipMaps can be supported on render target textures) surface.Usage = D3DUSAGE_RENDERTARGET; surface.Pool = D3DPOOL_DEFAULT; - if (IsSurfaceTexture()) + if (IsSurfaceTexture() || IsPalette()) { surface.Type = D3DTYPE_TEXTURE; if (FAILED((*d3d9Device)->CreateTexture(surface.Width, surface.Height, 1, surface.Usage, Format, surface.Pool, &surface.Texture, nullptr)) && @@ -7200,7 +7200,7 @@ HRESULT m_IDirectDrawSurfaceX::CopyToDrawTexture(LPRECT lpDestRect) return DDERR_GENERIC; } - DWORD ColorKey = (surfaceDesc2.ddpfPixelFormat.dwRGBBitCount && (surfaceDesc2.dwFlags & DDSD_CKSRCBLT)) ? + DWORD ColorKey = (surfaceDesc2.ddpfPixelFormat.dwRGBBitCount && (surfaceDesc2.dwFlags & DDSD_CKSRCBLT) && !IsPalette()) ? GetARGBColorKey(surfaceDesc2.ddckCKSrcBlt.dwColorSpaceLowValue, surfaceDesc2.ddpfPixelFormat) : 0; if (IsPalette()) diff --git a/ddraw/IDirectDrawX.cpp b/ddraw/IDirectDrawX.cpp index 2fe529b7..ee54f5ec 100644 --- a/ddraw/IDirectDrawX.cpp +++ b/ddraw/IDirectDrawX.cpp @@ -4677,7 +4677,7 @@ HRESULT m_IDirectDrawX::PresentScene(RECT* pRect) // Copy or draw primary surface before presenting HRESULT DrawRet = DDERR_GENERIC; - if (IsPrimaryRenderTarget()) + if (IsPrimaryRenderTarget() && !PrimarySurface->GetD3d9Texture()) { if (IsGammaSet) {