Merge branch 'unslot-music' into 'master'

Hardcoded music name switches

Like I said earlier, it's better if all the hardcoded music switches in 2.2 start with an underscore so that it's harder to accidentally overwrite them.

Should be accepted when music.dta is updated.

See merge request !17
This commit is contained in:
Inuyasha 2016-10-23 06:46:33 -04:00
commit fa187c5ae7
7 changed files with 41 additions and 29 deletions

View File

@ -837,6 +837,18 @@ static void IdentifyVersion(void)
I_Error("File %s has been modified with non-music lumps",musicfile);
}
#endif
#if 1 // This section can be deleted when music_new is merged with music.dta
{
const char *musicfile = "music_new.dta";
const char *musicpath = va(pandf,srb2waddir,musicfile);
int ms = W_VerifyNMUSlumps(musicpath); // Don't forget the music!
if (ms == 1)
D_AddFile(musicpath);
else if (ms == 0)
I_Error("File %s has been modified with non-music lumps",musicfile);
}
#endif
}
/* ======================================================================== */

View File

@ -559,7 +559,7 @@ static void F_IntroDrawScene(void)
if (finalecount < 4)
S_StopMusic();
if (finalecount == 4)
S_ChangeMusicInternal("stjr", false);
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_CACHE)), aspect);
@ -771,7 +771,7 @@ void F_IntroDrawer(void)
F_RunWipe(99,true);
}
S_ChangeMusicInternal("read_m", false);
S_ChangeMusicInternal("_intro", false);
}
else if (intro_scenenum == 3)
roidtics = BASEVIDWIDTH - 64;
@ -1130,7 +1130,7 @@ void F_StartCredits(void)
CON_ClearHUD();
S_StopMusic();
S_ChangeMusicInternal("credit", false);
S_ChangeMusicInternal("_creds", false);
finalecount = 0;
animtimer = 0;
@ -1427,7 +1427,7 @@ void F_StartTitleScreen(void)
// IWAD dependent stuff.
S_ChangeMusicInternal("titles", looptitle);
S_ChangeMusicInternal("_title", looptitle);
animtimer = 0;
@ -1593,7 +1593,7 @@ void F_StartContinue(void)
// In case menus are still up?!!
M_ClearMenus(true);
S_ChangeMusicInternal("contsc", false);
S_ChangeMusicInternal("_conti", false);
S_StopSounds();
timetonext = TICRATE*11;

View File

@ -4836,7 +4836,7 @@ static void M_SetupChoosePlayer(INT32 choice)
if (Playing() == false)
{
S_StopMusic();
S_ChangeMusicInternal("chrsel", true);
S_ChangeMusicInternal("_chsel", true);
}
SP_PlayerDef.prevMenu = currentMenu;
@ -5271,7 +5271,7 @@ void M_DrawTimeAttackMenu(void)
lumpnum_t lumpnum;
char beststr[40];
S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback
S_ChangeMusicInternal("_inter", true); // Eww, but needed for when user hits escape during demo playback
V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE));
@ -5434,7 +5434,7 @@ static void M_TimeAttack(INT32 choice)
itemOn = tastart; // "Start" is selected.
G_SetGamestate(GS_TIMEATTACK);
S_ChangeMusicInternal("racent", true);
S_ChangeMusicInternal("_inter", true);
}
// Drawing function for Nights Attack
@ -5444,7 +5444,7 @@ void M_DrawNightsAttackMenu(void)
lumpnum_t lumpnum;
char beststr[40];
S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback
S_ChangeMusicInternal("_inter", true); // Eww, but needed for when user hits escape during demo playback
V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE));
@ -5567,7 +5567,7 @@ static void M_NightsAttack(INT32 choice)
itemOn = nastart; // "Start" is selected.
G_SetGamestate(GS_TIMEATTACK);
S_ChangeMusicInternal("racent", true);
S_ChangeMusicInternal("_inter", true);
}
// Player has selected the "START" from the nights attack screen
@ -5801,7 +5801,7 @@ static void M_ModeAttackEndGame(INT32 choice)
itemOn = currentMenu->lastOn;
G_SetGamestate(GS_TIMEATTACK);
modeattacking = ATTACKING_NONE;
S_ChangeMusicInternal("racent", true);
S_ChangeMusicInternal("_inter", true);
// Update replay availability.
CV_AddValue(&cv_nextmap, 1);
CV_AddValue(&cv_nextmap, -1);
@ -7016,7 +7016,7 @@ static void M_ToggleDigital(void)
if (nodigimusic) return;
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
S_StopMusic();
S_ChangeMusicInternal("lclear", false);
S_ChangeMusicInternal("_clear", false);
M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING);
}
else
@ -7043,7 +7043,7 @@ static void M_ToggleMIDI(void)
I_InitMIDIMusic();
if (nomidimusic) return;
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
S_ChangeMusicInternal("lclear", false);
S_ChangeMusicInternal("_clear", false);
M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING);
}
else

View File

@ -3156,7 +3156,7 @@ void A_Invincibility(mobj_t *actor)
S_StopMusic();
if (mariomode)
G_GhostAddColor(GHC_INVINCIBLE);
S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false);
S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false);
}
}
@ -3192,7 +3192,7 @@ void A_SuperSneakers(mobj_t *actor)
else
{
S_StopMusic();
S_ChangeMusicInternal("shoes", false);
S_ChangeMusicInternal("_shoes", false);
}
}
}

View File

@ -2104,7 +2104,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
if (P_IsLocalPlayer(target->player)/* && target->player == &players[consoleplayer] */)
{
S_StopMusic(); // Stop the Music! Tails 03-14-2000
S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000
S_ChangeMusicInternal("_gover", false); // Yousa dead now, Okieday? Tails 03-14-2000
}
}
}
@ -2493,7 +2493,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
&& player->nightstime < 10*TICRATE)
{
//S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH
S_ChangeMusicInternal("drown",false);
S_ChangeMusicInternal("_drown",false);
}
}
}

View File

@ -958,7 +958,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings)
if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC) && P_IsLocalPlayer(player))
{
S_StopMusic();
S_ChangeMusicInternal("supers", true);
S_ChangeMusicInternal("_super", true);
}
S_StartSound(NULL, sfx_supert); //let all players hear it -mattw_cfi
@ -1094,7 +1094,7 @@ void P_PlayLivesJingle(player_t *player)
if (player)
player->powers[pw_extralife] = extralifetics + 1;
S_StopMusic(); // otherwise it won't restart if this is done twice in a row
S_ChangeMusicInternal("xtlife", false);
S_ChangeMusicInternal("_1up", false);
}
}
@ -1112,9 +1112,9 @@ void P_RestoreMusic(player_t *player)
return;
S_SpeedMusic(1.0f);
if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC))
S_ChangeMusicInternal("supers", true);
S_ChangeMusicInternal("_super", true);
else if (player->powers[pw_invulnerability] > 1)
S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false);
S_ChangeMusicInternal((mariomode) ? "_minv" : "_inv", false);
else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super])
{
if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC)
@ -1123,7 +1123,7 @@ void P_RestoreMusic(player_t *player)
S_ChangeMusic(mapmusname, mapmusflags, true);
}
else
S_ChangeMusicInternal("shoes", true);
S_ChangeMusicInternal("_shoes", true);
}
else
S_ChangeMusic(mapmusname, mapmusflags, true);
@ -2054,7 +2054,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player)
&& player == &players[consoleplayer])
{
S_StopMusic();
S_ChangeMusicInternal("drown", false);
S_ChangeMusicInternal("_drown", false);
}
}
@ -5621,7 +5621,7 @@ static void P_NiGHTSMovement(player_t *player)
}
else if (P_IsLocalPlayer(player) && player->nightstime == 10*TICRATE)
// S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH
S_ChangeMusicInternal("drown",false);
S_ChangeMusicInternal("_drown",false);
if (player->mo->z < player->mo->floorz)
@ -8745,7 +8745,7 @@ void P_PlayerThink(player_t *player)
if (countdown == 11*TICRATE - 1)
{
if (P_IsLocalPlayer(player))
S_ChangeMusicInternal("drown", false);
S_ChangeMusicInternal("_drown", false);
}
// If you've hit the countdown and you haven't made

View File

@ -679,7 +679,7 @@ void Y_Ticker(void)
boolean anybonuses = false;
if (!intertic) // first time only
S_ChangeMusicInternal("lclear", false); // don't loop it
S_ChangeMusicInternal("_clear", false); // don't loop it
if (intertic < TICRATE) // one second pause before tally begins
return;
@ -740,7 +740,7 @@ void Y_Ticker(void)
if (!intertic) // first time only
{
S_ChangeMusicInternal("lclear", false); // don't loop it
S_ChangeMusicInternal("_clear", false); // don't loop it
tallydonetic = 0;
}
@ -801,7 +801,7 @@ void Y_Ticker(void)
else if (intertype == int_match || intertype == int_ctf || intertype == int_teammatch) // match
{
if (!intertic) // first time only
S_ChangeMusicInternal("racent", true); // loop it
S_ChangeMusicInternal("_inter", true); // loop it
// If a player has left or joined, recalculate scores.
if (data.match.numplayers != D_NumPlayers())
@ -810,7 +810,7 @@ void Y_Ticker(void)
else if (intertype == int_race || intertype == int_classicrace) // race
{
if (!intertic) // first time only
S_ChangeMusicInternal("racent", true); // loop it
S_ChangeMusicInternal("_inter", true); // loop it
// Don't bother recalcing for race. It doesn't make as much sense.
}