summaryrefslogtreecommitdiff
path: root/window.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-15 19:49:16 +0000
committerDarkvater <darkvater@openttd.org>2006-11-15 19:49:16 +0000
commitb713974cd885defceace4f786254fe2127158a23 (patch)
tree127efefd7a8dd0e7a066c8ff9994c1375571ca91 /window.c
parentd33605ff21d6f5f324051da628dde746c71b54ed (diff)
downloadopenttd-b713974cd885defceace4f786254fe2127158a23.tar.xz
(svn r7156) -Codechange: Remove obsolete variable, localize global variable, use GB and change logic
of the win32: TAB speeds up, but ALT+TAB doesn't code.
Diffstat (limited to 'window.c')
-rw-r--r--window.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/window.c b/window.c
index b2e91990b..6c39621bf 100644
--- a/window.c
+++ b/window.c
@@ -1422,8 +1422,8 @@ void HandleKeypress(uint32 key)
// Setup event
e.event = WE_KEYPRESS;
- e.we.keypress.ascii = key & 0xFF;
- e.we.keypress.keycode = key >> 16;
+ e.we.keypress.ascii = GB(key, 0, 8);
+ e.we.keypress.keycode = GB(key, 16, 16);
e.we.keypress.cont = true;
// check if we have a query string window open before allowing hotkeys
@@ -1597,15 +1597,12 @@ void InputLoop(void)
MouseLoop(click, mousewheel);
}
-
-static int _we4_timer;
-
void UpdateWindows(void)
{
Window *w;
- int t;
+ static int we4_timer = 0;
+ int t = we4_timer + 1;
- t = _we4_timer + 1;
if (t >= 100) {
for (w = _last_window; w != _windows;) {
w--;
@@ -1613,7 +1610,7 @@ void UpdateWindows(void)
}
t = 0;
}
- _we4_timer = t;
+ we4_timer = t;
for (w = _last_window; w != _windows;) {
w--;