diff --git a/Changelog.md b/Changelog.md index 08d1446e..de022818 100644 --- a/Changelog.md +++ b/Changelog.md @@ -13,6 +13,10 @@ Note: Numbers starting with a "#" like #330 refer to the bugreport with that num * Fix bugs on 64bit Big Endian platforms (#472, #625) * Fixes for high-poly models (use heap allocation instead of `alloca()` for big buffers; #528) * Fix building dhewm3ded with newer OpenAL Soft headers (#633) +* Better support for High-DPI mice: + - Don't ignore mouse input on fast movement ("ridiculous mouse delta"), #616 + - Allow setting sensitivity to values `< 1` in the dhewm3 settings menu to allow sane speeds + for looking around with High-DPI mice (otherwise it might be way too fast) * Fix a crash (assertion) on start with ImGui if `SDL_GetWindowDisplayIndex()` or `SDL_GetDisplayDPI()` failed and the `imgui_scale` CVar was set to the default value of `-1` (setting it to `1` worked around the bug; #632) diff --git a/neo/framework/Dhewm3SettingsMenu.cpp b/neo/framework/Dhewm3SettingsMenu.cpp index 189f2f63..425e732f 100644 --- a/neo/framework/Dhewm3SettingsMenu.cpp +++ b/neo/framework/Dhewm3SettingsMenu.cpp @@ -1546,7 +1546,7 @@ static void DrawOptions(CVarOption options[], int numOptions) static CVarOption controlOptions[] = { CVarOption("Mouse Settings"), - CVarOption("sensitivity", "Sensitivity", OT_FLOAT, 1.0f, 30.0f), + CVarOption("sensitivity", "Sensitivity", OT_FLOAT, 0.01f, 30.0f), CVarOption("m_smooth", "Smoothing Samples", OT_INT, 1, 8), CVarOption("in_nograb", "Don't grab Mouse Cursor (for debugging/testing)", OT_BOOL), CVarOption("m_invertLook", [](idCVar& cvar) { diff --git a/neo/framework/UsercmdGen.cpp b/neo/framework/UsercmdGen.cpp index 6d664e4c..c03340ea 100644 --- a/neo/framework/UsercmdGen.cpp +++ b/neo/framework/UsercmdGen.cpp @@ -677,8 +677,17 @@ void idUsercmdGenLocal::MouseMove( void ) { historyCounter++; if ( idMath::Fabs( mx ) > 1000 || idMath::Fabs( my ) > 1000 ) { - Sys_DebugPrintf( "idUsercmdGenLocal::MouseMove: Ignoring ridiculous mouse delta.\n" ); - mx = my = 0; + // DG: This caused problems with High-DPI mice - there those values can legitimately happen. + // If it turns out that spurious big values happen for other reasons, we'll + // need a smarter check. Leaving the Sys_DebugPrintf() here to make detecting + // those cases easier, but added a static bool so High DPI mice don't spam the log. + static bool warningShown = false; + if ( !warningShown ) { + warningShown = true; + Sys_DebugPrintf( "idUsercmdGenLocal::MouseMove: Detected ridiculous mouse delta (expected with High DPI mice, though!).\n" ); + } + + //mx = my = 0; } mx *= sensitivity.GetFloat();