From a69969d6f99fda01624be0395553315f247bef5e Mon Sep 17 00:00:00 2001 From: cutealien Date: Thu, 22 Sep 2022 21:34:08 +0000 Subject: [PATCH] Fix MouseButtonStates for mouse events in CIrrDeviceSDL when middle or right button are released Needed to use bitwise not instead of logical not to clear bits for EMBSM_RIGHT and EMBSM_MIDDLE. Thanks @gcc for it's warnings git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6423 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CIrrDeviceSDL.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 0a0f371d..d0a21cd0 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -335,7 +335,7 @@ bool CIrrDeviceSDL::run() else { irrevent.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP; - MouseButtonStates &= !irr::EMBSM_RIGHT; + MouseButtonStates &= ~irr::EMBSM_RIGHT; } break; @@ -348,7 +348,7 @@ bool CIrrDeviceSDL::run() else { irrevent.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP; - MouseButtonStates &= !irr::EMBSM_MIDDLE; + MouseButtonStates &= ~irr::EMBSM_MIDDLE; } break;