Skip to content

Commit

Permalink
Change how vsync works on dd7to9
Browse files Browse the repository at this point in the history
  • Loading branch information
elishacloud committed Sep 8, 2024
1 parent 377cecc commit 9069b6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 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 7122
#define BUILD_NUMBER 7123
11 changes: 3 additions & 8 deletions ddraw/IDirectDrawX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1953,12 +1953,7 @@ HRESULT m_IDirectDrawX::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
return DDERR_GENERIC;
}

if (Config.ForceVsyncMode || IsUsing3D())
{
return DD_OK;
}

D3DRASTER_STATUS RasterStatus;
D3DRASTER_STATUS RasterStatus = {};

// Check flags
switch (dwFlags)
Expand Down Expand Up @@ -4622,7 +4617,7 @@ HRESULT m_IDirectDrawX::Present(RECT* pSourceRect, RECT* pDestRect)
}

// Use WaitForVerticalBlank for wait timer
if (EnableWaitVsync && !Config.EnableVSync)
if (EnableWaitVsync && !Config.EnableVSync && !Config.ForceVsyncMode && !IsUsing3D())
{
// Check how long since the last successful present
LARGE_INTEGER ClickTime = {};
Expand All @@ -4634,8 +4629,8 @@ HRESULT m_IDirectDrawX::Present(RECT* pSourceRect, RECT* pDestRect)
{
WaitForVerticalBlank(DDWAITVB_BLOCKBEGIN, nullptr);
}
EnableWaitVsync = false;
}
EnableWaitVsync = false;

// Present everthing, skip Preset when using DdrawWriteToGDI
HRESULT hr = D3DERR_DEVICELOST;
Expand Down

0 comments on commit 9069b6f

Please sign in to comment.