diff options
author | Paul Gilbert | 2016-07-17 20:18:20 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-17 20:18:20 -0400 |
commit | 87db74d771d86281def59c12ba8359abeaa03585 (patch) | |
tree | ee17957e99270b7e1533d6043869818a87d83dec /engines/titanic | |
parent | 011286d4b88b9d01ea1ceb232d6369385e68887e (diff) | |
download | scummvm-rg350-87db74d771d86281def59c12ba8359abeaa03585.tar.gz scummvm-rg350-87db74d771d86281def59c12ba8359abeaa03585.tar.bz2 scummvm-rg350-87db74d771d86281def59c12ba8359abeaa03585.zip |
TITANIC: Adding CStarControlSub12 methods
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/star_control/fmatrix.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/fmatrix.h | 2 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub12.cpp | 59 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub12.h | 23 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub13.cpp | 63 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub13.h | 13 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub20.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub20.h | 4 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 5 |
9 files changed, 169 insertions, 10 deletions
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp index 81604c84ec..af15477d04 100644 --- a/engines/titanic/star_control/fmatrix.cpp +++ b/engines/titanic/star_control/fmatrix.cpp @@ -78,17 +78,17 @@ void FMatrix::set(FVector *row1, FVector *row2, FVector *row3) { _row3 = *row3; } -void FMatrix::fn1(FVector *v) { +void FMatrix::fn1(const FVector *v) { _row3._x = v->_x; FVector tempVector; - tempVector.fn1(v); + _row3.fn1(&tempVector); _row2._x = tempVector._x; _row2._y = tempVector._y; _row2._z = tempVector._z; - _row3.multiply(v, &_row2); + _row3.multiply(&tempVector, &_row2); _row1._x = _row2._x; _row1._y = _row2._y; _row1._z = _row2._z; diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h index 33673874b4..d7c4acfbdc 100644 --- a/engines/titanic/star_control/fmatrix.h +++ b/engines/titanic/star_control/fmatrix.h @@ -69,7 +69,7 @@ public: */ void set(FVector *row1, FVector *row2, FVector *row3); - void fn1(FVector *v); + void fn1(const FVector *v); void fn2(FMatrix *m); void fn3(FMatrix *m); diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp index aa90a3c7c3..f968559a2f 100644 --- a/engines/titanic/star_control/star_control_sub12.cpp +++ b/engines/titanic/star_control/star_control_sub12.cpp @@ -41,6 +41,65 @@ CStarControlSub12::~CStarControlSub12() { deleteHandler(); } +void CStarControlSub12::proc2(const void *src) { + _sub13.copyFrom(src); +} + +void CStarControlSub12::proc3(const void *src) { + _handlerP->copyFrom1(src); +} + +void CStarControlSub12::proc4(const void *src) { + if (!isLocked()) { + _sub13.fn10(src); + set108(); + } +} + +void CStarControlSub12::proc5(const FVector *src) { + if (!isLocked()) + _sub13.fn11(src); +} + +void CStarControlSub12::proc6(int v) { + if (!isLocked()) + _sub13.setC(v); +} + +void CStarControlSub12::proc7(int v) { + if (!isLocked()) + _sub13.set10(v); +} + +void CStarControlSub12::proc8(int v) { + if (!isLocked()) + _sub13.set14(v); +} + +void CStarControlSub12::proc9(int v) { + if (!isLocked()) + _sub13.set18(v); +} + +void CStarControlSub12::proc10(int v) { + if (!isLocked()) + _sub13.set1C(v); +} + +void CStarControlSub12::proc11() { + if (!isLocked()) + _sub13.fn12(); +} + +void CStarControlSub12::proc12(double v1, double v2) { + if (!isLocked()) + _sub13.fn13(v1, v2); +} + +void CStarControlSub12::proc13(CStarControlSub13 *dest) { + *dest = _sub13; +} + void CStarControlSub12::load(SimpleFile *file, int param) { _sub13.load(file, param); } diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h index 0600aba446..1262aa8bf3 100644 --- a/engines/titanic/star_control/star_control_sub12.h +++ b/engines/titanic/star_control/star_control_sub12.h @@ -52,12 +52,28 @@ private: * Deletes any previous handler */ void deleteHandler(); + + /** + * Return whether the handler is locked + */ + bool isLocked() { return _handlerP->isLocked(); } public: CStarControlSub12(void *val1, void *val2); CStarControlSub12(CStarControlSub13 *src); virtual ~CStarControlSub12(); - virtual void proc3() {} + virtual void proc2(const void *src); + virtual void proc3(const void *src); + virtual void proc4(const void *src); + virtual void proc5(const FVector *src); + virtual void proc6(int v); + virtual void proc7(int v); + virtual void proc8(int v); + virtual void proc9(int v); + virtual void proc10(int v); + virtual void proc11(); + virtual void proc12(double v1, double v2); + virtual void proc13(CStarControlSub13 *dest); /** * Load the data for the class from file @@ -68,6 +84,11 @@ public: * Save the data for the class to file */ virtual void save(SimpleFile *file, int indent); + + + bool is108() const { return _field108; } + void set108() { _field108 = true; } + void reset108() { _field108 = false; } }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp index 2038af3127..a8599a7654 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 { @@ -73,6 +74,18 @@ void CStarControlSub13::setup(void *ptr) { // TODO } +void CStarControlSub13::copyFrom(const void *src) { + if (!src) + return; +/* + _field0 = src->_field0; + _field4 = src->_field4; + _field8 = src->_field8; + _fieldC = src->_field18; + _field10 = src->_field1C; + */ +} + void CStarControlSub13::load(SimpleFile *file, int param) { _field0 = file->readFloat(); _field4 = file->readFloat(); @@ -112,5 +125,55 @@ void CStarControlSub13::save(SimpleFile *file, int indent) { _matrix.save(file, indent); } +void CStarControlSub13::fn10(const void *src) { + error("TODO: CStarControlSub13::fn10"); +} + +void CStarControlSub13::fn11(const FVector *v) { + _matrix.fn1(v); + _fieldD4 = 0; +} + +void CStarControlSub13::setC(int v) { + _fieldC = v; + _fieldD4 = 0; +} + +void CStarControlSub13::set10(int v) { + _field10 = v; + _fieldD4 = 0; +} + +void CStarControlSub13::set14(int v) { + _field10 = v; +} + +void CStarControlSub13::set18(int v) { + _field18 = v; + _fieldD4 = 0; +} + +void CStarControlSub13::set1C(int v) { + _field1C = v; + _fieldD4 = 0; +} + +void CStarControlSub13::fn12() { + _matrix.clear(); + error("TODO: CStarControlSub13::fn12"); +} + +void CStarControlSub13::fn13(double v1, double v2) { + if (v1 == 0.0) { + _valArray[0] = v2; + _valArray[1] = -v2; + } else { + _valArray[3] = v2; + _valArray[4] = -v2; + } + + _valArray[2] = 0.0; + _field24 = v2 ? 2 : 0; +} } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h index 7eeab972aa..eb4a07cb32 100644 --- a/engines/titanic/star_control/star_control_sub13.h +++ b/engines/titanic/star_control/star_control_sub13.h @@ -58,6 +58,8 @@ public: CStarControlSub13(void *ptr); CStarControlSub13(CStarControlSub13 *src); + void copyFrom(const void *src); + /** * Load the data for the class from file */ @@ -67,6 +69,17 @@ public: * Save the data for the class to file */ void save(SimpleFile *file, int indent); + + void fn10(const void *src); + void fn11(const FVector *v); + void fn12(); + void fn13(double v1, double v2); + + void setC(int v); + void set10(int v); + void set14(int v); + void set18(int v); + void set1C(int v); }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_control_sub20.cpp b/engines/titanic/star_control/star_control_sub20.cpp index 958ee3813e..82b6b0d7dd 100644 --- a/engines/titanic/star_control/star_control_sub20.cpp +++ b/engines/titanic/star_control/star_control_sub20.cpp @@ -47,11 +47,11 @@ CStarControlSub20::~CStarControlSub20() { clear(); } -void CStarControlSub20::copyFrom1(void *src) { +void CStarControlSub20::copyFrom1(const void *src) { error("TODO: CStarControlSub20::copyFrom1"); } -void CStarControlSub20::copyFrom2(void *src) { +void CStarControlSub20::copyFrom2(const void *src) { error("TODO: CStarControlSub20::copyFrom2"); } diff --git a/engines/titanic/star_control/star_control_sub20.h b/engines/titanic/star_control/star_control_sub20.h index 376c09743a..9d90b80d26 100644 --- a/engines/titanic/star_control/star_control_sub20.h +++ b/engines/titanic/star_control/star_control_sub20.h @@ -44,8 +44,8 @@ public: CStarControlSub20(void *src); virtual ~CStarControlSub20(); - virtual void copyFrom1(void *src); - virtual void copyFrom2(void *src); + virtual void copyFrom1(const void *src); + virtual void copyFrom2(const void *src); virtual void proc4(); virtual void proc5(); virtual void proc6(); diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index 2308227f6c..5140dc086f 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -32,7 +32,10 @@ CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13((void *)nullptr), _owner(nullptr), _starField(nullptr), _videoSurface(nullptr), _field118(0), _videoSurface2(nullptr), _field210(0), _homePhotoMask(nullptr), _field218(0), _field21C(0) { - _sub12.proc3(); + static const uint DATA[8] = { 0, 0, 0x47C35000, 0, 0x41A00000, + 0x3F800000, 0x3F800000, 0x3F800000 }; + + _sub12.proc3(&DATA[0]); } void CStarView::load(SimpleFile *file, int param) { |