From a3039a781af3349e9606053c6b0aef6b79e70b9e Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 28 Aug 2020 17:10:54 -0400 Subject: [PATCH 1/6] New STJR Intro, replaces the old PURE FAT intro --- src/f_finale.c | 129 ++++++++++++++----------------------------------- 1 file changed, 35 insertions(+), 94 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index d83eeb5cf..d56869897 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -225,6 +225,9 @@ static INT32 cutscene_textspeed = 0; static UINT8 cutscene_boostspeed = 0; static tic_t cutscene_lasttextwrite = 0; +// STJR Intro +char stjrintro[9] = "STJRI000"; + // // This alters the text string cutscene_disptext. // Use the typical string drawing functions to display it. @@ -312,7 +315,7 @@ const char *introtext[NUMINTROSCENES]; static tic_t introscenetime[NUMINTROSCENES] = { - 7*TICRATE + (TICRATE/2), // STJr Presents + 7*TICRATE, // STJr Presents 11*TICRATE + (TICRATE/2), // Two months had passed since... 15*TICRATE + (TICRATE/2), // As it was about to drain the rings... 14*TICRATE, // What Sonic, Tails, and Knuckles... @@ -527,7 +530,8 @@ static void F_IntroDrawScene(void) switch (intro_scenenum) { case 0: - break; + bgxoffs = 28; + break; case 1: background = W_CachePatchName("INTRO1", PU_PATCH); break; @@ -616,98 +620,35 @@ static void F_IntroDrawScene(void) V_DrawScaledPatch(bgxoffs, 0, 0, background); } else if (intro_scenenum == 0) // STJr presents - { - // "Waaaaaaah" intro - if (finalecount-TICRATE/2 < 4*TICRATE+23) { - // aspect is FRACUNIT/2 for 4:3 (source) resolutions, smaller for 16:10 (SRB2) resolutions - fixed_t aspect = (FRACUNIT + (FRACUNIT*4/3 - FRACUNIT*vid.width/vid.height)/2)>>1; - fixed_t x,y; - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 2); - if (finalecount < 30) { // Cry! - if (finalecount < 4) - S_StopMusic(); - if (finalecount == 4) - S_ChangeMusicInternal("_stjr", false); - x = (BASEVIDWIDTH< 6) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH2", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - } - if (finalecount > 10) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH3", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - } - if (finalecount > 14) { - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH4", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - } - } - else if (finalecount-30 < 20) { // Big eggy - background = W_CachePatchName("FEEDIN", PU_PATCH); - x = (BASEVIDWIDTH< 1 && intro_curtime < 278) + { + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + if (intro_curtime < 30) // Make the text shine! + sprintf(stjrintro, "STJRI%03u", intro_curtime-1); + else if (intro_curtime >= 29 && intro_curtime < 50) // Pause on black screen for just a second + return; + else if (intro_curtime == 51) { - { - // Draw tiny eggy - fixed_t scale = FixedMul(FRACUNIT/3, aspect); - background = W_CachePatchName("FEEDIN", PU_PATCH); - x = (BASEVIDWIDTH< 4*TICRATE) { // Door is being raised! - int ftime = (finalecount-TICRATE/2-4*TICRATE); - y -= FixedDiv((ftime*ftime)< Date: Fri, 28 Aug 2020 17:11:38 -0400 Subject: [PATCH 2/6] Add new `STARTUP` lump, for the splash screen --- src/console.c | 8 ++++++-- src/d_main.c | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/console.c b/src/console.c index 0235b9bd4..21f660a56 100644 --- a/src/console.c +++ b/src/console.c @@ -1677,8 +1677,12 @@ static void CON_DrawBackpic(void) lumpnum_t piclump; int x, w, h; - // Get the lumpnum for CONSBACK, or fallback into MISSING. - piclump = W_CheckNumForName("CONSBACK"); + // Get the lumpnum for CONSBACK, STARTUP (Only during game startup) or fallback into MISSING. + if (con_startup) + piclump = W_CheckNumForName("STARTUP"); + else + piclump = W_CheckNumForName("CONSBACK"); + if (piclump == LUMPERROR) piclump = W_GetNumForName("MISSING"); diff --git a/src/d_main.c b/src/d_main.c index 25209de68..77c33e7ba 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -768,7 +768,7 @@ void D_SRB2Loop(void) */ /* Smells like a hack... Don't fade Sonic's ass into the title screen. */ if (gamestate != GS_TITLESCREEN) - V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("CONSBACK"), PU_PATCH)); + V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("STARTUP"), PU_PATCH)); for (;;) { From 3ef8024697bb41d4a54058a6005fbae08b9b22da Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 28 Aug 2020 20:08:46 -0400 Subject: [PATCH 3/6] Make the intro shorter as I felt it was a bit too long Change the code a bit so less magic numbers. --- src/f_finale.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index d56869897..71c7c3784 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -315,7 +315,7 @@ const char *introtext[NUMINTROSCENES]; static tic_t introscenetime[NUMINTROSCENES] = { - 7*TICRATE, // STJr Presents + 6*TICRATE, // STJr Presents 11*TICRATE + (TICRATE/2), // Two months had passed since... 15*TICRATE + (TICRATE/2), // As it was about to drain the rings... 14*TICRATE, // What Sonic, Tails, and Knuckles... @@ -621,14 +621,14 @@ static void F_IntroDrawScene(void) } else if (intro_scenenum == 0) // STJr presents { - if (intro_curtime > 1 && intro_curtime < 278) + if (intro_curtime > 1 && intro_curtime < introscenetime[intro_scenenum]) { V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - if (intro_curtime < 30) // Make the text shine! + if (intro_curtime < TICRATE-5) // Make the text shine! sprintf(stjrintro, "STJRI%03u", intro_curtime-1); - else if (intro_curtime >= 29 && intro_curtime < 50) // Pause on black screen for just a second + else if (intro_curtime >= TICRATE-6 && intro_curtime < 2*TICRATE-20) // Pause on black screen for just a second return; - else if (intro_curtime == 51) + 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 From 0bd71d9980bc0dffe9c6649320cf2df054a18268 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 29 Aug 2020 19:28:16 -0400 Subject: [PATCH 4/6] Attempts to make the intro a bit more shorter Make the scene time be 5 seconds long max Use the standard fade which is much shorter in length. --- src/f_finale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 71c7c3784..2ff19b377 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -315,7 +315,7 @@ const char *introtext[NUMINTROSCENES]; static tic_t introscenetime[NUMINTROSCENES] = { - 6*TICRATE, // STJr Presents + 5*TICRATE, // STJr Presents 11*TICRATE + (TICRATE/2), // Two months had passed since... 15*TICRATE + (TICRATE/2), // As it was about to drain the rings... 14*TICRATE, // What Sonic, Tails, and Knuckles... @@ -641,7 +641,7 @@ static void F_IntroDrawScene(void) F_TryColormapFade(31); V_DrawSmallScaledPatch(bgxoffs, 84, 0, background); F_WipeEndScreen(); - F_RunWipe(99,true); + F_RunWipe(0,true); } if (!WipeInAction) // Draw the patch if not in a wipe From b20352141e9b87973c0043a3e6d6450b99b0b2bb Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 29 Aug 2020 20:04:11 -0400 Subject: [PATCH 5/6] Fix compile error --- src/f_finale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 2ff19b377..e6765b020 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -621,7 +621,7 @@ static void F_IntroDrawScene(void) } else if (intro_scenenum == 0) // STJr presents { - if (intro_curtime > 1 && intro_curtime < introscenetime[intro_scenenum]) + 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! From db6bd42eb173cb1cb6818b64390aa042ee376e64 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Tue, 1 Sep 2020 14:05:45 -0400 Subject: [PATCH 6/6] Allow the game to continue even if the `STARTUP` lump is somehow missing --- src/d_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 4a93c852d..ca2f71a58 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -731,6 +731,7 @@ tic_t rendergametic; void D_SRB2Loop(void) { tic_t oldentertics = 0, entertic = 0, realtics = 0, rendertimeout = INFTICS; + static lumpnum_t gstartuplumpnum; if (dedicated) server = true; @@ -770,7 +771,12 @@ void D_SRB2Loop(void) */ /* Smells like a hack... Don't fade Sonic's ass into the title screen. */ if (gamestate != GS_TITLESCREEN) - V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(W_GetNumForName("STARTUP"), PU_PATCH)); + { + gstartuplumpnum = W_CheckNumForName("STARTUP"); + if (gstartuplumpnum == LUMPERROR) + gstartuplumpnum = W_GetNumForName("MISSING"); + V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(gstartuplumpnum, PU_PATCH)); + } for (;;) {