aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2017-04-07 21:52:36 -0400
committerPaul Gilbert2017-04-07 21:52:36 -0400
commit60bad801448d6ebec2a228a6d91f1638edd5ab9d (patch)
tree104f883b73d4d6ffd8d335948f1214731b647b79 /engines
parentb4a6ec62c2c5cc37c6e4a4ddae096411ace58875 (diff)
downloadscummvm-rg350-60bad801448d6ebec2a228a6d91f1638edd5ab9d.tar.gz
scummvm-rg350-60bad801448d6ebec2a228a6d91f1638edd5ab9d.tar.bz2
scummvm-rg350-60bad801448d6ebec2a228a6d91f1638edd5ab9d.zip
TITANIC: Shift vector returns from params to return values
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/star_control/star_control_sub12.cpp8
-rw-r--r--engines/titanic/star_control/star_control_sub12.h4
-rw-r--r--engines/titanic/star_control/star_control_sub13.cpp4
-rw-r--r--engines/titanic/star_control/star_control_sub13.h2
-rw-r--r--engines/titanic/star_control/star_control_sub5.cpp12
-rw-r--r--engines/titanic/star_control/star_control_sub7.cpp3
-rw-r--r--engines/titanic/star_control/star_field.cpp5
-rw-r--r--engines/titanic/star_control/star_points1.cpp6
-rw-r--r--engines/titanic/star_control/star_points2.cpp6
-rw-r--r--engines/titanic/star_control/star_ref.cpp3
10 files changed, 25 insertions, 28 deletions
diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index d07b3dbb73..8893902a53 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -199,15 +199,17 @@ int CStarControlSub12::proc27() const {
return _sub13._field24;
}
-void CStarControlSub12::proc28(int index, const FVector &src, FVector &dest) {
+FVector CStarControlSub12::proc28(int index, const FVector &src) {
+ FVector dest;
dest._x = ((_sub13._valArray[index] + src._x) * _sub13._centerVector._x)
/ (_sub13._centerVector._y * src._z);
dest._y = src._y * _sub13._centerVector._x / (_sub13._centerVector._z * src._z);
dest._z = src._z;
+ return dest;
}
-void CStarControlSub12::proc29(int index, const FVector &src, FVector &dest) {
- _sub13.fn16(index, src, dest);
+FVector CStarControlSub12::proc29(int index, const FVector &src) {
+ return _sub13.fn16(index, src);
}
FVector CStarControlSub12::proc30(int index, const FVector &v) {
diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h
index ffbbf228ef..f54ba11b08 100644
--- a/engines/titanic/star_control/star_control_sub12.h
+++ b/engines/titanic/star_control/star_control_sub12.h
@@ -92,8 +92,8 @@ public:
virtual double proc25() const;
virtual double proc26() const;
virtual int proc27() const;
- virtual void proc28(int index, const FVector &src, FVector &dest);
- virtual void proc29(int index, const FVector &src, FVector &dest);
+ virtual FVector proc28(int index, const FVector &src);
+ virtual FVector proc29(int index, const FVector &src);
virtual FVector proc30(int index, const FVector &v);
virtual FVector proc31(int index, const FVector &v);
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index bbf7fe6f7e..49bcdbcef7 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -199,15 +199,17 @@ FPose CStarControlSub13::getSub2() {
return _sub2;
}
-void CStarControlSub13::fn16(int index, const FVector &src, FVector &dest) {
+FVector CStarControlSub13::fn16(int index, const FVector &src) {
FPose temp = getSub1();
+ FVector dest;
dest._x = temp._row3._x * src._z + temp._row2._x * src._y
+ src._x * temp._row1._x + temp._vector._x;
dest._y = temp._row3._y * src._z + temp._row2._y * src._y
+ src._x * temp._row1._y + temp._vector._y;
dest._z = temp._row3._z * src._z + temp._row2._z * src._y
+ src._x * temp._row1._z + temp._vector._z;
+ return dest;
}
FVector CStarControlSub13::fn17(int index, const FVector &src) {
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 0d076919a9..123ca0914c 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -92,7 +92,7 @@ public:
void fn15(const FMatrix &matrix);
FPose getSub1();
FPose getSub2();
- void fn16(int index, const FVector &src, FVector &dest);
+ FVector fn16(int index, const FVector &src);
FVector fn17(int index, const FVector &src);
FVector fn18(int index, const FVector &src);
void fn19(double *v1, double *v2, double *v3, double *v4);
diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp
index 14ba7551f6..2fd8a119dd 100644
--- a/engines/titanic/star_control/star_control_sub5.cpp
+++ b/engines/titanic/star_control/star_control_sub5.cpp
@@ -318,7 +318,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
GridEntry &gridEntry = _grid[ctr2];
- sub12->proc28(2, gridEntry, tempV);
+ tempV = sub12->proc28(2, gridEntry);
gridEntry._position._x = tempV._x;
gridEntry._position._y = tempV._y + v2;
}
@@ -340,7 +340,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
GridEntry &gridEntry = _grid[ctr2];
- sub12->proc28(0, gridEntry, tempV);
+ tempV = sub12->proc28(0, gridEntry);
gridEntry._position._x = tempV._x + v1;
gridEntry._position._y = tempV._y + v2;
}
@@ -362,7 +362,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (int ctr2 = 0; ctr2 < size2; ++ctr2) {
GridEntry &gridEntry = _grid[ctr2];
- sub12->proc28(1, gridEntry, tempV);
+ tempV = sub12->proc28(1, gridEntry);
gridEntry._position._x = tempV._x + v1;
gridEntry._position._y = tempV._y + v2;
}
@@ -432,7 +432,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
GridEntry &gridEntry = _grid[ctr];
- sub12->proc28(2, gridEntry, tempV);
+ tempV = sub12->proc28(2, gridEntry);
gridEntry._position._x = tempV._x + v1;
gridEntry._position._y = tempV._y + v2;
}
@@ -454,7 +454,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
GridEntry &gridEntry = _grid[ctr];
- sub12->proc28(2, gridEntry, tempV);
+ tempV = sub12->proc28(2, gridEntry);
gridEntry._position._x = tempV._x + v1;
gridEntry._position._y = tempV._y + v2;
}
@@ -476,7 +476,7 @@ void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1
for (uint ctr = 0; ctr < entry._data2.size(); ++ctr) {
GridEntry &gridEntry = _grid[ctr];
- sub12->proc28(2, gridEntry, tempV);
+ tempV = sub12->proc28(2, gridEntry);
gridEntry._position._x = tempV._x + v1;
gridEntry._position._y = tempV._y + v2;
}
diff --git a/engines/titanic/star_control/star_control_sub7.cpp b/engines/titanic/star_control/star_control_sub7.cpp
index f7b86337fa..3324711160 100644
--- a/engines/titanic/star_control/star_control_sub7.cpp
+++ b/engines/titanic/star_control/star_control_sub7.cpp
@@ -50,8 +50,7 @@ void CStarControlSub7::draw(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
+ pose._row2._z * star._position._y + pose._vector._z;
if (newV._z > threshold) {
- FVector vTemp;
- sub12->proc28(2, newV, vTemp);
+ FVector vTemp = sub12->proc28(2, newV);
FRect r1(center._x + vTemp._x, center._y + vTemp._y,
center._x + vTemp._x + 4.0, center._y + vTemp._y + 4.0);
diff --git a/engines/titanic/star_control/star_field.cpp b/engines/titanic/star_control/star_field.cpp
index f071f16de2..d7e4935895 100644
--- a/engines/titanic/star_control/star_field.cpp
+++ b/engines/titanic/star_control/star_field.cpp
@@ -188,13 +188,12 @@ double CStarField::fn5(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12,
const CBaseStarEntry *dataP = _sub7.getDataPtr(_sub8._fieldC);
v2 = dataP->_position;
- FVector tv;
- sub12->proc29(2, v2, tv);
+ FVector tv = sub12->proc29(2, v2);
if (sub12->proc25() >= tv._z)
return -1.0;
- sub12->proc28(2, tv, tv);
+ tv = sub12->proc28(2, tv);
v1 = FVector(tv._x + surfaceArea->_centroid._x,
tv._y + surfaceArea->_centroid._y, tv._z);
diff --git a/engines/titanic/star_control/star_points1.cpp b/engines/titanic/star_control/star_points1.cpp
index fa16665409..cf5c98ebf4 100644
--- a/engines/titanic/star_control/star_points1.cpp
+++ b/engines/titanic/star_control/star_points1.cpp
@@ -88,10 +88,8 @@ void CStarPoints1::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) {
vector3._z = vTemp._x * pose._row1._z + vTemp._y * pose._row2._z + vTemp._z * pose._row3._z + pose._vector._z;
if (flag && vector1._z > threshold && vector3._z > threshold) {
- vector2.clear();
- vector4.clear();
- sub12->proc28(2, vector1, vector2);
- sub12->proc28(2, vector3, vector4);
+ vector2 = sub12->proc28(2, vector1);
+ vector4 = sub12->proc28(2, vector3);
r.bottom = vector4._y + vHeight2;
r.right = vector4._x + vWidth2;
diff --git a/engines/titanic/star_control/star_points2.cpp b/engines/titanic/star_control/star_points2.cpp
index ee04b65a01..7dec3f8605 100644
--- a/engines/titanic/star_control/star_points2.cpp
+++ b/engines/titanic/star_control/star_points2.cpp
@@ -99,10 +99,8 @@ void CStarPoints2::draw(CSurfaceArea *surface, CStarControlSub12 *sub12) {
+ pose._row1._y * se._v2._x + pose._vector._y;
if (vector1._z > threshold && vector3._z > threshold) {
- vector2.clear();
- vector4.clear();
- sub12->proc28(2, vector1, vector2);
- sub12->proc28(2, vector3, vector4);
+ vector2 = sub12->proc28(2, vector1);
+ vector4 = sub12->proc28(2, vector3);
r.bottom = vector4._y + vHeight2;
r.right = vector4._x + vWidth2;
diff --git a/engines/titanic/star_control/star_ref.cpp b/engines/titanic/star_control/star_ref.cpp
index e15a0f708a..dfea8aa980 100644
--- a/engines/titanic/star_control/star_ref.cpp
+++ b/engines/titanic/star_control/star_ref.cpp
@@ -45,8 +45,7 @@ void CBaseStarRef::process(CSurfaceArea *surface, CStarControlSub12 *sub12) {
double hyp = vector1._x * vector1._x + vector1._y * vector1._y + vector1._z * vector1._z;
if (vector1._z > threshold && hyp >= 1.0e12 && hyp < MAX_VAL) {
- vector2.clear();
- sub12->proc28(2, vector1, vector2);
+ vector2 = sub12->proc28(2, vector1);
const Common::Point pt((int)(vector2._x + vWidth2 - -0.5),
(int)(vector2._y + vHeight2 - -0.5));