diff options
author | frosch <frosch@openttd.org> | 2015-02-22 23:06:45 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2015-02-22 23:06:45 +0000 |
commit | 352e528cdab81f1903f13260dedb34d1b113b6e8 (patch) | |
tree | 138854a4db9517f6455825ad79acdfbac9151d9d /src/video/allegro_v.cpp | |
parent | fece468d9678fd11ed5435286dd32353c61b1dcc (diff) | |
download | openttd-352e528cdab81f1903f13260dedb34d1b113b6e8.tar.xz |
(svn r27167) -Fix: [SDL, Windows] Right-mouse-button scrolling scrolled/jumped way to far, when OpenTTD lagged during mouse event processing.
Diffstat (limited to 'src/video/allegro_v.cpp')
-rw-r--r-- | src/video/allegro_v.cpp | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp index c75bcfb2e..01628f99c 100644 --- a/src/video/allegro_v.cpp +++ b/src/video/allegro_v.cpp @@ -388,22 +388,10 @@ static void PollEvent() } /* Mouse movement */ - int dx = mouse_x - _cursor.pos.x; - int dy = mouse_y - _cursor.pos.y; - if (dx != 0 || dy != 0) { - if (_cursor.fix_at) { - _cursor.delta.x = dx; - _cursor.delta.y = dy; - position_mouse(_cursor.pos.x, _cursor.pos.y); - } else { - _cursor.delta.x = dx; - _cursor.delta.y = dy; - _cursor.pos.x = mouse_x; - _cursor.pos.y = mouse_y; - _cursor.dirty = true; - } - mouse_action = true; + if (_cursor.UpdateCursorPosition(mouse_x, mouse_y, false)) { + position_mouse(_cursor.pos.x, _cursor.pos.y); } + if (_cursor.delta.x != 0 || _cursor.delta.y) mouse_action = true; static int prev_mouse_z = 0; if (prev_mouse_z != mouse_z) { |