summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2008-02-17 17:00:43 +0000
committersmatz <smatz@openttd.org>2008-02-17 17:00:43 +0000
commitd3d126f9991fd71d2da431ad2c9ab98d44cc35e6 (patch)
tree8897308c424e55cc880f7283c6621d29d397c625 /src/video
parentd7a72c7002517c4818d60f4c45cdc6a3c4ccbf27 (diff)
downloadopenttd-d3d126f9991fd71d2da431ad2c9ab98d44cc35e6.tar.xz
(svn r12167) -Feature(tte): change colour of autorail and autoroad selection when Ctrl is pressed
Diffstat (limited to 'src/video')
-rw-r--r--src/video/cocoa/event.mm4
-rw-r--r--src/video/sdl_v.cpp5
-rw-r--r--src/video/win32_v.cpp5
3 files changed, 14 insertions, 0 deletions
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index 9302f13c8..3e8fc68c1 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -668,9 +668,13 @@ void QZ_GameLoop()
last_cur_ticks = cur_ticks;
next_tick = cur_ticks + 30;
+ bool old_ctrl_pressed = _ctrl_pressed;
+
_ctrl_pressed = !!(_current_mods & ( _patches.right_mouse_btn_emulation != RMBE_CONTROL ? NSControlKeyMask : NSCommandKeyMask));
_shift_pressed = !!(_current_mods & NSShiftKeyMask);
+ if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
+
GameLoop();
_screen.dst_ptr = _cocoa_subdriver->GetPixelBuffer();
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 25ce5a8c6..12478cfc9 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -490,6 +490,8 @@ void VideoDriver_SDL::MainLoop()
last_cur_ticks = cur_ticks;
next_tick = cur_ticks + 30;
+ bool old_ctrl_pressed = _ctrl_pressed;
+
_ctrl_pressed = !!(mod & KMOD_CTRL);
_shift_pressed = !!(mod & KMOD_SHIFT);
@@ -499,6 +501,9 @@ void VideoDriver_SDL::MainLoop()
(keys[SDLK_UP] ? 2 : 0) |
(keys[SDLK_RIGHT] ? 4 : 0) |
(keys[SDLK_DOWN] ? 8 : 0);
+
+ if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
+
GameLoop();
_screen.dst_ptr = _sdl_screen->pixels;
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index b0296199a..91f7439fa 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -856,6 +856,9 @@ void VideoDriver_Win32::MainLoop()
_realtime_tick += cur_ticks - last_cur_ticks;
last_cur_ticks = cur_ticks;
next_tick = cur_ticks + 30;
+
+ bool old_ctrl_pressed = _ctrl_pressed;
+
_ctrl_pressed = _wnd.has_focus && GetAsyncKeyState(VK_CONTROL)<0;
_shift_pressed = _wnd.has_focus && GetAsyncKeyState(VK_SHIFT)<0;
@@ -870,6 +873,8 @@ void VideoDriver_Win32::MainLoop()
_dirkeys = 0;
}
+ if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
+
GameLoop();
_cursor.delta.x = _cursor.delta.y = 0;