Implement "usermap" music definition slot

git-svn-id: https://svn.eduke32.com/eduke32@7802 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-07-18 01:25:33 +00:00 committed by Christoph Oelckers
parent ba7c266f89
commit 83e1a6902d
3 changed files with 8 additions and 1 deletions

View file

@ -84,6 +84,7 @@ enum {
MUS_INTRO = MUS_FIRST_SPECIAL, MUS_INTRO = MUS_FIRST_SPECIAL,
MUS_BRIEFING = MUS_FIRST_SPECIAL + 1, MUS_BRIEFING = MUS_FIRST_SPECIAL + 1,
MUS_LOADING = MUS_FIRST_SPECIAL + 2, MUS_LOADING = MUS_FIRST_SPECIAL + 2,
MUS_USERMAP = MUS_FIRST_SPECIAL + 3,
}; };
////////// TIMING CONSTANTS ////////// ////////// TIMING CONSTANTS //////////

View file

@ -5139,6 +5139,10 @@ static int32_t S_DefineMusic(const char *ID, const char *name)
{ {
sel += 2; sel += 2;
} }
else if (!Bstrcmp(ID,"usermap"))
{
sel += 3;
}
else else
{ {
sel = G_GetMusicIdx(ID); sel = G_GetMusicIdx(ID);

View file

@ -1802,7 +1802,9 @@ void G_SetupFilenameBasedMusic(char *nameBuf, const char *fileName, int levelNum
} }
} }
realloc_copy(&g_mapInfo[levelNum].musicfn, "dethtoll.mid"); char const * usermapMusic = g_mapInfo[MUS_USERMAP].musicfn;
if (usermapMusic != nullptr)
realloc_copy(&g_mapInfo[levelNum].musicfn, usermapMusic);
} }
int G_EnterLevel(int gameMode) int G_EnterLevel(int gameMode)