diff --git a/Dllmain/BuildNo.rc b/Dllmain/BuildNo.rc index 008b286c..df795f1c 100644 --- a/Dllmain/BuildNo.rc +++ b/Dllmain/BuildNo.rc @@ -1 +1 @@ -#define BUILD_NUMBER 6977 +#define BUILD_NUMBER 6978 diff --git a/ddraw/IDirect3DDeviceX.cpp b/ddraw/IDirect3DDeviceX.cpp index 4eb2806e..19ad8b5d 100644 --- a/ddraw/IDirect3DDeviceX.cpp +++ b/ddraw/IDirect3DDeviceX.cpp @@ -2227,6 +2227,9 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType, case D3DRENDERSTATE_ALPHABLENDENABLE: rsAlphaBlendEnabled = dwRenderState; break; + case D3DRENDERSTATE_SRCBLEND: + rsSrcBlend = dwRenderState; + break; case D3DRENDERSTATE_COLORKEYENABLE: rsColorKeyEnabled = dwRenderState; return D3D_OK; @@ -3356,10 +3359,12 @@ inline void m_IDirect3DDeviceX::UpdateDrawFlags(DWORD& dwFlags) // You can use D3DRENDERSTATE_COLORKEYENABLE render state with D3DRENDERSTATE_ALPHABLENDENABLE to implement fine blending control. if (rsColorKeyEnabled && rsAlphaBlendEnabled) { - LOG_LIMIT(100, __FUNCTION__ << " Warning: mixing color keying with alpha blending is not implemented!"); + LOG_LIMIT(100, __FUNCTION__ << " Warning: mixing color keying with alpha blending is not implemented: " << rsSrcBlend); } + // Check for color key - else if (rsColorKeyEnabled && CurrentTextureSurfaceX && CurrentTextureSurfaceX->GetColorKeyForShader(DrawStates.lowColorKey, DrawStates.highColorKey)) + if (rsColorKeyEnabled && !(rsAlphaBlendEnabled && rsSrcBlend == D3DBLEND_ONE) && + CurrentTextureSurfaceX && CurrentTextureSurfaceX->GetColorKeyForShader(DrawStates.lowColorKey, DrawStates.highColorKey)) { dwFlags |= D3DDP_DXW_COLORKEYENABLE; } diff --git a/ddraw/IDirect3DDeviceX.h b/ddraw/IDirect3DDeviceX.h index 9c5da8f8..add5c6a0 100644 --- a/ddraw/IDirect3DDeviceX.h +++ b/ddraw/IDirect3DDeviceX.h @@ -46,6 +46,7 @@ class m_IDirect3DDeviceX : public IUnknown, public AddressLookupTableDdrawObject // Render states DWORD rsAlphaBlendEnabled = FALSE; + DWORD rsSrcBlend = 0; DWORD rsColorKeyEnabled = FALSE; // SetTexture array