Reverts if you can't produce a graphics mode requested from setup menu
Fixes bug #695. git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1600 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+3
-1
@@ -1,6 +1,8 @@
|
||||
Changes towards version 0.4:
|
||||
- Attempting to set to a mode that Doesn't Work in Setup no longer ends
|
||||
the program (bug #695) - Michael
|
||||
- Fixed segfault when shutting down because video could not be initialized
|
||||
(bug #683), - Michael
|
||||
(bug #683) - Michael
|
||||
- Fixed crash when restarting Sa-Matra battle after abort (bug #700) -Alex
|
||||
- Some cleanups, enabling successful build with GCC 4 (bug #710),
|
||||
mostly from Ville Skyttà - SvdB
|
||||
|
||||
@@ -732,10 +732,24 @@ TFB_FlushGraphics () // Only call from main thread!!
|
||||
ClearSemaphore (DC.data.sendsignal.sem);
|
||||
break;
|
||||
case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
|
||||
TFB_ReInitGraphics (DC.data.reinitvideo.driver, DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height,
|
||||
DC.data.reinitvideo.bpp);
|
||||
break;
|
||||
{
|
||||
int oldDriver = GraphicsDriver;
|
||||
int oldBpp = ScreenColorDepth;
|
||||
if (TFB_ReInitGraphics (DC.data.reinitvideo.driver, DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height,
|
||||
DC.data.reinitvideo.bpp))
|
||||
{
|
||||
fprintf (stderr, "Could not provide requested mode: reverting to last known driver and bpp.\n");
|
||||
if (TFB_ReInitGraphics (oldDriver, DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height,
|
||||
oldBpp))
|
||||
{
|
||||
fprintf (stderr, "Couldn't reinit at that point either. Your video has been somehow tied in knots.\n");
|
||||
exit (-1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user