summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-19 22:27:43 +0000
committerrubidium <rubidium@openttd.org>2009-01-19 22:27:43 +0000
commit0893cb2adfd7eaa729058bdf903c3064c84f707c (patch)
tree664cb4e8bc33dd46d0714fba91555b279d7f58af /src
parent7a81c0e5b42a55ad5d84e51a91a414792e29a4b9 (diff)
downloadopenttd-0893cb2adfd7eaa729058bdf903c3064c84f707c.tar.xz
(svn r15156) -Fix: add scrollwheel support to allegro
Diffstat (limited to 'src')
-rw-r--r--src/video/allegro_v.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/allegro_v.cpp b/src/video/allegro_v.cpp
index 455c991d2..e0509aa52 100644
--- a/src/video/allegro_v.cpp
+++ b/src/video/allegro_v.cpp
@@ -381,6 +381,13 @@ static void PollEvent()
mouse_action = true;
}
+ static int prev_mouse_z = 0;
+ if (prev_mouse_z != mouse_z) {
+ _cursor.wheel = (prev_mouse_z - mouse_z) < 0 ? -1 : 1;
+ prev_mouse_z = mouse_z;
+ mouse_action = true;
+ }
+
if (mouse_action) HandleMouseEvents();
poll_keyboard();