Move intro ticking out of the drawer

This commit is contained in:
Sally Coolatta 2022-04-25 21:37:41 -04:00 committed by Eidolon
parent 9276637db0
commit 400c6e0891

View file

@ -515,9 +515,9 @@ void F_StartIntro(void)
}
//
// F_IntroDrawScene
// F_IntroDrawer
//
static void F_IntroDrawScene(void)
void F_IntroDrawer(void)
{
boolean highres = true;
INT32 cx = 8, cy = 128;
@ -623,24 +623,22 @@ static void F_IntroDrawScene(void)
if (intro_curtime > 1 && intro_curtime < (INT32)introscenetime[intro_scenenum])
{
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
if (intro_curtime < TICRATE-5) // Make the text shine!
{
sprintf(stjrintro, "STJRI%03u", intro_curtime-1);
}
else if (intro_curtime >= TICRATE-6 && intro_curtime < 2*TICRATE-20) // Pause on black screen for just a second
{
return;
}
else if (intro_curtime == 2*TICRATE-19)
{
// Fade in the text
// The text fade out is automatically handled when switching to a new intro scene
strncpy(stjrintro, "STJRI029", 9);
S_ChangeMusicInternal("_stjr", false);
background = W_CachePatchName(stjrintro, PU_PATCH_LOWPRIORITY);
wipestyleflags = WSF_FADEIN;
F_WipeStartScreen();
F_TryColormapFade(31);
V_DrawSmallScaledPatch(bgxoffs, 84, 0, background);
F_WipeEndScreen();
F_RunWipe(0,true);
}
if (!WipeInAction) // Draw the patch if not in a wipe
@ -839,17 +837,27 @@ static void F_IntroDrawScene(void)
V_DrawRightAlignedString(BASEVIDWIDTH-4, BASEVIDHEIGHT-12, V_ALLOWLOWERCASE|(trans<<V_ALPHASHIFT), "\x86""Press ""\x82""ENTER""\x86"" to skip...");
}
if (animtimer)
animtimer--;
V_DrawString(cx, cy, V_ALLOWLOWERCASE, cutscene_disptext);
}
//
// F_IntroDrawer
// F_IntroTicker
//
void F_IntroDrawer(void)
void F_IntroTicker(void)
{
// advance animation
finalecount++;
timetonext--;
F_WriteText();
// check for skipping
if (keypressed)
keypressed = false;
wipestyleflags = WSF_CROSSFADE;
if (timetonext <= 0)
{
if (intro_scenenum == 0)
@ -859,6 +867,9 @@ void F_IntroDrawer(void)
wipestyleflags = WSF_FADEOUT;
F_WipeStartScreen();
F_TryColormapFade(31);
F_IntroDrawer();
F_WipeEndScreen();
F_RunWipe(99,true);
}
@ -872,6 +883,9 @@ void F_IntroDrawer(void)
wipestyleflags = (WSF_FADEOUT|WSF_TOWHITE);
F_WipeStartScreen();
F_TryColormapFade(0);
F_IntroDrawer();
F_WipeEndScreen();
F_RunWipe(99,true);
}
@ -883,6 +897,9 @@ void F_IntroDrawer(void)
wipestyleflags = WSF_FADEOUT;
F_WipeStartScreen();
F_TryColormapFade(31);
F_IntroDrawer();
F_WipeEndScreen();
F_RunWipe(99,true);
}
@ -918,12 +935,12 @@ void F_IntroDrawer(void)
wipegamestate = GS_INTRO;
return;
}
F_NewCutscene(introtext[++intro_scenenum]);
timetonext = introscenetime[intro_scenenum];
F_WipeStartScreen();
wipegamestate = -1;
wipestyleflags = WSF_CROSSFADE;
animtimer = stoptimer = 0;
}
@ -931,78 +948,36 @@ void F_IntroDrawer(void)
if (rendermode != render_none)
{
if (intro_scenenum == 5 && intro_curtime == 5*TICRATE)
if (intro_scenenum == 0 && intro_curtime == 2*TICRATE-19)
{
patch_t *radar = W_CachePatchName("RADAR", PU_PATCH_LOWPRIORITY);
S_ChangeMusicInternal("_stjr", false);
wipestyleflags = WSF_FADEIN;
F_WipeStartScreen();
F_WipeColorFill(31);
V_DrawSmallScaledPatch(0, 0, 0, radar);
W_UnlockCachedPatch(radar);
V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext);
F_TryColormapFade(31);
F_IntroDrawer();
F_WipeEndScreen();
F_RunWipe(99,true);
}
else if (intro_scenenum == 7 && intro_curtime == 6*TICRATE) // Force a wipe here
else if ((intro_scenenum == 5 && intro_curtime == 5*TICRATE)
|| (intro_scenenum == 7 && intro_curtime == 6*TICRATE)
//|| (intro_scenenum == 11 && intro_curtime == 7*TICRATE)
|| (intro_scenenum == 15 && intro_curtime == 7*TICRATE))
{
patch_t *grass = W_CachePatchName("SGRASS2", PU_PATCH_LOWPRIORITY);
F_WipeStartScreen();
F_WipeColorFill(31);
V_DrawSmallScaledPatch(0, 0, 0, grass);
W_UnlockCachedPatch(grass);
V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext);
F_WipeEndScreen();
F_RunWipe(99,true);
}
/*else if (intro_scenenum == 11 && intro_curtime == 7*TICRATE)
{
patch_t *confront = W_CachePatchName("CONFRONT", PU_PATCH_LOWPRIORITY);
F_WipeStartScreen();
F_WipeColorFill(31);
V_DrawSmallScaledPatch(0, 0, 0, confront);
W_UnlockCachedPatch(confront);
V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext);
F_WipeEndScreen();
F_RunWipe(99,true);
}*/
if (intro_scenenum == 15 && intro_curtime == 7*TICRATE)
{
patch_t *sdo = W_CachePatchName("SONICDO2", PU_PATCH_LOWPRIORITY);
F_WipeStartScreen();
F_WipeColorFill(31);
V_DrawSmallScaledPatch(0, 0, 0, sdo);
W_UnlockCachedPatch(sdo);
V_DrawString(224, 8, V_ALLOWLOWERCASE, cutscene_disptext);
F_IntroDrawer();
F_WipeEndScreen();
F_RunWipe(99,true);
}
}
F_IntroDrawScene();
}
//
// F_IntroTicker
//
void F_IntroTicker(void)
{
// advance animation
finalecount++;
timetonext--;
F_WriteText();
// check for skipping
if (keypressed)
keypressed = false;
if (animtimer)
animtimer--;
}
//