diff options
author | David Fioramonti | 2017-08-06 17:05:56 -0700 |
---|---|---|
committer | David Fioramonti | 2017-08-06 18:05:18 -0700 |
commit | c4751fc6110154951df0f14b9dbfd9ca40d0db6c (patch) | |
tree | 6b69d03d7d1b031273183bfde09e532e7ecca38d /engines | |
parent | 8b81bb2faabde88d6d00e938360f21f2c97ad774 (diff) | |
download | scummvm-rg350-c4751fc6110154951df0f14b9dbfd9ca40d0db6c.tar.gz scummvm-rg350-c4751fc6110154951df0f14b9dbfd9ca40d0db6c.tar.bz2 scummvm-rg350-c4751fc6110154951df0f14b9dbfd9ca40d0db6c.zip |
TITANIC: Change Starview slowdown to reverse
This changes the starview manual camera movement using semicolon.
Before it slowed down the ship. To make it more like the original
game it now adds negative velocity so that it slows down then
speeds up in the backward direction.
The functions were renamed accordingly.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/star_control/camera_mover.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/star_control/camera_mover.h | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_camera.h | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 4 |
5 files changed, 17 insertions, 20 deletions
diff --git a/engines/titanic/star_control/camera_mover.cpp b/engines/titanic/star_control/camera_mover.cpp index 8b1e4ef1eb..f6392d5ea2 100644 --- a/engines/titanic/star_control/camera_mover.cpp +++ b/engines/titanic/star_control/camera_mover.cpp @@ -69,20 +69,17 @@ void CCameraMover::copyTo(CNavigationInfo *dest) { dest->_unusedZ = _unusedZ; } -void CCameraMover::increaseSpeed() { +void CCameraMover::increaseForwardSpeed() { if (!isLocked() && _speed < _maxSpeed) { _speedChangeCtr += _speedChangeInc; _speed += ABS(_speedChangeCtr); } } -void CCameraMover::decreaseSpeed() { - if (!isLocked()) { +void CCameraMover::increaseBackwardSpeed() { + if (!isLocked() && _speed > -_maxSpeed) { _speedChangeCtr -= _speedChangeInc; _speed -= ABS(_speedChangeCtr); - - if (_speedChangeCtr < 0.0) - _speedChangeCtr = 0.0; } } diff --git a/engines/titanic/star_control/camera_mover.h b/engines/titanic/star_control/camera_mover.h index ef5f3555e7..c3ec0c6f30 100644 --- a/engines/titanic/star_control/camera_mover.h +++ b/engines/titanic/star_control/camera_mover.h @@ -53,14 +53,14 @@ public: virtual void copyTo(CNavigationInfo *dest); /** - * Increases movement speed + * Increases movement speed in forward direction */ - virtual void increaseSpeed(); + virtual void increaseForwardSpeed(); /** - * Decreases movement speed + * Decreases movement speed in backward direction */ - virtual void decreaseSpeed(); + virtual void increaseBackwardSpeed(); /** * Increase to full speed diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index 0d81383449..6829194904 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -146,12 +146,12 @@ void CStarCamera::updatePosition(CErrorCode *errorCode) { } } -void CStarCamera::increaseSpeed() { - _mover->increaseSpeed(); +void CStarCamera::increaseForwardSpeed() { + _mover->increaseForwardSpeed(); } -void CStarCamera::decreaseSpeed() { - _mover->decreaseSpeed(); +void CStarCamera::increaseBackwardSpeed() { + _mover->increaseBackwardSpeed(); } void CStarCamera::fullSpeed() { diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h index 1f0e12ccd9..fa46eb38b1 100644 --- a/engines/titanic/star_control/star_camera.h +++ b/engines/titanic/star_control/star_camera.h @@ -102,14 +102,14 @@ public: virtual void updatePosition(CErrorCode *errorCode); /** - * Increases movement speed + * Increases movement speed in forward direction */ - virtual void increaseSpeed(); + virtual void increaseForwardSpeed(); /** - * Decreases movement speed + * Decreases movement speed in backward direction */ - virtual void decreaseSpeed(); + virtual void increaseBackwardSpeed(); /** * Increase to full speed diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 97752c2f95..576fd87b54 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -187,7 +187,7 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_SEMICOLON: if (matchedIndex == -1) { - _camera.increaseSpeed(); + _camera.increaseForwardSpeed(); errorCode->set(); return true; } @@ -195,7 +195,7 @@ bool CStarView::KeyCharMsg(int key, CErrorCode *errorCode) { case Common::KEYCODE_PERIOD: if (matchedIndex == -1) { - _camera.decreaseSpeed(); + _camera.increaseBackwardSpeed(); errorCode->set(); return true; } |