From aed4ae10a78320d847542b18c10498ae1cd4567e Mon Sep 17 00:00:00 2001 From: Chris Apers Date: Sun, 21 Jan 2007 14:18:24 +0000 Subject: Speed up mouse emulation with hires games svn-id: r25148 --- backends/platform/PalmOS/Src/base_mouse.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'backends') diff --git a/backends/platform/PalmOS/Src/base_mouse.cpp b/backends/platform/PalmOS/Src/base_mouse.cpp index 691d66605f..8e6d2724cb 100644 --- a/backends/platform/PalmOS/Src/base_mouse.cpp +++ b/backends/platform/PalmOS/Src/base_mouse.cpp @@ -45,17 +45,19 @@ bool OSystem_PalmBase::showMouse(bool visible) { void OSystem_PalmBase::simulate_mouse(Event &event, Int8 iHoriz, Int8 iVert, Coord *xr, Coord *yr) { Int16 x = _mouseCurState.x; Int16 y = _mouseCurState.y; - Int16 slow; + Int16 slow, fact; _lastKeyRepeat++; + fact = _screenWidth / 320; + fact = (fact) ? fact : 1; - if (_lastKeyRepeat > 32) - _lastKeyRepeat = 32; + if (_lastKeyRepeat > 32 * fact) + _lastKeyRepeat = 32 * fact; slow = (iHoriz && iVert) ? 2 : 1; - x += iHoriz * (_lastKeyRepeat >> 2) / slow; - y += iVert * (_lastKeyRepeat >> 2) / slow; + x += iHoriz * (_lastKeyRepeat >> 2) / slow * fact; + y += iVert * (_lastKeyRepeat >> 2) / slow * fact; x = (x < 0 ) ? 0 : x; x = (x >= _screenWidth ) ? _screenWidth - 1 : x; -- cgit v1.2.3