aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/myst_stacks
diff options
context:
space:
mode:
authorBastien Bouclet2018-04-21 17:32:11 +0200
committerBastien Bouclet2018-04-21 17:32:11 +0200
commit7c7010204bc0099a806b3b68c01040564e07ae0f (patch)
tree3dbe9b64a88e85e30790a259a193c604881752ec /engines/mohawk/myst_stacks
parentbfa97d8f7a87d02eb60ce4198988ef34d791837f (diff)
downloadscummvm-rg350-7c7010204bc0099a806b3b68c01040564e07ae0f.tar.gz
scummvm-rg350-7c7010204bc0099a806b3b68c01040564e07ae0f.tar.bz2
scummvm-rg350-7c7010204bc0099a806b3b68c01040564e07ae0f.zip
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.
Diffstat (limited to 'engines/mohawk/myst_stacks')
-rw-r--r--engines/mohawk/myst_stacks/selenitic.cpp27
-rw-r--r--engines/mohawk/myst_stacks/selenitic.h10
2 files changed, 26 insertions, 11 deletions
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