summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2019-03-30 08:46:21 +0100
committerNiels Martin Hansen <nielsm@indvikleren.dk>2019-03-30 22:02:14 +0100
commit66c60e52bac69b752f1dd7b7c599577fcbfa17a1 (patch)
tree1b06441fdf302d3066eea00d206bbf42a76d7d84
parent0cf25e84df31401a38da462094c8fa576512369e (diff)
downloadopenttd-66c60e52bac69b752f1dd7b7c599577fcbfa17a1.tar.xz
Change: [SDL] Do not offer video smaller than 640x480
-rw-r--r--src/video/sdl_v.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 54502dfae..62bbb3301 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -223,6 +223,7 @@ static void GetVideoModes()
for (int i = 0; modes[i]; i++) {
uint w = modes[i]->w;
uint h = modes[i]->h;
+ if (w < 640 || h < 480) continue; // reject too small resolutions
int j;
for (j = 0; j < n; j++) {
if (_resolutions[j].width == w && _resolutions[j].height == h) break;
@@ -234,6 +235,7 @@ static void GetVideoModes()
if (++n == lengthof(_resolutions)) break;
}
}
+ if (n == 0) usererror("No usable screen resolutions found!\n");
_num_resolutions = n;
SortResolutions(_num_resolutions);
}