1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

Revert "do not return WM_NULL for now (needs more testing)"

This reverts commit a42bdae84d2129a0d91eaa225b3e2b46f419b392.
This commit is contained in:
FunkyFr3sh 2024-09-10 15:40:27 +02:00
parent 4df4766736
commit cdb68e9dd1

View File

@ -614,7 +614,7 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
void HandleMessage(LPMSG lpMsg, HWND hWnd) void HandleMessage(LPMSG lpMsg, HWND hWnd)
{ {
if (lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width) if (lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width && !g_config.fixmousehook)
{ {
if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt)) if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt))
{ {
@ -652,8 +652,7 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd)
mouse_lock(); mouse_lock();
//lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
break;
} }
break; break;
@ -675,12 +674,13 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd)
if (!g_config.devmode && !g_mouse_locked) if (!g_config.devmode && !g_mouse_locked)
{ {
// Does not work with 'New Robinson' // Does not work with 'New Robinson'
//lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
break; break;
} }
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam)); InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam));
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam)); InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam));
break; break;
} }
} }