diff options
author | Paul Gilbert | 2017-07-27 21:18:35 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-07-27 21:18:35 -0400 |
commit | 27f51565c3046015110fa5ca4ff16036972348dc (patch) | |
tree | 4ba987ce1c900e63486dbd90eea5146a69243d18 | |
parent | 00bbb73ce584ad262bccbf25c082d33627ba4911 (diff) | |
download | scummvm-rg350-27f51565c3046015110fa5ca4ff16036972348dc.tar.gz scummvm-rg350-27f51565c3046015110fa5ca4ff16036972348dc.tar.bz2 scummvm-rg350-27f51565c3046015110fa5ca4ff16036972348dc.zip |
TITANIC: Fix handling of Gondolier sliders when arms are used on them
-rw-r--r-- | engines/titanic/game/gondolier/gondolier_base.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/game/gondolier/gondolier_mixer.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/game/gondolier/gondolier_slider.cpp | 23 |
3 files changed, 17 insertions, 16 deletions
diff --git a/engines/titanic/game/gondolier/gondolier_base.cpp b/engines/titanic/game/gondolier/gondolier_base.cpp index f5f9791fa8..174d8b56ab 100644 --- a/engines/titanic/game/gondolier/gondolier_base.cpp +++ b/engines/titanic/game/gondolier/gondolier_base.cpp @@ -61,10 +61,10 @@ void CGondolierBase::load(SimpleFile *file) { _puzzleSolved = file->readNumber(); _volume1 = file->readNumber(); _slider1 = file->readNumber(); - _rightSliderHooked = file->readNumber(); + _leftSliderHooked = file->readNumber(); _volume2 = file->readNumber(); _slider2 = file->readNumber(); - _leftSliderHooked = file->readNumber(); + _rightSliderHooked = file->readNumber(); _priorLeftSliderHooked = file->readNumber(); _priorRightSliderHooked = file->readNumber(); diff --git a/engines/titanic/game/gondolier/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp index 4b8bd88436..e71562f9d4 100644 --- a/engines/titanic/game/gondolier/gondolier_mixer.cpp +++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp @@ -144,7 +144,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) { if (msg->_strValue == "Fly") { _slider1 = CLIP(msg->_numValue, 0, 10); - if (!_leftSliderHooked) { + if (!_rightSliderHooked) { _slider2 = 10 - _slider1; CStatusChangeMsg statusMsg; statusMsg._newStatus = _slider2; @@ -155,7 +155,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) { if (msg->_strValue == "Tos") { _slider2 = CLIP(msg->_numValue, 0, 10); - if (!_rightSliderHooked) { + if (!_leftSliderHooked) { _slider1 = 10 - _slider2; CStatusChangeMsg statusMsg; statusMsg._newStatus = _slider1; @@ -163,7 +163,7 @@ bool CGondolierMixer::SignalObject(CSignalObject *msg) { } } - if (!_slider1 && !_slider2 && _rightSliderHooked && _leftSliderHooked) { + if (!_slider1 && !_slider2 && _leftSliderHooked && _rightSliderHooked) { _puzzleSolved = true; CStatusChangeMsg statusMsg; statusMsg._newStatus = 1; diff --git a/engines/titanic/game/gondolier/gondolier_slider.cpp b/engines/titanic/game/gondolier/gondolier_slider.cpp index b5edac57d4..9478920c9a 100644 --- a/engines/titanic/game/gondolier/gondolier_slider.cpp +++ b/engines/titanic/game/gondolier/gondolier_slider.cpp @@ -79,14 +79,14 @@ void CGondolierSlider::load(SimpleFile *file) { bool CGondolierSlider::MouseButtonDownMsg(CMouseButtonDownMsg *msg) { if (!_chestOpen) return false; - if (_sliderNum ? _rightSliderHooked : _leftSliderHooked) + if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) return false; return _thumbRect.contains(msg->_mousePos); } bool CGondolierSlider::MouseDragMoveMsg(CMouseDragMoveMsg *msg) { - if (!(_sliderNum ? _rightSliderHooked : _leftSliderHooked)) { + if (!(_sliderNum ? _leftSliderHooked : _rightSliderHooked)) { int minVal = 0x7FFFFFFF; int foundIndex = -1; int yp = (_defaultThumbRect.top + _defaultThumbRect.bottom) / 2 @@ -120,7 +120,7 @@ bool CGondolierSlider::EnterViewMsg(CEnterViewMsg *msg) { bool CGondolierSlider::MouseDragStartMsg(CMouseDragStartMsg *msg) { if (!_chestOpen) return false; - if (_sliderNum ? _rightSliderHooked : _leftSliderHooked) + if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) return false; _dragging = checkStartDragging(msg); @@ -143,7 +143,7 @@ bool CGondolierSlider::MouseDragEndMsg(CMouseDragEndMsg *msg) { } bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) { - if (_sliderNum ? _rightSliderHooked : _leftSliderHooked) + if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) return false; if (!_thumbRect.intersects(msg->_rect)) { @@ -152,9 +152,9 @@ bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) { } else { _armName = msg->_armName; if (_sliderNum) { - _rightSliderHooked = _priorLeftSliderHooked = true; + _leftSliderHooked = _priorLeftSliderHooked = true; } else { - _leftSliderHooked = _priorRightSliderHooked = true; + _rightSliderHooked = _priorRightSliderHooked = true; } msg->_isHooked = true; @@ -164,7 +164,7 @@ bool CGondolierSlider::IsHookedOnMsg(CIsHookedOnMsg *msg) { } bool CGondolierSlider::FrameMsg(CFrameMsg *msg) { - if (_sliderNum ? _rightSliderHooked : _leftSliderHooked) { + if (_sliderNum ? _leftSliderHooked : _rightSliderHooked) { if (_sliderIndex < 10) { ++_sliderIndex; CSignalObject signalMsg; @@ -182,6 +182,7 @@ bool CGondolierSlider::FrameMsg(CFrameMsg *msg) { } } else if (_sliderNum ? _priorRightSliderHooked : _priorLeftSliderHooked) { if (!_dragging && !_puzzleSolved && _sliderIndex > 0) { + --_sliderIndex; CSignalObject signalMsg; signalMsg.execute(this); } @@ -208,11 +209,11 @@ bool CGondolierSlider::SignalObject(CSignalObject *msg) { bool CGondolierSlider::ActMsg(CActMsg *msg) { if (msg->_action == "Unhook") { if (_sliderNum) { - _rightSliderHooked = _priorLeftSliderHooked = false; - _priorRightSliderHooked = _leftSliderHooked; + _leftSliderHooked = _priorLeftSliderHooked = false; + _priorRightSliderHooked = _rightSliderHooked; } else { - _leftSliderHooked = _priorRightSliderHooked = false; - _priorLeftSliderHooked = _rightSliderHooked; + _rightSliderHooked = _priorRightSliderHooked = false; + _priorLeftSliderHooked = _leftSliderHooked; } } |