[Scummvm-git-logs] scummvm master -> 60bad801448d6ebec2a228a6d91f1638edd5ab9d

dreammaster dreammaster at scummvm.org
Sat Apr 8 03:52:48 CEST 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
60bad80144 TITANIC: Shift vector returns from params to return values


Commit: 60bad801448d6ebec2a228a6d91f1638edd5ab9d
    https://github.com/scummvm/scummvm/commit/60bad801448d6ebec2a228a6d91f1638edd5ab9d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-04-07T21:52:36-04:00

Commit Message:
TITANIC: Shift vector returns from params to return values

Changed paths:
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub12.h
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h
    engines/titanic/star_control/star_control_sub5.cpp
    engines/titanic/star_control/star_control_sub7.cpp
    engines/titanic/star_control/star_field.cpp
    engines/titanic/star_control/star_points1.cpp
    engines/titanic/star_control/star_points2.cpp
    engines/titanic/star_control/star_ref.cpp


diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index d07b3db..8893902 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 ffbbf22..f54ba11 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 bbf7fe6..49bcdbc 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 0d07691..123ca09 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 14ba755..2fd8a11 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 f7b8633..3324711 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 f071f16..d7e4935 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 fa16665..cf5c98e 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 ee04b65..7dec3f8 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 e15a0f7..dfea8aa 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));





More information about the Scummvm-git-logs mailing list