From 352e528cdab81f1903f13260dedb34d1b113b6e8 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 22 Feb 2015 23:06:45 +0000 Subject: (svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing. --- src/video/sdl_v.cpp | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'src/video/sdl_v.cpp') diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index d59ab20d4..ea68c2165 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -545,20 +545,8 @@ int VideoDriver_SDL::PollEvent() switch (ev.type) { case SDL_MOUSEMOTION: - if (_cursor.fix_at) { - int dx = ev.motion.x - _cursor.pos.x; - int dy = ev.motion.y - _cursor.pos.y; - if (dx != 0 || dy != 0) { - _cursor.delta.x = dx; - _cursor.delta.y = dy; - SDL_CALL SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y); - } - } else { - _cursor.delta.x = ev.motion.x - _cursor.pos.x; - _cursor.delta.y = ev.motion.y - _cursor.pos.y; - _cursor.pos.x = ev.motion.x; - _cursor.pos.y = ev.motion.y; - _cursor.dirty = true; + if (_cursor.UpdateCursorPosition(ev.motion.x, ev.motion.y, true)) { + SDL_CALL SDL_WarpMouse(_cursor.pos.x, _cursor.pos.y); } HandleMouseEvents(); break; -- cgit v1.2.3-54-g00ecf