- cleaned i_music.h off external dependencies.

* take I_BuildMIDIMenuList out of it
* pass the command line state to disable music from the init call.
* don't declare internal 'nomusic' variable in the header.
This commit is contained in:
Christoph Oelckers 2023-06-17 09:49:15 +02:00
parent 99c76a3ff5
commit 4538236a38
5 changed files with 10 additions and 16 deletions

View file

@ -40,7 +40,6 @@
#include <zlib.h>
#include <zmusic.h>
#include "m_argv.h"
#include "filesystem.h"
#include "c_dispatch.h"
@ -218,13 +217,13 @@ static void SetupDMXGUS()
//
//==========================================================================
void I_InitMusic(void)
void I_InitMusic(int musicstate)
{
I_InitSoundFonts();
snd_musicvolume->Callback ();
nomusic = !!Args->CheckParm("-nomusic") || !!Args->CheckParm("-nosound");
nomusic = musicstate;
snd_mididevice->Callback();

View file

@ -34,27 +34,16 @@
#ifndef __I_MUSIC_H__
#define __I_MUSIC_H__
#include "c_cvars.h"
class FileReader;
struct FOptionValues;
//
// MUSIC I/O
//
void I_InitMusic ();
void I_BuildMIDIMenuList (FOptionValues *);
void I_InitMusic (int);
// Volume.
void I_SetRelativeVolume(float);
void I_SetMusicVolume (double volume);
extern int nomusic;
EXTERN_CVAR(Bool, mus_enabled)
EXTERN_CVAR(Float, snd_musicvolume)
inline float AmplitudeTodB(float amplitude)
{

View file

@ -53,9 +53,11 @@
#include "gain_analysis.h"
#include "i_specialpaths.h"
#include "configfile.h"
#include "c_cvars.h"
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
extern int nomusic;
extern float S_GetMusicVolume (const char *music);
static void S_ActivatePlayList(bool goBack);
@ -81,6 +83,8 @@ static MusicCallbacks mus_cb = { nullptr, DefaultOpenMusic };
// PUBLIC DATA DEFINITIONS -------------------------------------------------
EXTERN_CVAR(Bool, mus_enabled)
EXTERN_CVAR(Float, snd_musicvolume)
EXTERN_CVAR(Int, snd_mididevice)
EXTERN_CVAR(Float, mod_dumb_mastervolume)
EXTERN_CVAR(Float, fluid_gain)

View file

@ -1662,6 +1662,7 @@ static void InitMusicMenus()
// Special menus will be created once all engine data is loaded
//
//=============================================================================
void I_BuildMIDIMenuList(FOptionValues*);
void M_CreateMenus()
{

View file

@ -66,6 +66,7 @@
#include "g_game.h"
#include "s_music.h"
#include "v_draw.h"
#include "m_argv.h"
// PUBLIC DATA DEFINITIONS -------------------------------------------------
@ -229,7 +230,7 @@ void S_Init()
}
I_InitSound();
I_InitMusic();
I_InitMusic(Args->CheckParm("-nomusic") || Args->CheckParm("-nosound"));
// Heretic and Hexen have sound curve lookup tables. Doom does not.
int curvelump = fileSystem.CheckNumForName("SNDCURVE");