shithub: choc

Download patch

ref: 9972c330a53315b3cf7e20dcca562f4fa8c26b89
parent: 1e693bd3ee4ad2754476e5a216dc8f136db23498
author: Simon Howard <[email protected]>
date: Mon Mar 25 05:49:10 EDT 2019

Fix mouse speed box in accelerating case.

This got broken in #797. The calculation in the accelerating case when
the speed is below the threshold is not the same as in the
non-accelerating case. This was causing the thermometer to be very low
when below the threshold rather than a smooth transition.

--- a/src/v_video.c
+++ b/src/v_video.c
@@ -959,8 +959,12 @@
 
     // Calculate line length
 
-    if (draw_acceleration && speed >= mouse_threshold)
+    if (!draw_acceleration)
     {
+        linelen = speed / linelen_multiplier;
+    }
+    else if (speed >= mouse_threshold)
+    {
         // Undo acceleration and get back the original mouse speed
         original_speed = speed - mouse_threshold;
         original_speed = (int) (original_speed / mouse_acceleration);
@@ -970,7 +974,7 @@
     }
     else
     {
-        linelen = speed / linelen_multiplier;
+        linelen = (speed * redline_x) / mouse_threshold;
     }
 
     // Draw horizontal "thermometer"