diff options
author | Darkvater <Darkvater@openttd.org> | 2006-11-15 21:01:19 +0000 |
---|---|---|
committer | Darkvater <Darkvater@openttd.org> | 2006-11-15 21:01:19 +0000 |
commit | acc87fc9f07fedc993e20519bec35474154f4167 (patch) | |
tree | 5ba9323bfd824f096f19b533df5deb1a2d4ba669 /video | |
parent | 3328ceea9e8dd9f270a9f7e9cc72ea5ab3397a0e (diff) | |
download | openttd-acc87fc9f07fedc993e20519bec35474154f4167.tar.xz |
(svn r7157) -Fix [FS#221, SF1168820]: Some mouse events possibly lost under high CPU load, handle
mouse input right away instead of waiting for GameLoop. (KUDr)
Diffstat (limited to 'video')
-rw-r--r-- | video/cocoa_v.m | 3 | ||||
-rw-r--r-- | video/sdl_v.c | 3 | ||||
-rw-r--r-- | video/win32_v.c | 7 |
3 files changed, 13 insertions, 0 deletions
diff --git a/video/cocoa_v.m b/video/cocoa_v.m index e10e87dc2..bf9468873 100644 --- a/video/cocoa_v.m +++ b/video/cocoa_v.m @@ -404,6 +404,7 @@ static void QZ_MouseMovedEvent(int x, int y) _cursor.pos.y = y; _cursor.dirty = true; } + HandleMouseEvents(); } @@ -417,6 +418,7 @@ static void QZ_MouseButtonEvent(int button, BOOL down) _left_button_down = false; _left_button_clicked = false; } + HandleMouseEvents(); break; case 1: @@ -426,6 +428,7 @@ static void QZ_MouseButtonEvent(int button, BOOL down) } else { _right_button_down = false; } + HandleMouseEvents(); break; } } diff --git a/video/sdl_v.c b/video/sdl_v.c index f72d620fe..0b4ae25f7 100644 --- a/video/sdl_v.c +++ b/video/sdl_v.c @@ -325,6 +325,7 @@ static int PollEvent(void) _cursor.pos.y = ev.motion.y; _cursor.dirty = true; } + HandleMouseEvents(); break; case SDL_MOUSEBUTTONDOWN: @@ -347,6 +348,7 @@ static int PollEvent(void) default: break; } + HandleMouseEvents(); break; case SDL_MOUSEBUTTONUP: @@ -360,6 +362,7 @@ static int PollEvent(void) } else if (ev.button.button == SDL_BUTTON_RIGHT) { _right_button_down = false; } + HandleMouseEvents(); break; case SDL_ACTIVEEVENT: diff --git a/video/win32_v.c b/video/win32_v.c index bef30e271..1894e7a24 100644 --- a/video/win32_v.c +++ b/video/win32_v.c @@ -266,23 +266,27 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP case WM_LBUTTONDOWN: SetCapture(hwnd); _left_button_down = true; + HandleMouseEvents(); return 0; case WM_LBUTTONUP: ReleaseCapture(); _left_button_down = false; _left_button_clicked = false; + HandleMouseEvents(); return 0; case WM_RBUTTONDOWN: SetCapture(hwnd); _right_button_down = true; _right_button_clicked = true; + HandleMouseEvents(); return 0; case WM_RBUTTONUP: ReleaseCapture(); _right_button_down = false; + HandleMouseEvents(); return 0; case WM_MOUSELEAVE: @@ -290,6 +294,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP _cursor.in_window = false; if (!_left_button_down && !_right_button_down) MyShowCursor(true); + HandleMouseEvents(); return 0; case WM_MOUSEMOVE: { @@ -337,6 +342,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP _cursor.dirty = true; } MyShowCursor(false); + HandleMouseEvents(); return 0; } @@ -483,6 +489,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP } else if (delta > 0) { _cursor.wheel--; } + HandleMouseEvents(); return 0; } |