Screen fade task retired; also replace XFormColorMap() hacks with a separate new call FadeScreen()

git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3412 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
avolkov
2009-12-10 08:23:51 +00:00
parent 2d13f9a9d7
commit 1d508c0b4c
16 changed files with 102 additions and 192 deletions
+3 -2
View File
@@ -258,7 +258,7 @@ extern HOT_SPOT MAKE_HOT_SPOT (COORD, COORD);
extern INTERSECT_CODE BoxIntersect (RECT *pr1, RECT *pr2, RECT *printer);
extern void BoxUnion (RECT *pr1, RECT *pr2, RECT *punion);
enum
typedef enum
{
FadeAllToWhite = 250,
FadeSomeToWhite,
@@ -266,7 +266,7 @@ enum
FadeAllToColor,
FadeSomeToBlack,
FadeSomeToColor
};
} ScreenFadeType;
extern BOOLEAN InitGraphics (int argc, char *argv[], COUNT
KbytesRequired);
@@ -356,6 +356,7 @@ extern DRAWABLE GetFrameParentDrawable (FRAME Frame);
extern BOOLEAN SetColorMap (COLORMAPPTR ColorMapPtr);
extern DWORD XFormColorMap (COLORMAPPTR ColorMapPtr, SIZE TimeInterval);
extern DWORD FadeScreen (ScreenFadeType fadeType, SIZE TimeInterval);
extern void FlushColorXForms (void);
#define InitColorMapResources InitStringTableResources
#define LoadColorMapFile LoadStringTableFile
+55 -73
View File
@@ -17,23 +17,12 @@
*/
#include "gfx_common.h"
#include "libs/tasklib.h"
#include "libs/timelib.h"
#include "libs/inplib.h"
#include "libs/log.h"
#include <string.h>
static struct
{
COLORMAPPTR CMapPtr;
SIZE Ticks;
union
{
COUNT NumCycles;
Task XFormTask;
} tc;
} FadeControl;
typedef struct xform_control
{
int CMapIndex; // -1 means unused
@@ -53,8 +42,10 @@ static struct
Mutex Lock;
} XFormControl;
volatile int FadeAmount = FADE_NORMAL_INTENSITY;
static volatile int FadeEnd, XForming;
static int fadeAmount = FADE_NORMAL_INTENSITY;
static int fadeDelta;
static TimeCount fadeStartTime;
static sint32 fadeInterval;
#define SPARE_COLORMAPS 20
#define MAP_POOL_SIZE (MAX_COLORMAPS + SPARE_COLORMAPS)
@@ -313,63 +304,59 @@ SetColorMap (COLORMAPPTR map)
/* Fade Transforms */
static int
fade_xform_task (void *data)
int
GetFadeAmount (void)
{
SIZE TDelta, TTotal;
DWORD CurTime;
Task task = (Task)data;
int newAmount;
XForming = TRUE;
while (FadeControl.tc.XFormTask == 0
&& (!Task_ReadState (task, TASK_EXIT)))
TaskSwitch ();
TTotal = FadeControl.Ticks;
FadeControl.tc.XFormTask = 0;
LockMutex (XFormControl.Lock);
{
CurTime = GetTimeCounter ();
do
{
DWORD StartTime;
if (fadeInterval)
{ // have a pending fade
TimeCount Now = GetTimeCounter ();
sint32 elapsed;
elapsed = Now - fadeStartTime;
if (elapsed > fadeInterval)
elapsed = fadeInterval;
StartTime = CurTime;
SleepThreadUntil (CurTime + ONE_SECOND / 60);
CurTime = GetTimeCounter ();
if (!XForming || (TDelta = (SIZE)(CurTime - StartTime)) > TTotal)
TDelta = TTotal;
newAmount = fadeAmount + (long)fadeDelta * elapsed / fadeInterval;
FadeAmount += (FadeEnd - FadeAmount) * TDelta / TTotal;
//log_add (log_Debug, "fade_xform_task FadeAmount %d\n", FadeAmount);
} while ((TTotal -= TDelta) && (!Task_ReadState (task, TASK_EXIT)));
if (elapsed >= fadeInterval)
{ // fade is over
fadeAmount = newAmount;
fadeInterval = 0;
}
}
else
{ // no fade pending, return the current
newAmount = fadeAmount;
}
XForming = FALSE;
UnlockMutex (XFormControl.Lock);
FinishTask (task);
return 0;
return newAmount;
}
static void
FlushFadeXForms (void)
{
if (XForming)
{
XForming = FALSE;
TaskSwitch ();
LockMutex (XFormControl.Lock);
if (fadeInterval)
{ // end the fade immediately
fadeAmount += fadeDelta;
fadeInterval = 0;
}
UnlockMutex (XFormControl.Lock);
}
static DWORD
XFormFade (COLORMAPPTR ColorMapPtr, SIZE TimeInterval)
DWORD
FadeScreen (ScreenFadeType fadeType, SIZE TimeInterval)
{
BYTE what;
DWORD TimeOut;
TimeCount TimeOut;
int FadeEnd;
FlushFadeXForms ();
what = *ColorMapPtr;
switch (what)
switch (fadeType)
{
case FadeAllToBlack:
case FadeSomeToBlack:
@@ -387,24 +374,26 @@ XFormFade (COLORMAPPTR ColorMapPtr, SIZE TimeInterval)
return (GetTimeCounter ());
}
FadeControl.Ticks = TimeInterval;
if (FadeControl.Ticks <= 0 ||
(FadeControl.tc.XFormTask = AssignTask (fade_xform_task,
1024, "fade transform")) == 0)
{
FadeAmount = FadeEnd;
LockMutex (XFormControl.Lock);
if (TimeInterval <= 0)
{ // end the fade immediately
fadeAmount = FadeEnd;
// cancel any pending fades
fadeInterval = 0;
TimeOut = GetTimeCounter ();
}
else
{
do
TaskSwitch ();
while (FadeControl.tc.XFormTask);
TimeOut = GetTimeCounter () + TimeInterval + 1;
fadeInterval = TimeInterval;
fadeDelta = FadeEnd - fadeAmount;
fadeStartTime = GetTimeCounter ();
TimeOut = fadeStartTime + TimeInterval + 1;
}
return (TimeOut);
UnlockMutex (XFormControl.Lock);
return TimeOut;
}
/* Colormap Transforms */
@@ -598,23 +587,16 @@ XFormPLUT (COLORMAPPTR ColorMapPtr, SIZE TimeInterval)
return (EndTime);
}
DWORD
XFormColorMap (COLORMAPPTR ColorMapPtr, SIZE TimeInterval)
{
int what;
if (!ColorMapPtr)
return (0);
if (QuitPosted) // Don't make users wait for fades
TimeInterval = 0;
what = *ColorMapPtr;
if (what >= (int)FadeAllToWhite && what <= (int)FadeSomeToColor)
return XFormFade (ColorMapPtr, TimeInterval);
else
return XFormPLUT (ColorMapPtr, TimeInterval);
return XFormPLUT (ColorMapPtr, TimeInterval);
}
void
+1 -1
View File
@@ -47,7 +47,7 @@ typedef struct tfb_colormap
struct tfb_colormap *next;
} TFB_ColorMap;
extern volatile int FadeAmount;
extern int GetFadeAmount (void);
extern void InitColorMaps (void);
extern void UninitColorMaps (void);
+2 -2
View File
@@ -253,7 +253,7 @@ TFB_SwapBuffers (int force_full_redraw)
static int last_fade_amount = 255, last_transition_amount = 255;
static int fade_amount = 255, transition_amount = 255;
fade_amount = FadeAmount;
fade_amount = GetFadeAmount ();
transition_amount = TransitionAmount;
if (force_full_redraw == TFB_REDRAW_NO && !TFB_BBox.valid &&
@@ -618,7 +618,7 @@ TFB_FlushGraphics (void) // Only call from main thread!!
{
static int last_fade = 255;
static int last_transition = 255;
int current_fade = FadeAmount;
int current_fade = GetFadeAmount ();
int current_transition = TransitionAmount;
if ((current_fade != 255 && current_fade != last_fade) ||
+1 -2
View File
@@ -750,9 +750,8 @@ CommIntroTransition (void)
}
else if (curIntroMode == CIM_FADE_IN_SCREEN)
{
BYTE clut_buf[] = {FadeAllToColor};
UnbatchGraphics ();
XFormColorMap ((COLORMAPPTR)clut_buf, fadeTime);
FadeScreen (FadeAllToColor, fadeTime);
}
else
{ // Uknown transition
+2 -5
View File
@@ -776,7 +776,6 @@ on_input_frame (void)
void
Credits (BOOLEAN WithOuttakes)
{
BYTE fade_buf[1];
MUSIC_REF hMusic;
CREDITS_INPUT_STATE cis;
RECT screenRect;
@@ -801,8 +800,7 @@ Credits (BOOLEAN WithOuttakes)
s.frame = CreditsBack;
LockMutex (GraphicsLock);
DrawStamp (&s);
fade_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2);
FadeScreen (FadeAllToColor, ONE_SECOND / 2);
UnlockMutex (GraphicsLock);
// set the position of outtakes comm
@@ -842,8 +840,7 @@ Credits (BOOLEAN WithOuttakes)
LockMutex (GraphicsLock);
SetContext (ScreenContext);
fade_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
FlushColorXForms ();
UnlockMutex (GraphicsLock);
+9 -26
View File
@@ -35,14 +35,12 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic)
{
#ifdef WANT_SHIP_SPINS
char vnbuf[32];
BYTE clut_buf[1];
RECT old_r;
LoadIntoExtraScreen (NULL);
#if 0
/* This is cut out right now but should be part of the 3DO side */
clut_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 4));
FlushColorXForms ();
#endif
@@ -55,8 +53,7 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic)
sprintf (vnbuf, "slides.spins.%02u", (unsigned)index);
ShowPresentation (vnbuf);
clut_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 4));
FlushColorXForms ();
GetContextClipRect (&old_r);
@@ -67,8 +64,7 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic)
if (hMusic)
PlayMusic (hMusic, TRUE, 1);
clut_buf[0] = FadeAllToColor;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 4));
SleepThreadUntil (FadeScreen (FadeAllToColor, ONE_SECOND / 4));
FlushColorXForms ();
#else
(void) index; /* Satisfy compiler */
@@ -79,13 +75,10 @@ DoShipSpin (COUNT index, MUSIC_REF hMusic)
void
SplashScreen (void (* DoProcessing)(DWORD TimeOut))
{
BYTE xform_buf[1];
STAMP s;
DWORD TimeOut;
xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap (
(COLORMAPPTR) xform_buf, ONE_SECOND / 120));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 120));
LockMutex (GraphicsLock);
SetContext (ScreenContext);
s.origin.x = s.origin.y = 0;
@@ -94,8 +87,7 @@ SplashScreen (void (* DoProcessing)(DWORD TimeOut))
DestroyDrawable (ReleaseDrawable (s.frame));
UnlockMutex (GraphicsLock);
xform_buf[0] = FadeAllToColor;
TimeOut = XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2);
TimeOut = FadeScreen (FadeAllToColor, ONE_SECOND / 2);
if (DoProcessing)
DoProcessing (TimeOut);
@@ -118,35 +110,26 @@ SplashScreen (void (* DoProcessing)(DWORD TimeOut))
}
GLOBAL (CurrentActivity) &= ~CHECK_ABORT;
xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
}
void
Introduction (void)
{
BYTE xform_buf[1];
ShowPresentation (INTROPRES_STRTAB);
xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
}
void
Victory (void)
{
BYTE xform_buf[1];
xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
/* by default we do 3DO cinematics; or PC slides when 3DO files are
* not present */
ShowPresentation (FINALPRES_STRTAB);
xform_buf[0] = FadeAllToBlack;
XFormColorMap ((COLORMAPPTR)xform_buf, 0);
FadeScreen (FadeAllToBlack, 0);
}
void
+1 -3
View File
@@ -1052,10 +1052,8 @@ ChangeGameSelection:
}
if (LastActivity == CHECK_LOAD && first_time)
{
BYTE clut_buf[] = {FadeAllToColor};
UnbatchGraphics ();
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
FadeScreen (FadeAllToColor, ONE_SECOND / 2);
}
else
{
+4 -11
View File
@@ -114,12 +114,11 @@ ParseColorString (const char *Src, Color* pColor)
static BOOLEAN
DoFadeScreen (PRESENTATION_INPUT_STATE* pPIS, const char *Src, BYTE FadeType)
{
BYTE xform_buf[1] = {FadeType};
int msecs;
if (1 == sscanf (Src, "%d", &msecs))
{
pPIS->TimeOut = XFormColorMap ((COLORMAPPTR) xform_buf,
(SIZE)(msecs * ONE_SECOND / 1000)) + ONE_SECOND / 10;
pPIS->TimeOut = FadeScreen (FadeType, msecs * ONE_SECOND / 1000)
+ ONE_SECOND / 10;
pPIS->TimeOutOnSkip = FALSE;
}
return TRUE;
@@ -851,11 +850,7 @@ DoVideoInput (void *pIS)
static void
FadeClearScreen (void)
{
BYTE xform_buf[1];
xform_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap (
(COLORMAPPTR) xform_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
// clear the screen with black
LockMutex (GraphicsLock);
@@ -864,9 +859,7 @@ FadeClearScreen (void)
ClearDrawable ();
UnlockMutex (GraphicsLock);
// fade in black rect instantly
xform_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR) xform_buf, 0);
FadeScreen (FadeAllToColor, 0);
}
static BOOLEAN
+8 -17
View File
@@ -1678,11 +1678,9 @@ static void
StartMelee (MELEE_STATE *pMS)
{
{
BYTE black_buf[] = {FadeAllToBlack};
FadeMusic (0, ONE_SECOND / 2);
SleepThreadUntil (XFormColorMap (
(COLORMAPPTR)black_buf, ONE_SECOND / 2) + ONE_SECOND / 60);
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2)
+ ONE_SECOND / 60);
FlushColorXForms ();
StopMusic ();
}
@@ -1712,14 +1710,10 @@ StartMelee (MELEE_STATE *pMS)
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
return;
{
BYTE black_buf[] = { FadeAllToBlack };
SleepThreadUntil (XFormColorMap (
(COLORMAPPTR)black_buf, ONE_SECOND / 2)
+ ONE_SECOND / 60);
FlushColorXForms ();
}
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2)
+ ONE_SECOND / 60);
FlushColorXForms ();
} while (0 /* !(GLOBAL (CurrentActivity) & CHECK_ABORT) */);
GLOBAL (CurrentActivity) = SUPER_MELEE;
@@ -2099,11 +2093,8 @@ DoMelee (MELEE_STATE *pMS)
LockMutex (GraphicsLock);
InitMelee (pMS);
UnlockMutex (GraphicsLock);
{
BYTE clut_buf[] = {FadeAllToColor};
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
}
FadeScreen (FadeAllToColor, ONE_SECOND / 2);
pMS->LastInputTime = GetTimeCounter ();
return TRUE;
}
+3 -6
View File
@@ -696,12 +696,9 @@ GetInitialMeleeStarShips (HSTARSHIP *result)
}
// Fade in
{
BYTE fade_buf[] = {FadeAllToColor};
SleepThreadUntil (XFormColorMap
((COLORMAPPTR) fade_buf, ONE_SECOND / 2) + ONE_SECOND / 60);
FlushColorXForms ();
}
SleepThreadUntil (FadeScreen (FadeAllToColor, ONE_SECOND / 2)
+ ONE_SECOND / 60);
FlushColorXForms ();
playerMask = 0;
for (playerI = 0; playerI < NUM_PLAYERS; playerI++)
+2 -7
View File
@@ -306,19 +306,14 @@ DeviceFailed (BYTE which_device)
if (LOBYTE (GLOBAL (CurrentActivity)) == IN_INTERPLANETARY
&& playerInPlanetOrbit ())
{
BYTE fade_buf[1];
PlayMenuSound (MENU_SOUND_INVOKED);
fade_buf[0] = FadeAllToWhite;
SleepThreadUntil (
XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND * 1)
SleepThreadUntil (FadeScreen (FadeAllToWhite, ONE_SECOND * 1)
+ (ONE_SECOND * 2));
if (CurStarDescPtr->Index != CHMMR_DEFINED
|| pSolarSysState->pOrbitalDesc !=
&pSolarSysState->PlanetDesc[1])
{
fade_buf[0] = FadeAllToColor;
XFormColorMap ((COLORMAPPTR)fade_buf, ONE_SECOND * 2);
FadeScreen (FadeAllToColor, ONE_SECOND * 2);
}
else
{
+1 -3
View File
@@ -239,9 +239,7 @@ ZapToUrquanEncounter (void)
{
#define LOST_DAYS 15
BYTE black_buf[] = {FadeAllToBlack};
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND * 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND * 2));
LockMutex (GraphicsLock);
MoveGameClockDays (LOST_DAYS);
UnlockMutex (GraphicsLock);
+1 -3
View File
@@ -1379,12 +1379,10 @@ InitSolarSys (void)
if (LastActivity == (CHECK_LOAD | CHECK_RESTART))
{ // Starting a new game, NOT from load!
// We have to fade the screen in from intro or menu
BYTE clut_buf[] = {FadeAllToColor};
DrawOuterSystem ();
RedrawQueue (FALSE);
UnbatchGraphics ();
XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND / 2);
FadeScreen (FadeAllToColor, ONE_SECOND / 2);
LastActivity = 0;
}
+7 -23
View File
@@ -141,11 +141,7 @@ DoRestart (MENU_STATE *pMS)
LastInputTime = GetTimeCounter ();
pMS->Initialized = TRUE;
{
BYTE clut_buf[] = {FadeAllToColor};
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf,
ONE_SECOND / 2));
}
SleepThreadUntil (FadeScreen (FadeAllToColor, ONE_SECOND / 2));
}
else if (GLOBAL (CurrentActivity) & CHECK_ABORT)
{
@@ -153,8 +149,6 @@ DoRestart (MENU_STATE *pMS)
}
else if (PulsedInputState.menu[KEY_MENU_SELECT])
{
BYTE fade_buf[1];
switch (pMS->CurState)
{
case LOAD_SAVED_GAME:
@@ -185,10 +179,7 @@ DoRestart (MENU_STATE *pMS)
UnbatchGraphics ();
return TRUE;
case QUIT_GAME:
fade_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap (
(COLORMAPPTR)fade_buf, ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
GLOBAL (CurrentActivity) = CHECK_ABORT;
break;
}
@@ -270,13 +261,10 @@ static BOOLEAN
RestartMenu (MENU_STATE *pMS)
{
TimeCount TimeOut;
BYTE black_buf[1];
ReinitQueue (&race_q[0]);
ReinitQueue (&race_q[1]);
black_buf[0] = FadeAllToBlack;
SetContext (ScreenContext);
GLOBAL (CurrentActivity) |= CHECK_ABORT;
@@ -284,12 +272,10 @@ RestartMenu (MENU_STATE *pMS)
&& GET_GAME_STATE (UTWIG_BOMB_ON_SHIP)
&& !GET_GAME_STATE (UTWIG_BOMB))
{ // player blew himself up with Utwig bomb
BYTE white_buf[] = {FadeAllToWhite};
SET_GAME_STATE (UTWIG_BOMB_ON_SHIP, 0);
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)white_buf,
ONE_SECOND / 8) + ONE_SECOND / 60);
SleepThreadUntil (FadeScreen (FadeAllToWhite, ONE_SECOND / 8)
+ ONE_SECOND / 60);
SetContextBackGroundColor (
BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0F));
ClearDrawable ();
@@ -316,7 +302,7 @@ RestartMenu (MENU_STATE *pMS)
LastActivity = 0;
NextActivity = 0;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)black_buf, TimeOut));
SleepThreadUntil (FadeScreen (FadeAllToBlack, TimeOut));
if (TimeOut == ONE_SECOND / 8)
SleepThread (ONE_SECOND * 3);
DrawRestartMenuGraphic (pMS);
@@ -341,7 +327,7 @@ RestartMenu (MENU_STATE *pMS)
if (GLOBAL (CurrentActivity) & CHECK_ABORT)
return (FALSE); // quit
TimeOut = XFormColorMap ((COLORMAPPTR)black_buf, ONE_SECOND / 2);
TimeOut = FadeScreen (FadeAllToBlack, ONE_SECOND / 2);
SleepThreadUntil (TimeOut);
FlushColorXForms ();
@@ -373,9 +359,7 @@ TryStartGame (void)
}
else if (GLOBAL (CurrentActivity) == (ACTIVITY)~0)
{ // timed out
BYTE black_buf[] = {FadeAllToBlack};
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)black_buf,
ONE_SECOND / 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND / 2));
return (FALSE);
}
else if (GLOBAL (CurrentActivity) & CHECK_ABORT)
+2 -8
View File
@@ -443,10 +443,7 @@ static void
DoTimePassage (void)
{
#define LOST_DAYS 14
BYTE clut_buf[1];
clut_buf[0] = FadeAllToBlack;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, ONE_SECOND * 2));
SleepThreadUntil (FadeScreen (FadeAllToBlack, ONE_SECOND * 2));
LockMutex (GraphicsLock);
MoveGameClockDays (LOST_DAYS);
UnlockMutex (GraphicsLock);
@@ -556,8 +553,6 @@ CleanupAfterStarBase (void)
void
InstallBombAtEarth (void)
{
BYTE clut_buf[1];
DoTimePassage ();
LockMutex (GraphicsLock);
@@ -567,8 +562,7 @@ InstallBombAtEarth (void)
ClearDrawable ();
UnlockMutex (GraphicsLock);
clut_buf[0] = FadeAllToColor;
SleepThreadUntil (XFormColorMap ((COLORMAPPTR)clut_buf, 0));
SleepThreadUntil (FadeScreen (FadeAllToColor, 0));
SET_GAME_STATE (CHMMR_BOMB_STATE, 3); /* bomb processed */
GLOBAL (CurrentActivity) = CHECK_LOAD; /* fake a load game */