TITANIC: Extra construction for CStarControlSub12

This commit is contained in:
Paul Gilbert 2016-07-17 16:43:53 -04:00
parent 9e14d4a566
commit 011286d4b8
9 changed files with 79 additions and 10 deletions

View File

@ -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
}

View File

@ -47,6 +47,7 @@ public:
public:
FMatrix();
FMatrix(DMatrix *src);
FMatrix(FMatrix *src);
/**
* Load the data for the class from file

View File

@ -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();
}

View File

@ -54,6 +54,7 @@ private:
void deleteHandler();
public:
CStarControlSub12(void *val1, void *val2);
CStarControlSub12(CStarControlSub13 *src);
virtual ~CStarControlSub12();
virtual void proc3() {}

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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) {