From b579a258f8e26140e1004473f0ff3b0ff0347dfb Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 11 Mar 2018 11:43:43 +0100 Subject: [PATCH] fix mouse_lock bug --- ddraw.rc | 8 ++++---- src/main.c | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ddraw.rc b/ddraw.rc index 7a8cf60..74162a2 100644 --- a/ddraw.rc +++ b/ddraw.rc @@ -1,6 +1,6 @@ 1 VERSIONINFO -FILEVERSION 1,1,5,0 -PRODUCTVERSION 1,1,5,0 +FILEVERSION 1,1,5,1 +PRODUCTVERSION 1,1,5,1 { BLOCK "StringFileInfo" { @@ -8,13 +8,13 @@ PRODUCTVERSION 1,1,5,0 { VALUE "CompanyName", "cncnet.org" VALUE "FileDescription", "DirectDraw replacement for C&C95 and Red Alert" - VALUE "FileVersion", "1.1.5.0" + VALUE "FileVersion", "1.1.5.1" VALUE "InternalName", "ddraw" VALUE "LegalCopyright", "Copyright (c) 2010-2018" VALUE "LegalTrademarks", "" VALUE "OriginalFileName", "ddraw.dll" VALUE "ProductName", "DirectDraw replacement for C&C95 and Red Alert" - VALUE "ProductVersion", "1.1.5.0" + VALUE "ProductVersion", "1.1.5.1" VALUE "Comments", "https://cncnet.org" } } diff --git a/src/main.c b/src/main.c index f30a445..01dbc12 100644 --- a/src/main.c +++ b/src/main.c @@ -389,13 +389,13 @@ HRESULT __stdcall ddraw_SetDisplayMode(IDirectDrawImpl *This, DWORD width, DWORD { SetWindowPos(This->hWnd, HWND_TOPMOST, 0, 0, This->render.width, This->render.height, SWP_SHOWWINDOW); - mouse_lock(); - if(!This->devmode && ChangeDisplaySettings(&This->render.mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL) { This->render.run = FALSE; return DDERR_INVALIDMODE; } + + mouse_lock(); } if(This->render.thread == NULL) @@ -522,14 +522,14 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_ACTIVATE: if (wParam == WA_ACTIVE || wParam == WA_CLICKACTIVE) { - if (wParam == WA_ACTIVE) - { - mouse_lock(); - } if (!ddraw->windowed) { ChangeDisplaySettings(&ddraw->render.mode, CDS_FULLSCREEN); } + if (wParam == WA_ACTIVE) + { + mouse_lock(); + } } else if (wParam == WA_INACTIVE) {