diff options
Diffstat (limited to 'engines/mohawk')
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.cpp | 23 | ||||
-rw-r--r-- | engines/mohawk/myst_stacks/selenitic.h | 1 |
2 files changed, 20 insertions, 4 deletions
diff --git a/engines/mohawk/myst_stacks/selenitic.cpp b/engines/mohawk/myst_stacks/selenitic.cpp index 087143abfc..e9439047ff 100644 --- a/engines/mohawk/myst_stacks/selenitic.cpp +++ b/engines/mohawk/myst_stacks/selenitic.cpp @@ -44,6 +44,7 @@ Selenitic::Selenitic(MohawkEngine_Myst *vm) : _soundReceiverDirection = 0; _soundReceiverStartTime = 0; + _soundReceiverNearBlinkCounter = 0; } Selenitic::~Selenitic() { @@ -990,13 +991,26 @@ uint16 Selenitic::soundReceiverCurrentSound(uint16 source, uint16 position) { if (position == solution) { soundId = soundIdGood; } else if (position > solution && position <= solution + 50) { - _soundReceiverLeftButton->drawConditionalDataToScreen(2); - _soundReceiverLeftButton->drawConditionalDataToScreen(0); + _soundReceiverNearBlinkCounter++; + if (_soundReceiverNearBlinkCounter % 2) { + _soundReceiverLeftButton->drawConditionalDataToScreen(2); + } else { + _soundReceiverLeftButton->drawConditionalDataToScreen(0); + } soundId = soundIdNear; } else if (position < solution && position >= solution - 50) { - _soundReceiverRightButton->drawConditionalDataToScreen(2); - _soundReceiverRightButton->drawConditionalDataToScreen(0); + _soundReceiverNearBlinkCounter++; + if (_soundReceiverNearBlinkCounter % 2) { + _soundReceiverRightButton->drawConditionalDataToScreen(2); + } else { + _soundReceiverRightButton->drawConditionalDataToScreen(0); + } soundId = soundIdNear; + } else if (_soundReceiverNearBlinkCounter > 0) { + // Make sure the buttons don't stay highlighted when leaving the 'near' area + _soundReceiverRightButton->drawConditionalDataToScreen(0); + _soundReceiverLeftButton->drawConditionalDataToScreen(0); + _soundReceiverNearBlinkCounter = 0; } } @@ -1053,6 +1067,7 @@ void Selenitic::o_soundReceiver_init(uint16 var, const ArgumentsArray &args) { soundReceiverSetSubimageRect(); _soundReceiverSigmaPressed = false; + _soundReceiverNearBlinkCounter = 0; } void Selenitic::o_soundLock_init(uint16 var, const ArgumentsArray &args) { diff --git a/engines/mohawk/myst_stacks/selenitic.h b/engines/mohawk/myst_stacks/selenitic.h index e0b4564bb9..341886d20b 100644 --- a/engines/mohawk/myst_stacks/selenitic.h +++ b/engines/mohawk/myst_stacks/selenitic.h @@ -86,6 +86,7 @@ private: uint16 _soundReceiverDirection; // 120 uint16 _soundReceiverSpeed; // 122 uint32 _soundReceiverStartTime; //124 + uint _soundReceiverNearBlinkCounter; MystAreaImageSwitch *_soundReceiverViewer; // 128 MystAreaImageSwitch *_soundReceiverRightButton; // 132 MystAreaImageSwitch *_soundReceiverLeftButton; // 136 |