diff options
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/star_control/star_camera.cpp | 24 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 2 |
2 files changed, 19 insertions, 7 deletions
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp index fae519e1f1..392c53e202 100644 --- a/engines/titanic/star_control/star_camera.cpp +++ b/engines/titanic/star_control/star_camera.cpp @@ -479,20 +479,32 @@ void CStarCamera::fn1(CViewport *viewport, const FVector &v) { } void CStarCamera::fn2(FVector v1, FVector v2, FVector v3) { + // Calculations only done when the first marker is locked on if (_matrixRow == -1) { FVector tempV; + double val1, val2, val3, val4, val5; + double val6, val7, val8, val9; + + val1 = _viewport._centerVector._y * v1._x; tempV._z = _viewport._field10; + val2 = _viewport._centerVector._y * tempV._z * v3._x; + val3 = _viewport._centerVector._z * v1._y; + val4 = _viewport._centerVector._z * tempV._z; + val5 = val1 * v1._z / _viewport._centerVector._x; v3._z = v1._z; - tempV._x = _viewport._centerVector._z * v1._y * v1._z / _viewport._centerVector._x; - v3._y = _viewport._centerVector._y * tempV._z * v3._x / _viewport._centerVector._x; - v3._x = _viewport._centerVector._y * v1._x * v1._z / _viewport._centerVector._x - _viewport._valArray[2]; - tempV._y = _viewport._centerVector._z * tempV._z * v3._y / _viewport._centerVector._x; - tempV._x = tempV._x - _viewport._valArray[2]; + val6 = val4 * v3._y; + val7 = val3 * v1._z / _viewport._centerVector._x; + val8 = val6 / _viewport._centerVector._x; + val9 = val2 / _viewport._centerVector._x; + v3._x = val5 - _viewport._valArray[2]; + v3._y = val7; + tempV._x = val9 - _viewport._valArray[2]; + tempV._y = val8; v3.normalize(); tempV.normalize(); - FMatrix matrix = _viewport.getOrientation(); + DMatrix matrix = _viewport.getOrientation(); const FVector &pos = _viewport._position; _mover->proc10(v3, tempV, pos, matrix); diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 77724698e0..9b292d715b 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -379,7 +379,7 @@ void CStarView::lockStar() { if (_starField && !_showingPhoto) { CSurfaceArea surfaceArea(_videoSurface); FVector v1, v2, v3; - double val = _starField->fn5(&surfaceArea, &_camera, v1, v2, v3); + double val = _starField->fn5(&surfaceArea, &_camera, v1, v2, v3); if (val > -1.0) { v1 -= surfaceArea._centroid; |