diff options
author | Paul Gilbert | 2017-06-02 20:32:12 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-06-02 20:32:12 -0400 |
commit | 9583083c73e28add4c759843cf2fcd893d0936eb (patch) | |
tree | 0a045011d4eca15fb9fd42aa76f3597cc5566f7d /engines/titanic/star_control | |
parent | 26ee9caebfed56c660df4ca9bbb09696f15baf65 (diff) | |
download | scummvm-rg350-9583083c73e28add4c759843cf2fcd893d0936eb.tar.gz scummvm-rg350-9583083c73e28add4c759843cf2fcd893d0936eb.tar.bz2 scummvm-rg350-9583083c73e28add4c759843cf2fcd893d0936eb.zip |
TITANIC: Simplify DVector fn4
Diffstat (limited to 'engines/titanic/star_control')
-rw-r--r-- | engines/titanic/star_control/dvector.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/dvector.h | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub21.cpp | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp index 0dab5bbbcb..55030d243c 100644 --- a/engines/titanic/star_control/dvector.cpp +++ b/engines/titanic/star_control/dvector.cpp @@ -77,7 +77,7 @@ DVector DVector::fn3() const { return dest; } -void DVector::fn4(const DVector &v, DMatrix &m) { +DMatrix DVector::fn4(const DVector &v) { const double FACTOR = 180.0 / M_PI; DMatrix matrix1, matrix2, matrix3, matrix4; DMatrix dest; @@ -94,7 +94,7 @@ void DVector::fn4(const DVector &v, DMatrix &m) { matrix3 = matrix1.fn4(matrix2); matrix4 = matrix1.fn1(); - m = matrix4.fn4(matrix3); + return matrix4.fn4(matrix3); } DMatrix DVector::fn5() const { diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h index d9672065bf..cb0d8fb4ee 100644 --- a/engines/titanic/star_control/dvector.h +++ b/engines/titanic/star_control/dvector.h @@ -51,7 +51,7 @@ public: DVector *fn1(DVector &dest, const DMatrix &m); void fn2(double val); DVector fn3() const; - void fn4(const DVector &v, DMatrix &m); + DMatrix fn4(const DVector &v); DMatrix fn5() const; /** diff --git a/engines/titanic/star_control/star_control_sub21.cpp b/engines/titanic/star_control/star_control_sub21.cpp index 86109a11ac..2dc90d503f 100644 --- a/engines/titanic/star_control/star_control_sub21.cpp +++ b/engines/titanic/star_control/star_control_sub21.cpp @@ -47,11 +47,10 @@ void CStarControlSub21::proc10(const FVector &v1, const FVector &v2, const FVect DVector vector1 = v1; DVector vector2 = v2; - DMatrix matrix1, matrix2 = m, matrix3; - vector2.fn4(vector1, matrix1); - FMatrix matrix4 = matrix1.fn4(matrix2); + DMatrix matrix1 = vector2.fn4(vector1); + FMatrix matrix2 = matrix1.fn4(m); - _sub24.proc3(m, matrix4); + _sub24.proc3(m, matrix2); incLockCount(); } |