summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-09-03 00:24:27 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-09-03 00:24:27 +0200
commit1be10947ba37964feb10e0cf45576b029043866b (patch)
tree6290098f8f07038e97a78871984a35c08a448b12
parentd32c8fc79a9b55a4fd6b1fdd3b0d7ea6efa27a24 (diff)
downloadplan9front-1be10947ba37964feb10e0cf45576b029043866b.tar.xz
doom: fix mixbuffer size confusion
-rw-r--r--sys/src/games/doom/i_sound.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/src/games/doom/i_sound.c b/sys/src/games/doom/i_sound.c
index daa24a088..54771728a 100644
--- a/sys/src/games/doom/i_sound.c
+++ b/sys/src/games/doom/i_sound.c
@@ -14,9 +14,6 @@
/* Needed for calling the actual sound output. */
#define SAMPLECOUNT (512<<2)
#define NUM_CHANNELS 8
-/* It is 2 for 16bit, and 2 for two channels */
-#define BUFMUL 4
-#define MIXBUFFERSIZE (SAMPLECOUNT*BUFMUL)
/* The actual lengths of all sound effects. */
int lengths[NUMSFX];
@@ -29,7 +26,7 @@ static int audio_fd;
** are modified and added, and stored in the buffer
** that is submitted to the audio device.
*/
-signed short mixbuffer[MIXBUFFERSIZE];
+signed short mixbuffer[SAMPLECOUNT*2];
/* The channel step amount... */
uint channelstep[NUM_CHANNELS];
@@ -153,7 +150,7 @@ void I_InitSound(void)
}
/* Now initialize mixbuffer with zero. */
- memset(mixbuffer, 0, sizeof(mixbuffer));
+ memset(mixbuffer, 0, sizeof mixbuffer);
}
/* This function loops all active (internal) sound
@@ -275,7 +272,7 @@ void I_UpdateSound(void)
void I_SubmitSound(void)
{
if(audio_fd >= 0)
- write(audio_fd, mixbuffer, MIXBUFFERSIZE);
+ write(audio_fd, mixbuffer, sizeof mixbuffer);
}
void I_ShutdownSound(void)