From: <web...@pr...> - 2018-01-15 10:31:33
|
Author: entryway Date: Mon Jan 15 09:49:48 2018 New Revision: 4532 Log: - MUSINFO: add support for music numbers 1-64 inclusive - MUSINFO: music number 0 plays the map's default music Fabian Greffrath Modified: branches/prboom-plus-24/prboom2/src/p_mobj.c branches/prboom-plus-24/prboom2/src/s_advsound.c branches/prboom-plus-24/prboom2/src/s_advsound.h branches/prboom-plus-24/prboom2/src/s_sound.c Modified: branches/prboom-plus-24/prboom2/src/p_mobj.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_mobj.c Sun Nov 19 21:06:20 2017 (r4531) +++ branches/prboom-plus-24/prboom2/src/p_mobj.c Mon Jan 15 09:49:48 2018 (r4532) @@ -1381,7 +1381,7 @@ !(options & MTF_HARD) : !(options & MTF_NORMAL)) return NULL; - if (thingtype >= 14101 && thingtype <= 14164) + if (thingtype >= 14100 && thingtype <= 14164) { // Use the ambient number iden_num = thingtype - 14100; // Mus change Modified: branches/prboom-plus-24/prboom2/src/s_advsound.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/s_advsound.c Sun Nov 19 21:06:20 2017 (r4531) +++ branches/prboom-plus-24/prboom2/src/s_advsound.c Mon Jan 15 09:49:48 2018 (r4532) @@ -59,11 +59,6 @@ // void S_ParseMusInfo(const char *mapid) { - memset(&musinfo, 0, sizeof(musinfo)); - musinfo.current_item = -1; - - S_music[NUMMUSIC].lumpnum = -1; - if (W_CheckNumForName("MUSINFO") != -1) { int num, lumpnum; @@ -106,7 +101,7 @@ } else { - lprintf(LO_ERROR, "S_ParseMusInfo: Number not in range 1 to %d", MAX_MUS_ENTRIES); + lprintf(LO_ERROR, "S_ParseMusInfo: Number not in range 1 to %d", MAX_MUS_ENTRIES - 1); } } } Modified: branches/prboom-plus-24/prboom2/src/s_advsound.h ============================================================================== --- branches/prboom-plus-24/prboom2/src/s_advsound.h Sun Nov 19 21:06:20 2017 (r4531) +++ branches/prboom-plus-24/prboom2/src/s_advsound.h Mon Jan 15 09:49:48 2018 (r4532) @@ -44,7 +44,7 @@ //MUSINFO lump // -#define MAX_MUS_ENTRIES 64 +#define MAX_MUS_ENTRIES 65 typedef struct musinfo_s { Modified: branches/prboom-plus-24/prboom2/src/s_sound.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/s_sound.c Sun Nov 19 21:06:20 2017 (r4531) +++ branches/prboom-plus-24/prboom2/src/s_sound.c Mon Jan 15 09:49:48 2018 (r4532) @@ -215,6 +215,10 @@ else mnum = spmus[gamemap-1]; } + + memset(&musinfo, 0, sizeof(musinfo)); + musinfo.items[0] = -1; + S_ChangeMusic(mnum, true); } @@ -532,6 +536,13 @@ mus_playing = music; musinfo.current_item = -1; + + // [crispy] MUSINFO value 0 is reserved for the map's default music + if (musinfo.items[0] == -1) + { + musinfo.items[0] = music->lumpnum; + S_music[NUMMUSIC].lumpnum = -1; + } } void S_RestartMusic(void) |