From b3f5ce5482ebc372f2a9e8237d7813a90c4a02c5 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Mon, 8 Oct 2007 20:36:37 +0000 Subject: added some comments --- src/engine/client/snd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/engine/client/snd.c b/src/engine/client/snd.c index 18bc7f6a..79121584 100644 --- a/src/engine/client/snd.c +++ b/src/engine/client/snd.c @@ -57,7 +57,7 @@ static int mixing_rate = 48000; void snd_set_channel(int cid, float vol, float pan) { channels[cid].vol = (int)(vol*255.0f); - channels[cid].pan = (int)(pan*255.0f); + channels[cid].pan = (int)(pan*255.0f); /* TODO: this is only on and off right now */ } static int play(int cid, int sid, int flags, float x, float y) @@ -112,7 +112,7 @@ void snd_stop(int vid) lock_release(sound_lock); } -/* there should be a faster way todo this */ +/* TODO: there should be a faster way todo this */ static short int2short(int i) { if(i > 0x7fff) @@ -165,6 +165,7 @@ static void mix(short *final_out, unsigned frames) /* volume calculation */ if(v->flags&SNDFLAG_POS && v->channel->pan) { + /* TODO: we should respect the channel panning value */ const int range = 1500; /* magic value, remove */ int dx = v->x - center_x; int dy = v->y - center_y; @@ -205,6 +206,7 @@ static void mix(short *final_out, unsigned frames) lock_release(sound_lock); /* clamp accumulated values */ + /* TODO: this seams slow */ for(i = 0; i < frames; i++) { int j = i<<1; -- cgit 1.4.1