From e03a1106628e2d3e954c67c21bada5eae07c5c7d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 Mar 2016 23:37:40 -0500 Subject: TITANIC: Fleshing out CPetControl support classes --- .../titanic/pet_control/pet_control_list_item.cpp | 27 ++++++++ .../titanic/pet_control/pet_control_list_item.h | 42 +++++++++++++ .../titanic/pet_control/pet_control_list_item2.cpp | 34 ++++++++++ .../titanic/pet_control/pet_control_list_item2.h | 49 +++++++++++++++ engines/titanic/pet_control/pet_control_sub1.cpp | 3 + engines/titanic/pet_control/pet_control_sub1.h | 24 +++++++ engines/titanic/pet_control/pet_control_sub10.cpp | 48 ++++++++++++++ engines/titanic/pet_control/pet_control_sub10.h | 54 ++++++++++++++++ engines/titanic/pet_control/pet_control_sub11.cpp | 27 ++++++++ engines/titanic/pet_control/pet_control_sub11.h | 36 +++++++++++ engines/titanic/pet_control/pet_control_sub12.cpp | 38 +++++++++++ engines/titanic/pet_control/pet_control_sub12.h | 69 ++++++++++++++++++++ engines/titanic/pet_control/pet_control_sub2.cpp | 7 +++ engines/titanic/pet_control/pet_control_sub2.h | 24 +++++++ engines/titanic/pet_control/pet_control_sub3.h | 17 +++++ engines/titanic/pet_control/pet_control_sub4.cpp | 7 +++ engines/titanic/pet_control/pet_control_sub4.h | 14 +++++ engines/titanic/pet_control/pet_control_sub5.h | 12 ++++ engines/titanic/pet_control/pet_control_sub6.h | 5 ++ engines/titanic/pet_control/pet_control_sub7.h | 4 ++ engines/titanic/pet_control/pet_control_sub8.cpp | 9 +++ engines/titanic/pet_control/pet_control_sub8.h | 13 ++++ .../titanic/pet_control/pet_control_sub_base.cpp | 33 ++++++++++ engines/titanic/pet_control/pet_control_sub_base.h | 57 ++++++++++++++++- engines/titanic/pet_control/pet_val.cpp | 61 ++++++++++++++++++ engines/titanic/pet_control/pet_val.h | 50 +++++++++++++++ engines/titanic/pet_control/pet_val_base.cpp | 73 ++++++++++++++++++++++ engines/titanic/pet_control/pet_val_base.h | 67 ++++++++++++++++++++ 28 files changed, 902 insertions(+), 2 deletions(-) create mode 100644 engines/titanic/pet_control/pet_control_list_item.cpp create mode 100644 engines/titanic/pet_control/pet_control_list_item.h create mode 100644 engines/titanic/pet_control/pet_control_list_item2.cpp create mode 100644 engines/titanic/pet_control/pet_control_list_item2.h create mode 100644 engines/titanic/pet_control/pet_control_sub10.cpp create mode 100644 engines/titanic/pet_control/pet_control_sub10.h create mode 100644 engines/titanic/pet_control/pet_control_sub11.cpp create mode 100644 engines/titanic/pet_control/pet_control_sub11.h create mode 100644 engines/titanic/pet_control/pet_control_sub12.cpp create mode 100644 engines/titanic/pet_control/pet_control_sub12.h create mode 100644 engines/titanic/pet_control/pet_val.cpp create mode 100644 engines/titanic/pet_control/pet_val.h create mode 100644 engines/titanic/pet_control/pet_val_base.cpp create mode 100644 engines/titanic/pet_control/pet_val_base.h (limited to 'engines/titanic/pet_control') diff --git a/engines/titanic/pet_control/pet_control_list_item.cpp b/engines/titanic/pet_control/pet_control_list_item.cpp new file mode 100644 index 0000000000..ea678754f5 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_list_item.cpp @@ -0,0 +1,27 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/pet_control/pet_control_list_item.h" + +namespace Titanic { + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_list_item.h b/engines/titanic/pet_control/pet_control_list_item.h new file mode 100644 index 0000000000..64808c0309 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_list_item.h @@ -0,0 +1,42 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_CONTROL_LIST_ITEM_H +#define TITANIC_PET_CONTROL_LIST_ITEM_H + +#include "titanic/core/list.h" +#include "titanic/pet_control/pet_val.h" + +namespace Titanic { + +class CPetControlListItem : public ListItem { +protected: + CPetVal _val; + int _field30; +public: + CPetControlListItem() : _field30(0) {} + +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_CONTROL_LIST_ITEM_H */ diff --git a/engines/titanic/pet_control/pet_control_list_item2.cpp b/engines/titanic/pet_control/pet_control_list_item2.cpp new file mode 100644 index 0000000000..05847a9fe5 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_list_item2.cpp @@ -0,0 +1,34 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/pet_control/pet_control_list_item2.h" + +namespace Titanic { +/* +CPetControlListItem2::CPetControlListItem2(), + _field34(0), _field38(0), _field3C(0), _field40(0), + _field44(0), _field48(0), _field4C(0), _field50(0), + _field54(0), _field58(0), _field5C(0) { +} +*/ + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_list_item2.h b/engines/titanic/pet_control/pet_control_list_item2.h new file mode 100644 index 0000000000..26f32d5371 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_list_item2.h @@ -0,0 +1,49 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_CONTROL_LIST_ITEM2_H +#define TITANIC_PET_CONTROL_LIST_ITEM2_H + +#include "titanic/pet_control/pet_control_list_item.h" + +namespace Titanic { + +class CPetControlListItem2 : public CPetControlListItem { +protected: + int _field34; + int _field38; + int _field3C; + int _field40; + int _field44; + int _field48; + int _field4C; + int _field50; + int _field54; + int _field58; + int _field5C; +public: + //CPetControlListItem2(); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_CONTROL_LIST_ITEM2_H */ diff --git a/engines/titanic/pet_control/pet_control_sub1.cpp b/engines/titanic/pet_control/pet_control_sub1.cpp index 808358678a..7ca6d6ffbc 100644 --- a/engines/titanic/pet_control/pet_control_sub1.cpp +++ b/engines/titanic/pet_control/pet_control_sub1.cpp @@ -24,6 +24,9 @@ namespace Titanic { +CPetControlSub1::CPetControlSub1() : _field414(0), _field418(0) { +} + void CPetControlSub1::save(SimpleFile *file, int indent) const { } diff --git a/engines/titanic/pet_control/pet_control_sub1.h b/engines/titanic/pet_control/pet_control_sub1.h index 5e38523858..fbe1bbb510 100644 --- a/engines/titanic/pet_control/pet_control_sub1.h +++ b/engines/titanic/pet_control/pet_control_sub1.h @@ -24,11 +24,35 @@ #define TITANIC_PET_CONTROL_SUB1_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub12.h" +#include "titanic/pet_control/pet_val.h" namespace Titanic { class CPetControlSub1 : public CPetControlSubBase { +private: + CPetVal _val1; + CPetVal _val2; + CPetVal _val3; + CPetVal _valArray1[3]; + CPetVal _val4; + CPetVal _val5; + CPetVal _val6; + CPetControlSubData _field14C; + CPetVal _val7; + CPetVal _val8; + CPetVal _val9; + CPetVal _valArray2[9]; + int _field30C; + CPetControlSub12 _sub1; + CPetControlSub12 _sub2; + int _valArray3[3]; + int _field414; + int _field418; + CString _string1; public: + CPetControlSub1(); + /** * Save the data for the class to file */ diff --git a/engines/titanic/pet_control/pet_control_sub10.cpp b/engines/titanic/pet_control/pet_control_sub10.cpp new file mode 100644 index 0000000000..226ac4ec8b --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub10.cpp @@ -0,0 +1,48 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/textconsole.h" +#include "titanic/pet_control/pet_control_sub10.h" + +namespace Titanic { + +CPetControlSub10::CPetControlSub10() : _field10(0), _field14(7), + _field18(-1), _field1C(-1), _field20(0), _field24(0) { +} + +void CPetControlSub10::proc8() { + error("TODO"); +} + +void CPetControlSub10::proc9() { + error("TODO"); +} + +void CPetControlSub10::proc10() { + error("TODO"); +} + +void CPetControlSub10::proc11() { + error("TODO"); +} + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_sub10.h b/engines/titanic/pet_control/pet_control_sub10.h new file mode 100644 index 0000000000..f8534d7089 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub10.h @@ -0,0 +1,54 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_CONTROL_SUB10_H +#define TITANIC_PET_CONTROL_SUB10_H + +#include "titanic/core/list.h" +#include "titanic/pet_control/pet_control_sub10.h" +#include "titanic/pet_control/pet_control_list_item.h" + +namespace Titanic { + +class CPetControlSub10 : public List { +protected: + int _field10; + int _field14; + int _field18; + int _field1C; + int _field20; + int _field24; + CPetVal _val1; + CPetVal _val2; + CPetVal _val3; +public: + CPetControlSub10(); + + virtual void proc8(); + virtual void proc9(); + virtual void proc10(); + virtual void proc11(); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_CONTROL_SUB10_H */ diff --git a/engines/titanic/pet_control/pet_control_sub11.cpp b/engines/titanic/pet_control/pet_control_sub11.cpp new file mode 100644 index 0000000000..5148d1267a --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub11.cpp @@ -0,0 +1,27 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/pet_control/pet_control_sub11.h" + +namespace Titanic { + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_sub11.h b/engines/titanic/pet_control/pet_control_sub11.h new file mode 100644 index 0000000000..ebad13bff5 --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub11.h @@ -0,0 +1,36 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_CONTROL_SUB11_H +#define TITANIC_PET_CONTROL_SUB11_H + +#include "titanic/pet_control/pet_control_sub10.h" + +namespace Titanic { + +class CPetControlSub11 : public CPetControlSub10 { +public: +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_CONTROL_SUB11_H */ diff --git a/engines/titanic/pet_control/pet_control_sub12.cpp b/engines/titanic/pet_control/pet_control_sub12.cpp new file mode 100644 index 0000000000..1e8d62834e --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub12.cpp @@ -0,0 +1,38 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software(0), you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation(0), either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY(0), without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program(0), if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "titanic/pet_control/pet_control_sub12.h" + +namespace Titanic { + +CPetControlSub12::CPetControlSub12() : + _field0(0), _field4(0), _field8(0), _field18(0), + _field1C(0), _field20(0), _field24(0), _field28(0), + _field2C(0), _field30(0), _field34(0), _field38(0), + _field3C(0), _field40(0), _field44(0), _field48(0), + _field4C(0), _field50(0), _field54(0), _field58(0), + _field5C(0), _field60(0), _field64(0), _field68(0), + _field6C(0), _field70(0), _field74(0), _field78(0), + _field7C(0) { +} + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_sub12.h b/engines/titanic/pet_control/pet_control_sub12.h new file mode 100644 index 0000000000..b90c451d5e --- /dev/null +++ b/engines/titanic/pet_control/pet_control_sub12.h @@ -0,0 +1,69 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_CONTROL_SUB12_H +#define TITANIC_PET_CONTROL_SUB12_H + +#include "titanic/simple_file.h" + +namespace Titanic { + +class CPetControlSub12 { +protected: + int _field0; + int _field4; + int _field8; + CString _string1; + int _field18; + int _field1C; + int _field20; + int _field24; + int _field28; + int _field2C; + int _field30; + int _field34; + int _field38; + int _field3C; + int _field40; + int _field44; + int _field48; + int _field4C; + int _field50; + int _field54; + int _field58; + int _field5C; + int _field60; + int _field64; + int _field68; + int _field6C; + int _field70; + int _field74; + int _field78; + int _field7C; +public: + CPetControlSub12(); + +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_CONTROL_SUB12_H */ diff --git a/engines/titanic/pet_control/pet_control_sub2.cpp b/engines/titanic/pet_control/pet_control_sub2.cpp index a48869e806..84896bb939 100644 --- a/engines/titanic/pet_control/pet_control_sub2.cpp +++ b/engines/titanic/pet_control/pet_control_sub2.cpp @@ -24,6 +24,13 @@ namespace Titanic { +CPetControlSub2::CPetControlSub2() : + _field100(0), _field104(0), _field108(0), _field10C(0), + _field110(0), _field114(0), _field118(0), _field11C(0), + _field1C0(0), _field1C4(0), _field1C8(0), _field1CC(0), + _field1D0(0), _field1D4(0) { +} + void CPetControlSub2::save(SimpleFile *file, int indent) const { } diff --git a/engines/titanic/pet_control/pet_control_sub2.h b/engines/titanic/pet_control/pet_control_sub2.h index a54142c225..46ad1acacc 100644 --- a/engines/titanic/pet_control/pet_control_sub2.h +++ b/engines/titanic/pet_control/pet_control_sub2.h @@ -24,11 +24,35 @@ #define TITANIC_PET_CONTROL_SUB2_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub11.h" +#include "titanic/pet_control/pet_control_sub12.h" +#include "titanic/pet_control/pet_control_list_item2.h" namespace Titanic { class CPetControlSub2 : public CPetControlSubBase { +private: + CPetControlSub11 _sub11; + CPetControlListItem2 _listItem; + int _field100; + int _field104; + int _field108; + int _field10C; + int _field110; + int _field114; + int _field118; + int _field11C; + CPetVal _val1; + CPetControlSub12 _sub12; + int _field1C0; + int _field1C4; + int _field1C8; + int _field1CC; + int _field1D0; + int _field1D4; public: + CPetControlSub2(); + /** * Save the data for the class to file */ diff --git a/engines/titanic/pet_control/pet_control_sub3.h b/engines/titanic/pet_control/pet_control_sub3.h index 1b37628131..b5eebb1fb6 100644 --- a/engines/titanic/pet_control/pet_control_sub3.h +++ b/engines/titanic/pet_control/pet_control_sub3.h @@ -24,10 +24,27 @@ #define TITANIC_PET_CONTROL_SUB3_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub10.h" +#include "titanic/pet_control/pet_control_sub12.h" +#include "titanic/pet_control/pet_val.h" namespace Titanic { class CPetControlSub3 : public CPetControlSubBase { +private: + CPetControlSub10 _sub10; + CPetVal _val1; + CPetVal _val2; + CPetVal _val3; + CPetVal _val4; + CPetVal _val5; + CPetVal _val6; + CPetVal _val7; + CPetVal _val8; + CPetVal _val9; + CPetVal _val10; + CPetVal _val11; + CPetControlSub12 _sub12; public: /** * Save the data for the class to file diff --git a/engines/titanic/pet_control/pet_control_sub4.cpp b/engines/titanic/pet_control/pet_control_sub4.cpp index 35367a6186..49e5cb23fd 100644 --- a/engines/titanic/pet_control/pet_control_sub4.cpp +++ b/engines/titanic/pet_control/pet_control_sub4.cpp @@ -24,6 +24,13 @@ namespace Titanic { +CPetControlSub4::CPetControlSub4() : _field28C(0), + _field290(0), _field294(0), _field298(0) { + for (int idx = 0; idx < 46; ++idx) { + _valArray1[idx] = _valArray2[idx] = 0; + } +} + void CPetControlSub4::save(SimpleFile *file, int indent) const { } diff --git a/engines/titanic/pet_control/pet_control_sub4.h b/engines/titanic/pet_control/pet_control_sub4.h index b00acffdd9..b5de13b468 100644 --- a/engines/titanic/pet_control/pet_control_sub4.h +++ b/engines/titanic/pet_control/pet_control_sub4.h @@ -23,12 +23,26 @@ #ifndef TITANIC_PET_CONTROL_SUB4_H #define TITANIC_PET_CONTROL_SUB4_H +#include "titanic/simple_file.h" #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub10.h" +#include "titanic/pet_control/pet_control_sub12.h" namespace Titanic { class CPetControlSub4 : public CPetControlSubBase { +private: + CPetControlSub12 _sub12; + CPetControlSub10 _sub10; + int _valArray1[46]; + int _valArray2[46]; + int _field28C; + int _field290; + int _field294; + int _field298; public: + CPetControlSub4(); + /** * Save the data for the class to file */ diff --git a/engines/titanic/pet_control/pet_control_sub5.h b/engines/titanic/pet_control/pet_control_sub5.h index 2142a1050c..41b37fd7b2 100644 --- a/engines/titanic/pet_control/pet_control_sub5.h +++ b/engines/titanic/pet_control/pet_control_sub5.h @@ -24,10 +24,22 @@ #define TITANIC_PET_CONTROL_SUB5_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_val.h" namespace Titanic { class CPetControlSub5 : public CPetControlSubBase { +private: + CPetVal _val1; + CPetVal _val2; + CPetVal _val3; + CPetVal _val4; + CPetControlSubData _field17C; + int _field98; + int _field9C; + int _fieldA0; + CPetVal _valArray1[6]; + public: /** * Save the data for the class to file diff --git a/engines/titanic/pet_control/pet_control_sub6.h b/engines/titanic/pet_control/pet_control_sub6.h index d26c8f2753..93f83c2d6b 100644 --- a/engines/titanic/pet_control/pet_control_sub6.h +++ b/engines/titanic/pet_control/pet_control_sub6.h @@ -24,10 +24,15 @@ #define TITANIC_PET_CONTROL_SUB6_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub10.h" +#include "titanic/pet_control/pet_control_sub12.h" namespace Titanic { class CPetControlSub6 : public CPetControlSubBase { +private: + CPetControlSub10 _sub10; + CPetControlSub10 _sub12; public: /** * Save the data for the class to file diff --git a/engines/titanic/pet_control/pet_control_sub7.h b/engines/titanic/pet_control/pet_control_sub7.h index 660fe2a542..d74ac3c405 100644 --- a/engines/titanic/pet_control/pet_control_sub7.h +++ b/engines/titanic/pet_control/pet_control_sub7.h @@ -24,10 +24,14 @@ #define TITANIC_PET_CONTROL_SUB7_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_control_sub12.h" namespace Titanic { class CPetControlSub7 : public CPetControlSubBase { +private: + CPetControlSub12 _sub1; + CPetControlSub12 _sub2; public: /** * Save the data for the class to file diff --git a/engines/titanic/pet_control/pet_control_sub8.cpp b/engines/titanic/pet_control/pet_control_sub8.cpp index 471630835f..c2b0f7f67f 100644 --- a/engines/titanic/pet_control/pet_control_sub8.cpp +++ b/engines/titanic/pet_control/pet_control_sub8.cpp @@ -24,6 +24,15 @@ namespace Titanic { +static const int INDEXES[6] = { 1, 0, 2, 3, 4, 5 }; + +int CPetControlSub8::_indexes[6]; + +CPetControlSub8::CPetControlSub8() { + for (int idx = 0; idx < 6; ++idx) + _indexes[INDEXES[idx]] = idx; +} + void CPetControlSub8::save(SimpleFile *file, int indent) const { } diff --git a/engines/titanic/pet_control/pet_control_sub8.h b/engines/titanic/pet_control/pet_control_sub8.h index e6de1f89e1..391d4cf1fa 100644 --- a/engines/titanic/pet_control/pet_control_sub8.h +++ b/engines/titanic/pet_control/pet_control_sub8.h @@ -24,11 +24,24 @@ #define TITANIC_PET_CONTROL_SUB8_H #include "titanic/pet_control/pet_control_sub_base.h" +#include "titanic/pet_control/pet_val.h" namespace Titanic { class CPetControlSub8 : public CPetControlSubBase { +private: + static int _indexes[6]; + + CPetVal _valArray1[6]; + CPetVal _valArray2[6]; + CPetVal _val1; + CPetVal _val2; + CPetVal _val3; + CPetVal _val4; + CPetVal _valArray3[7]; public: + CPetControlSub8(); + /** * Save the data for the class to file */ diff --git a/engines/titanic/pet_control/pet_control_sub_base.cpp b/engines/titanic/pet_control/pet_control_sub_base.cpp index 35194317c3..05a3425b5f 100644 --- a/engines/titanic/pet_control/pet_control_sub_base.cpp +++ b/engines/titanic/pet_control/pet_control_sub_base.cpp @@ -20,8 +20,41 @@ * */ +#include "common/textconsole.h" #include "titanic/pet_control/pet_control_sub_base.h" namespace Titanic { +void CPetControlSubBase::proc4() { + error("TODO"); +} + +void CPetControlSubBase::proc16() { + error("TODO"); +} + +void CPetControlSubBase::proc25() { + error("TODO"); +} + +void CPetControlSubBase::proc27() { + error("TODO"); +} + +void CPetControlSubBase::proc28() { + error("TODO"); +} + +void CPetControlSubBase::proc29() { + error("TODO"); +} + +void CPetControlSubBase::proc30() { + error("TODO"); +} + +void CPetControlSubBase::proc31() { + error("TODO"); +} + } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_control_sub_base.h b/engines/titanic/pet_control/pet_control_sub_base.h index b11f5cc78b..85423820f4 100644 --- a/engines/titanic/pet_control/pet_control_sub_base.h +++ b/engines/titanic/pet_control/pet_control_sub_base.h @@ -27,21 +27,74 @@ namespace Titanic { +struct CPetControlSubData { + int _field0; + int _field4; + int _field8; + int _fieldC; + + CPetControlSubData() : _field0(0), _field4(0), + _field8(0), _fieldC(0) {} +}; + class CPetControlSubBase { protected: int _field4; public: CPetControlSubBase() : _field4(0) {} + virtual int proc1() { return 0; } + virtual int proc2() { return 0; } + virtual void proc3() {} + virtual void proc4(); + virtual void proc5() {} + virtual int proc6() { return 0; } + virtual int proc7() { return 0; } + virtual int proc8() { return 0; } + virtual int proc9() { return 0; } + virtual int proc10() { return 0; } + virtual int proc11() { return 0; } + virtual int proc12() { return 0; } + virtual int proc13() { return 0; } + virtual int proc14() { return 0; } + virtual int proc15() { return 0; } + virtual void proc16(); + /** - * Save the data for the class to file + * Returns true if the object is in a valid state */ - virtual void save(SimpleFile *file, int indent) const = 0; + virtual bool isValid() const { return false; } /** * Load the data for the class from file */ virtual void load(SimpleFile *file) = 0; + + virtual void proc19() {} + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const = 0; + + virtual void proc21() {} + virtual void proc22() {} + virtual void proc23() {} + virtual void proc24() {} + virtual void proc25(); + virtual int proc26() { return 0; } + virtual void proc27(); + virtual void proc28(); + virtual void proc29(); + virtual void proc30(); + virtual void proc31(); + virtual void proc32() {} + virtual void proc33() {} + virtual void proc34() {} + virtual void proc35() {} + virtual void proc36() {} + virtual void proc37() {} + virtual void proc38() {} }; } // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp new file mode 100644 index 0000000000..f3ee2bf9bf --- /dev/null +++ b/engines/titanic/pet_control/pet_val.cpp @@ -0,0 +1,61 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/textconsole.h" +#include "titanic/pet_control/pet_val.h" + +namespace Titanic { + +void CPetVal::proc1() { + error("TODO"); +} + +void CPetVal::proc2() { + error("TODO"); +} + +void CPetVal::proc3() { + error("TODO"); +} + +void CPetVal::proc4() { + error("TODO"); +} + +void CPetVal::proc5(CLinkItemSub *linkItem) { + error("TODO"); +} + +int CPetVal::proc16() { + switch (!_field14) { + case 0: + return _field18; + case 1: + return _field1C; + case 2: + return _field20; + default: + return 0; + } +} + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h new file mode 100644 index 0000000000..f1f9bd1f3c --- /dev/null +++ b/engines/titanic/pet_control/pet_val.h @@ -0,0 +1,50 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_VAL_H +#define TITANIC_PET_VAL_H + +#include "titanic/pet_control/pet_val_base.h" + +namespace Titanic { + +class CPetVal: public CPetValBase { +protected: + int _field18; + int _field1C; + int _field20; +public: + CPetVal() : CPetValBase(), _field18(0), _field1C(0), _field20(0) {} + + virtual void proc1(); + virtual void proc2(); + virtual void proc3(); + virtual void proc4(); + + virtual void proc5(CLinkItemSub *linkItem); + + virtual int proc16(); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_VAL_H */ diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp new file mode 100644 index 0000000000..fed1b0d709 --- /dev/null +++ b/engines/titanic/pet_control/pet_val_base.cpp @@ -0,0 +1,73 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "common/textconsole.h" +#include "titanic/pet_control/pet_val_base.h" + +namespace Titanic { + +void CPetValBase::proc5(CLinkItemSub *linkItem) { + if (linkItem) + linkItem->clear(); +} + +int CPetValBase::proc6() { + error("TODO"); +} + +int CPetValBase::proc7() { + error("TODO"); +} + +void CPetValBase::proc8() { + error("TODO"); +} + +int CPetValBase::proc9() { + error("TODO"); +} + +void CPetValBase::proc10() { + error("TODO"); +} + +void CPetValBase::proc11() { + error("TODO"); +} + +void CPetValBase::proc12() { + error("TODO"); +} + +void CPetValBase::proc13() { + error("TODO"); +} + +void CPetValBase::proc14() { + error("TODO"); +} + +void CPetValBase::proc15() { + error("TODO"); +} + +} // End of namespace Titanic diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h new file mode 100644 index 0000000000..a2701149a7 --- /dev/null +++ b/engines/titanic/pet_control/pet_val_base.h @@ -0,0 +1,67 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef TITANIC_PET_VAL_BASE_H +#define TITANIC_PET_VAL_BASE_H + +#include "titanic/simple_file.h" +#include "titanic/core/link_item.h" + +namespace Titanic { + +class CPetValBase { +protected: + int _field4; + int _field8; + int _fieldC; + int _field10; + int _field14; +public: + CPetValBase() : _field4(0), _field8(0), _fieldC(0), + _field10(0), _field14(0) {} + + virtual void proc1() {} + virtual void proc2() {} + virtual void proc3() {} + virtual void proc4() {} + + virtual void proc5(CLinkItemSub *linkItem); + + virtual int proc6(); + virtual int proc7(); + virtual void proc8(); + virtual int proc9(); + virtual void proc10(); + virtual void proc11(); + virtual void proc12(); + virtual void proc13(); + virtual void proc14(); + virtual void proc15(); + + virtual int proc16() { return 0; } + + virtual void proc17(int v) { _field14 = v; } +}; + +} // End of namespace Titanic + +#endif /* TITANIC_PET_VAL_BASE_H */ -- cgit v1.2.3