Skip to content

Commit

Permalink
support dedicated music tracks for the NRFTL levels
Browse files Browse the repository at this point in the history
Not sure if something comparable exists for the Masterlevels,
but this supports nrftl_midipack_prboomplus.wad, Fixes #713
  • Loading branch information
fabiangreffrath committed Dec 18, 2023
1 parent 4f11460 commit 66497c4
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
29 changes: 18 additions & 11 deletions src/doom/s_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,23 +379,30 @@ void S_Start(void)

if (gamemode == commercial)
{
const int nmus[] =
const int nmus[9][2] =
{
mus_messag,
mus_ddtblu,
mus_doom,
mus_shawn,
mus_in_cit,
mus_the_da,
mus_in_cit,
mus_shawn2,
mus_ddtbl2,
{mus_nrftl1, mus_messag},
{mus_nrftl2, mus_ddtblu},
{mus_nrftl3, mus_doom},
{mus_nrftl4, mus_shawn},
{mus_nrftl5, mus_in_cit},
{mus_nrftl6, mus_the_da},
{mus_nrftl7, mus_in_cit},
{mus_nrftl8, mus_shawn2},
{mus_nrftl9, mus_ddtbl2},
};

if ((gameepisode == 2 || gamemission == pack_nerve) &&
gamemap <= arrlen(nmus))
{
mnum = nmus[gamemap - 1];
char name[9];

mnum = nmus[gamemap - 1][0];
M_snprintf(name, sizeof(name), "d_%s", S_music[mnum].name);
if (W_CheckNumForName(name) == -1)
{
mnum = nmus[gamemap - 1][1];
}
}
else
mnum = mus_runnin + gamemap - 1;
Expand Down
10 changes: 10 additions & 0 deletions src/doom/sounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ musicinfo_t S_music[] =
MUSIC("read_m"),
MUSIC("dm2ttl"),
MUSIC("dm2int"),
// [crispy] NRFTL
MUSIC("nrftl1"),
MUSIC("nrftl2"),
MUSIC("nrftl3"),
MUSIC("nrftl4"),
MUSIC("nrftl5"),
MUSIC("nrftl6"),
MUSIC("nrftl7"),
MUSIC("nrftl8"),
MUSIC("nrftl9"),
MUSIC(NULL),
MUSIC("musinfo")
};
Expand Down
10 changes: 10 additions & 0 deletions src/doom/sounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,16 @@ typedef enum
mus_read_m,
mus_dm2ttl,
mus_dm2int,
// [crispy] NRFTL
mus_nrftl1,
mus_nrftl2,
mus_nrftl3,
mus_nrftl4,
mus_nrftl5,
mus_nrftl6,
mus_nrftl7,
mus_nrftl8,
mus_nrftl9,
NUMMUSIC,
mus_musinfo
} musicenum_t;
Expand Down

0 comments on commit 66497c4

Please sign in to comment.