mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
(WIP) Play Title music after credits track ends
For some reason I_GetSongLength is not reliable here, and try to accomodate fastforward...
This commit is contained in:
parent
6bbcf64f15
commit
34ec886d34
4 changed files with 34 additions and 4 deletions
|
|
@ -982,6 +982,7 @@ UINT16 finaleemeralds = 0;
|
||||||
|
|
||||||
void F_StartGameEvaluation(void)
|
void F_StartGameEvaluation(void)
|
||||||
{
|
{
|
||||||
|
Music_SetFadeOut("credits", 250);
|
||||||
Music_DelayEnd("credits", TICRATE/4);
|
Music_DelayEnd("credits", TICRATE/4);
|
||||||
Music_Tick(); // it needs to fade out right now
|
Music_Tick(); // it needs to fade out right now
|
||||||
|
|
||||||
|
|
@ -1327,6 +1328,7 @@ void F_GameEvaluationTicker(void)
|
||||||
{
|
{
|
||||||
if (finalecount == 1)
|
if (finalecount == 1)
|
||||||
{
|
{
|
||||||
|
Music_Stop("credits");
|
||||||
// sitting on that distant _shore
|
// sitting on that distant _shore
|
||||||
Music_Remap("shore", "_SHORE");
|
Music_Remap("shore", "_SHORE");
|
||||||
Music_Play("shore");
|
Music_Play("shore");
|
||||||
|
|
@ -1336,6 +1338,7 @@ void F_GameEvaluationTicker(void)
|
||||||
{
|
{
|
||||||
if (finalecount == TICRATE/2)
|
if (finalecount == TICRATE/2)
|
||||||
{
|
{
|
||||||
|
Music_Stop("credits");
|
||||||
// _drift across open waters
|
// _drift across open waters
|
||||||
Music_Remap("shore", "_DRIFT");
|
Music_Remap("shore", "_DRIFT");
|
||||||
Music_Play("shore");
|
Music_Play("shore");
|
||||||
|
|
@ -2075,7 +2078,15 @@ void F_AttractDemoTicker(void)
|
||||||
{
|
{
|
||||||
keypressed = false;
|
keypressed = false;
|
||||||
|
|
||||||
if (attractcountdown > 0 && !g_fast_forward)
|
if (g_fast_forward)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (demo.attract == DEMO_ATTRACT_CREDITS)
|
||||||
|
{
|
||||||
|
F_ConsiderCreditsMusicUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attractcountdown > 0)
|
||||||
{
|
{
|
||||||
if (attractcredit)
|
if (attractcredit)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@
|
||||||
#include "w_wad.h"
|
#include "w_wad.h"
|
||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
|
#include "i_sound.h"
|
||||||
#include "i_joy.h"
|
#include "i_joy.h"
|
||||||
#include "i_threads.h"
|
#include "i_threads.h"
|
||||||
#include "dehacked.h"
|
#include "dehacked.h"
|
||||||
|
|
@ -371,6 +372,21 @@ static void F_InitCreditsSlide(void)
|
||||||
CON_ClearHUD();
|
CON_ClearHUD();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void F_NewCreditsMusic(const char *trackname, bool looping)
|
||||||
|
{
|
||||||
|
Music_Remap("credits", trackname);
|
||||||
|
Music_Loop("credits", looping);
|
||||||
|
Music_Play("credits");
|
||||||
|
}
|
||||||
|
|
||||||
|
void F_ConsiderCreditsMusicUpdate(void)
|
||||||
|
{
|
||||||
|
if (!Music_CanLoop("credits") && I_GetSongLength() == I_GetSongPosition())
|
||||||
|
{
|
||||||
|
F_NewCreditsMusic("_title", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void F_StartCredits(void)
|
void F_StartCredits(void)
|
||||||
{
|
{
|
||||||
G_SetGamestate(GS_CREDITS);
|
G_SetGamestate(GS_CREDITS);
|
||||||
|
|
@ -391,7 +407,8 @@ void F_StartCredits(void)
|
||||||
Music_StopAll();
|
Music_StopAll();
|
||||||
S_StopSounds();
|
S_StopSounds();
|
||||||
|
|
||||||
Music_Play("credits");
|
Music_SetFadeOut("credits", 0);
|
||||||
|
F_NewCreditsMusic("_creds", false);
|
||||||
|
|
||||||
F_CreditsReset();
|
F_CreditsReset();
|
||||||
|
|
||||||
|
|
@ -809,6 +826,8 @@ void F_CreditTicker(void)
|
||||||
{
|
{
|
||||||
g_credits.havent_ticked = false;
|
g_credits.havent_ticked = false;
|
||||||
|
|
||||||
|
F_ConsiderCreditsMusicUpdate();
|
||||||
|
|
||||||
g_credits.transition_prev = g_credits.transition;
|
g_credits.transition_prev = g_credits.transition;
|
||||||
g_credits.scroll_timer_prev = g_credits.scroll_timer;
|
g_credits.scroll_timer_prev = g_credits.scroll_timer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ void F_TickCreditsDemoExit(void);
|
||||||
|
|
||||||
INT32 F_CreditsDemoExitFade(void);
|
INT32 F_CreditsDemoExitFade(void);
|
||||||
|
|
||||||
|
void F_ConsiderCreditsMusicUpdate(void);
|
||||||
|
|
||||||
void F_CreditTicker(void);
|
void F_CreditTicker(void);
|
||||||
|
|
||||||
void F_CreditDrawer(void);
|
void F_CreditDrawer(void);
|
||||||
|
|
|
||||||
|
|
@ -168,8 +168,6 @@ void Music_Init(void)
|
||||||
|
|
||||||
tune.priority = 100;
|
tune.priority = 100;
|
||||||
tune.song = "_creds";
|
tune.song = "_creds";
|
||||||
tune.fade_out = 250;
|
|
||||||
tune.loop = false;
|
|
||||||
tune.credit = true;
|
tune.credit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue