From fed093879282fac03c4fdcaa0aac519de468f1e1 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Tue, 26 Jan 2010 20:10:12 +0100 Subject: Fixed crash when failing to switch to fullscreen/windowed The setup page tries to restore the previous video mode by calling setFullscreen again after it has failed. However, the setFullscreen function assumed a valid mode was set (it referenced mScreen). This would then crash. Worked around by remembering the parameters passed to setVideoMode, and using those in setFullscreen. Besides fixing a potential crash, this also fixes switching between fullscreen and windowed on Maemo 5. Probably trying to keep the color depth the same was what made it fail (which is not necessary anyway). --- src/graphics.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h index b8e87af1..b9b2b1d5 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -195,7 +195,11 @@ class Graphics : public gcn::SDLGraphics protected: SDL_Surface *mScreen; - bool mFullscreen, mHWAccel; + int mWidth; + int mHeight; + int mBpp; + bool mFullscreen; + bool mHWAccel; }; extern Graphics *graphics; -- cgit v1.2.3-70-g09d2