aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/star_control/camera_auto_mover.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-07 20:00:35 -0400
committerGitHub2017-09-07 20:00:35 -0400
commit2b7b75f9a8d9a3724085f35a2689b53c7eef4dfa (patch)
treec062f42d0d37af40008ec3b90be9e6f8c0f9fead /engines/titanic/star_control/camera_auto_mover.cpp
parente7745bf0255135d9a668d024daa60ce06dc83fea (diff)
parent93d9ac926c466f39670073f60166630c1fd65539 (diff)
downloadscummvm-rg350-2b7b75f9a8d9a3724085f35a2689b53c7eef4dfa.tar.gz
scummvm-rg350-2b7b75f9a8d9a3724085f35a2689b53c7eef4dfa.tar.bz2
scummvm-rg350-2b7b75f9a8d9a3724085f35a2689b53c7eef4dfa.zip
Merge pull request #1016 from dafioram/star_control-cleanup
TITANIC: Star control cleanup
Diffstat (limited to 'engines/titanic/star_control/camera_auto_mover.cpp')
-rw-r--r--engines/titanic/star_control/camera_auto_mover.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/engines/titanic/star_control/camera_auto_mover.cpp b/engines/titanic/star_control/camera_auto_mover.cpp
index fcd1e9e0ee..71f7de85b2 100644
--- a/engines/titanic/star_control/camera_auto_mover.cpp
+++ b/engines/titanic/star_control/camera_auto_mover.cpp
@@ -41,27 +41,7 @@ CCameraAutoMover::CCameraAutoMover() : _srcPos(0.0, 1000000.0, 0.0) {
_transitionPercentInc = 0.0;
}
-// TODO: same as setPath also orientations are not used
-void CCameraAutoMover::setPath2(const FVector &oldPos, const FVector &newPos,
- const FMatrix &oldOrientation, const FMatrix &newOrientation) {
- _srcPos = oldPos;
- _destPos = newPos;
- _posDelta = _destPos - _srcPos;
-
- float temp = 0.0;
- _posDelta.normalize(temp); // Do the normalization, put the scale amount in temp
- _distance = temp;
- _active = false;
- _field34 = false;
- _transitionPercent = 1.0;
- _field40 = -1;
- _field44 = -1;
- _field48 = -1;
- _field4C = 0;
-}
-
-// TODO: same as proc2 also orientations are not used
-void CCameraAutoMover::setOrientations(const FMatrix &srcOrient, const FMatrix &destOrient) {
+void CCameraAutoMover::clear() {
_srcPos.clear();
_destPos.clear();
_transitionPercent = 1.0;
@@ -70,18 +50,14 @@ void CCameraAutoMover::setOrientations(const FMatrix &srcOrient, const FMatrix &
_field34 = false;
}
-// TODO: same as setPath2 also orientations are not used
-void CCameraAutoMover::setPath(const FVector &srcV, const FVector &destV, const FMatrix &orientation) {
+void CCameraAutoMover::setPath(const FVector &srcV, const FVector &destV) {
_srcPos = srcV;
_destPos = destV;
_posDelta = _destPos - _srcPos;
float temp = 0.0;
- if (!_posDelta.normalize(temp)) {
- // Do the normalization, put the scale amount in temp,
- // but if it is unsuccessful, crash
- assert(temp);
- }
+ _posDelta.normalize(temp); // normalization won't happen if _posDelta is zero vector
+ // and that is okay
_distance = temp;
_active = false;