diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/neverhood.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/sound.cpp | 9 |
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 12703d9f39..5e9981caa6 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -79,7 +79,7 @@ GameModule::GameModule(NeverhoodEngine *vm) _mainMenuRequested(false) { // Other initializations moved to actual engine class - _vm->_soundMan->playSoundThree(0x002D0031, 0x8861079); + _vm->_soundMan->playSoundThree(0x002D0031, 0x08861079); SetMessageHandler(&GameModule::handleMessage); } @@ -427,6 +427,8 @@ void GameModule::checkRequests() { _vm->_audioResourceMan->stopAllSounds(); _vm->_soundMan->stopAllMusic(); _vm->_soundMan->stopAllSounds(); + // Reinsert turning sound because SoundMan::stopAllSounds() removes it + _vm->_soundMan->playSoundThree(0x002D0031, 0x08861079); delete _childObject; delete _prevChildObject; _childObject = NULL; diff --git a/engines/neverhood/neverhood.cpp b/engines/neverhood/neverhood.cpp index 82590d6c96..6b1f2d9346 100644 --- a/engines/neverhood/neverhood.cpp +++ b/engines/neverhood/neverhood.cpp @@ -197,11 +197,11 @@ void NeverhoodEngine::mainLoop() { _gameModule->draw(); _console->onFrame(); _screen->update(); + if (_updateSound) + _soundMan->update(); nextFrameTime = _screen->getNextFrameTime(); }; - if (_updateSound) - _soundMan->update(); _audioResourceMan->updateMusic(); _system->updateScreen(); diff --git a/engines/neverhood/sound.cpp b/engines/neverhood/sound.cpp index 6888cc56bc..5821fd6df3 100644 --- a/engines/neverhood/sound.cpp +++ b/engines/neverhood/sound.cpp @@ -241,13 +241,13 @@ void SoundItem::update() { if (_playOnceAfterCountdown) { if (_currCountdown == 0) _currCountdown = _initialCountdown; - else if (--_currCountdown == 0) + else if (--_currCountdown <= 0) _soundResource->play(); } else if (_playOnceAfterRandomCountdown) { if (_currCountdown == 0) { if (_minCountdown > 0 && _maxCountdown > 0 && _minCountdown < _maxCountdown) _currCountdown = _vm->_rnd->getRandomNumberRng(_minCountdown, _maxCountdown); - } else if (--_currCountdown == 0) + } else if (--_currCountdown <= 0) _soundResource->play(); } else if (_playLooping && !_soundResource->isPlaying()) _soundResource->playLooping(); @@ -257,8 +257,8 @@ void SoundItem::update() { SoundMan::SoundMan(NeverhoodEngine *vm) : _vm(vm), _soundIndex1(-1), _soundIndex2(-1), _soundIndex3(-1), - _initialCountdown(0), _playOnceAfterCountdown(false), - _initialCountdown3(0), _playOnceAfterCountdown3(false) { + _initialCountdown(15), _playOnceAfterCountdown(false), + _initialCountdown3(9), _playOnceAfterCountdown3(false) { } SoundMan::~SoundMan() { @@ -379,7 +379,6 @@ void SoundMan::update() { if (soundItem) soundItem->update(); } - for (uint i = 0; i < _musicItems.size(); ++i) { MusicItem *musicItem = _musicItems[i]; if (musicItem) |