From 43534ac86db6d8a7d9383a39381fdbf70e7004a3 Mon Sep 17 00:00:00 2001 From: Peter Slattery Date: Tue, 4 Feb 2020 23:39:17 -0800 Subject: [PATCH] Fixed a problem with how we were handling mouse button states. --- src/win32_foldhaus.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/win32_foldhaus.cpp b/src/win32_foldhaus.cpp index 2685f37..be25e13 100644 --- a/src/win32_foldhaus.cpp +++ b/src/win32_foldhaus.cpp @@ -561,8 +561,6 @@ WinMain ( // // Set up worker threads - // - const s32 WorkerThreadCount = PLATFORM_THREAD_COUNT; worker_thread_info* WorkerThreads = 0; if (PLATFORM_THREAD_COUNT > 0) @@ -679,34 +677,32 @@ WinMain ( !((Mouse.LeftButtonState & KeyState_IsDown) > 0)) { Mouse.LeftButtonState = 0; - } else if (Mouse.LeftButtonState & KeyState_IsDown) + } + else if (Mouse.LeftButtonState & KeyState_IsDown) { Mouse.LeftButtonState |= KeyState_WasDown; } if (Mouse.MiddleButtonState & KeyState_WasDown && - !((Mouse.LeftButtonState & KeyState_IsDown) > 0)) + !((Mouse.MiddleButtonState & KeyState_IsDown) > 0)) { Mouse.MiddleButtonState = 0; - } else if (Mouse.MiddleButtonState & KeyState_IsDown) + } + else if (Mouse.MiddleButtonState & KeyState_IsDown) { Mouse.MiddleButtonState |= KeyState_WasDown; } if (Mouse.RightButtonState & KeyState_WasDown && - !((Mouse.LeftButtonState & KeyState_IsDown) > 0)) + !((Mouse.RightButtonState & KeyState_IsDown) > 0)) { Mouse.RightButtonState = 0; - } else if (Mouse.RightButtonState & KeyState_IsDown) + } + else if (Mouse.RightButtonState & KeyState_IsDown) { Mouse.RightButtonState |= KeyState_WasDown; } - - /////////////////////////////////// - // Finish Up - ////////////////////////////////// - HDC DeviceContext = GetDC(MainWindow.Handle); SwapBuffers(DeviceContext); ReleaseDC(MainWindow.Handle, DeviceContext);