Fixed a problem with how we were handling mouse button states.

This commit is contained in:
Peter Slattery 2020-02-04 23:39:17 -08:00
parent 3d9851fbe2
commit 43534ac86d
1 changed files with 8 additions and 12 deletions

View File

@ -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);