From 1676b3b46ffb137a686ca204fa00854a23b0e8f2 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Mon, 24 Nov 2014 14:53:28 +0100 Subject: [PATCH] Fix #218 erratic mouse behaviour --HG-- branch : hotfix --- code/ryzom/client/src/events_listener.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/code/ryzom/client/src/events_listener.cpp b/code/ryzom/client/src/events_listener.cpp index 89963a2ab..760a5dc08 100644 --- a/code/ryzom/client/src/events_listener.cpp +++ b/code/ryzom/client/src/events_listener.cpp @@ -184,8 +184,8 @@ void CEventsListener::operator()(const CEvent& event) } // NOTE: No 0, 0 center mouse message in Windows (lower mouse message rate), but safe to assume any movement messages are requeued relative to our new position - // In case free look bugs on other platform, we may need to push in our own message on setMousePos for Windows - if (s_MouseFreeLookWaitCenter) // scX == 0 && scY == 0) + bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3))); + if (s_MouseFreeLookWaitCenter && !outsideBounds) { // Centered, set last to 0 s_MouseFreeLookLastX = 0; @@ -204,8 +204,7 @@ void CEventsListener::operator()(const CEvent& event) // updateFreeLookPos is called in updateMouseSmoothing per frame // Center cursor - bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3))); - if (outsideBounds) + if (outsideBounds && !s_MouseFreeLookWaitCenter) { s_MouseFreeLookWaitCenter = true; Driver->setMousePos(0.5f, 0.5f);