summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-06-13 14:57:42 +0000
committerrubidium <rubidium@openttd.org>2007-06-13 14:57:42 +0000
commite64eede7171fbed1f92dbf402bfe393d8a2bdf6a (patch)
tree4ed718705f44ad283136fd6f4ddcf8cb06e92987 /src
parent0a4a4875fbcb4d3769fac83a987fc55e40bfba66 (diff)
downloadopenttd-e64eede7171fbed1f92dbf402bfe393d8a2bdf6a.tar.xz
(svn r10139) -Fix: all inner parts of OpenTTD assume that the resolution is at least 1 by 1, so force the resolution to be always at least 1 by 1.
Diffstat (limited to 'src')
-rw-r--r--src/openttd.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index c3983aee1..72dc622db 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -475,6 +475,11 @@ int ttd_main(int argc, char *argv[])
if (startyear != INVALID_YEAR) _patches_newgame.starting_year = startyear;
if (generation_seed != GENERATE_NEW_SEED) _patches_newgame.generation_seed = generation_seed;
+ /* The width and height must be at least 1 pixel, this
+ * way all internal drawing routines work correctly. */
+ if (_cur_resolution[0] == 0) _cur_resolution[0] = 1;
+ if (_cur_resolution[1] == 0) _cur_resolution[1] = 1;
+
#if defined(ENABLE_NETWORK)
if (dedicated_host) snprintf(_network_server_bind_ip_host, NETWORK_HOSTNAME_LENGTH, "%s", dedicated_host);
if (dedicated_port) _network_server_port = dedicated_port;