[Scummvm-git-logs] scummvm master -> 028681be461882124fbd5f7ff990df7cf5be23c7
dreammaster
dreammaster at scummvm.org
Mon Mar 13 00:35:47 CET 2017
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
13cdf3b565 TITANIC: Implementing more starmap code
028681be46 TITANIC: Renamings in DMatrix class, thanks to Dark-Star
Commit: 13cdf3b56580d60424d36d21d0399238a7b05da3
https://github.com/scummvm/scummvm/commit/13cdf3b56580d60424d36d21d0399238a7b05da3
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-12T19:30:40-04:00
Commit Message:
TITANIC: Implementing more starmap code
Changed paths:
engines/titanic/star_control/star_control_sub23.h
engines/titanic/star_control/star_control_sub24.cpp
engines/titanic/star_control/star_control_sub24.h
engines/titanic/star_control/star_control_sub25.cpp
engines/titanic/star_control/star_control_sub25.h
engines/titanic/star_control/star_control_sub26.cpp
engines/titanic/star_control/star_control_sub26.h
engines/titanic/star_control/star_control_sub27.cpp
engines/titanic/star_control/star_control_sub27.h
diff --git a/engines/titanic/star_control/star_control_sub23.h b/engines/titanic/star_control/star_control_sub23.h
index 8d18a8f..244e835 100644
--- a/engines/titanic/star_control/star_control_sub23.h
+++ b/engines/titanic/star_control/star_control_sub23.h
@@ -31,7 +31,7 @@
namespace Titanic {
class CStarControlSub23 {
-private:
+protected:
int _field4;
int _field8;
FVector _row1, _row2;
@@ -48,7 +48,7 @@ private:
int _field54;
int _field58;
double _field5C;
- int _field60;
+ double _field60;
double _field64;
CStarControlSub25 _sub25;
public:
diff --git a/engines/titanic/star_control/star_control_sub24.cpp b/engines/titanic/star_control/star_control_sub24.cpp
index 6f17eb7..27f29b4 100644
--- a/engines/titanic/star_control/star_control_sub24.cpp
+++ b/engines/titanic/star_control/star_control_sub24.cpp
@@ -25,5 +25,19 @@
namespace Titanic {
+void CStarControlSub24::proc3(const FMatrix &m1, const FMatrix &m2) {
+
+}
+
+void CStarControlSub24::proc4(FVector &v1, FVector &v2, FMatrix &m) {
+ CStarControlSub23::proc4(v1, v2, m);
+
+ // TODO
+}
+
+int CStarControlSub24::proc5(CErrorCode &errorCode, FVector &v, const FMatrix &m) {
+ // TODO
+ return 0;
+}
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub24.h b/engines/titanic/star_control/star_control_sub24.h
index 9c29efb..34b9cf4 100644
--- a/engines/titanic/star_control/star_control_sub24.h
+++ b/engines/titanic/star_control/star_control_sub24.h
@@ -30,6 +30,10 @@ namespace Titanic {
class CStarControlSub24 : public CStarControlSub23 {
public:
virtual ~CStarControlSub24() {}
+
+ virtual void proc3(const FMatrix &m1, const FMatrix &m2);
+ virtual void proc4(FVector &v1, FVector &v2, FMatrix &m);
+ virtual int proc5(CErrorCode &errorCode, FVector &v, const FMatrix &m);
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub25.cpp b/engines/titanic/star_control/star_control_sub25.cpp
index f91c75a..73c72e6 100644
--- a/engines/titanic/star_control/star_control_sub25.cpp
+++ b/engines/titanic/star_control/star_control_sub25.cpp
@@ -25,4 +25,10 @@
namespace Titanic {
+void CStarControlSub25::fn1(const FMatrix &m1, const FMatrix &m2) {
+ _matrix1 = m1;
+ _matrix2 = m2;
+
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub25.h b/engines/titanic/star_control/star_control_sub25.h
index b61569c..85692cf 100644
--- a/engines/titanic/star_control/star_control_sub25.h
+++ b/engines/titanic/star_control/star_control_sub25.h
@@ -35,7 +35,7 @@ public:
CStarControlSub26 _sub1;
CStarControlSub26 _sub2;
public:
-
+ void fn1(const FMatrix &m1, const FMatrix &m2);
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub26.cpp b/engines/titanic/star_control/star_control_sub26.cpp
index 89ff93c..546a3e9 100644
--- a/engines/titanic/star_control/star_control_sub26.cpp
+++ b/engines/titanic/star_control/star_control_sub26.cpp
@@ -30,5 +30,16 @@ double CStarControlSub26::fn1() const {
_sub._v3 * _sub._v3 + _field0 * _field0;
}
+void CStarControlSub26::setup(double val1, double val2, double val3, double val4) {
+ _field0 = val1;
+ _sub._v1 = val2;
+ _sub._v2 = val3;
+ _sub._v3 = val4;
+}
+
+void CStarControlSub26::copyFrom(const CStarControlSub26 *src) {
+ _field0 = src->_field0;
+ _sub = src->_sub;
+}
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub26.h b/engines/titanic/star_control/star_control_sub26.h
index 4054a2b..9023da9 100644
--- a/engines/titanic/star_control/star_control_sub26.h
+++ b/engines/titanic/star_control/star_control_sub26.h
@@ -39,7 +39,18 @@ public:
public:
CStarControlSub26() : _field0(1.0) {}
+ /**
+ * Sets the field values
+ */
+ void setup(double val1, double val2, double val3, double val4);
+
+ /**
+ * Copies from another instance
+ */
+ void copyFrom(const CStarControlSub26 *src);
+
double fn1() const;
+
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub27.cpp b/engines/titanic/star_control/star_control_sub27.cpp
index 6f17eb7..706e947 100644
--- a/engines/titanic/star_control/star_control_sub27.cpp
+++ b/engines/titanic/star_control/star_control_sub27.cpp
@@ -20,10 +20,40 @@
*
*/
-#include "titanic/star_control/star_control_sub24.h"
+#include "titanic/star_control/star_control_sub27.h"
#include "common/textconsole.h"
namespace Titanic {
+void CStarControlSub27::proc2(FVector &v1, FVector &v2, FMatrix &m1, FMatrix &m2) {
+ CStarControlSub23::proc2(v1, v2, m1, m2);
+
+ int v24 = _field24;
+ if (_field24 > 0.0) {
+ _field8 = 1;
+ _field34 = 1;
+ proc6(120, 4, _field24);
+ }
+
+ if (m1 != m2) {
+ _sub25.fn1(m1, m2);
+ _field58 = 0;
+ _field5C = 0.0;
+
+ if (_field4C == 0) {
+ _field60 = -1.5881868e-23;
+ _field64 = 1.4499999;
+ _field8 = 1;
+ } else {
+ _field60 = 1.0 / (double)v24;
+ _field8 = 1;
+ }
+ }
+}
+
+int CStarControlSub27::proc5(CErrorCode &errorCode, FVector &v, const FMatrix &m) {
+ // TODO
+ return 0;
+}
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/star_control_sub27.h b/engines/titanic/star_control/star_control_sub27.h
index 9770c97..8015912 100644
--- a/engines/titanic/star_control/star_control_sub27.h
+++ b/engines/titanic/star_control/star_control_sub27.h
@@ -30,6 +30,9 @@ namespace Titanic {
class CStarControlSub27 : public CStarControlSub23 {
public:
virtual ~CStarControlSub27() {}
+
+ virtual void proc2(FVector &v1, FVector &v2, FMatrix &m1, FMatrix &m2);
+ virtual int proc5(CErrorCode &errorCode, FVector &v, const FMatrix &m);
};
} // End of namespace Titanic
Commit: 028681be461882124fbd5f7ff990df7cf5be23c7
https://github.com/scummvm/scummvm/commit/028681be461882124fbd5f7ff990df7cf5be23c7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-03-12T19:35:38-04:00
Commit Message:
TITANIC: Renamings in DMatrix class, thanks to Dark-Star
Changed paths:
engines/titanic/star_control/dmatrix.cpp
engines/titanic/star_control/dmatrix.h
diff --git a/engines/titanic/star_control/dmatrix.cpp b/engines/titanic/star_control/dmatrix.cpp
index 2539352..9fc7a85 100644
--- a/engines/titanic/star_control/dmatrix.cpp
+++ b/engines/titanic/star_control/dmatrix.cpp
@@ -46,8 +46,8 @@ DMatrix::DMatrix(int mode, const FMatrix *src) {
_frow2._z = src->_row2._z;
}
-DMatrix::DMatrix(int mode, double val) {
- set(mode, val);
+DMatrix::DMatrix(DAxis axis, double amount) {
+ setRotationMatrix(axis, amount);
}
DMatrix::DMatrix(const FMatrix &src) {
@@ -65,13 +65,13 @@ void DMatrix::deinit() {
_static = nullptr;
}
-void DMatrix::set(int mode, double amount) {
+void DMatrix::setRotationMatrix(DAxis axis, double amount) {
const double FACTOR = 0.0174532925199433;
double sinVal = sin(amount * FACTOR);
double cosVal = cos(amount * FACTOR);
- switch (mode) {
- case 0:
+ switch (axis) {
+ case X_AXIS:
_row1._x = 1.0;
_row2._y = cosVal;
_row2._z = sinVal;
@@ -79,7 +79,7 @@ void DMatrix::set(int mode, double amount) {
_row3._z = cosVal;
break;
- case 1:
+ case Y_AXIS:
_row1._x = cosVal;
_row1._z = sinVal;
_row2._y = 1.0;
@@ -87,7 +87,7 @@ void DMatrix::set(int mode, double amount) {
_row3._z = cosVal;
break;
- case 2:
+ case Z_AXIS:
_row1._x = cosVal;
_row1._y = sinVal;
_row2._x = -sinVal;
diff --git a/engines/titanic/star_control/dmatrix.h b/engines/titanic/star_control/dmatrix.h
index b7fd8bf..7d1f0e0 100644
--- a/engines/titanic/star_control/dmatrix.h
+++ b/engines/titanic/star_control/dmatrix.h
@@ -28,6 +28,8 @@
namespace Titanic {
+enum DAxis { X_AXIS, Y_AXIS, Z_AXIS };
+
class FMatrix;
class CStarControlSub26;
@@ -50,13 +52,13 @@ public:
public:
DMatrix();
DMatrix(int mode, const FMatrix *src);
- DMatrix(int mode, double val);
+ DMatrix(DAxis axis, double amount);
DMatrix(const FMatrix &src);
/**
- * Sets up data for the matrix
+ * Sets up a matrix for rotating on a given axis by a given amount
*/
- void set(int mode, double amount);
+ void setRotationMatrix(DAxis axis, double amount);
void fn1(DMatrix &m);
void fn3(CStarControlSub26 *sub26);
More information about the Scummvm-git-logs
mailing list