1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

improve cursor lock

This commit is contained in:
FunkyFr3sh 2021-06-12 05:45:28 +02:00
parent 2c2a83d93c
commit a399797982
4 changed files with 9 additions and 1 deletions

View File

@ -109,6 +109,7 @@ typedef struct CNCDDRAW
BOOL wine;
BOOL altenter;
BOOL hidecursor;
HCURSOR old_cursor;
BOOL accurate_timers;
BOOL resizable;
BOOL nonexclusive;

View File

@ -64,6 +64,8 @@ void mouse_lock()
}
else
{
real_SetCursor(g_ddraw->old_cursor);
if (g_ddraw->hidecursor)
{
g_ddraw->hidecursor = FALSE;
@ -125,6 +127,8 @@ void mouse_unlock()
}
}
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
real_ClipCursor(NULL);
real_SetCursorPos(

View File

@ -122,7 +122,7 @@ int WINAPI fake_ShowCursor(BOOL bShow)
HCURSOR WINAPI fake_SetCursor(HCURSOR hCursor)
{
if (g_ddraw && !g_ddraw->handlemouse && (g_ddraw->locked || g_ddraw->devmode))
return real_SetCursor(hCursor);
return real_SetCursor(g_ddraw->old_cursor = hCursor);
return NULL;
}

View File

@ -102,7 +102,10 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
return DefWindowProc(hWnd, uMsg, wParam, lParam);
case HTCLIENT:
if (!g_ddraw->locked)
{
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
default:
break;
}