Skip to content

Commit

Permalink
Make flip fill color customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Mar 16, 2024
1 parent cbf8e0c commit 19bebd0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dllmain/BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 6970
#define BUILD_NUMBER 6971
1 change: 1 addition & 0 deletions Settings/AllSettings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ DirectShowEmulation = 0
DdrawAutoFrameSkip = 0
DdrawEmulateSurface = 0
DdrawEmulateLock = 0
DdrawFlipFillColor = 0
DdrawFixByteAlignment = 0
DdrawRemoveScanlines = 0
DdrawRemoveInterlacing = 0
Expand Down
2 changes: 2 additions & 0 deletions Settings/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
visit(DdrawCustomHeight) \
visit(DdrawDisableDirect3DCaps) \
visit(DdrawEmulateLock) \
visit(DdrawFlipFillColor) \
visit(DdrawRemoveScanlines) \
visit(DdrawRemoveInterlacing) \
visit(DdrawFixByteAlignment) \
Expand Down Expand Up @@ -228,6 +229,7 @@ struct CONFIG
DWORD DdrawOverrideHeight = 0; // Force Direct3d9 to use this height when using Dd7to9
DWORD OverrideRefreshRate = 0; // Force Direct3d9 to use this refresh rate, only works in exclusive fullscreen mode
DWORD DdrawOverrideStencilFormat = 0; // Force Direct3d9 to use this AutoStencilFormat when using Dd7to9
DWORD DdrawFlipFillColor = 0; // Color used to fill the primary surface before flipping
bool DdrawEnableMouseHook = false; // Allow to hook into mouse to limit it to the chosen resolution
DWORD DdrawHookSystem32 = 0; // Hooks the ddraw.dll file in the Windows System32 folder
DWORD D3d8HookSystem32 = 0; // Hooks the d3d8.dll file in the Windows System32 folder
Expand Down
1 change: 1 addition & 0 deletions Settings/Settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ DdrawOverrideBitMode = 0
DdrawAutoFrameSkip = 0
DdrawEmulateSurface = 0
DdrawEmulateLock = 0
DdrawFlipFillColor = 0
DdrawFixByteAlignment = 0
DdrawRemoveScanlines = 0
DdrawRemoveInterlacing = 0
Expand Down
6 changes: 2 additions & 4 deletions ddraw/IDirectDrawSurfaceX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ bool dirtyFlag = false;
bool SceneReady = false;
bool IsPresentRunning = false;

const DWORD PrimarySurfaceFillColor = 0x00000000;

// Cached surface wrapper interface v1 list
std::vector<m_IDirectDrawSurface*> SurfaceWrapperListV1;

Expand Down Expand Up @@ -1360,7 +1358,7 @@ HRESULT m_IDirectDrawSurfaceX::Flip(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverri
// Clear dirty surface before flip if system memory or 3D device
if (surfaceDesc2.ddsCaps.dwCaps & (DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE))
{
HRESULT hr_c = ColorFill(nullptr, PrimarySurfaceFillColor);
HRESULT hr_c = ColorFill(nullptr, Config.DdrawFlipFillColor);

if (FAILED(hr_c))
{
Expand Down Expand Up @@ -1748,7 +1746,7 @@ bool m_IDirectDrawSurfaceX::GetColorKeyForShader(float(&lowColorKey)[4], float(&
{
if (!primary.ShaderColorKey.IsSet)
{
GetColorKeyArray(primary.ShaderColorKey.lowColorKey, primary.ShaderColorKey.highColorKey, PrimarySurfaceFillColor, PrimarySurfaceFillColor, surfaceDesc2.ddpfPixelFormat);
GetColorKeyArray(primary.ShaderColorKey.lowColorKey, primary.ShaderColorKey.highColorKey, Config.DdrawFlipFillColor, Config.DdrawFlipFillColor, surfaceDesc2.ddpfPixelFormat);
primary.ShaderColorKey.IsSet = true;
}
lowColorKey[0] = primary.ShaderColorKey.lowColorKey[0];
Expand Down

0 comments on commit 19bebd0

Please sign in to comment.