while (i < Cmd_Argc (cmd))
{
// Get the name, and appends ".wav" as an extension if there's none
- strlcpy (name, Cmd_Argv(cmd, i), sizeof (name));
+ dp_strlcpy (name, Cmd_Argv(cmd, i), sizeof (name));
if (!strrchr (name, '.'))
- strlcat (name, ".wav", sizeof (name));
+ dp_strlcat (name, ".wav", sizeof (name));
i++;
// If we need to get the volume from the command line
#ifdef CONFIG_VIDEO_CAPTURE
recording_sound = false;
#endif
+
+ CDAudio_Startup();
}
void S_Shutdown(void)
if (snd_renderbuffer == NULL)
return;
+ CDAudio_Shutdown();
+
oldpaintedtime = snd_renderbuffer->endframe;
if (simsound)
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;
}
#ifdef USEXMP
XMP_OpenLibrary ();
#endif
+
+ CDAudio_Init();
}
// Add a sfx_t struct for this sound
sfx = (sfx_t *)Mem_Alloc (snd_mempool, sizeof (*sfx));
memset (sfx, 0, sizeof(*sfx));
- strlcpy (sfx->name, name, sizeof (sfx->name));
+ dp_strlcpy (sfx->name, name, sizeof (sfx->name));
sfx->memsize = sizeof(*sfx);
sfx->next = known_sfx;
known_sfx = sfx;
{
//Con_Printf("-- entnum %i origin %f %f %f neworigin %f %f %f\n", ch->entnum, ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]);
- if (ch->entnum > MAX_EDICTS)
+ if (CLVM_prog->loaded && ch->entnum > MAX_EDICTS)
if (!CL_VM_GetEntitySoundOrigin(ch->entnum, ch->origin))
ch->entnum = MAX_EDICTS; // entity was removed, disown sound
}
else
Matrix4x4_OriginFromMatrix(&cl.entities[ch->entnum].render.matrix, ch->origin);
}
- else if (cl.csqc_server2csqcentitynumber[ch->entnum])
+ else if (CLVM_prog->loaded && cl.csqc_server2csqcentitynumber[ch->entnum])
{
//Con_Printf("-- entnum %i (client %i) origin %f %f %f neworigin %f %f %f\n", ch->entnum, cl.csqc_server2csqcentitynumber[ch->entnum], ch->origin[0], ch->origin[1], ch->origin[2], cl.entities[ch->entnum].state_current.origin[0], cl.entities[ch->entnum].state_current.origin[1], cl.entities[ch->entnum].state_current.origin[2]);
S_PaintAndSubmit();
}
-qbool S_LocalSound (const char *sound)
+qbool S_LocalSoundEx (const char *sound, int chan, float fvol)
{
sfx_t *sfx;
int ch_ind;
// 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);
+}