diff options
author | Paul Gilbert | 2017-07-31 22:03:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-07-31 22:03:17 -0400 |
commit | a42172485efb47638bd4cb27f7be8d32247a5605 (patch) | |
tree | dba0a77d1d66b7ad118f435cb5fdbb5be9c86782 /engines | |
parent | 993b013ad9a500cb150bb9aa5b03c2e1c309f5f9 (diff) | |
download | scummvm-rg350-a42172485efb47638bd4cb27f7be8d32247a5605.tar.gz scummvm-rg350-a42172485efb47638bd4cb27f7be8d32247a5605.tar.bz2 scummvm-rg350-a42172485efb47638bd4cb27f7be8d32247a5605.zip |
TITANIC: Fix forward/backward manual camera movement in starmap
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/star_control/camera_mover.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/engines/titanic/star_control/camera_mover.cpp b/engines/titanic/star_control/camera_mover.cpp index bd588e6382..8b1e4ef1eb 100644 --- a/engines/titanic/star_control/camera_mover.cpp +++ b/engines/titanic/star_control/camera_mover.cpp @@ -48,30 +48,38 @@ CCameraMover::~CCameraMover() { } void CCameraMover::copyFrom(const CNavigationInfo *src) { - *((CNavigationInfo *)this) = *src; + _speed = src->_speed; + _unused = src->_speedChangeCtr; + _maxSpeed = src->_speedChangeInc; + _speedChangeCtr = src->_unused; + _speedChangeInc = src->_maxSpeed; + _unusedX = src->_unusedX; + _unusedY = src->_unusedY; + _unusedZ = src->_unusedZ; } void CCameraMover::copyTo(CNavigationInfo *dest) { - *dest = *((CNavigationInfo *)this); + dest->_speed = _speed; + dest->_speedChangeCtr = _unused; + dest->_speedChangeInc = _maxSpeed; + dest->_unused = _speedChangeCtr; + dest->_maxSpeed = _speedChangeInc; + dest->_unusedX = _unusedX; + dest->_unusedY = _unusedY; + dest->_unusedZ = _unusedZ; } void CCameraMover::increaseSpeed() { if (!isLocked() && _speed < _maxSpeed) { _speedChangeCtr += _speedChangeInc; - if (_speedChangeCtr > _speed) - _speed -= _speedChangeCtr; - else - _speed += _speedChangeCtr; + _speed += ABS(_speedChangeCtr); } } void CCameraMover::decreaseSpeed() { if (!isLocked()) { _speedChangeCtr -= _speedChangeInc; - if (_speedChangeCtr > _speed) - _speed -= _speedChangeCtr; - else - _speed += _speedChangeCtr; + _speed -= ABS(_speedChangeCtr); if (_speedChangeCtr < 0.0) _speedChangeCtr = 0.0; |