diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-29 21:00:07 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2022-06-29 21:23:23 +0300 |
commit | 069304ca394d4d6069f00bb976f2d75e82bf675c (patch) | |
tree | f882ecf526effeda207d418049391a315b17cc2f /indra/llwindow/llwindowwin32.cpp | |
parent | f6515257a0cc405d6549c5d56302fb0d90176807 (diff) | |
parent | 1e4f2ec07e32a142f35817d3186a124df3f8cd25 (diff) |
Merge branch 'master' (DRTVWR-543) into DRTVWR-559
# Conflicts:
# autobuild.xml
# indra/llrender/llgl.cpp
# indra/newview/CMakeLists.txt
# indra/newview/llvovolume.cpp
Diffstat (limited to 'indra/llwindow/llwindowwin32.cpp')
-rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 67c50294e1..1f23040260 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3058,8 +3058,20 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_ if (raw->header.dwType == RIM_TYPEMOUSE) { LLMutexLock lock(&window_imp->mRawMouseMutex); - window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; - window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + + S32 speed; + const S32 DEFAULT_SPEED(10); + SystemParametersInfo(SPI_GETMOUSESPEED, 0, &speed, 0); + if (speed == DEFAULT_SPEED) + { + window_imp->mRawMouseDelta.mX += raw->data.mouse.lLastX; + window_imp->mRawMouseDelta.mY -= raw->data.mouse.lLastY; + } + else + { + window_imp->mRawMouseDelta.mX += round((F32)raw->data.mouse.lLastX * (F32)speed / DEFAULT_SPEED); + window_imp->mRawMouseDelta.mY -= round((F32)raw->data.mouse.lLastY * (F32)speed / DEFAULT_SPEED); + } } } } |