Skip to content

Commit 16a3044

Browse files
committed
Added a no_music CLI toggle to disable music (fixes #159).
1 parent b42edb4 commit 16a3044

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

client/snd_miniaudio.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ static qboolean trackFinished = false;
5555
static cvar_t *cd_volume;
5656
static cvar_t *cd_loopcount;
5757
static cvar_t *cd_looptrack;
58+
static cvar_t *no_music;
5859

5960
#ifdef __APPLE__
6061
static ma_uint32 periodSizeInFrames;
@@ -197,7 +198,8 @@ void Miniaudio_Init(void)
197198
cd_volume = Cvar_Get("cd_volume", "1", CVAR_ARCHIVE);
198199
cd_loopcount = Cvar_Get("cd_loopcount", "4", 0);
199200
cd_looptrack = Cvar_Get("cd_looptrack", "11", 0);
200-
enabled = true;
201+
no_music = Cvar_Get("no_music", "0", 0);
202+
enabled = no_music->value == 0;
201203
paused = false;
202204

203205
#ifdef __APPLE__
@@ -300,6 +302,9 @@ void Miniaudio_Stop(void)
300302

301303
void Miniaudio_Update(void)
302304
{
305+
if (no_music->value != 0)
306+
return;
307+
303308
if (cd_volume->modified)
304309
{
305310
cd_volume->modified = false;

0 commit comments

Comments
 (0)