diff --git a/src/console.c b/src/console.c index 0235b9bd4bf9a940b98e6c6729379ea44f61f411..21f660a56bc2914294a52246feb907e6be5c2cd4 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 f6394704ed72c74f8fb60621054f80f6b5106909..ca2f71a588fda02927b6f47c65ce764231dba5fd 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("CONSBACK"), PU_PATCH)); + { + gstartuplumpnum = W_CheckNumForName("STARTUP"); + if (gstartuplumpnum == LUMPERROR) + gstartuplumpnum = W_GetNumForName("MISSING"); + V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(gstartuplumpnum, PU_PATCH)); + } for (;;) { diff --git a/src/f_finale.c b/src/f_finale.c index d83eeb5cf5cb7aa78d57ab587eded567c3ae0ab1..e6765b0203c038a8e2a1a2b0958c6b0e6caf910b 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 + 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... @@ -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<<FRACBITS)/2 - FixedMul(334<<FRACBITS, aspect)/2; - y = (BASEVIDHEIGHT<<FRACBITS)/2 - FixedMul(358<<FRACBITS, aspect)/2; - V_DrawSciencePatch(x, y, 0, (patch = W_CachePatchName("WAHH1", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - if (finalecount > 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<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2; - y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, aspect); - V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, aspect); - } - else if (finalecount-50 < 30) { // Zoom out - fixed_t scale = FixedDiv(aspect, FixedDiv((finalecount-50)<<FRACBITS, (15<<FRACBITS))+FRACUNIT); - background = W_CachePatchName("FEEDIN", PU_PATCH); - x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale)); - y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale); - V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale); + { + 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); + wipestyleflags = WSF_FADEIN; + F_WipeStartScreen(); + F_TryColormapFade(31); + V_DrawSmallScaledPatch(bgxoffs, 84, 0, background); + F_WipeEndScreen(); + F_RunWipe(0,true); } - else + + if (!WipeInAction) // Draw the patch if not in a wipe { - { - // Draw tiny eggy - fixed_t scale = FixedMul(FRACUNIT/3, aspect); - background = W_CachePatchName("FEEDIN", PU_PATCH); - x = (BASEVIDWIDTH<<FRACBITS)/2 - FixedMul(560<<FRACBITS, aspect)/2 + (FixedMul(560<<FRACBITS, aspect) - FixedMul(560<<FRACBITS, scale)); - y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(477<<FRACBITS, scale); - V_DrawSciencePatch(x, y, V_SNAPTOBOTTOM, background, scale); - } - - if (finalecount-84 < 58) { // Pure Fat is driving up! - int ftime = (finalecount-84); - x = (-189*FRACUNIT) + (FixedMul((6<<FRACBITS)+FRACUNIT/3, ftime<<FRACBITS) - FixedMul((6<<FRACBITS)+FRACUNIT/3, FixedDiv(FixedMul(ftime<<FRACBITS, ftime<<FRACBITS), 120<<FRACBITS))); - y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect); - // Draw the body - V_DrawSciencePatch(x, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the door - V_DrawSciencePatch(x+FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the wheel - V_DrawSciencePatch(x+FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName(va("TYRE%02u",(abs(finalecount-144)/3)%16), PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the wheel cover - V_DrawSciencePatch(x+FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - } else { // Pure Fat has stopped! - y = (BASEVIDHEIGHT<<FRACBITS) - FixedMul(417<<FRACBITS, aspect); - // Draw the body - V_DrawSciencePatch(0, y, V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT1", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the wheel - V_DrawSciencePatch(FixedMul(178<<FRACBITS, aspect), y+FixedMul(344<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("TYRE00", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the wheel cover - V_DrawSciencePatch(FixedMul(88<<FRACBITS, aspect), y+FixedMul(238<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT3", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - // Draw the door - if (finalecount-TICRATE/2 > 4*TICRATE) { // Door is being raised! - int ftime = (finalecount-TICRATE/2-4*TICRATE); - y -= FixedDiv((ftime*ftime)<<FRACBITS, 23<<FRACBITS); - } - V_DrawSciencePatch(FixedMul(344<<FRACBITS, aspect), y+FixedMul(292<<FRACBITS, aspect), V_SNAPTOLEFT|V_SNAPTOBOTTOM, (patch = W_CachePatchName("PUREFAT2", PU_PATCH)), aspect); - W_UnlockCachedPatch(patch); - } + background = W_CachePatchName(stjrintro, PU_PATCH); + V_DrawSmallScaledPatch(bgxoffs, 84, 0, background); } - } else { - V_DrawCreditString((160 - V_CreditStringWidth("SONIC TEAM JR")/2)<<FRACBITS, 80<<FRACBITS, 0, "SONIC TEAM JR"); - V_DrawCreditString((160 - V_CreditStringWidth("PRESENTS")/2)<<FRACBITS, 96<<FRACBITS, 0, "PRESENTS"); } } else if (intro_scenenum == 10) // Sky Runner @@ -922,7 +863,7 @@ void F_IntroDrawer(void) F_WipeEndScreen(); F_RunWipe(99,true); } - + S_ChangeMusicInternal("_intro", false); } else if (intro_scenenum == 10) @@ -1017,7 +958,7 @@ void F_IntroDrawer(void) F_WipeEndScreen(); F_RunWipe(99,true); } - /*else if (intro_scenenum == 12 && intro_curtime == 7*TICRATE) + /*else if (intro_scenenum == 11 && intro_curtime == 7*TICRATE) { patch_t *confront = W_CachePatchName("CONFRONT", PU_PATCH);