summaryrefslogtreecommitdiff
path: root/src/video/sdl_v.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2008-01-01 14:20:48 +0000
committerbelugas <belugas@openttd.org>2008-01-01 14:20:48 +0000
commit3dd61f423ad6c79f319388625f2223d0e46a2f16 (patch)
tree4649001ed8ff619fb2275a558ad17a1e8a942a9c /src/video/sdl_v.cpp
parenta8611311ac842618f0be9e20b8339e7adbf86738 (diff)
downloadopenttd-3dd61f423ad6c79f319388625f2223d0e46a2f16.tar.xz
(svn r11734) -Change: Allow ToggleFullScreen to return the result of the operation' attempt. Previously, only visual clues were available.
-Fix[FS#1519]: When you can not use this resolution at full screen, now you'll know that it failed. As for the reason it did not work, each computer/OS has its reason.
Diffstat (limited to 'src/video/sdl_v.cpp')
-rw-r--r--src/video/sdl_v.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index 4461fbf32..cf0e9971d 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -521,14 +521,16 @@ bool VideoDriver_SDL::ChangeResolution(int w, int h)
return CreateMainSurface(w, h);
}
-void VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
+bool VideoDriver_SDL::ToggleFullscreen(bool fullscreen)
{
_fullscreen = fullscreen;
GetVideoModes(); // get the list of available video modes
if (_num_resolutions == 0 || !this->ChangeResolution(_cur_resolution[0], _cur_resolution[1])) {
// switching resolution failed, put back full_screen to original status
_fullscreen ^= true;
+ return false;
}
+ return true;
}
#endif /* WITH_SDL */