[Scummvm-git-logs] scummvm master -> 51f80a529b80438d18161e2b2c52cbb86934494c

dreammaster dreammaster at scummvm.org
Sun Apr 2 00:01: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:
51f80a529b TITANIC: Renamings for CStarControlSub13 class


Commit: 51f80a529b80438d18161e2b2c52cbb86934494c
    https://github.com/scummvm/scummvm/commit/51f80a529b80438d18161e2b2c52cbb86934494c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-04-01T18:01:38-04:00

Commit Message:
TITANIC: Renamings for CStarControlSub13 class

Changed paths:
    engines/titanic/star_control/star_control_sub12.cpp
    engines/titanic/star_control/star_control_sub13.cpp
    engines/titanic/star_control/star_control_sub13.h


diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp
index 635176b..1f6df61 100644
--- a/engines/titanic/star_control/star_control_sub12.cpp
+++ b/engines/titanic/star_control/star_control_sub12.cpp
@@ -199,9 +199,9 @@ int CStarControlSub12::proc27() const {
 }
 
 void CStarControlSub12::proc28(int index, const FVector &src, FVector &dest) {
-	dest._x = ((_sub13._valArray[index] + src._x) * _sub13._fieldC8)
-		/ (_sub13._fieldCC * src._z);
-	dest._y = src._y * _sub13._fieldC8 / (_sub13._fieldD0 * src._z);
+	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;
 }
 
@@ -480,10 +480,10 @@ void CStarControlSub12::fn2(FVector v1, FVector v2, FVector v3) {
 		FVector tempV;
 		tempV._z = _sub13._field10;
 		v3._z = v1._z;
-		tempV._x = _sub13._fieldD0 * v1._y * v1._z / _sub13._fieldC8;
-		v3._y = _sub13._fieldCC * tempV._z * v3._x / _sub13._fieldC8;
-		v3._x = _sub13._fieldCC * v1._x * v1._z / _sub13._fieldC8 - _sub13._valArray[2];
-		tempV._y = _sub13._fieldD0 * tempV._z * v3._y / _sub13._fieldC8;
+		tempV._x = _sub13._centerVector._z * v1._y * v1._z / _sub13._centerVector._x;
+		v3._y = _sub13._centerVector._y * tempV._z * v3._x / _sub13._centerVector._x;
+		v3._x = _sub13._centerVector._y * v1._x * v1._z / _sub13._centerVector._x - _sub13._valArray[2];
+		tempV._y = _sub13._centerVector._z * tempV._z * v3._y / _sub13._centerVector._x;
 		tempV._x = tempV._x - _sub13._valArray[2];
 
 		v3.normalize();
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp
index e6e46d9..dd4fcde 100644
--- a/engines/titanic/star_control/star_control_sub13.cpp
+++ b/engines/titanic/star_control/star_control_sub13.cpp
@@ -34,8 +34,6 @@ CStarControlSub13::CStarControlSub13() {
 	_width = 600;
 	_height = 340;
 	_field24 = 0;
-	_fieldC0 = _fieldC4 = _fieldC8 = 0.0;
-	_fieldCC = _fieldD0 = 0.0;
 	_flag = false;
 	Common::fill(&_valArray[0], &_valArray[5], 0.0);
 }
@@ -51,11 +49,8 @@ CStarControlSub13::CStarControlSub13(CStarControlSub13 *src) :
 	_width = src->_width;
 	_height = src->_height;
 
-	_fieldCC = src->_fieldCC;
-	_fieldD0 = src->_fieldD0;
-	_fieldC0 = src->_fieldC0;
-	_fieldC4 = src->_fieldC4;
-	_fieldC8 = src->_fieldC8;
+	_center = src->_center;
+	_centerVector = src->_centerVector;
 	_field24 = src->_field24;
 
 	Common::copy(&src->_valArray[0], &src->_valArray[4], &_valArray[0]);
@@ -221,8 +216,8 @@ FVector CStarControlSub13::fn17(int index, const FVector &src) {
 	FVector tv = src.fn5(&sub6);
 
 	dest._x = (_valArray[index] + tv._x)
-		* _fieldC8 / (_fieldCC * tv._z);
-	dest._y = (tv._y * _fieldC8) / (_fieldD0 * tv._z);
+		* _centerVector._x / (_centerVector._y * tv._z);
+	dest._y = (tv._y * _centerVector._x) / (_centerVector._z * tv._z);
 	dest._z = tv._z;
 	return dest;
 }
@@ -233,15 +228,15 @@ FVector CStarControlSub13::fn18(int index, const FVector &src) {
 	FVector tv = src.fn5(&sub6);
 
 	dest._x = (_valArray[index] + tv._x)
-		* _fieldC8 / (_fieldCC * tv._z);
-	dest._y = (tv._y * _fieldC8) / (_fieldD0 * tv._z);
+		* _centerVector._x / (_centerVector._y * tv._z);
+	dest._y = (tv._y * _centerVector._x) / (_centerVector._z * tv._z);
 	dest._z = tv._z;
 	return dest;
 }
 
 void CStarControlSub13::fn19(double *v1, double *v2, double *v3, double *v4) {
-	*v1 = _fieldC8 / _fieldCC;
-	*v2 = _fieldC8 / _fieldD0;
+	*v1 = _centerVector._x / _centerVector._y;
+	*v2 = _centerVector._x / _centerVector._z;
 	*v3 = _valArray[3];
 	*v4 = _valArray[4];
 }
@@ -253,13 +248,10 @@ void CStarControlSub13::reset() {
 	_sub2._vector = _position;
 	_sub2.fn4(&_sub1);
 
-	double widthV = (double)_width * 0.5;
-	double heightV = (double)_height * 0.5;
-	_fieldC0 = widthV;
-	_fieldC4 = heightV;
-	_fieldC8 = MIN(widthV, heightV);
-	_fieldCC = tan(_field18 * FACTOR);
-	_fieldD0 = tan(_field1C * FACTOR);
+	_center = FPoint((double)_width * 0.5, (double)_height * 0.5);
+	_centerVector._x = MIN(_center._x, _center._y);
+	_centerVector._y = tan(_field18 * FACTOR);
+	_centerVector._z = tan(_field1C * FACTOR);
 	_flag = true;
 }
 
diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h
index 80b2e55..3c8606d 100644
--- a/engines/titanic/star_control/star_control_sub13.h
+++ b/engines/titanic/star_control/star_control_sub13.h
@@ -40,8 +40,7 @@ private:
 	FMatrix _matrix;
 	CStarControlSub6 _sub1;
 	CStarControlSub6 _sub2;
-	double _fieldC0;
-	double _fieldC4;
+	FPoint _center;
 	bool _flag;
 private:
 	void reset();
@@ -51,9 +50,7 @@ public:
 	double _field14;
 	int _field24;
 	double _valArray[5];
-	double _fieldC8;
-	double _fieldCC;
-	double _fieldD0;
+	FVector _centerVector;
 public:
 	CStarControlSub13();
 	CStarControlSub13(CStarControlSub13 *src);





More information about the Scummvm-git-logs mailing list