diff options
Diffstat (limited to 'engines/titanic')
-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; |