From edee70ddd062b734851b660ccf3379b14c8aebea Mon Sep 17 00:00:00 2001 From: Echelon9 Date: Tue, 27 Nov 2012 22:37:27 +1100 Subject: [PATCH] Fix up IDirect3DSurface8_LockRect and IDirect3DTexture8_LockRect calls for situations where Flags set to NULL. Resolves issued with Halo1 and Turok. --- src/CxbxKrnl/EmuD3D8.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CxbxKrnl/EmuD3D8.cpp b/src/CxbxKrnl/EmuD3D8.cpp index ef5267b45..7eda0bb5d 100644 --- a/src/CxbxKrnl/EmuD3D8.cpp +++ b/src/CxbxKrnl/EmuD3D8.cpp @@ -5696,9 +5696,6 @@ HRESULT WINAPI XTL::EmuIDirect3DSurface8_LockRect } else { - if(Flags & 0x40) - EmuWarning("D3DLOCK_TILED ignored!"); - IDirect3DSurface8 *pSurface8 = pThis->EmuSurface8; DWORD NewFlags = 0; @@ -5706,7 +5703,10 @@ HRESULT WINAPI XTL::EmuIDirect3DSurface8_LockRect if(Flags & 0x80) NewFlags |= D3DLOCK_READONLY; - if(!(Flags & 0x80) && !(Flags & 0x40)) + if(Flags & 0x40) + EmuWarning("D3DLOCK_TILED ignored!"); + + if(!(Flags & 0x80) && !(Flags & 0x40) && Flags != 0) CxbxKrnlCleanup("EmuIDirect3DSurface8_LockRect: Unknown Flags! (0x%.08X)", Flags); try @@ -5833,7 +5833,10 @@ HRESULT WINAPI XTL::EmuIDirect3DTexture8_LockRect if(Flags & 0x80) NewFlags |= D3DLOCK_READONLY; - if(!(Flags & 0x80) && !(Flags & 0x40)) + if(Flags & 0x40) + EmuWarning("D3DLOCK_TILED ignored!"); + + if(!(Flags & 0x80) && !(Flags & 0x40) && Flags != 0) CxbxKrnlCleanup("EmuIDirect3DTexture8_LockRect: Unknown Flags! (0x%.08X)", Flags); // Remove old lock(s)