X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=snd_main.c;h=6f3bf31e1294bd9f313377db4c08ebd6b1c9c29e;hb=6d2aecb1bb2e09cdd6ff0c3d44600d1af67b2305;hp=3e8d52a86ccd8dcb3c44123b32cbc6b54a0918d6;hpb=feb22f39c2c1a481b8c7a2364767b6402d5d94a1;p=xonotic%2Fdarkplaces.git diff --git a/snd_main.c b/snd_main.c index 3e8d52a8..6f3bf31e 100644 --- a/snd_main.c +++ b/snd_main.c @@ -661,6 +661,8 @@ void S_Startup (void) #ifdef CONFIG_VIDEO_CAPTURE recording_sound = false; #endif + + CDAudio_Startup(); } void S_Shutdown(void) @@ -668,6 +670,8 @@ void S_Shutdown(void) if (snd_renderbuffer == NULL) return; + CDAudio_Shutdown(); + oldpaintedtime = snd_renderbuffer->endframe; if (simsound) @@ -778,8 +782,8 @@ void S_Init(void) if (Sys_CheckParm("-nosound")) { // dummy out Play and Play2 because mods stuffcmd that - Cmd_AddCommand(CF_CLIENT, "play", Host_NoOperation_f, "does nothing because -nosound was specified"); - Cmd_AddCommand(CF_CLIENT, "play2", Host_NoOperation_f, "does nothing because -nosound was specified"); + Cmd_AddCommand(CF_CLIENT, "play", Cmd_NoOperation_f, "does nothing because -nosound was specified"); + Cmd_AddCommand(CF_CLIENT, "play2", Cmd_NoOperation_f, "does nothing because -nosound was specified"); return; } @@ -824,6 +828,8 @@ void S_Init(void) #ifdef USEXMP XMP_OpenLibrary (); #endif + + CDAudio_Init(); } @@ -2240,7 +2246,7 @@ void S_ExtraUpdate (void) S_PaintAndSubmit(); } -qbool S_LocalSound (const char *sound) +qbool S_LocalSoundEx (const char *sound, int chan, float fvol) { sfx_t *sfx; int ch_ind; @@ -2261,10 +2267,15 @@ qbool S_LocalSound (const char *sound) // fun fact: in Quake 1, this used -1 "replace any entity channel", // which we no longer support anyway // changed by Black in r4297 "Changed S_LocalSound to play multiple sounds at a time." - ch_ind = S_StartSound (cl.viewentity, 0, sfx, vec3_origin, 1, 0); + ch_ind = S_StartSound (cl.viewentity, chan, sfx, vec3_origin, fvol, 0); if (ch_ind < 0) return false; channels[ch_ind].flags |= CHANNELFLAG_LOCALSOUND; return true; } + +qbool S_LocalSound (const char *sound) +{ + return S_LocalSoundEx(sound, 0, 1); +}