summaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-17 21:09:08 +0000
committerrubidium <rubidium@openttd.org>2011-11-17 21:09:08 +0000
commit6e31c2f068180c16c1a7ece0f166c100bf4b4616 (patch)
tree95761c44f538faf74e7f65d750cca358d2cb67a7 /src/os
parentcc85ef493af3bb9af9bbbbed4a24048bc248669f (diff)
downloadopenttd-6e31c2f068180c16c1a7ece0f166c100bf4b4616.tar.xz
(svn r23241) -Codechange: make the decision when to go to the custom drawn cursor more prominently during the initialisation of OpenTTD
Diffstat (limited to 'src/os')
-rw-r--r--src/os/windows/win32.cpp12
-rw-r--r--src/os/windows/win32.h2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp
index 54c5c9cd3..39203cbca 100644
--- a/src/os/windows/win32.cpp
+++ b/src/os/windows/win32.cpp
@@ -28,14 +28,16 @@
#include <sys/stat.h>
static bool _has_console;
+static bool _cursor_disable = true;
+static bool _cursor_visible = true;
-static bool cursor_visible = true;
-
-bool MyShowCursor(bool show)
+bool MyShowCursor(bool show, bool toggle)
{
- if (cursor_visible == show) return show;
+ if (toggle) _cursor_disable = !_cursor_disable;
+ if (_cursor_disable) return show;
+ if (_cursor_visible == show) return show;
- cursor_visible = show;
+ _cursor_visible = show;
ShowCursor(show);
return !show;
diff --git a/src/os/windows/win32.h b/src/os/windows/win32.h
index 19f04d1f2..66c519973 100644
--- a/src/os/windows/win32.h
+++ b/src/os/windows/win32.h
@@ -13,7 +13,7 @@
#define WIN32_H
#include <windows.h>
-bool MyShowCursor(bool show);
+bool MyShowCursor(bool show, bool toggle = false);
typedef void (*Function)(int);
bool LoadLibraryList(Function proc[], const char *dll);