about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2011-06-27 22:57:06 +0200
committeroy <Tom_Adams@web.de>2011-06-27 22:57:06 +0200
commit47cdd2524b4d5bff7f171686af8260aa8a083c50 (patch)
tree53c8ee7eb8dfcfd98b22ed93dbadf3dd86bc2977 /src/engine/client
parente8938e3d8044d5f4a71c578c69019052f6a07bf1 (diff)
downloadzcatch-47cdd2524b4d5bff7f171686af8260aa8a083c50.tar.gz
zcatch-47cdd2524b4d5bff7f171686af8260aa8a083c50.zip
do not try to play sound when it isn't enabled
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/sound.cpp2
-rw-r--r--src/engine/client/sound.h4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/engine/client/sound.cpp b/src/engine/client/sound.cpp
index 4678bb8a..52f51bcb 100644
--- a/src/engine/client/sound.cpp
+++ b/src/engine/client/sound.cpp
@@ -54,7 +54,6 @@ static CVoice m_aVoices[NUM_VOICES] = { {0} };
 static CChannel m_aChannels[NUM_CHANNELS] = { {255, 0} };
 
 static LOCK m_SoundLock = 0;
-static int m_SoundEnabled = 0;
 
 static int m_CenterX = 0;
 static int m_CenterY = 0;
@@ -198,6 +197,7 @@ static void SdlCallback(void *pUnused, Uint8 *pStream, int Len)
 
 int CSound::Init()
 {
+	m_SoundEnabled = 0;
 	m_pGraphics = Kernel()->RequestInterface<IEngineGraphics>();
 	m_pStorage = Kernel()->RequestInterface<IStorage>();
 	
diff --git a/src/engine/client/sound.h b/src/engine/client/sound.h
index 3cc84d4d..8112427c 100644
--- a/src/engine/client/sound.h
+++ b/src/engine/client/sound.h
@@ -7,6 +7,8 @@
 
 class CSound : public IEngineSound
 {
+	int m_SoundEnabled;
+
 public:
 	IEngineGraphics *m_pGraphics;
 	IStorage *m_pStorage;
@@ -23,6 +25,8 @@ public:
 	static IOHANDLE ms_File;
 	static int ReadData(void *pBuffer, int Size);
 
+	virtual bool IsSoundEnabled() { return m_SoundEnabled != 0; }
+
 	virtual int LoadWV(const char *pFilename);
 
 	virtual void SetListenerPos(float x, float y);