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

fix for HOMM4 cursor issues

This commit is contained in:
FunkyFr3sh 2023-07-07 23:54:59 +02:00
parent 6101e34ddd
commit dfe15ec8b0
2 changed files with 6 additions and 1 deletions

View File

@ -922,7 +922,9 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
if (!g_ddraw->devmode)
{
HCURSOR cursor = real_SetCursor(LoadCursor(NULL, IDC_ARROW));
InterlockedExchange((LONG*)&g_ddraw->old_cursor, (LONG)cursor);
if (cursor != LoadCursor(NULL, IDC_WAIT))
InterlockedExchange((LONG*)&g_ddraw->old_cursor, (LONG)cursor);
}
int cursor_count = real_ShowCursor(TRUE) - 1;

View File

@ -61,6 +61,7 @@ void mouse_unlock()
g_mouse_locked = FALSE;
real_ClipCursor(NULL);
//ReleaseCapture();
RECT rc = { 0 };
real_GetClientRect(g_ddraw->hwnd, &rc);
@ -74,6 +75,8 @@ void mouse_unlock()
(int)(rc.left + (cur_x * g_ddraw->render.scale_w)),
(int)(rc.top + (cur_y * g_ddraw->render.scale_h)));
real_SetCursor(LoadCursor(NULL, IDC_ARROW));
while (real_ShowCursor(TRUE) < 0);
}
}