diff options
author | rubidium <rubidium@openttd.org> | 2006-12-03 17:42:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2006-12-03 17:42:56 +0000 |
commit | 5fffa66b71c395da722ff109b5bb37f9ca35d963 (patch) | |
tree | 72ffedf306e22a23e8271d6191eddefb7710a910 /gfx.c | |
parent | 231111ce3d3d37c05a71591a4760a6dc95beac69 (diff) | |
download | openttd-5fffa66b71c395da722ff109b5bb37f9ca35d963.tar.xz |
(svn r7332) -Fix: segmentation fault, discovered by ln-, in the SDL video driver when one goes to fullscreen and there are no suitable resolutions.
Diffstat (limited to 'gfx.c')
-rw-r--r-- | gfx.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -15,6 +15,7 @@ #include "table/control_codes.h" #include "fontcache.h" #include "genworld.h" +#include "debug.h" #ifdef _DEBUG bool _dbg_screen_rect; @@ -1998,7 +1999,13 @@ bool ChangeResInGame(int w, int h) _video_driver->change_resolution(w, h); } -void ToggleFullScreen(bool fs) {_video_driver->toggle_fullscreen(fs);} +void ToggleFullScreen(bool fs) +{ + _video_driver->toggle_fullscreen(fs); + if (_fullscreen != fs && _num_resolutions == 0) { + DEBUG(misc, 0) ("Could not find a suitable fullscreen resolution."); + } +} static int CDECL compare_res(const void *pa, const void *pb) { |