mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 01:06:19 +00:00
Fix #218 erratic mouse behaviour
This commit is contained in:
parent
fd73b48d36
commit
c20bfb1b75
1 changed files with 3 additions and 4 deletions
|
@ -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
|
// 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
|
bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3)));
|
||||||
if (s_MouseFreeLookWaitCenter) // scX == 0 && scY == 0)
|
if (s_MouseFreeLookWaitCenter && !outsideBounds)
|
||||||
{
|
{
|
||||||
// Centered, set last to 0
|
// Centered, set last to 0
|
||||||
s_MouseFreeLookLastX = 0;
|
s_MouseFreeLookLastX = 0;
|
||||||
|
@ -204,8 +204,7 @@ void CEventsListener::operator()(const CEvent& event)
|
||||||
// updateFreeLookPos is called in updateMouseSmoothing per frame
|
// updateFreeLookPos is called in updateMouseSmoothing per frame
|
||||||
|
|
||||||
// Center cursor
|
// Center cursor
|
||||||
bool outsideBounds = ((abs(scX) > (drW >> 3)) || (abs(scY) > (drH >> 3)));
|
if (outsideBounds && !s_MouseFreeLookWaitCenter)
|
||||||
if (outsideBounds)
|
|
||||||
{
|
{
|
||||||
s_MouseFreeLookWaitCenter = true;
|
s_MouseFreeLookWaitCenter = true;
|
||||||
Driver->setMousePos(0.5f, 0.5f);
|
Driver->setMousePos(0.5f, 0.5f);
|
||||||
|
|
Loading…
Reference in a new issue