Skip to content

Commit 9d49abf

Browse files
committed
Undo: Handle CooperativeLevel flags better
Fixes Patrician 3
1 parent b8c9724 commit 9d49abf

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

Dllmain/BuildNo.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define BUILD_NUMBER 8078
1+
#define BUILD_NUMBER 8079

ddraw/IDirectDrawX.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ namespace {
3838

3939
// Exclusive mode settings
4040
HMONITOR hMonitor = nullptr;
41-
DWORD LastCooperativeLevelFlags = 0;
4241
bool ExclusiveMode = false;
4342
bool FullScreenWindowed = false;
4443
DISPLAYSETTINGS Exclusive = {};
@@ -1664,7 +1663,6 @@ HRESULT m_IDirectDrawX::SetCooperativeLevel(HWND hWnd, DWORD dwFlags, DWORD Dire
16641663

16651664
// Store flags
16661665
bool WasDeviceCreated = false;
1667-
const DWORD OriginalFlags = dwFlags;
16681666
const HWND LasthWnd = DisplayMode.hWnd;
16691667
const bool LastFPUPreserve = Device.FPUPreserve;
16701668
const bool LastWindowed = Device.IsWindowed;
@@ -1710,13 +1708,6 @@ HRESULT m_IDirectDrawX::SetCooperativeLevel(HWND hWnd, DWORD dwFlags, DWORD Dire
17101708
FullScreenWindowed = false;
17111709
}
17121710

1713-
// Check for exclusive mode
1714-
if (LastCooperativeLevelFlags == ((OriginalFlags & ~DDSCL_NORMAL) | DDSCL_EXCLUSIVE) && hWnd == LasthWnd)
1715-
{
1716-
// No changes in flags, just replacing exclusive with normal
1717-
FullScreenWindowed = true;
1718-
}
1719-
17201711
// Check window handle
17211712
if (IsWindow(hWnd) && DisplayMode.hWnd != hWnd &&
17221713
(((!ExclusiveMode || Exclusive.hWnd == hWnd) && (!DisplayMode.hWnd || !DisplayMode.SetBy || DisplayMode.SetBy == this)) || !IsWindow(DisplayMode.hWnd)))
@@ -1798,9 +1789,6 @@ HRESULT m_IDirectDrawX::SetCooperativeLevel(HWND hWnd, DWORD dwFlags, DWORD Dire
17981789
RedrawWindow(DisplayMode.hWnd, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE | RDW_ALLCHILDREN);
17991790
}
18001791

1801-
// Store flags
1802-
LastCooperativeLevelFlags = OriginalFlags;
1803-
18041792
return DD_OK;
18051793
}
18061794

@@ -2428,7 +2416,6 @@ void m_IDirectDrawX::InitInterface(DWORD DirectXVersion)
24282416

24292417
// Exclusive mode
24302418
hMonitor = nullptr;
2431-
LastCooperativeLevelFlags = 0;
24322419
ExclusiveMode = false;
24332420
FullScreenWindowed = false;
24342421
Exclusive = {};

0 commit comments

Comments
 (0)