From cc5629014e7f8182ea4c2819112bc97401624eca Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 6 Jun 2017 20:20:53 -0400 Subject: TITANIC: Further fixes for locking marker 2 --- engines/titanic/star_control/dvector.cpp | 8 ++++---- engines/titanic/star_control/dvector.h | 2 +- engines/titanic/star_control/star_camera.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'engines') diff --git a/engines/titanic/star_control/dvector.cpp b/engines/titanic/star_control/dvector.cpp index 6e962fe876..77357fa923 100644 --- a/engines/titanic/star_control/dvector.cpp +++ b/engines/titanic/star_control/dvector.cpp @@ -42,16 +42,16 @@ double DVector::getDistance(const DVector &src) { DVector DVector::fn1(const DMatrix &m) { DVector dest; - dest._x = m._row3._x * _z + m._row2._x * _y + _x * m._row1._x + m._row4._x; + dest._x = m._row3._x * _z + m._row2._x * _y + m._row1._x * _x + m._row4._x; dest._y = m._row2._y * _y + m._row3._y * _z + m._row1._y * _x + m._row4._y; dest._z = m._row3._z * _z + m._row2._z * _y + m._row1._z * _x + m._row4._z; return dest; } -void DVector::fn2(double val) { +void DVector::fn2(double angle) { const double FACTOR = 2 * M_PI / 360.0; - double sinVal = sin(val * FACTOR); - double cosVal = cos(val * FACTOR); + double sinVal = sin(angle * FACTOR); + double cosVal = cos(angle * FACTOR); _x = cosVal * _x - sinVal * _z; _z = cosVal * _z + sinVal * _x; diff --git a/engines/titanic/star_control/dvector.h b/engines/titanic/star_control/dvector.h index b4fb21b5be..ef54745f3e 100644 --- a/engines/titanic/star_control/dvector.h +++ b/engines/titanic/star_control/dvector.h @@ -49,7 +49,7 @@ public: double getDistance(const DVector &src); DVector fn1(const DMatrix &m); - void fn2(double val); + void fn2(double angle); DVector fn3() const; DMatrix fn4(const DVector &v); DMatrix fn5() const; diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index f1763c603d..7678ba4940 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -463,7 +463,7 @@ void CStarCamera::lockMarker2(CViewport *viewport, const FVector &v) { m1 = m1.fn4(m2); m2 = m1.fn1(); - FVector tempV2 = _viewport._position; + DVector tempV2 = _viewport._position; DMatrix m4; m4._row1 = viewport->_position; m4._row2 = DVector(0.0, 0.0, 0.0); @@ -497,7 +497,7 @@ void CStarCamera::lockMarker2(CViewport *viewport, const FVector &v) { tempV3._z = m5._row3._z * 1000000.0 + m4._row1._z; m4._row4 = tempV3; - tempV2 = tempV2.fn1(); + tempV2 = tempV2.fn1(m2); m4._row1 = m4._row1.fn1(m2); m4._row3 = m4._row3.fn1(m2); m4._row2 = m4._row2.fn1(m2); -- cgit v1.2.3