Skip to content

Commit

Permalink
Hack for Midtown Madness with DXVK
Browse files Browse the repository at this point in the history
Make sure to set the following in the ini file:
DdrawOverrideStencilFormat = 80
ForceExclusiveFullscreen   = 1
  • Loading branch information
elishacloud committed Mar 12, 2024
1 parent f5014fb commit 6029ebb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 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 6960
#define BUILD_NUMBER 6961
5 changes: 5 additions & 0 deletions GDI/User32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ HWND WINAPI user_CreateWindowExT(D CreateWindowExT, DWORD dwExStyle, T lpClassNa
return nullptr;
}

if (dwStyle == 0x80080000)
{
dwStyle = WS_OVERLAPPEDWINDOW;
}

// Handle popup window type
if ((dwStyle & WS_POPUP) && (dwStyle & WS_VISIBLE) && !(dwStyle & WS_CLIPSIBLINGS) && !hWndParent)
{
Expand Down
8 changes: 7 additions & 1 deletion ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2830,6 +2830,12 @@ HRESULT m_IDirectDrawX::CreateD3D9Device()
return DDERR_GENERIC;
}

// Only reset device on hwnd change
if (d3d9Device && hFocusWindow == GetHwnd())
{
return DD_OK;
}

SetCriticalSection();
SetPTCriticalSection();

Expand Down Expand Up @@ -2981,7 +2987,7 @@ HRESULT m_IDirectDrawX::CreateD3D9Device()

// Set behavior flags
BehaviorFlags = (d3dcaps.VertexProcessingCaps ? D3DCREATE_HARDWARE_VERTEXPROCESSING : D3DCREATE_SOFTWARE_VERTEXPROCESSING) |
D3DCREATE_MULTITHREADED |
D3DCREATE_MULTITHREADED | D3DCREATE_FPU_PRESERVE |
(Device.FPUPreserve ? D3DCREATE_FPU_PRESERVE : 0);

Logging::Log() << __FUNCTION__ << " Direct3D9 device! " <<
Expand Down

0 comments on commit 6029ebb

Please sign in to comment.