diff options
author | Bastien Bouclet | 2018-04-21 17:36:46 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-04-21 17:36:46 +0200 |
commit | e421b18c3874702d66ff4bdd7e6c2416160c4270 (patch) | |
tree | 15283192619f4ffed8d7fae7166d6f3e3b97d5f7 /engines/mohawk/myst_stacks | |
parent | 08bbef8f7d62c485105908a024acdd836329ca18 (diff) | |
parent | 7c7010204bc0099a806b3b68c01040564e07ae0f (diff) | |
download | scummvm-rg350-e421b18c3874702d66ff4bdd7e6c2416160c4270.tar.gz scummvm-rg350-e421b18c3874702d66ff4bdd7e6c2416160c4270.tar.bz2 scummvm-rg350-e421b18c3874702d66ff4bdd7e6c2416160c4270.zip |
Merge branch 'dafioram-myst_soundrecvrChanges'
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.cpp | 31 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.h | 10 |
2 files changed, 28 insertions, 13 deletions
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 246315013b..a91b9952b3 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -61,7 +61,7 @@ Selenitic::Selenitic(MohawkEngine_Myst *vm) : _soundReceiverCurrentSource = nullptr; _soundReceiverPosition = nullptr; - _soundReceiverSpeed = 0; + _soundReceiverSpeed = kSoundReceiverSpeedStill; _soundReceiverViewer = nullptr; _soundReceiverRightButton = nullptr; _soundReceiverLeftButton = nullptr; @@ -669,7 +669,7 @@ void Selenitic::soundReceiverLeftRight(uint direction) { _vm->_sound->stopEffect(); _soundReceiverDirection = direction; - _soundReceiverSpeed = 1; + _soundReceiverSpeed = kSoundReceiverSpeedSlow; _soundReceiverStartTime = _vm->_system->getMillis(); soundReceiverUpdate(); @@ -951,7 +951,7 @@ void Selenitic::soundReceiver_run() { if (_soundReceiverDirection) { uint32 currentTime = _vm->_system->getMillis(); - if (_soundReceiverSpeed == 50 && currentTime > _soundReceiverStartTime + 500) { + if (_soundReceiverSpeed == kSoundReceiverSpeedFast && currentTime > _soundReceiverStartTime + 500) { soundReceiverIncreaseSpeed(); _soundReceiverStartTime = currentTime; } else if (currentTime > _soundReceiverStartTime + 1000) { @@ -959,8 +959,9 @@ void Selenitic::soundReceiver_run() { _soundReceiverStartTime = currentTime; } - if (currentTime > _soundReceiverStartTime + 100) + if (_soundReceiverSpeed > kSoundReceiverSpeedSlow || currentTime > _soundReceiverStartTime + 100) { soundReceiverUpdate(); + } } else if (!_soundReceiverSigmaPressed) { soundReceiverUpdateSound(); } @@ -969,14 +970,20 @@ void Selenitic::soundReceiver_run() { void Selenitic::soundReceiverIncreaseSpeed() { switch (_soundReceiverSpeed) { - case 1: - _soundReceiverSpeed = 10; + case kSoundReceiverSpeedStill: + // Should not happen break; - case 10: - _soundReceiverSpeed = 50; + case kSoundReceiverSpeedSlow: + _soundReceiverSpeed = kSoundReceiverSpeedNormal; + break; + case kSoundReceiverSpeedNormal: + _soundReceiverSpeed = kSoundReceiverSpeedFast; + break; + case kSoundReceiverSpeedFast: + _soundReceiverSpeed = kSoundReceiverSpeedFaster; break; - case 50: - _soundReceiverSpeed = 100; + case kSoundReceiverSpeedFaster: + // Can't go faster break; } } @@ -1023,7 +1030,7 @@ uint16 Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) { if (sourceEnabled) { if (position == solution) { soundId = soundIdGood; - } else if (position > solution && position <= solution + 50) { + } else if (position > solution && position < solution + 50) { _soundReceiverNearBlinkCounter++; if (_soundReceiverNearBlinkCounter % 2) { _soundReceiverLeftButton->drawConditionalDataToScreen(2); @@ -1031,7 +1038,7 @@ uint16 Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) { _soundReceiverLeftButton->drawConditionalDataToScreen(0); } soundId = soundIdNear; - } else if (position < solution && position >= solution - 50) { + } else if (position < solution && position > solution - 50) { _soundReceiverNearBlinkCounter++; if (_soundReceiverNearBlinkCounter % 2) { _soundReceiverRightButton->drawConditionalDataToScreen(2); diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index 1dc1505ec2..368f6f2566 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -74,6 +74,14 @@ private: DECLARE_OPCODE(o_mazeRunnerRight_init); DECLARE_OPCODE(o_mazeRunnerLeft_init); + enum SoundReceiverSpeed { + kSoundReceiverSpeedStill = 0, + kSoundReceiverSpeedSlow = 1, + kSoundReceiverSpeedNormal = 5, // The original has this at 10 + kSoundReceiverSpeedFast = 10, // The original has this at 50 too fast! + kSoundReceiverSpeedFaster = 13, // The original has this at 100, way too fast! + }; + void soundReceiver_run(); MystGameState::Selenitic &_state; @@ -84,7 +92,7 @@ private: MystAreaImageSwitch *_soundReceiverCurrentSource; // 112 uint16 *_soundReceiverPosition; // 116 uint16 _soundReceiverDirection; // 120 - uint16 _soundReceiverSpeed; // 122 + SoundReceiverSpeed _soundReceiverSpeed; // 122 uint32 _soundReceiverStartTime; //124 uint _soundReceiverNearBlinkCounter; MystAreaImageSwitch *_soundReceiverViewer; // 128 |