Base title screen, gets screen fade working from intro->title for the fade to work

This commit is contained in:
Sryder13 2018-01-15 03:40:25 +00:00
parent 76013dad19
commit 96612ab934
3 changed files with 55 additions and 66 deletions

View File

@ -341,7 +341,10 @@ static void D_Display(void)
case GS_INTRO:
F_IntroDrawer();
if (wipegamestate == (gamestate_t)-1)
{
wipe = true;
wipedefindex = gamestate; // wipe_xxx_toblack
}
break;
case GS_CUTSCENE:

View File

@ -35,7 +35,7 @@
// Stage of animation:
// 0 = text, 1 = art screen
static INT32 finalecount;
INT32 titlescrollspeed = 80;
INT32 titlescrollspeed = 5;
static INT32 timetonext; // Delay between screen changes
static INT32 continuetime; // Short delay when continuing
@ -52,21 +52,11 @@ static UINT8 curDemo = 0;
static UINT32 demoDelayLeft;
static UINT32 demoIdleLeft;
static patch_t *ttbanner; // white banner with "robo blast" and "2"
static patch_t *ttwing; // wing background
static patch_t *ttsonic; // "SONIC"
static patch_t *ttswave1; // Title Sonics
static patch_t *ttswave2;
static patch_t *ttswip1;
static patch_t *ttsprep1;
static patch_t *ttsprep2;
static patch_t *ttspop1;
static patch_t *ttspop2;
static patch_t *ttspop3;
static patch_t *ttspop4;
static patch_t *ttspop5;
static patch_t *ttspop6;
static patch_t *ttspop7;
static patch_t *ttbanner; // SONIC ROBO BLAST 2
static patch_t *ttkart; // *vroom* KART
static patch_t *ttcheckers; // *vroom* KART
static patch_t *ttkflash; // flash screen
static void F_SkyScroll(INT32 scrollspeed);
@ -364,6 +354,11 @@ void F_IntroDrawer(void)
}
D_StartTitle();
// Yes, this is a weird hack, we need to force a wipe for this because the game state has changed in the middle of where it would normally wipe
// Need to set the wipe start and then draw the first frame of the title screen to get it working
F_WipeStartScreen();
F_TitleScreenDrawer();
wipegamestate = -1; // force a wipe
return;
}
@ -925,28 +920,18 @@ void F_StartTitleScreen(void)
// IWAD dependent stuff.
S_ChangeMusicInternal("titles", looptitle);
// music is started in the ticker
S_StopMusic();
animtimer = 0;
demoDelayLeft = demoDelayTime;
demoIdleLeft = demoIdleTime;
ttbanner = W_CachePatchName("TTBANNER", PU_LEVEL);
ttwing = W_CachePatchName("TTWING", PU_LEVEL);
ttsonic = W_CachePatchName("TTSONIC", PU_LEVEL);
ttswave1 = W_CachePatchName("TTSWAVE1", PU_LEVEL);
ttswave2 = W_CachePatchName("TTSWAVE2", PU_LEVEL);
ttswip1 = W_CachePatchName("TTSWIP1", PU_LEVEL);
ttsprep1 = W_CachePatchName("TTSPREP1", PU_LEVEL);
ttsprep2 = W_CachePatchName("TTSPREP2", PU_LEVEL);
ttspop1 = W_CachePatchName("TTSPOP1", PU_LEVEL);
ttspop2 = W_CachePatchName("TTSPOP2", PU_LEVEL);
ttspop3 = W_CachePatchName("TTSPOP3", PU_LEVEL);
ttspop4 = W_CachePatchName("TTSPOP4", PU_LEVEL);
ttspop5 = W_CachePatchName("TTSPOP5", PU_LEVEL);
ttspop6 = W_CachePatchName("TTSPOP6", PU_LEVEL);
ttspop7 = W_CachePatchName("TTSPOP7", PU_LEVEL);
ttbanner = W_CachePatchName("TTKBANNR", PU_LEVEL);
ttkart = W_CachePatchName("TTKART", PU_LEVEL);
ttcheckers = W_CachePatchName("TTCHECK", PU_LEVEL);
ttkflash = W_CachePatchName("TTKFLASH", PU_LEVEL);
}
// (no longer) De-Demo'd Title Screen
@ -955,57 +940,58 @@ void F_TitleScreenDrawer(void)
if (modeattacking)
return; // We likely came here from retrying. Don't do a damn thing.
// Draw that sky!
F_SkyScroll(titlescrollspeed);
if (finalecount < 50)
V_DrawFill(0, 0, 320, 200, 31);
else
// Draw that sky!
F_SkyScroll(titlescrollspeed);
// Don't draw outside of the title screewn, or if the patch isn't there.
if (!ttwing || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
if (!ttbanner || (gamestate != GS_TITLESCREEN && gamestate != GS_WAITINGPLAYERS))
return;
V_DrawScaledPatch(30, 14, 0, ttwing);
V_DrawSmallScaledPatch(84, 36, 0, ttbanner);
if (finalecount < 57)
if (finalecount < 20)
{
if (finalecount == 35)
V_DrawScaledPatch(115, 15, 0, ttspop1);
else if (finalecount == 36)
V_DrawScaledPatch(114, 15, 0,ttspop2);
else if (finalecount == 37)
V_DrawScaledPatch(113, 15, 0,ttspop3);
else if (finalecount == 38)
V_DrawScaledPatch(112, 15, 0,ttspop4);
else if (finalecount == 39)
V_DrawScaledPatch(111, 15, 0,ttspop5);
else if (finalecount == 40)
V_DrawScaledPatch(110, 15, 0, ttspop6);
else if (finalecount >= 41 && finalecount <= 44)
V_DrawScaledPatch(109, 15, 0, ttspop7);
else if (finalecount >= 45 && finalecount <= 48)
V_DrawScaledPatch(108, 12, 0, ttsprep1);
else if (finalecount >= 49 && finalecount <= 52)
V_DrawScaledPatch(107, 9, 0, ttsprep2);
else if (finalecount >= 53 && finalecount <= 56)
V_DrawScaledPatch(106, 6, 0, ttswip1);
V_DrawScaledPatch(93, 106, 0, ttsonic);
if (finalecount >= 10)
V_DrawSciencePatch((84<<FRACBITS) - FixedDiv(180<<FRACBITS, 10<<FRACBITS)*(20-finalecount), (87<<FRACBITS), 0, ttkart, FRACUNIT/2);
}
else
{
V_DrawScaledPatch(93, 106, 0,ttsonic);
if (finalecount/5 & 1)
V_DrawScaledPatch(100, 3, 0,ttswave1);
else
V_DrawScaledPatch(100,3, 0,ttswave2);
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
// Checkers, only need to be drawn after the whiteout, but we can do it here because it won't be seen before anyway
V_DrawSciencePatch(0, 0 - FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + FixedMul(40<<FRACBITS, FixedDiv(finalecount%70, 70)), V_SNAPTOLEFT, ttcheckers, FRACUNIT);
}
V_DrawScaledPatch(48, 142, 0,ttbanner);
if (finalecount >= 50 && finalecount < 55)
{
V_DrawFill(0, 0, 320, 200, 120);
V_DrawSmallScaledPatch(84, 36, 0, ttkflash);
}
}
// (no longer) De-Demo'd Title Screen
void F_TitleScreenTicker(boolean run)
{
if (run)
{
finalecount++;
if (finalecount == 10)
{
S_StartSound(NULL, sfx_spin);
}
else if (finalecount == 50)
{
// Now start the music
S_ChangeMusicInternal("titles", looptitle);
S_StartSound(NULL, sfx_zoom);
}
}
// don't trigger if doing anything besides idling on title
if (gameaction != ga_nothing || gamestate != GS_TITLESCREEN)
return;

View File

@ -48,7 +48,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
0, // wipe_level_toblack
UINT8_MAX, // wipe_intermission_toblack
UINT8_MAX, // wipe_continuing_toblack
0, // wipe_titlescreen_toblack
3, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack
99, // wipe_credits_toblack
0, // wipe_evaluation_toblack
@ -63,7 +63,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
0, // wipe_level_final
0, // wipe_intermission_final
0, // wipe_continuing_final
0, // wipe_titlescreen_final
3, // wipe_titlescreen_final
0, // wipe_timeattack_final
99, // wipe_credits_final
0, // wipe_evaluation_final