PSP: support mouse speed/joy deadzone options and smooth cursor motion

This commit is contained in:
rsn8887 2018-01-04 06:02:19 -06:00
parent 231407206d
commit 4e4a5892c8
4 changed files with 73 additions and 41 deletions

View file

@ -162,7 +162,7 @@ bool Cursor::increaseXY(int32 incX, int32 incY) {
int32 oldX = _x, oldY = _y;
// adjust for differences in X and Y
// adjust for screen resolution
adjustXYForScreenSize(incX, incY);
_x += incX;
@ -207,10 +207,6 @@ inline void Cursor::adjustXYForScreenSize(int32 &x, int32 &y) {
// resolutions and for x, which is wider.
int32 newX = x, newY = y;
// adjust width movement to match height (usually around 1.5)
if (_mouseLimitWidth >= _mouseLimitHeight + (_mouseLimitHeight >> 1))
newX = newX + (newX >> 1);
if (_mouseLimitWidth >= 600) { // multiply by 2
newX <<= 1;
newY <<= 1;
@ -218,16 +214,6 @@ inline void Cursor::adjustXYForScreenSize(int32 &x, int32 &y) {
newX = newX + (newX >> 1);
newY = newY + (newY >> 1);
}
// Divide all movements by 8
newX >>= 3;
newY >>= 3;
// Make sure we didn't destroy minimum movement
if (!((x && !newX) || (y && !newY))) {
x = newX;
y = newY;
}
}
// This is only called when we have a new screen