DXGL r664 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r663‎ | r664 | r665 >
Date:23:24, 9 June 2016
Author:admin
Status:new
Tags:
Comment:
Fix Blt() to/from same surface with source colorkey.
Modified paths:
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDrawSurface.cpp
@@ -740,6 +740,15 @@
741741 if (FAILED(error)) TRACE_RET(HRESULT, 23, error);
742742 error = this->ddInterface->tmpsurface->Blt(&tmprect, lpDDSrcSurface, lpSrcRect, 0, NULL);
743743 if (FAILED(error)) TRACE_RET(HRESULT, 23, error);
 744+ if (dwFlags & DDBLT_KEYSRC)
 745+ {
 746+ if (this->ddInterface->tmpsurface->ddsd.ddckCKSrcBlt.dwColorSpaceHighValue !=
 747+ this->ddInterface->tmpsurface->ddsd.ddckCKSrcBlt.dwColorSpaceLowValue)
 748+ this->ddInterface->tmpsurface->SetColorKey(DDCKEY_SRCBLT | DDCKEY_COLORSPACE,
 749+ &((glDirectDrawSurface7*)lpDDSrcSurface)->ddsd.ddckCKSrcBlt);
 750+ else this->ddInterface->tmpsurface->SetColorKey(DDCKEY_SRCBLT,
 751+ &((glDirectDrawSurface7*)lpDDSrcSurface)->ddsd.ddckCKSrcBlt);
 752+ }
744753 TRACE_RET(HRESULT, 23, this->Blt(lpDestRect, (LPDIRECTDRAWSURFACE7)this->ddInterface->tmpsurface,
745754 &tmprect, dwFlags, lpDDBltFx));
746755 }