From 96612ab93466d2721f4ef47c3da342031f11f018 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Mon, 15 Jan 2018 03:40:25 +0000 Subject: [PATCH 1/5] Base title screen, gets screen fade working from intro->title for the fade to work --- src/d_main.c | 3 ++ src/f_finale.c | 114 ++++++++++++++++++++++--------------------------- src/f_wipe.c | 4 +- 3 files changed, 55 insertions(+), 66 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index f63e23ef..f3697766 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -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: diff --git a/src/f_finale.c b/src/f_finale.c index 83699768..0a8af369 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -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<= 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; diff --git a/src/f_wipe.c b/src/f_wipe.c index 981c10a5..ed5736cb 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -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 From 1448956f262062a093bdcde6ade35a3bd12b081f Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Mon, 15 Jan 2018 04:03:27 +0000 Subject: [PATCH 2/5] Fix checkers position in non-green resolutions --- 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 0a8af369..d77c67fb 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -962,8 +962,8 @@ void F_TitleScreenDrawer(void) 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<= 50 && finalecount < 55) From b53bf115e334b805b35cd83a9fddd65945f5899f Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Mon, 15 Jan 2018 16:39:59 +0000 Subject: [PATCH 3/5] Loop the title screen music --- src/g_game.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 8d16ba0e..a0a40329 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -125,7 +125,7 @@ INT16 spstage_start; INT16 sstage_start; INT16 sstage_end; -boolean looptitle = false; +boolean looptitle = true; boolean useNightsSS = false; UINT8 skincolor_redteam = SKINCOLOR_RED; From 7746b613106bc60f883e427d6aae3039a1f5a72c Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Mon, 15 Jan 2018 20:40:32 +0000 Subject: [PATCH 4/5] Fix pause graphic position --- src/d_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index f63e23ef..97574704 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -523,7 +523,7 @@ static void D_Display(void) else py = viewwindowy + 4; patch = W_CachePatchName("M_PAUSE", PU_CACHE); - V_DrawScaledPatch(viewwindowx + (viewwidth - SHORT(patch->width))/2, py, 0, patch); + V_DrawScaledPatch(viewwindowx + (BASEVIDWIDTH - SHORT(patch->width))/2, py, 0, patch); } // vid size change is now finished if it was on... From d317164a222a4935aab21b37dee0984bd5597a87 Mon Sep 17 00:00:00 2001 From: Sryder13 Date: Mon, 15 Jan 2018 21:02:33 +0000 Subject: [PATCH 5/5] Our quit screen is 640x400 There's a small fix for V_DrawFixedPatch that makes it account for scale when blacking out the rest of the screen, for when scale is 50% or 25%, but can theoretically work with any scale --- src/m_menu.c | 2 +- src/v_video.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 2c2a237a..72605689 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7855,7 +7855,7 @@ void M_QuitResponse(INT32 ch) ptime = I_GetTime() + NEWTICRATE*2; // Shortened the quit time, used to be 2 seconds Tails 03-26-2001 while (ptime > I_GetTime()) { - V_DrawScaledPatch(0, 0, 0, W_CachePatchName("GAMEQUIT", PU_CACHE)); // Demo 3 Quit Screen Tails 06-16-2001 + V_DrawSmallScaledPatch(0, 0, 0, W_CachePatchName("GAMEQUIT", PU_CACHE)); // Demo 3 Quit Screen Tails 06-16-2001 I_FinishUpdate(); // Update the screen with the image Tails 06-19-2001 I_Sleep(); } diff --git a/src/v_video.c b/src/v_video.c index 6a803689..5f533596 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -476,7 +476,8 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t desttop += (vid.height - (BASEVIDHEIGHT * dupy)) * vid.width / 2; } // if it's meant to cover the whole screen, black out the rest - if (x == 0 && SHORT(patch->width) == BASEVIDWIDTH && y == 0 && SHORT(patch->height) == BASEVIDHEIGHT) + if (x == 0 && FixedMul(SHORT(patch->width)<>FRACBITS == BASEVIDWIDTH + && y == 0 && FixedMul(SHORT(patch->height)<>FRACBITS == BASEVIDHEIGHT) { column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[0])); source = (const UINT8 *)(column) + 3;