aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-06-04 18:28:49 -0400
committerPaul Gilbert2017-06-04 18:28:49 -0400
commita8e03289dfa0faabd5e1dde388d0f09b3e600dea (patch)
treef8032b815c4c1673271923c33e6838c740bad774 /engines
parent71fd9b79e2a5f15658dd369d5f7d1e5fb27783a3 (diff)
downloadscummvm-rg350-a8e03289dfa0faabd5e1dde388d0f09b3e600dea.tar.gz
scummvm-rg350-a8e03289dfa0faabd5e1dde388d0f09b3e600dea.tar.bz2
scummvm-rg350-a8e03289dfa0faabd5e1dde388d0f09b3e600dea.zip
TITANIC: Renamings for the individual lock marker methods
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/star_control/star_camera.cpp93
-rw-r--r--engines/titanic/star_control/star_camera.h17
-rw-r--r--engines/titanic/star_control/star_view.cpp6
3 files changed, 64 insertions, 52 deletions
diff --git a/engines/titanic/star_control/star_camera.cpp b/engines/titanic/star_control/star_camera.cpp
index b84664ecfe..9b11043fa0 100644
--- a/engines/titanic/star_control/star_camera.cpp
+++ b/engines/titanic/star_control/star_camera.cpp
@@ -426,55 +426,42 @@ void CStarCamera::deleteHandler() {
}
}
-void CStarCamera::fn1(CViewport *viewport, const FVector &v) {
- if (_matrixRow == 1) {
- FMatrix newOr = viewport->getOrientation();
- FMatrix oldOr = _viewport.getOrientation();
- FVector newPos = viewport->_position;
- FVector oldPos = _viewport._position;
-
- _mover->proc8(oldPos, newPos, oldOr, newOr);
- CStarVector *sv = new CStarVector(this, v);
- _mover->setVector(sv);
- }
-}
+void CStarCamera::lockMarker1(FVector v1, FVector v2, FVector v3) {
+ if (_matrixRow != -1)
+ return;
-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;
- 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();
- const FVector &pos = _viewport._position;
- _mover->proc10(v3, tempV, pos, matrix);
-
- CStarVector *sv = new CStarVector(this, v2);
- _mover->setVector(sv);
- }
+ 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;
+ 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();
+ const FVector &pos = _viewport._position;
+ _mover->proc10(v3, tempV, pos, matrix);
+
+ CStarVector *sv = new CStarVector(this, v2);
+ _mover->setVector(sv);
}
-void CStarCamera::fn3(CViewport *viewport, const FVector &v) {
+void CStarCamera::lockMarker2(CViewport *viewport, const FVector &v) {
if (_matrixRow != 0)
return;
@@ -576,4 +563,18 @@ void CStarCamera::fn3(CViewport *viewport, const FVector &v) {
_mover->setVector(sv);
}
+void CStarCamera::lockMarker3(CViewport *viewport, const FVector &v) {
+ if (_matrixRow != 1)
+ return;
+
+ FMatrix newOr = viewport->getOrientation();
+ FMatrix oldOr = _viewport.getOrientation();
+ FVector newPos = viewport->_position;
+ FVector oldPos = _viewport._position;
+
+ _mover->proc8(oldPos, newPos, oldOr, newOr);
+ CStarVector *sv = new CStarVector(this, v);
+ _mover->setVector(sv);
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_camera.h b/engines/titanic/star_control/star_camera.h
index 21a2ebcff6..454dfb86c4 100644
--- a/engines/titanic/star_control/star_camera.h
+++ b/engines/titanic/star_control/star_camera.h
@@ -192,9 +192,20 @@ public:
*/
void clearIsMoved() { _isMoved = false; }
- void fn1(CViewport *sub13, const FVector &v);
- void fn2(FVector v1, FVector v2, FVector v3);
- void fn3(CViewport *sub13, const FVector &v);
+ /**
+ * Lock in the first matched star marker
+ */
+ void lockMarker1(FVector v1, FVector v2, FVector v3);
+
+ /**
+ * Lock in the second matched star marker
+ */
+ void lockMarker2(CViewport *viewport, const FVector &v);
+
+ /**
+ * Lock in the third and final matched star marker
+ */
+ void lockMarker3(CViewport *viewport, const FVector &v);
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp
index 77724698e0..55f40b1b4f 100644
--- a/engines/titanic/star_control/star_view.cpp
+++ b/engines/titanic/star_control/star_view.cpp
@@ -388,19 +388,19 @@ void CStarView::lockStar() {
switch (_starField->getMatchedIndex()) {
case -1:
// First star match
- _camera.fn2(v1, v2, v3);
+ _camera.lockMarker1(v1, v2, v3);
_starField->incMatches();
break;
case 0:
// Second star match
- _camera.fn3(&_photoViewport, v2);
+ _camera.lockMarker2(&_photoViewport, v2);
_starField->incMatches();
break;
case 1:
// Third star match
- _camera.fn1(&_photoViewport, v2);
+ _camera.lockMarker3(&_photoViewport, v2);
_starField->incMatches();
break;