summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-09 16:05:24 +0000
committerrubidium <rubidium@openttd.org>2009-11-09 16:05:24 +0000
commitcbf4b80b86a3fec2e8021e618fd828e9953c464b (patch)
treecfaf9c230f443b972a7eeb6281bf2e3a3b947d82 /src
parent85a910f02e6dd835354d11353f27f99e56ff4f1e (diff)
downloadopenttd-cbf4b80b86a3fec2e8021e618fd828e9953c464b.tar.xz
(svn r18030) -Fix: screen jumped a bit for at least SDL and Allegro when right-click-dragging
Diffstat (limited to 'src')
-rw-r--r--src/smallmap_gui.cpp2
-rw-r--r--src/video/win32_v.cpp1
-rw-r--r--src/window.cpp7
3 files changed, 6 insertions, 4 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index 3d0bda3b0..fd4449599 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -1064,8 +1064,6 @@ public:
if (widget == SM_WIDGET_MAP) {
if (_scrolling_viewport) return;
_scrolling_viewport = true;
- _cursor.delta.x = 0;
- _cursor.delta.y = 0;
}
}
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index efa4295ed..31cc01471 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -879,7 +879,6 @@ void VideoDriver_Win32::MainLoop()
if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
GameLoop();
- _cursor.delta.x = _cursor.delta.y = 0;
if (_force_full_redraw) MarkWholeScreenDirty();
diff --git a/src/window.cpp b/src/window.cpp
index a336d6585..30ce10192 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2197,7 +2197,7 @@ static void HandleKeyScrolling()
}
}
-void MouseLoop(MouseClick click, int mousewheel)
+static void MouseLoop(MouseClick click, int mousewheel)
{
DecreaseWindowCounters();
HandlePlacePresize();
@@ -2340,6 +2340,11 @@ void HandleMouseEvents()
}
MouseLoop(click, mousewheel);
+
+ /* We have moved the mouse the required distance,
+ * no need to move it at any later time. */
+ _cursor.delta.x = 0;
+ _cursor.delta.y = 0;
}
/**