diff options
author | Jamieson Christian | 2003-09-27 23:41:57 +0000 |
---|---|---|
committer | Jamieson Christian | 2003-09-27 23:41:57 +0000 |
commit | 072bf0f47626bfb4122b95605426eff3c8d23eb0 (patch) | |
tree | 3ed0cdbde2d29b450c654406f58e8b0d685d8de9 /backends/sdl/sdl.cpp | |
parent | b2b9a7cb07a24124e4ea3877a72d44cff7bcbff7 (diff) | |
download | scummvm-rg350-072bf0f47626bfb4122b95605426eff3c8d23eb0.tar.gz scummvm-rg350-072bf0f47626bfb4122b95605426eff3c8d23eb0.tar.bz2 scummvm-rg350-072bf0f47626bfb4122b95605426eff3c8d23eb0.zip |
Fixed program crash when trying to switch to a
video mode that isn't supported (such as going
to fullscreen under COMI with a 3x scaler and
a video card that doesn't like 1920x1440 LOL).
The program still terminates when this happens,
due to the suboptimal way we make the switch to
another video mode. (By the time we find out
that we can't make the switch, it's too late to
revert back). But at least it doesn't crash.
svn-id: r10449
Diffstat (limited to 'backends/sdl/sdl.cpp')
-rw-r--r-- | backends/sdl/sdl.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 9118830a39..c4eed72bc3 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -134,8 +134,19 @@ void OSystem_SDL::load_gfx_mode() { _hwscreen = SDL_SetVideoMode(_screenWidth * _scaleFactor, (_adjustAspectRatio ? 240 : _screenHeight) * _scaleFactor, 16, _full_screen ? (SDL_FULLSCREEN|SDL_SWSURFACE) : SDL_SWSURFACE ); - if (_hwscreen == NULL) - error("_hwscreen failed"); + if (_hwscreen == NULL) { + // DON'T use error(), as this tries to bring up the debug + // console, which WON'T WORK now that _hwscreen is hosed. + + // FIXME: We should be able to continue the game without + // shutting down or bringing up the debug console, but at + // this point we've already screwed up all our member vars. + // We need to find a way to call SDL_VideoModeOK *before* + // that happens and revert to all the old settings if we + // can't pull off the switch to the new settings. + warning("SDL_SetVideoMode says we can't switch to that mode"); + quit(); + } // // Create the surface used for the graphics in 16 bit before scaling, and also the overlay |