void S_FreeSfx (sfx_t *sfx, qboolean force);
-static void S_Play_Common (float fvol, float attenuation)
+static void S_Play_Common (cmd_state_t *cmd, float fvol, float attenuation)
{
int i, ch_ind;
char name [MAX_QPATH];
sfx_t *sfx;
i = 1;
- while (i < Cmd_Argc ())
+ while (i < Cmd_Argc (cmd))
{
// Get the name, and appends ".wav" as an extension if there's none
- strlcpy (name, Cmd_Argv (i), sizeof (name));
+ strlcpy (name, Cmd_Argv(cmd, i), sizeof (name));
if (!strrchr (name, '.'))
strlcat (name, ".wav", sizeof (name));
i++;
// If we need to get the volume from the command line
if (fvol == -1.0f)
{
- fvol = atof (Cmd_Argv (i));
+ fvol = atof (Cmd_Argv(cmd, i));
i++;
}
}
}
-static void S_Play_f(void)
+static void S_Play_f(cmd_state_t *cmd)
{
- S_Play_Common (1.0f, 1.0f);
+ S_Play_Common(cmd, 1.0f, 1.0f);
}
-static void S_Play2_f(void)
+static void S_Play2_f(cmd_state_t *cmd)
{
- S_Play_Common (1.0f, 0.0f);
+ S_Play_Common(cmd, 1.0f, 0.0f);
}
-static void S_PlayVol_f(void)
+static void S_PlayVol_f(cmd_state_t *cmd)
{
- S_Play_Common (-1.0f, 0.0f);
+ S_Play_Common(cmd, -1.0f, 0.0f);
}
-static void S_SoundList_f (void)
+static void S_SoundList_f(cmd_state_t *cmd)
{
unsigned int i;
sfx_t *sfx;
}
-static void S_SoundInfo_f(void)
+static void S_SoundInfo_f(cmd_state_t *cmd)
{
if (snd_renderbuffer == NULL)
{
}
#if 0
- // LordHavoc: now you can with the resampler...
+ // LadyHavoc: now you can with the resampler...
// You can't change sound speed after start time (not yet supported)
if (prev_render_format.speed != 0)
{
sound_spatialized = false;
}
-static void S_Restart_f(void)
+static void S_Restart_f(cmd_state_t *cmd)
{
// NOTE: we can't free all sounds if we are running a map (this frees sfx_t that are still referenced by precaches)
// So, refuse to do this if we are connected.
if (COM_CheckParm("-nosound"))
{
// dummy out Play and Play2 because mods stuffcmd that
- Cmd_AddCommand("play", Host_NoOperation_f, "does nothing because -nosound was specified");
- Cmd_AddCommand("play2", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(&cmd_client, "play", Host_NoOperation_f, "does nothing because -nosound was specified");
+ Cmd_AddCommand(&cmd_client, "play2", Host_NoOperation_f, "does nothing because -nosound was specified");
return;
}
if (COM_CheckParm("-simsound"))
simsound = true;
- Cmd_AddCommand("play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
- Cmd_AddCommand("play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
- Cmd_AddCommand("playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
- Cmd_AddCommand("stopsound", S_StopAllSounds, "silence");
- Cmd_AddCommand("soundlist", S_SoundList_f, "list loaded sounds");
- Cmd_AddCommand("soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
- Cmd_AddCommand("snd_restart", S_Restart_f, "restart sound system");
- Cmd_AddCommand("snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
+ Cmd_AddCommand(&cmd_client, "play", S_Play_f, "play a sound at your current location (not heard by anyone else)");
+ Cmd_AddCommand(&cmd_client, "play2", S_Play2_f, "play a sound globally throughout the level (not heard by anyone else)");
+ Cmd_AddCommand(&cmd_client, "playvol", S_PlayVol_f, "play a sound at the specified volume level at your current location (not heard by anyone else)");
+ Cmd_AddCommand(&cmd_client, "stopsound", S_StopAllSounds_f, "silence");
+ Cmd_AddCommand(&cmd_client, "soundlist", S_SoundList_f, "list loaded sounds");
+ Cmd_AddCommand(&cmd_client, "soundinfo", S_SoundInfo_f, "print sound system information (such as channels and speed)");
+ Cmd_AddCommand(&cmd_client, "snd_restart", S_Restart_f, "restart sound system");
+ Cmd_AddCommand(&cmd_client, "snd_unloadallsounds", S_UnloadAllSounds_f, "unload all sound files");
Cvar_RegisterVariable(&nosound);
Cvar_RegisterVariable(&snd_precache);
S_UnloadAllSounds_f
==================
*/
-void S_UnloadAllSounds_f (void)
+void S_UnloadAllSounds_f(cmd_state_t *cmd)
{
int i;
ch->mixspeed = mixspeed;
// anything coming from the view entity will always be full volume
- // LordHavoc: make sounds with ATTN_NONE have no spatialization
+ // LadyHavoc: make sounds with ATTN_NONE have no spatialization
if (ch->entnum == cl.viewentity || ch->entnum == CL_VM_GetViewEntity() || ch->distfade == 0)
{
ch->prologic_invert = 1;
}
}
-void S_StopAllSounds (void)
+void S_StopAllSounds(void)
{
unsigned int i;
}
}
+void S_StopAllSounds_f(cmd_state_t *cmd)
+{
+ S_StopAllSounds();
+}
+
+
void S_PauseGameSounds (qboolean toggle)
{
unsigned int i;