From 83e1a6902daa4124aaf26168067f1a38de949094 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 18 Jul 2019 01:25:33 +0000 Subject: [PATCH] Implement "usermap" music definition slot git-svn-id: https://svn.eduke32.com/eduke32@7802 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/duke3d.h | 1 + source/duke3d/src/game.cpp | 4 ++++ source/duke3d/src/premap.cpp | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/duke3d/src/duke3d.h b/source/duke3d/src/duke3d.h index 26e845b95..6035ebd1d 100644 --- a/source/duke3d/src/duke3d.h +++ b/source/duke3d/src/duke3d.h @@ -84,6 +84,7 @@ enum { MUS_INTRO = MUS_FIRST_SPECIAL, MUS_BRIEFING = MUS_FIRST_SPECIAL + 1, MUS_LOADING = MUS_FIRST_SPECIAL + 2, + MUS_USERMAP = MUS_FIRST_SPECIAL + 3, }; ////////// TIMING CONSTANTS ////////// diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 258655689..71fbc903b 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5139,6 +5139,10 @@ static int32_t S_DefineMusic(const char *ID, const char *name) { sel += 2; } + else if (!Bstrcmp(ID,"usermap")) + { + sel += 3; + } else { sel = G_GetMusicIdx(ID); diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index 54bb67c3c..fe38af71b 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -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)