From d16bee4a0f2fc2114f8562218314d19d34397eed Mon Sep 17 00:00:00 2001 From: driAn Date: Mon, 18 Aug 2008 21:09:05 +0000 Subject: [PATCH] avoid all sound processing when audio=0 git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2340 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/sound.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/src/sound.cpp b/source/src/sound.cpp index 6e77e573..b94d043c 100644 --- a/source/src/sound.cpp +++ b/source/src/sound.cpp @@ -1299,12 +1299,14 @@ void musicsuggest(int id, int millis, bool rndofs) // play bg music if nothing e void musicfadeout(int id) { + if(nosound || !gamemusic) return; if(!gamemusic->playing() || !musics.inrange(id)) return; if(!strcmp(musics[id], gamemusic->name)) gamemusic->fadeout(lastmillis+1000, 1000); } void registermusic(char *name) { + if(nosound) return; if(!name || !name[0]) return; musics.add(newstring(name)); } @@ -1323,6 +1325,8 @@ int findsound(char *name, int vol, vector &sounds) int addsound(char *name, int vol, int maxuses, bool loop, vector &sounds) { + if(nosound) return -1; + sbuffer *b = bufferpool.find(name); if(!b) { @@ -1522,6 +1526,8 @@ void playsound(int n, const vec *v, int priority) { playsound(n, new staticrefer void playsoundname(char *s, const vec *loc, int vol) { + if(!nosound) return; + if(vol <= 0) vol = 100; int id = findsound(s, vol, gamesounds); if(id < 0) id = addsound(s, vol, 0, false, gamesounds);