Fixed crash when failing to switch to fullscreen/windowed
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>
Tue, 26 Jan 2010 19:10:12 +0000 (20:10 +0100)
committerTametomo <irarice@gmail.com>
Wed, 27 Jan 2010 01:41:28 +0000 (18:41 -0700)
commite846bad0558362af8693a6994b947d342475450e
treeeca97388d744b772837e02ee4995aafe6f42cc5a
parent021875c6bdcf5c5c5ae57d011a49bcca5df07d73
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).

CHANGES FROM ORIGINAL COMMIT: Some extra cleanups for our own formatting
                              rules, as well as merging and fixing the
                              resizing code, as needed from this commit's
                              changes.

Signed-off-by: Tametomo <irarice@gmail.com>
src/bindings/guichan/graphics.cpp
src/bindings/guichan/graphics.h
src/bindings/guichan/opengl/openglgraphics.cpp
src/bindings/guichan/opengl/openglgraphics.h
src/bindings/guichan/sdl/sdlgraphics.cpp
src/bindings/guichan/sdl/sdlgraphics.h