Skip to content

Commit

Permalink
fix mouse_lock bug
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Mar 11, 2018
1 parent c141dc4 commit b579a25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ddraw.rc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
1 VERSIONINFO
FILEVERSION 1,1,5,0
PRODUCTVERSION 1,1,5,0
FILEVERSION 1,1,5,1
PRODUCTVERSION 1,1,5,1
{
BLOCK "StringFileInfo"
{
BLOCK "040904B0"
{
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"
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit b579a25

Please sign in to comment.