From f293e4ee1f51d10256ac3ba46c6e8b998cc4ef5b Mon Sep 17 00:00:00 2001 From: tomch Date: Sun, 21 Apr 2013 21:31:12 +0000 Subject: [PATCH] Reverted this part of r934: . Moved DIMouse::DirectInputInit() from WM_CREATE to main init-loop (just before msg-pump) --- AppleWin/source/Applewin.cpp | 6 ------ AppleWin/source/Frame.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/AppleWin/source/Applewin.cpp b/AppleWin/source/Applewin.cpp index 94538776..fa6cf7ab 100644 --- a/AppleWin/source/Applewin.cpp +++ b/AppleWin/source/Applewin.cpp @@ -999,12 +999,6 @@ int APIENTRY WinMain(HINSTANCE passinstance, HINSTANCE, LPSTR lpCmdLine, int) tfe_init(); LogFileOutput("Main: tfe_init()\n"); - if (g_Slot4 == CT_MouseInterface) // TODO: Check all slots for MouseInterface card - { - DIMouse::DirectInputInit(g_hFrameWindow); - LogFileOutput("Main: DIMouse::DirectInputInit()\n"); - } - Snapshot_Startup(); // Do this after everything has been init'ed LogFileOutput("Main: Snapshot_Startup()\n"); diff --git a/AppleWin/source/Frame.cpp b/AppleWin/source/Frame.cpp index 386738d5..8903cd09 100644 --- a/AppleWin/source/Frame.cpp +++ b/AppleWin/source/Frame.cpp @@ -750,8 +750,8 @@ LRESULT CALLBACK FrameWndProc ( DSInit(); LogFileOutput("WM_CREATE: DSInit()\n"); -// DIMouse::DirectInputInit(window); -// LogFileOutput("WM_CREATE: DIMouse::DirectInputInit()\n"); + DIMouse::DirectInputInit(window); + LogFileOutput("WM_CREATE: DIMouse::DirectInputInit()\n"); MB_Initialize(); LogFileOutput("WM_CREATE: MB_Initialize()\n"); @@ -1130,8 +1130,9 @@ LRESULT CALLBACK FrameWndProc ( break; case WM_MOUSEMOVE: { - int x = LOWORD(lparam); - int y = HIWORD(lparam); + // MSDN: "WM_MOUSEMOVE message" : Do not use the LOWORD or HIWORD macros to extract the x- and y- coordinates... + int x = GET_X_LPARAM(lparam); + int y = GET_Y_LPARAM(lparam); int newover = (((x >= buttonx) && (x <= buttonx+BUTTONCX) && (y >= buttony) &&