From a7def0ac3d28fe58235e0f8ec6d5228e80d224b6 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sat, 25 Aug 2018 08:03:05 -0400 Subject: [PATCH] Add S_MusicName back as a convenience function * Move MUSICRATE to doomdef.h --- src/doomdef.h | 2 ++ src/s_sound.c | 5 +++++ src/s_sound.h | 4 +--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index b09aaa415..51ff25076 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -356,6 +356,8 @@ typedef enum #define NEWTICRATERATIO 1 // try 4 for 140 fps :) #define NEWTICRATE (TICRATE*NEWTICRATERATIO) +#define MUSICRATE 1000 // sound timing is calculated by milliseconds + #define RING_DIST 512*FRACUNIT // how close you need to be to a ring to attract it #define PUSHACCEL (2*FRACUNIT) // Acceleration for MF2_SLIDEPUSH items. diff --git a/src/s_sound.c b/src/s_sound.c index de6a28f24..2126dfc07 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1394,6 +1394,11 @@ musictype_t S_MusicType(void) return I_SongType(); } +const char *S_MusicName(void) +{ + return music_name; +} + boolean S_MusicInfo(char *mname, UINT16 *mflags, boolean *looping) { if (!I_SongPlaying()) diff --git a/src/s_sound.h b/src/s_sound.h index d5323da3a..3cb05000b 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -20,9 +20,6 @@ #include "command.h" #include "tables.h" // angle_t -// sound timing is calculated by milliseconds -#define MUSICRATE 1000 - // mask used to indicate sound origin is player item pickup #define PICKUP_SOUND 0x8000 @@ -139,6 +136,7 @@ boolean S_MusicDisabled(void); boolean S_MusicPlaying(void); boolean S_MusicPaused(void); musictype_t S_MusicType(void); +const char *S_MusicName(void); boolean S_MusicInfo(char *mname, UINT16 *mflags, boolean *looping); boolean S_MusicExists(const char *mname, boolean checkMIDI, boolean checkDigi); #define S_DigExists(a) S_MusicExists(a, false, true)