diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 2253f9857..2e7208b50 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.3: +- Can use F10 to quit during splash screen as well as main menu -Michael - Fixed starship location when being teleported from Procyon to the Earth Starbase after the Precursor bomb is installed. - Svdb - Crew death on planet is now counted properly in all cases (bug #70) -Mika diff --git a/sc2/src/sc2code/fmv.c b/sc2/src/sc2code/fmv.c index 9276f3c33..6158b0bca 100644 --- a/sc2/src/sc2code/fmv.c +++ b/sc2/src/sc2code/fmv.c @@ -89,19 +89,45 @@ Introduction (void) FlushInput (); + LoadMasterShipList (); + InitGameKernel (); xform_buf[0] = FadeAllToColor; TimeOut = XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2); - LoadMasterShipList (); - SleepThreadUntil (TimeOut); + while ((GetTimeCounter () <= TimeOut) && + !(GLOBAL (CurrentActivity) & CHECK_ABORT)) + { + UpdateInputState (); + TaskSwitch (); + } + if (GLOBAL (CurrentActivity) & CHECK_ABORT) + { + return; + } - GLOBAL (CurrentActivity) |= CHECK_ABORT; + /* There was a forcible setting of CHECK_ABORT here. I cannot + * find any purpose for this that DoRestart doesn't handle + * better (forcing all other threads but this one to quit out, + * I believe), and have thus removed it. It was interfering + * with the proper operation of the quit operation. + * --Michael */ + TimeOut += ONE_SECOND * 3; while (!(InputState = AnyButtonPress (FALSE)) && - (TaskSwitch (), GetTimeCounter ()) <= TimeOut) - { - // - } + (GetTimeCounter () <= TimeOut) && + !(GLOBAL (CurrentActivity) & CHECK_ABORT)) + { + TaskSwitch (); + } + if (GLOBAL (CurrentActivity) & CHECK_ABORT) + { + return; + } GLOBAL (CurrentActivity) &= ~CHECK_ABORT; + + /* You can't try to quit during a fade to black, because if + * you try, the confirmation window will fade to black too. + * Fixing this will require a rewrite of our whole rendering + * engine. -- Michael */ xform_buf[0] = FadeAllToBlack; SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); @@ -112,8 +138,6 @@ Introduction (void) DoFMV (play_intro ? "intro" : "drumall", NULL, TRUE); play_intro = !play_intro; } - - InitGameKernel (); } void diff --git a/sc2/src/sc2code/restart.c b/sc2/src/sc2code/restart.c index f9f388c2f..7db251525 100644 --- a/sc2/src/sc2code/restart.c +++ b/sc2/src/sc2code/restart.c @@ -84,7 +84,7 @@ DWORD InTime; static BOOLEAN DoRestart (PMENU_STATE pMS) { - /* Cancel any presses of the Pause or Exit keys. */ + /* Cancel any presses of the Pause key. */ GamePaused = FALSE; if (!pMS->Initialized) @@ -94,8 +94,13 @@ DoRestart (PMENU_STATE pMS) { BYTE clut_buf[] = {FadeAllToColor}; - - SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2)); + DWORD TimeOut = XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2); + while ((GetTimeCounter () <= TimeOut) && + !(GLOBAL (CurrentActivity) & CHECK_ABORT)) + { + UpdateInputState (); + TaskSwitch (); + } } } #ifdef TESTING @@ -175,7 +180,13 @@ TimedOut: LastActivity = GLOBAL (CurrentActivity); GLOBAL (CurrentActivity) = 0; if (LastActivity == (ACTIVITY)~0) + { Introduction (); + if (GLOBAL (CurrentActivity) & CHECK_ABORT) + { + TFB_Abort (); + } + } memset ((PMENU_STATE)&MenuState, 0, sizeof (MenuState)); MenuState.InputFunc = DoRestart;