Allow for quits during fade-in and splash screen (addresses #422)

Still can't quit during fade-outs, because the fading is not paused, and
affects the confirmation window too.  Bad times.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@1087 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
mcmartin
2003-07-26 05:15:52 +00:00
parent 38a37975fb
commit cbb902048a
3 changed files with 48 additions and 12 deletions
+33 -9
View File
@@ -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
+14 -3
View File
@@ -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;