diff options
author | Paul Gilbert | 2016-07-17 16:43:53 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-17 16:43:53 -0400 |
commit | 011286d4b88b9d01ea1ceb232d6369385e68887e (patch) | |
tree | 253a8d112bec4bce1ceded6003dedb23565ea8bf /engines/titanic | |
parent | 9e14d4a56660ab3f090fd8eaed756a4d83353d76 (diff) | |
download | scummvm-rg350-011286d4b88b9d01ea1ceb232d6369385e68887e.tar.gz scummvm-rg350-011286d4b88b9d01ea1ceb232d6369385e68887e.tar.bz2 scummvm-rg350-011286d4b88b9d01ea1ceb232d6369385e68887e.zip |
TITANIC: Extra construction for CStarControlSub12
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/star_control/fmatrix.cpp | 6 | ||||
-rw-r--r-- | engines/titanic/star_control/fmatrix.h | 1 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub12.cpp | 5 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub12.h | 1 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub13.cpp | 55 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub13.h | 5 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub6.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/star_control/star_control_sub6.h | 3 | ||||
-rw-r--r-- | engines/titanic/star_control/star_view.cpp | 2 |
9 files changed, 79 insertions, 10 deletions
diff --git a/engines/titanic/star_control/fmatrix.cpp b/engines/titanic/star_control/fmatrix.cpp index c53892d0fe..81604c84ec 100644 --- a/engines/titanic/star_control/fmatrix.cpp +++ b/engines/titanic/star_control/fmatrix.cpp @@ -32,6 +32,12 @@ FMatrix::FMatrix(DMatrix *src) { copyFrom(src); } +FMatrix::FMatrix(FMatrix *src) { + _row1 = src->_row1; + _row2 = src->_row2; + _row3 = src->_row3; +} + void FMatrix::copyFrom(const DMatrix *src) { // TODO } diff --git a/engines/titanic/star_control/fmatrix.h b/engines/titanic/star_control/fmatrix.h index 5dbbe99253..33673874b4 100644 --- a/engines/titanic/star_control/fmatrix.h +++ b/engines/titanic/star_control/fmatrix.h @@ -47,6 +47,7 @@ public: public: FMatrix(); FMatrix(DMatrix *src); + FMatrix(FMatrix *src); /** * Load the data for the class from file diff --git a/engines/titanic/star_control/star_control_sub12.cpp b/engines/titanic/star_control/star_control_sub12.cpp index a2e1f068ef..aa90a3c7c3 100644 --- a/engines/titanic/star_control/star_control_sub12.cpp +++ b/engines/titanic/star_control/star_control_sub12.cpp @@ -32,6 +32,11 @@ CStarControlSub12::CStarControlSub12(void *val1, void *val2) : setupHandler(val2); } +CStarControlSub12::CStarControlSub12(CStarControlSub13 *src) : + _field4(-1), _handlerP(nullptr), _field108(0), _sub13(src) { + +} + CStarControlSub12::~CStarControlSub12() { deleteHandler(); } diff --git a/engines/titanic/star_control/star_control_sub12.h b/engines/titanic/star_control/star_control_sub12.h index a114cded81..0600aba446 100644 --- a/engines/titanic/star_control/star_control_sub12.h +++ b/engines/titanic/star_control/star_control_sub12.h @@ -54,6 +54,7 @@ private: void deleteHandler(); public: CStarControlSub12(void *val1, void *val2); + CStarControlSub12(CStarControlSub13 *src); virtual ~CStarControlSub12(); virtual void proc3() {} diff --git a/engines/titanic/star_control/star_control_sub13.cpp b/engines/titanic/star_control/star_control_sub13.cpp index fd67c19785..2038af3127 100644 --- a/engines/titanic/star_control/star_control_sub13.cpp +++ b/engines/titanic/star_control/star_control_sub13.cpp @@ -24,25 +24,51 @@ namespace Titanic { -CStarControlSub13::CStarControlSub13(void *ptr): +CStarControlSub13::CStarControlSub13(void *src) : _field0(0), _field4(0), _field8(0), _fieldC0(0), _fieldC4(0), _fieldC8(0), _fieldCC(0), _fieldD0(0) { - if (ptr) { - setup(ptr); + if (src) { + setup(src); } else { _fieldC = 0; _field10 = 0x44480000; _field14 = 0x461C4000; _field18 = 0x41A00000; _field1C = 0x41A00000; - _field20 = 600; - _field22 = 340; + _width = 600; + _height = 340; _field24 = 0; } _fieldD4 = 0; } +CStarControlSub13::CStarControlSub13(CStarControlSub13 *src) : + _matrix(&src->_matrix), _sub1(&src->_sub1), _sub2(&src->_sub2) { + _field0 = src->_field0; + _field4 = src->_field4; + _field8 = src->_field8; + _fieldC = src->_fieldC; + _field10 = src->_field10; + _field14 = src->_field14; + _field18 = src->_field18; + _field1C = src->_field1C; + _width = src->_width; + _height = src->_height; + + _fieldCC = src->_fieldCC; + _fieldD0 = src->_fieldD0; + _fieldC0 = src->_fieldC0; + _fieldC4 = src->_fieldC4; + _fieldC8 = src->_fieldC8; + _field24 = src->_field24; + + _valArray[0] = src->_valArray[0]; + _valArray[2] = src->_valArray[2]; + _valArray[3] = src->_valArray[3]; + _fieldD4 = 0; +} + void CStarControlSub13::setup(void *ptr) { // TODO } @@ -56,8 +82,10 @@ void CStarControlSub13::load(SimpleFile *file, int param) { _field14 = file->readFloat(); _field18 = file->readFloat(); _field1C = file->readFloat(); - _field20 = file->readNumber(); - _field22 = _field20 >> 16; + + int widthHeight = file->readNumber(); + _width = widthHeight & 0xff; + _height = _width >> 16; _field24 = file->readNumber(); for (int idx = 0; idx < 5; ++idx) @@ -68,6 +96,19 @@ void CStarControlSub13::load(SimpleFile *file, int param) { } void CStarControlSub13::save(SimpleFile *file, int indent) { + file->writeFloatLine(_field0, indent); + file->writeFloatLine(_field4, indent); + file->writeFloatLine(_field8, indent); + file->writeFloatLine(_fieldC, indent); + file->writeFloatLine(_field10, indent); + file->writeFloatLine(_field14, indent); + file->writeFloatLine(_field18, indent); + file->writeFloatLine(_field1C, indent); + file->writeFloatLine(_width | (_height << 16), indent); + + for (int idx = 0; idx < 5; ++idx) + file->writeFloatLine(_valArray[idx], indent); + _matrix.save(file, indent); } diff --git a/engines/titanic/star_control/star_control_sub13.h b/engines/titanic/star_control/star_control_sub13.h index 37ffe1bdb9..7eeab972aa 100644 --- a/engines/titanic/star_control/star_control_sub13.h +++ b/engines/titanic/star_control/star_control_sub13.h @@ -39,8 +39,8 @@ private: double _field14; double _field18; double _field1C; - int _field20; - int _field22; + int _width; + int _height; int _field24; double _valArray[5]; FMatrix _matrix; @@ -56,6 +56,7 @@ private: void setup(void *ptr); public: CStarControlSub13(void *ptr); + CStarControlSub13(CStarControlSub13 *src); /** * Load the data for the class from file diff --git a/engines/titanic/star_control/star_control_sub6.cpp b/engines/titanic/star_control/star_control_sub6.cpp index 83abc22c6f..a5a1d81aa8 100644 --- a/engines/titanic/star_control/star_control_sub6.cpp +++ b/engines/titanic/star_control/star_control_sub6.cpp @@ -34,6 +34,10 @@ CStarControlSub6::CStarControlSub6(int mode, double val) { set(mode, val); } +CStarControlSub6::CStarControlSub6(const CStarControlSub6 *src) { + copyFrom(src); +} + void CStarControlSub6::init() { _static = nullptr; } @@ -101,4 +105,11 @@ void CStarControlSub6::set(int mode, double amount) { _field2C = 0.0; } +void CStarControlSub6::copyFrom(const CStarControlSub6 *src) { + _matrix = src->_matrix; + _field24 = src->_field24; + _field28 = src->_field28; + _field2C = src->_field2C; +} + } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_control_sub6.h b/engines/titanic/star_control/star_control_sub6.h index 10058f5888..fe2b3d44b5 100644 --- a/engines/titanic/star_control/star_control_sub6.h +++ b/engines/titanic/star_control/star_control_sub6.h @@ -41,6 +41,7 @@ public: public: CStarControlSub6(); CStarControlSub6(int mode, double amount); + CStarControlSub6(const CStarControlSub6 *src); /** * Clear the item @@ -51,6 +52,8 @@ public: * Sets the default data */ void set(int mode, double val); + + void copyFrom(const CStarControlSub6 *src); }; } // End of namespace Titanic diff --git a/engines/titanic/star_control/star_view.cpp b/engines/titanic/star_control/star_view.cpp index a4c742c82a..2308227f6c 100644 --- a/engines/titanic/star_control/star_view.cpp +++ b/engines/titanic/star_control/star_view.cpp @@ -28,7 +28,7 @@ namespace Titanic { -CStarView::CStarView() : _sub12(nullptr, nullptr), _sub13(nullptr), +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) { |