diff options
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; } |