]> icculus.org git repositories - divverent/nexuiz.git/blob - menusrc/sound.qc
First commit (this actually is a copy of the dpmod qc from 30.10.03 22:55)
[divverent/nexuiz.git] / menusrc / sound.qc
1 ///////////////////////////////////////////////
2 // Sound Source File
3 ///////////////////////
4 // This file belongs to dpmod/darkplaces
5 // AK contains all manager constants, etc.
6 ///////////////////////////////////////////////
7
8 void(void) snd_init =
9 {
10         snd_loadsound(SOUND_SELECT, SOUND_ENFORCELOADING);
11         snd_loadsound(SOUND_CHANGE, SOUND_ENFORCELOADING);
12         snd_loadsound(SOUND_ACTION, SOUND_ENFORCELOADING);
13 };
14
15 void(void) snd_frame =
16 {
17 };
18
19 void(void) snd_toggle =
20 {
21 };
22
23 void(float keynr, float ascii) snd_keydown =
24 {
25 };
26
27 void(void) snd_shutdown =
28 {
29         snd_unloadsound(SOUND_SELECT);
30         snd_unloadsound(SOUND_CHANGE);
31         snd_unloadsound(SOUND_ACTION);
32 };
33
34 void(string sound_name) snd_play =
35 {
36         localsound(sound_name);
37 };
38
39 string(string sound_name, float complain) snd_loadsound =
40 {
41         string c;
42
43         c = precache_sound(sound_name);
44
45         if(c == "" && complain)
46                 error("Couldn't load ", sound_name, " !\n");
47         return c;
48 };
49
50 void(string sound_name) snd_unloadsound =
51 {
52         // FIXME: there is now free/unload sound at the moment
53         // at least non that works the way it should
54 };
55