Skip to content

Commit

Permalink
Fix emulation and fix debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Sep 29, 2019
1 parent 2bdfdd4 commit 648605c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
@@ -1 +1 @@
#define BUILD_NUMBER 6333
#define BUILD_NUMBER 6334
2 changes: 1 addition & 1 deletion External/Hooking
Submodule Hooking updated 1 files
+1 −1 HotPatch.cpp
8 changes: 4 additions & 4 deletions ddraw/IDirectDrawSurfaceX.cpp
Expand Up @@ -2278,7 +2278,7 @@ HRESULT m_IDirectDrawSurfaceX::CreateD3d9Surface()
surfaceBitCount = GetBitCount(surfaceFormat);
IsSurfaceEmulated = (surfaceFormat == D3DFMT_R8G8B8) ||
(Config.DdrawEmulateSurface && (surfaceFormat == D3DFMT_P8 || surfaceFormat == D3DFMT_R5G6B5 || surfaceFormat == D3DFMT_A1R5G5B5 || surfaceFormat == D3DFMT_X1R5G5B5 ||
surfaceFormat == D3DFMT_A8R8G8B8 || surfaceFormat == D3DFMT_X8R8G8B8));
surfaceFormat == D3DFMT_R8G8B8 || surfaceFormat == D3DFMT_A8R8G8B8 || surfaceFormat == D3DFMT_X8R8G8B8));
DCRequiresEmulation = (surfaceFormat != D3DFMT_R5G6B5 && surfaceFormat != D3DFMT_X1R5G5B5 && surfaceFormat != D3DFMT_R8G8B8 && surfaceFormat != D3DFMT_X8R8G8B8);
D3DFORMAT Format = (surfaceFormat == D3DFMT_P8) ? D3DFMT_L8 : (surfaceFormat == D3DFMT_R8G8B8) ? D3DFMT_X8R8G8B8 : surfaceFormat;

Expand Down Expand Up @@ -3623,7 +3623,7 @@ HRESULT m_IDirectDrawSurfaceX::CopySurface(m_IDirectDrawSurfaceX* pSourceSurface
// Copy memory (simple)
if (!IsStretchRect && !IsColorKey & !IsMirrorLeftRight)
{
if ((DestRectWidth * (INT)ByteCount) == DestPitch && SrcLockRect.Pitch == DestLockRect.Pitch)
if (SrcLockRect.Pitch == DestLockRect.Pitch && (DestRectWidth * (INT)ByteCount) == DestPitch)
{
memcpy(DestBuffer, SrcBuffer, DestRectHeight * DestLockRect.Pitch);
}
Expand Down Expand Up @@ -3768,7 +3768,7 @@ HRESULT m_IDirectDrawSurfaceX::CopyEmulatedSurface(LPRECT lpDestRect, bool CopyT
default:
if (CopyToRealSurfaceTexture)
{
if (WidthPitch == SurfaceLockRect.Pitch)
if (SurfaceLockRect.Pitch == EmulatedLockRect.Pitch && WidthPitch == SurfaceLockRect.Pitch)
{
memcpy(SurfaceBuffer, EmulatedBuffer, SurfaceLockRect.Pitch * RectHeight);
}
Expand All @@ -3784,7 +3784,7 @@ HRESULT m_IDirectDrawSurfaceX::CopyEmulatedSurface(LPRECT lpDestRect, bool CopyT
}
else
{
if (WidthPitch == EmulatedLockRect.Pitch)
if (SurfaceLockRect.Pitch == EmulatedLockRect.Pitch && WidthPitch == EmulatedLockRect.Pitch)
{
memcpy(EmulatedBuffer, SurfaceBuffer, EmulatedLockRect.Pitch * RectHeight);
}
Expand Down

0 comments on commit 648605c

Please sign in to comment.