diff options
author | Paul Gilbert | 2017-03-12 19:30:40 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-03-12 19:30:40 -0400 |
commit | 13cdf3b56580d60424d36d21d0399238a7b05da3 (patch) | |
tree | 60ff740eeb3953ecb249776c20d788526e42a6bf | |
parent | 811edc9d7ed81db43d1fb17ef18f3cf92d3285ee (diff) | |
download | scummvm-rg350-13cdf3b56580d60424d36d21d0399238a7b05da3.tar.gz scummvm-rg350-13cdf3b56580d60424d36d21d0399238a7b05da3.tar.bz2 scummvm-rg350-13cdf3b56580d60424d36d21d0399238a7b05da3.zip |
TITANIC: Implementing more starmap code
9 files changed, 83 insertions, 4 deletions
diff --git a/engines/titanic/star_control/star_control_sub23.h b/engines/titanic/star_control/star_control_sub23.h index 8d18a8f2c8..244e835236 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 6f17eb7193..27f29b41ca 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 9c29efb0bd..34b9cf4eac 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 f91c75af6a..73c72e6a77 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 b61569c49d..85692cf62d 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 89ff93c347..546a3e9fae 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 4054a2ba6e..9023da906c 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 6f17eb7193..706e947a05 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 9770c97b16..801591294e 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 |