diff options
author | johndoe123 | 2012-10-01 10:40:10 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:43:44 +0200 |
commit | 0a1a228a883b3c13915a9e83886464b85ed2c81e (patch) | |
tree | 976d9ef67d1dbb07d25d8e31777ddd90bbdcbf3d | |
parent | 0c272631df66fc574e2d1bb67d4aa22f434dd178 (diff) | |
download | scummvm-rg350-0a1a228a883b3c13915a9e83886464b85ed2c81e.tar.gz scummvm-rg350-0a1a228a883b3c13915a9e83886464b85ed2c81e.tar.bz2 scummvm-rg350-0a1a228a883b3c13915a9e83886464b85ed2c81e.zip |
NEVERHOOD: Change sound stuff in Module1700
- Add Entity::setSoundVolume
-rw-r--r-- | engines/neverhood/entity.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/entity.h | 1 | ||||
-rw-r--r-- | engines/neverhood/module1700.cpp | 8 | ||||
-rw-r--r-- | engines/neverhood/module1700.h | 1 |
4 files changed, 9 insertions, 5 deletions
diff --git a/engines/neverhood/entity.cpp b/engines/neverhood/entity.cpp index d7d78969d2..0cb906acbd 100644 --- a/engines/neverhood/entity.cpp +++ b/engines/neverhood/entity.cpp @@ -142,6 +142,10 @@ bool Entity::isSoundPlaying(uint index) { return getSoundResource(index)->isPlaying(); } +void Entity::setSoundVolume(uint index, int volume) { + getSoundResource(index)->setVolume(volume); +} + void Entity::deleteSoundResources() { if (_soundResources) { for (uint i = 0; i < kMaxSoundResources; ++i) diff --git a/engines/neverhood/entity.h b/engines/neverhood/entity.h index eafc467b55..b0348ea60b 100644 --- a/engines/neverhood/entity.h +++ b/engines/neverhood/entity.h @@ -109,6 +109,7 @@ protected: void loadSound(uint index, uint32 fileHash); void playSound(uint index, uint32 fileHash = 0); bool isSoundPlaying(uint index); + void setSoundVolume(uint index, int volume); void deleteSoundResources(); }; diff --git a/engines/neverhood/module1700.cpp b/engines/neverhood/module1700.cpp index 13d0f35198..f914fa9c5b 100644 --- a/engines/neverhood/module1700.cpp +++ b/engines/neverhood/module1700.cpp @@ -34,7 +34,7 @@ static const uint32 kModule1700SoundList[] = { }; Module1700::Module1700(NeverhoodEngine *vm, Module *parentModule, int which) - : Module(vm, parentModule), _soundResource(vm) { + : Module(vm, parentModule) { _vm->_soundMan->addMusic(0x04212331, 0x31114225); _vm->_soundMan->addSoundList(0x04212331, kModule1700SoundList); @@ -105,9 +105,9 @@ void Module1700::updateScene() { } else if (_moduleResult == 1) { createScene(1, 1); } else if (_moduleResult == 2) { - if (!_soundResource.isPlaying()) { - _soundResource.setVolume(60); - _soundResource.play(0x58B45E58); + if (!isSoundPlaying(0)) { + setSoundVolume(0, 60); + playSound(0, 0x58B45E58); } createScene(2, 2); } diff --git a/engines/neverhood/module1700.h b/engines/neverhood/module1700.h index f7388484b2..2488c46e49 100644 --- a/engines/neverhood/module1700.h +++ b/engines/neverhood/module1700.h @@ -35,7 +35,6 @@ public: Module1700(NeverhoodEngine *vm, Module *parentModule, int which); virtual ~Module1700(); protected: - SoundResource _soundResource; void createScene(int sceneNum, int which); void updateScene(); }; |