summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-06 09:37:26 +0000
committerrubidium <rubidium@openttd.org>2011-11-06 09:37:26 +0000
commit1f823f89a15661cdeedaaee9e036b137afc674df (patch)
tree52cc0830f74638399ad1dac7076f10497623c05e
parent18d1345d1c1727377eb8f2880fcd33213fa52801 (diff)
downloadopenttd-1f823f89a15661cdeedaaee9e036b137afc674df.tar.xz
(svn r23123) -Fix [FS#4790] (r22792): variable was initialised at the wrong moment making things with the cursor go wrong
-rw-r--r--src/openttd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 9d729fd2f..83545cb89 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -400,7 +400,6 @@ struct AfterNewGRFScan : NewGRFScanCallback {
/* initialize the ingame console */
IConsoleInit();
- _cursor.in_window = true;
InitializeGUI();
IConsoleCmdExec("exec scripts/autoexec.scr 0");
@@ -667,6 +666,12 @@ int ttd_main(int argc, char *argv[])
_cur_resolution.width = ClampU(_cur_resolution.width, 1, UINT16_MAX / 2);
_cur_resolution.height = ClampU(_cur_resolution.height, 1, UINT16_MAX / 2);
+ /* Assume the cursor starts within the game as not all video drivers
+ * get an event that the cursor is within the window when it is opened.
+ * Saying the cursor is there makes no visible difference as it would
+ * just be out of the bounds of the window. */
+ _cursor.in_window = true;
+
/* enumerate language files */
InitializeLanguagePacks();