about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJoel de Vahl <joel@stalverk80.se>2009-01-11 12:10:30 +0000
committerJoel de Vahl <joel@stalverk80.se>2009-01-11 12:10:30 +0000
commit2a7402dd6c78e5b0e41bae57bfdd8aec57545f0d (patch)
tree846542258748f31953eadbe770fe3e6bbde191ac /src
parent2aafe11723e8c30b0482bbefb4c1c9a25fba92b3 (diff)
downloadzcatch-2a7402dd6c78e5b0e41bae57bfdd8aec57545f0d.tar.gz
zcatch-2a7402dd6c78e5b0e41bae57bfdd8aec57545f0d.zip
use dmg for osx deliver, build universal binary, fix backspace being entered as a character
Diffstat (limited to 'src')
-rw-r--r--src/engine/client/ec_snd.c11
-rw-r--r--src/game/client/components/menus.cpp2
-rw-r--r--src/game/editor/ed_editor.cpp2
3 files changed, 9 insertions, 6 deletions
diff --git a/src/engine/client/ec_snd.c b/src/engine/client/ec_snd.c
index a7219b65..ed66cc1f 100644
--- a/src/engine/client/ec_snd.c
+++ b/src/engine/client/ec_snd.c
@@ -36,7 +36,7 @@ typedef struct
 	int pan;
 } CHANNEL;
 
-typedef struct VOICE_t
+typedef struct
 {
 	SAMPLE *snd;
 	CHANNEL *channel;
@@ -59,6 +59,8 @@ static int center_y = 0;
 static int mixing_rate = 48000;
 static volatile int sound_volume = 100;
 
+static int next_voice = 0;
+
 void snd_set_channel(int cid, float vol, float pan)
 {
 	channels[cid].vol = (int)(vol*255.0f);
@@ -73,12 +75,13 @@ static int play(int cid, int sid, int flags, float x, float y)
 	lock_wait(sound_lock);
 	
 	/* search for voice */
-	/* TODO: fix this linear search */
 	for(i = 0; i < NUM_VOICES; i++)
 	{
-		if(!voices[i].snd)
+		int id = (next_voice + i) % NUM_VOICES;
+		if(!voices[id].snd)
 		{
-			vid = i;
+			vid = id;
+			next_voice = id+1;
 			break;
 		}
 	}
diff --git a/src/game/client/components/menus.cpp b/src/game/client/components/menus.cpp
index 3122a3bd..29372b62 100644
--- a/src/game/client/components/menus.cpp
+++ b/src/game/client/components/menus.cpp
@@ -240,7 +240,7 @@ int MENUS::ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, f
 			if (at_index > len)
 				at_index = len;
 			
-			if (!(c >= 0 && c < 32))
+			if (!(c >= 0 && c < 32) && c != 127)
 			{
 				if (len < str_size - 1 && at_index < str_size - 1)
 				{
diff --git a/src/game/editor/ed_editor.cpp b/src/game/editor/ed_editor.cpp
index 6908484b..bc02d2b4 100644
--- a/src/game/editor/ed_editor.cpp
+++ b/src/game/editor/ed_editor.cpp
@@ -217,7 +217,7 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo
 			if (at_index > len)
 				at_index = len;
 			
-			if (!(c >= 0 && c < 32))
+			if (!(c >= 0 && c < 32) && c != 127)
 			{
 				if (len < str_size - 1 && at_index < str_size - 1)
 				{