diff options
author | Paul Gilbert | 2017-03-11 15:03:34 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-03-11 15:03:34 -0500 |
commit | f757ad51c1f56ed18e8f4e4afcbabd577be89a36 (patch) | |
tree | a29ffef474626caf9cda011d4f36e748ecb43bf9 | |
parent | d84d166fc6709d12c4ef745f93cf4920f611e918 (diff) | |
download | scummvm-rg350-f757ad51c1f56ed18e8f4e4afcbabd577be89a36.tar.gz scummvm-rg350-f757ad51c1f56ed18e8f4e4afcbabd577be89a36.tar.bz2 scummvm-rg350-f757ad51c1f56ed18e8f4e4afcbabd577be89a36.zip |
TITANIC: More CStarControlSub13 methods
-rw-r--r-- | engines/titanic/star_control/star_control_sub13.cpp | 20 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub6.cpp | 3 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub6.h | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp index d7153d4a1a..ac247c503b 100644 --- a/engines/titanic/star_control/star_control_sub13.cpp +++ b/engines/titanic/star_control/star_control_sub13.cpp @@ -21,6 +21,7 @@ */ #include "titanic/star_control/star_control_sub13.h" +#include "titanic/titanic.h" namespace Titanic { @@ -156,7 +157,19 @@ void CStarControlSub13::set1C(double v) { void CStarControlSub13::fn12() { _matrix.clear(); - error("TODO: CStarControlSub13::fn12"); + + CStarControlSub6 m1(0, g_vm->getRandomNumber(359)); + CStarControlSub6 m2(1, g_vm->getRandomNumber(359)); + CStarControlSub6 m3(2, g_vm->getRandomNumber(359)); + + CStarControlSub6 s1, s2; + CStarControlSub6 *s; + s = CStarControlSub6::setup(&s1, &m1, &m2); + s = CStarControlSub6::setup(&s2, s, &m3); + + m1.copyFrom(*s); + _matrix.fn2(&m1); + _fieldD4 = 0; } void CStarControlSub13::fn13(StarMode mode, double v2) { @@ -236,7 +249,10 @@ FVector CStarControlSub13::fn18(int index, const FVector &src) { } void CStarControlSub13::fn19(double *v1, double *v2, double *v3, double *v4) { - error("TODO: CStarControlSub13::fn19"); + *v1 = _fieldC8 / _fieldCC; + *v2 = _fieldC8 / _fieldD0; + *v3 = _valArray[3]; + *v4 = _valArray[4]; } void CStarControlSub13::reset() { diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp index 5d9034d616..b1dd9e43e3 100644 --- a/engines/titanic/star_control/star_control_sub6.cpp +++ b/engines/titanic/star_control/star_control_sub6.cpp @@ -114,7 +114,7 @@ void CStarControlSub6::copyFrom(const FMatrix &src) { _row3 = src._row3; } -void CStarControlSub6::setup(CStarControlSub6 *dest, const CStarControlSub6 *s2, const CStarControlSub6 *s3) { +CStarControlSub6 *CStarControlSub6::setup(CStarControlSub6 *dest, const CStarControlSub6 *s2, const CStarControlSub6 *s3) { CStarControlSub6 &d = *dest; d._row1._x = s3->_row1._x * s2->_row1._x @@ -156,6 +156,7 @@ void CStarControlSub6::setup(CStarControlSub6 *dest, const CStarControlSub6 *s2, + s2->_vector._z * s3->_row3._z + s2->_vector._x * s3->_row1._z + s3->_vector._z; + return dest; } void CStarControlSub6::fn1(CStarControlSub6 *sub6) { diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h index b1c829c884..572ac4a4f1 100644 --- a/engines/titanic/star_control/star_control_sub6.h +++ b/engines/titanic/star_control/star_control_sub6.h @@ -48,7 +48,7 @@ public: /** * Sets up a passed instance from the specified two other ones */ - static void setup(CStarControlSub6 *dest, const CStarControlSub6 *s2, const CStarControlSub6 *s3); + static CStarControlSub6 *setup(CStarControlSub6 *dest, const CStarControlSub6 *s2, const CStarControlSub6 *s3); /** * Sets the default data |