mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-18 23:42:26 +00:00
Don't ignore "ridiculous mouse deltas", allow sensitivity < 1.0
Modern mice support ridiculously high DPI values, >20'000. Not sure what that's actually good for, but if people use that, they ran into the "idUsercmdGenLocal::MouseMove: Ignoring ridiculous mouse delta" case which just threw away the mouse input values so the game didn't respond to mouse input anymore or at least felt choppy. I'm not sure what that code was originally good for, under which (undesired) circumstances that happened, but for now it's disabled, only the warning is still logged, but only once. For these high DPI values to still be usable (camera not moving way too fast), it probably makes sense if the mouse sensitivity can be set to values < 1.0. The CVar always supported that, but I adjusted the Dhewm3SettingsMenu so it sensitivity can also be set to values between 0.01 and 1 there (still going up to 30, like before). fixes #616
This commit is contained in:
parent
56c1a093e5
commit
ce4e6f076f
3 changed files with 16 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue