diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-27 19:32:35 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2007-11-27 19:32:35 +0000 |
| commit | 8fa8485a3a207565a610dac981cb2da2a6a6d040 (patch) | |
| tree | 5ee8d57e86c4e7d5b17fc8772f79e719d1789c92 /src/game/client/game_client.cpp | |
| parent | 9a8c0809c78782a1bcd038fe29277c12dbe781b8 (diff) | |
| download | zcatch-8fa8485a3a207565a610dac981cb2da2a6a6d040.tar.gz zcatch-8fa8485a3a207565a610dac981cb2da2a6a6d040.zip | |
fixed CTF sounds. fixed close teewars bug
Diffstat (limited to 'src/game/client/game_client.cpp')
| -rw-r--r-- | src/game/client/game_client.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index d4a0ced9..e1949611 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -24,6 +24,7 @@ enum CHN_GUI=0, CHN_MUSIC, CHN_WORLD, + CHN_GLOBAL, }; data_container *data = 0x0; @@ -550,7 +551,8 @@ extern "C" void modc_init() // setup sound channels snd_set_channel(CHN_GUI, 1.0f, 0.0f); snd_set_channel(CHN_MUSIC, 1.0f, 0.0f); - snd_set_channel(CHN_WORLD, 1.0f, 1.0f); + snd_set_channel(CHN_WORLD, 0.9f, 1.0f); + snd_set_channel(CHN_GLOBAL, 1.0f, 0.0f); // load the data container data = load_data_from_memory(internal_data); @@ -718,22 +720,11 @@ static void process_events(int s) temp_system.new_particle(p, v, 0.5f+0.5f*frandom(), 16.0f, 128.0f, 0.985f); } } - else if(item.type == EVENT_SOUND) + else if(item.type == EVENT_SOUND_WORLD) { ev_sound *ev = (ev_sound *)data; - vec2 p(ev->x, ev->y); - int soundid = ev->sound; //(ev->sound & SOUND_MASK); - //bool bstartloop = (ev->sound & SOUND_LOOPFLAG_STARTLOOP) != 0; - //bool bstoploop = (ev->sound & SOUND_LOOPFLAG_STOPLOOP) != 0; - //float vol, pan; - //sound_vol_pan(p, &vol, &pan); - - if(soundid >= 0 && soundid < NUM_SOUNDS) - { - // TODO: we need to control the volume of the diffrent sounds - // depening on the category - snd_play_random(CHN_WORLD, soundid, 1.0f, p); - } + if(ev->sound >= 0 && ev->sound < NUM_SOUNDS) + snd_play_random(CHN_WORLD, ev->sound, 1.0f, vec2(ev->x, ev->y)); } } } @@ -2789,6 +2780,11 @@ extern "C" void modc_message(int msg) client_datas[cid].emoticon = emoticon; client_datas[cid].emoticon_start = client_tick(); } + else if(msg == MSG_SOUND_GLOBAL) + { + int soundid = msg_unpack_int(); + snd_play_random(CHN_GLOBAL, soundid, 1.0f, vec2(0,0)); + } } extern "C" void modc_connected() |