From dc930150cfef40a9e3e2ce9dc0ba4a3c5b754d4f Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Wed, 13 Oct 2010 18:00:39 +0000 Subject: [PATCH] Und noch ein paar Dinge mehr am Sound gemacht --- src/client/sound/snd_dma.c | 17 +++++++++++++---- src/client/sound/snd_mix.c | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/client/sound/snd_dma.c b/src/client/sound/snd_dma.c index 42229005..27802ce1 100644 --- a/src/client/sound/snd_dma.c +++ b/src/client/sound/snd_dma.c @@ -62,11 +62,11 @@ int paintedtime; than could actually be referenced during gameplay, because we don't want to free anything until we are sure we won't need it. */ -#define MAX_SFX (MAX_SOUNDS*3) +#define MAX_SFX (MAX_SOUNDS*2) sfx_t known_sfx[MAX_SFX]; int num_sfx; -#define MAX_PLAYSOUNDS 96 +#define MAX_PLAYSOUNDS 128 playsound_t s_playsounds[MAX_PLAYSOUNDS]; playsound_t s_freeplays; playsound_t s_pendingplays; @@ -432,7 +432,9 @@ playsound_t *S_AllocPlaysound (void) { ps = s_freeplays.next; if (ps == &s_freeplays) + { return NULL; /* no free playsounds, this results in stuttering an cracking */ + } /* unlink from freelist */ ps->prev->next = ps->next; @@ -648,7 +650,7 @@ void S_StartLocalSound (char *sound) { return; } - S_StartSound (NULL, cl.playernum+1, 0, sfx, 1, ATTN_NONE, 0); + S_StartSound (NULL, cl.playernum+1, 0, sfx, 1, 1, 0); } void S_ClearBuffer (void) { @@ -668,7 +670,14 @@ void S_ClearBuffer (void) { SNDDMA_BeginPainting (); if (dma.buffer) { - memset(dma.buffer, clear, dma.samples * dma.samplebits/8); + int i; + unsigned char *ptr = (unsigned char *)dma.buffer; + + i = dma.samples * dma.samplebits / 8; + while (i--) { + *ptr = clear; + ptr++; + } } SNDDMA_Submit (); diff --git a/src/client/sound/snd_mix.c b/src/client/sound/snd_mix.c index 7c318baf..948ef366 100644 --- a/src/client/sound/snd_mix.c +++ b/src/client/sound/snd_mix.c @@ -29,7 +29,7 @@ #include "../header/client.h" #include "header/local.h" -#define PAINTBUFFER_SIZE 8192 +#define PAINTBUFFER_SIZE 2048 portable_samplepair_t paintbuffer[PAINTBUFFER_SIZE]; int snd_scaletable[32][256];