From 7b70770c16b5e77d1255bb2ab86f2d057e3dfeea Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 22 Dec 2019 23:59:59 +0100 Subject: [PATCH] BUGFIX note for MouseX/Y --- Source/diablo.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 7a2c8a4b4..3ac13dc16 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -719,13 +719,13 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } break; case WM_MOUSEMOVE: - MouseX = LOWORD(lParam); - MouseY = HIWORD(lParam); + MouseX = LOWORD(lParam); // BUGFIX (short)LOWORD coords are signed + MouseY = HIWORD(lParam); // BUGFIX (short)HIWORD coords are signed gmenu_on_mouse_move(); return 0; case WM_LBUTTONDOWN: - MouseX = LOWORD(lParam); - MouseY = HIWORD(lParam); + MouseX = LOWORD(lParam); // BUGFIX (short)LOWORD coords are signed + MouseY = HIWORD(lParam); // BUGFIX (short)HIWORD coords are signed if (sgbMouseDown == 0) { sgbMouseDown = 1; SetCapture(hWnd); @@ -733,8 +733,8 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return 0; case WM_LBUTTONUP: - MouseX = LOWORD(lParam); - MouseY = HIWORD(lParam); + MouseX = LOWORD(lParam); // BUGFIX (short)LOWORD coords are signed + MouseY = HIWORD(lParam); // BUGFIX (short)HIWORD coords are signed if (sgbMouseDown == 1) { sgbMouseDown = 0; LeftMouseUp(); @@ -743,8 +743,8 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return 0; case WM_RBUTTONDOWN: - MouseX = LOWORD(lParam); - MouseY = HIWORD(lParam); + MouseX = LOWORD(lParam); // BUGFIX (short)LOWORD coords are signed + MouseY = HIWORD(lParam); // BUGFIX (short)HIWORD coords are signed if (sgbMouseDown == 0) { sgbMouseDown = 2; SetCapture(hWnd); @@ -752,8 +752,8 @@ LRESULT CALLBACK GM_Game(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) } return 0; case WM_RBUTTONUP: - MouseX = LOWORD(lParam); - MouseY = HIWORD(lParam); + MouseX = LOWORD(lParam); // BUGFIX (short)LOWORD coords are signed + MouseY = HIWORD(lParam); // BUGFIX (short)HIWORD coords are signed if (sgbMouseDown == 2) { sgbMouseDown = 0; ReleaseCapture();