diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 21c1bdc45..b95df910b 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Revert gfx settings entirely when a mode switch fails (bug #1056) - Alex - Fixed the Syreen lights-out scene timing (bug #1011) - Alex - Added a native error box for MacOSX (like we have for Windows) - Alex - Fix for weird colors problem on MacOSX w/ SDL 1.2.14; also improves diff --git a/sc2/src/libs/graphics/sdl/sdl_common.c b/sc2/src/libs/graphics/sdl/sdl_common.c index 8a9d5c758..ba634f3e5 100644 --- a/sc2/src/libs/graphics/sdl/sdl_common.c +++ b/sc2/src/libs/graphics/sdl/sdl_common.c @@ -860,16 +860,18 @@ TFB_FlushGraphics (void) // Only call from main thread!! case TFB_DRAWCOMMANDTYPE_REINITVIDEO: { int oldDriver = GraphicsDriver; + int oldFlags = GfxFlags; + int oldWidth = ScreenWidthActual; + int oldHeight = ScreenHeightActual; if (TFB_ReInitGraphics (DC.data.reinitvideo.driver, DC.data.reinitvideo.flags, DC.data.reinitvideo.width, DC.data.reinitvideo.height)) { log_add (log_Error, "Could not provide requested mode: " "reverting to last known driver."); - if (TFB_ReInitGraphics (oldDriver, - DC.data.reinitvideo.flags, - DC.data.reinitvideo.width, - DC.data.reinitvideo.height)) + // We don't know what exactly failed, so roll it all back + if (TFB_ReInitGraphics (oldDriver, oldFlags, + oldWidth, oldHeight)) { log_add (log_Fatal, "Couldn't reinit at that point either. "