diff options
-rw-r--r-- | engines/titanic/star_control/base_star.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub5.cpp | 68 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub5.h | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 8 |
4 files changed, 43 insertions, 43 deletions
diff --git a/engines/titanic/star_control/base_star.cpp b/engines/titanic/star_control/base_star.cpp index 2556eeee50..cfadedd8e7 100644 --- a/engines/titanic/star_control/base_star.cpp +++ b/engines/titanic/star_control/base_star.cpp @@ -184,7 +184,7 @@ void CBaseStar::draw1(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; if (total2 < 1.0e12) { - sub5->proc2(&pose, vector, centroid._x, centroid._y, total2, + sub5->proc2(pose, vector, centroid._x, centroid._y, total2, surfaceArea, sub12); continue; } @@ -269,7 +269,7 @@ void CBaseStar::draw2(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; if (total2 < 1.0e12) { - sub5->proc2(&pose, vector, centroid._x, centroid._y, total2, + sub5->proc2(pose, vector, centroid._x, centroid._y, total2, surfaceArea, sub12); continue; } @@ -358,7 +358,7 @@ void CBaseStar::draw3(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; if (total2 < 1.0e12) { - sub5->proc2(&pose, vector, centroid._x, centroid._y, total2, + sub5->proc2(pose, vector, centroid._x, centroid._y, total2, surfaceArea, sub12); continue; } @@ -465,7 +465,7 @@ void CBaseStar::draw4(CSurfaceArea *surfaceArea, CStarControlSub12 *sub12, CStar total2 = tempY * tempY + tempX * tempX + tempZ * tempZ; if (total2 < 1.0e12) { - sub5->proc2(&pose, vector, centroid._x, centroid._y, total2, + sub5->proc2(pose, vector, centroid._x, centroid._y, total2, surfaceArea, sub12); continue; } diff --git a/engines/titanic/star_control/star_control_sub5.cpp b/engines/titanic/star_control/star_control_sub5.cpp index 0ef40e7cb6..14ba7551f6 100644 --- a/engines/titanic/star_control/star_control_sub5.cpp +++ b/engines/titanic/star_control/star_control_sub5.cpp @@ -189,7 +189,7 @@ bool CStarControlSub5::setup2(int val1, int val2) { return false; } -void CStarControlSub5::proc2(FPose *pose, const FVector &vector, double v1, double v2, double v3, +void CStarControlSub5::proc2(const FPose &pose, const FVector &vector, double v1, double v2, double v3, CSurfaceArea *surfaceArea, CStarControlSub12 *sub12) { const int VALUES[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4 }; double val1 = sub12->proc25(); @@ -252,15 +252,15 @@ void CStarControlSub5::proc2(FPose *pose, const FVector &vector, double v1, doub _sub1._vector._x = f22 * f10 + vector._x; _sub1._vector._y = f9 * f22 + vector._y; _sub1._vector._z = f22 * f12 + vector._z; - _sub2._row1._x = pose->_row1._x * f13 + f16 * pose->_row3._x + f15 * pose->_row2._x; - _sub2._row1._y = f15 * pose->_row2._y + f16 * pose->_row3._y + f13 * pose->_row1._y; - _sub2._row1._z = f16 * pose->_row3._z + f13 * pose->_row1._z + f15 * pose->_row2._z; - _sub2._row2._x = pose->_row1._x * f17 + f19 * pose->_row3._x + f18 * pose->_row2._x; - _sub2._row2._y = f18 * pose->_row2._y + f17 * pose->_row1._y + f19 * pose->_row3._y; - _sub2._row2._z = f18 * pose->_row2._z + f19 * pose->_row3._z + f17 * pose->_row1._z; - _sub2._row3._x = pose->_row1._x * f20 + f21 * pose->_row3._x; - _sub2._row3._y = f20 * pose->_row1._y + f21 * pose->_row3._y; - _sub2._row3._z = f20 * pose->_row1._z + f21 * pose->_row3._z; + _sub2._row1._x = pose._row1._x * f13 + f16 * pose._row3._x + f15 * pose._row2._x; + _sub2._row1._y = f15 * pose._row2._y + f16 * pose._row3._y + f13 * pose._row1._y; + _sub2._row1._z = f16 * pose._row3._z + f13 * pose._row1._z + f15 * pose._row2._z; + _sub2._row2._x = pose._row1._x * f17 + f19 * pose._row3._x + f18 * pose._row2._x; + _sub2._row2._y = f18 * pose._row2._y + f17 * pose._row1._y + f19 * pose._row3._y; + _sub2._row2._z = f18 * pose._row2._z + f19 * pose._row3._z + f17 * pose._row1._z; + _sub2._row3._x = pose._row1._x * f20 + f21 * pose._row3._x; + _sub2._row3._y = f20 * pose._row1._y + f21 * pose._row3._y; + _sub2._row3._z = f20 * pose._row1._z + f21 * pose._row3._z; f23 = _sub1._vector._y; f24 = _sub1._vector._z; @@ -269,18 +269,18 @@ void CStarControlSub5::proc2(FPose *pose, const FVector &vector, double v1, doub f27 = _sub1._vector._x; f28 = _sub1._vector._y; - _sub2._vector._x = pose->_row1._x * _sub1._vector._x - + pose->_row3._x * _sub1._vector._z - + pose->_row2._x * f28 - + pose->_vector._x; - _sub2._vector._y = f23 * pose->_row2._y - + f24 * pose->_row3._y - + f25 * pose->_row1._y - + pose->_vector._y; - _sub2._vector._z = f26 * pose->_row3._z - + f27 * pose->_row1._z - + f28 * pose->_row2._z - + pose->_vector._z; + _sub2._vector._x = pose._row1._x * _sub1._vector._x + + pose._row3._x * _sub1._vector._z + + pose._row2._x * f28 + + pose._vector._x; + _sub2._vector._y = f23 * pose._row2._y + + f24 * pose._row3._y + + f25 * pose._row1._y + + pose._vector._y; + _sub2._vector._z = f26 * pose._row3._z + + f27 * pose._row1._z + + f28 * pose._row2._z + + pose._vector._z; size2 = (int)_array[1]._data2.size(); size1 = (int)_array[1]._data1.size(); @@ -407,22 +407,22 @@ void CStarControlSub5::proc2(FPose *pose, const FVector &vector, double v1, doub const FVector &d2v = entry._data2[ctr]; FVector newV = d2v + vector; - f41 = pose->_row1._x; - f42 = pose->_row3._x; - f43 = pose->_row2._x; + f41 = pose._row1._x; + f42 = pose._row3._x; + f43 = pose._row2._x; f44 = f43 * newV._y; f45 = f41 * newV._x + f42 * newV._z + f44; - f46 = f45 + pose->_vector._x; + f46 = f45 + pose._vector._x; gridEntry._x = f46; - gridEntry._y = newV._y * pose->_row2._y - + newV._z * pose->_row3._y - + newV._x * pose->_row1._y - + pose->_vector._y; - gridEntry._z = newV._z * pose->_row3._z - + newV._y * pose->_row2._z - + newV._x * pose->_row1._z - + pose->_vector._z; + gridEntry._y = newV._y * pose._row2._y + + newV._z * pose._row3._y + + newV._x * pose._row1._y + + pose._vector._y; + gridEntry._z = newV._z * pose._row3._z + + newV._y * pose._row2._z + + newV._x * pose._row1._z + + pose._vector._z; } if (val2 <= 0) { diff --git a/engines/titanic/star_control/star_control_sub5.h b/engines/titanic/star_control/star_control_sub5.h index 395bdc6379..25aafa87c8 100644 --- a/engines/titanic/star_control/star_control_sub5.h +++ b/engines/titanic/star_control/star_control_sub5.h @@ -116,7 +116,7 @@ public: virtual ~CStarControlSub5() {} virtual bool setup(); - virtual void proc2(FPose *pose, const FVector &vector, double v1, double v2, double v3, + virtual void proc2(const FPose &pose, const FVector &vector, double v1, double v2, double v3, CSurfaceArea *surfaceArea, CStarControlSub12 *sub12); virtual void proc3(CErrorCode *errorCode); diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 9c9e9722d3..6cd539144c 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -450,8 +450,8 @@ void CStarView::randomizeVectors1(FVector &v1, FVector &v2) { v2.normalize(); */ // Values temporarily hardcoded to match hacked values in original EXE - v1 = FVector(69481544.0, 69481544.0, 69481544.0); - v2 = FVector(-0.577350259, -0.577350259, -0.577350259); + v1 = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); + v2 = FVector((float)-0.577350259, (float)-0.577350259, (float)-0.577350259); } void CStarView::randomizeVectors2(FVector &v1, FVector &v2) { @@ -466,8 +466,8 @@ void CStarView::randomizeVectors2(FVector &v1, FVector &v2) { v2.normalize(); */ // Values temporarily hardcoded to match hacked values in original EXE - v1 = FVector(69481544.0, 69481544.0, 69481544.0); - v2 = FVector(0.624659300, -0.468542814, -0.624714553); + v1 = FVector((float)69481544.0, (float)69481544.0, (float)69481544.0); + v2 = FVector((float)0.624659300, (float)-0.468542814, (float)-0.624714553); } void CStarView::resizeSurface(CScreenManager *scrManager, int width, int height, |