Merge branch 'intro-fix' into 'master'

Intro skip fix

Closes #1184

See merge request KartKrew/Kart!2141
This commit is contained in:
toaster 2024-03-21 21:52:58 +00:00
commit ac140f1dce
2 changed files with 47 additions and 22 deletions

View file

@ -362,7 +362,7 @@ void F_StartIntro(void)
// //
static void F_IntroDrawScene(void) static void F_IntroDrawScene(void)
{ {
INT32 cx = 68*FRACUNIT, cy = 20*FRACUNIT; INT32 cx = 62*FRACUNIT, cy = 20*FRACUNIT;
INT32 jitterx = 0, jittery = 0; INT32 jitterx = 0, jittery = 0;
INT32 bgxoffs = 0; INT32 bgxoffs = 0;
patch_t *logoparts[5]; patch_t *logoparts[5];
@ -453,7 +453,7 @@ static disclaimerstate dc_state = 0;
static UINT8 dc_tics = 0; static UINT8 dc_tics = 0;
static UINT8 dc_segaframe = 1; static UINT8 dc_segaframe = 1;
static UINT8 dc_bgcol = 0; static UINT8 dc_bgcol = 0;
static UINT8 dc_lasttime = 0; static INT32 dc_lasttime = 0;
static boolean dc_ticking = false; static boolean dc_ticking = false;
static UINT8 dc_bluesegafade = 0; static UINT8 dc_bluesegafade = 0;
static UINT8 dc_textfade = 9; static UINT8 dc_textfade = 9;
@ -593,8 +593,10 @@ static void F_DisclaimerDrawScene(void)
// Fade out screen // Fade out screen
if (dc_state == DISCLAIMER_OUT) if (dc_state == DISCLAIMER_OUT)
{ {
if (dc_screenfade > 0 && !(dc_tics%10)) if (dc_screenfade > 0)
{
dc_screenfade--; dc_screenfade--;
}
} }
// ================================= STATE TRANSITIONS // ================================= STATE TRANSITIONS
@ -669,13 +671,42 @@ void F_IntroTicker(void)
return; return;
} }
if (timetonext <= 0) // check for skipping
const boolean disclaimerskippable =
(
intro_scenenum == INTROSCENE_DISCLAIMER
&& dc_state == DISCLAIMER_FINAL
&& dc_tics >= (TICRATE/2) + (5*6) // bottom text needs to fade all the way in
);
const boolean doskip =
(
skippableallowed
&& keypressed
&& (timetonext > 10)
&& (
intro_scenenum >= INTROSCENE_KREW
|| disclaimerskippable
)
);
if (keypressed)
keypressed = false;
if (doskip && disclaimerskippable)
{
dc_state = DISCLAIMER_OUT;
dc_tics = 0;
timetonext = 10;
}
else if (doskip || timetonext <= 0)
{ {
intro_scenenum++; intro_scenenum++;
if (intro_scenenum == (M_GameTrulyStarted() INT32 destscenenum = NUMINTROSCENES-1;
? NUMINTROSCENES if (M_GameTrulyStarted() == false)
: INTROSCENE_KREW) destscenenum = INTROSCENE_DISCLAIMER;
) else if (doskip)
destscenenum = INTROSCENE_KREW;
if (intro_scenenum > destscenenum)
{ {
D_StartTitle(); D_StartTitle();
// Custom built fade to skip the to-black // Custom built fade to skip the to-black
@ -685,10 +716,14 @@ void F_IntroTicker(void)
//F_NewCutscene(introtext[intro_scenenum]); //F_NewCutscene(introtext[intro_scenenum]);
timetonext = introscenetime[intro_scenenum]; timetonext = introscenetime[intro_scenenum];
animtimer = stoptimer = 0; animtimer = stoptimer = 0;
if (intro_scenenum == INTROSCENE_DISCLAIMER) if (
wipegamestate = -1; doskip
if (intro_scenenum == INTROSCENE_KREW) || intro_scenenum == INTROSCENE_DISCLAIMER
|| intro_scenenum == INTROSCENE_KREW
)
{
wipegamestate = -1; wipegamestate = -1;
}
} }
if (intro_scenenum == INTROSCENE_KREW) if (intro_scenenum == INTROSCENE_KREW)
@ -709,10 +744,6 @@ void F_IntroTicker(void)
F_WriteText(); F_WriteText();
// check for skipping
if (keypressed)
keypressed = false;
if (animtimer > 0) if (animtimer > 0)
animtimer--; animtimer--;
} }
@ -774,12 +805,6 @@ boolean F_IntroResponder(event_t *event)
if (keypressed) if (keypressed)
return false; return false;
if (intro_scenenum <= INTROSCENE_DISCLAIMER)
{
// do not allow skipping the disclaimer
return false;
}
keypressed = true; keypressed = true;
return true; return true;
} }

View file

@ -1399,7 +1399,7 @@ boolean G_Responder(event_t *ev)
{ {
if (F_IntroResponder(ev)) if (F_IntroResponder(ev))
{ {
D_SetDeferredStartTitle(true); //D_SetDeferredStartTitle(true); -- intro state tracked in f_finale directly
return true; return true;
} }
} }