[Scummvm-git-logs] scummvm master -> 4931f6405b964200ebae1b1f63c12fd197c3b641
OMGPizzaGuy
noreply at scummvm.org
Tue Apr 30 12:59:11 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4931f6405b ULTIMA8: Adjust run and walk threshold calculation.
Commit: 4931f6405b964200ebae1b1f63c12fd197c3b641
https://github.com/scummvm/scummvm/commit/4931f6405b964200ebae1b1f63c12fd197c3b641
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-04-30T07:58:46-05:00
Commit Message:
ULTIMA8: Adjust run and walk threshold calculation.
Previous calculation only used half the range of 0-255.
Changed paths:
engines/ultima/ultima8/kernel/mouse.cpp
diff --git a/engines/ultima/ultima8/kernel/mouse.cpp b/engines/ultima/ultima8/kernel/mouse.cpp
index c0fa5a2dc48..242e0d86ef6 100644
--- a/engines/ultima/ultima8/kernel/mouse.cpp
+++ b/engines/ultima/ultima8/kernel/mouse.cpp
@@ -58,8 +58,8 @@ Mouse::Mouse() : _lastMouseFrame(-1), _flashingCursorTime(0), _mouseOverGump(0),
// space to make the large cursor without having to hit the edge.
// Walk & run threshold range of 0-255
- ConfMan.registerDefault("walk_threshold", 24);
- ConfMan.registerDefault("run_threshold", 80);
+ ConfMan.registerDefault("walk_threshold", 50);
+ ConfMan.registerDefault("run_threshold", 160);
_walkThreshold = CLIP<int>(ConfMan.getInt("walk_threshold"), 0, 255);
_runThreshold = CLIP<int>(ConfMan.getInt("run_threshold"), 0, 255);
@@ -164,16 +164,16 @@ int Mouse::getMouseLength(int mx, int my) const {
// Reference point is the center of the screen
int dx = abs(mx - dims.width() / 2);
int dy = abs((dims.height() / 2) - my);
- int xmed = dims.width() * _runThreshold / 255;
- int ymed = dims.height() * _runThreshold / 255;
+ int xmed = dims.width() / 2 * _runThreshold / 255;
+ int ymed = dims.height() / 2 * _runThreshold / 255;
if (dx > xmed || dy > ymed)
return 2;
// For short cursor, reference point is near the avatar's feet
dy = abs((dims.height() / 2 + 14) - my); //! constant
- int xshort = dims.width() * _walkThreshold / 255;
- int yshort = dims.height() * _walkThreshold / 255;
+ int xshort = dims.width() / 2 * _walkThreshold / 255;
+ int yshort = dims.height() / 2 * _walkThreshold / 255;
if (dx > xshort || dy > yshort)
return 1;
More information about the Scummvm-git-logs
mailing list