Revert graphics settings entirely when a mode switch fails; bug #1056

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3256 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-10-26 20:59:14 +00:00
parent 7c75c31291
commit 7d276bc796
2 changed files with 7 additions and 4 deletions
+1
View File
@@ -1,4 +1,5 @@
Changes towards version 0.7: 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 - Fixed the Syreen lights-out scene timing (bug #1011) - Alex
- Added a native error box for MacOSX (like we have for Windows) - 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 - Fix for weird colors problem on MacOSX w/ SDL 1.2.14; also improves
+6 -4
View File
@@ -860,16 +860,18 @@ TFB_FlushGraphics (void) // Only call from main thread!!
case TFB_DRAWCOMMANDTYPE_REINITVIDEO: case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
{ {
int oldDriver = GraphicsDriver; int oldDriver = GraphicsDriver;
int oldFlags = GfxFlags;
int oldWidth = ScreenWidthActual;
int oldHeight = ScreenHeightActual;
if (TFB_ReInitGraphics (DC.data.reinitvideo.driver, if (TFB_ReInitGraphics (DC.data.reinitvideo.driver,
DC.data.reinitvideo.flags, DC.data.reinitvideo.flags,
DC.data.reinitvideo.width, DC.data.reinitvideo.height)) DC.data.reinitvideo.width, DC.data.reinitvideo.height))
{ {
log_add (log_Error, "Could not provide requested mode: " log_add (log_Error, "Could not provide requested mode: "
"reverting to last known driver."); "reverting to last known driver.");
if (TFB_ReInitGraphics (oldDriver, // We don't know what exactly failed, so roll it all back
DC.data.reinitvideo.flags, if (TFB_ReInitGraphics (oldDriver, oldFlags,
DC.data.reinitvideo.width, oldWidth, oldHeight))
DC.data.reinitvideo.height))
{ {
log_add (log_Fatal, log_add (log_Fatal,
"Couldn't reinit at that point either. " "Couldn't reinit at that point either. "