summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 5cd5eba37..af1f77f4e 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -596,11 +596,12 @@ int ttd_main(int argc, char *argv[])
/*
* The width and height must be at least 1 pixel and width times
- * height must still fit within a 32 bits integer, this way all
- * internal drawing routines work correctly.
+ * height times bytes per pixel must still fit within a 32 bits
+ * integer, even for 32 bpp video modes. This way all internal
+ * drawing routines work correctly.
*/
- _cur_resolution.width = ClampU(_cur_resolution.width, 1, UINT16_MAX);
- _cur_resolution.height = ClampU(_cur_resolution.height, 1, UINT16_MAX);
+ _cur_resolution.width = ClampU(_cur_resolution.width, 1, UINT16_MAX / 2);
+ _cur_resolution.height = ClampU(_cur_resolution.height, 1, UINT16_MAX / 2);
/* enumerate language files */
InitializeLanguagePacks();