From 5a1fc8c23039c877fb1bc887631b04a5b93b6d51 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 21 Apr 2018 07:05:23 -0700 Subject: MOHAWK: MYST: Enhance: slow down sound receiver max spin rate This slows down the Selentic age sound receiver spin rate when fully depressing either of the turn buttons. This is a deviation from the original and improves the users experience. In the original when the button is fully depressed the receiver turns so fast that it is impossible to predict what angle you full be at when you let go. --- engines/mohawk/myst_stacks/selenitic.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/mohawk/myst_stacks') diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 246315013b..6d5aabd4ec 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -970,13 +970,13 @@ void Selenitic::soundReceiver_run() { void Selenitic::soundReceiverIncreaseSpeed() { switch (_soundReceiverSpeed) { case 1: - _soundReceiverSpeed = 10; + _soundReceiverSpeed = 5; // The original has this at 10 break; - case 10: - _soundReceiverSpeed = 50; + case 5: + _soundReceiverSpeed = 10; // The original has this at 50 too fast! break; - case 50: - _soundReceiverSpeed = 100; + case 10: + _soundReceiverSpeed = 13; // The original has this at 100, way too fast! break; } } -- cgit v1.2.3 From bfa97d8f7a87d02eb60ce4198988ef34d791837f Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Sat, 21 Apr 2018 07:15:34 -0700 Subject: MOHAWK: MYST: Make sound receiver hint boundary line up with orig In the original the sound reciever would provide a hint of the source sound direction when the user was less than 5 degrees away. In ScummVM it was less than or equal to 5 degrees. Now it matches the behavior of the original. --- engines/mohawk/myst_stacks/selenitic.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/mohawk/myst_stacks') diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 6d5aabd4ec..a74f3318f9 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -1023,7 +1023,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 +1031,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); -- cgit v1.2.3 From 7c7010204bc0099a806b3b68c01040564e07ae0f Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 21 Apr 2018 17:32:11 +0200 Subject: MOHAWK: MYST: Always redraw the sound receiver at constant speeds Fixes the sound receiver display stopping for a little while every second or so when keeping a direction button pressed. --- engines/mohawk/myst_stacks/selenitic.cpp | 27 +++++++++++++++++---------- engines/mohawk/myst_stacks/selenitic.h | 10 +++++++++- 2 files changed, 26 insertions(+), 11 deletions(-) (limited to 'engines/mohawk/myst_stacks') diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index a74f3318f9..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 = 5; // The original has this at 10 + case kSoundReceiverSpeedStill: + // Should not happen break; - case 5: - _soundReceiverSpeed = 10; // The original has this at 50 too fast! + case kSoundReceiverSpeedSlow: + _soundReceiverSpeed = kSoundReceiverSpeedNormal; break; - case 10: - _soundReceiverSpeed = 13; // The original has this at 100, way too fast! + case kSoundReceiverSpeedNormal: + _soundReceiverSpeed = kSoundReceiverSpeedFast; + break; + case kSoundReceiverSpeedFast: + _soundReceiverSpeed = kSoundReceiverSpeedFaster; + break; + case kSoundReceiverSpeedFaster: + // Can't go faster break; } } 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 -- cgit v1.2.3