diff options
author | Paul Gilbert | 2016-03-02 18:29:09 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-03-02 18:29:09 -0500 |
commit | 96825e282392d24e683c0e9cb7b7a1ac9aa4f467 (patch) | |
tree | 0e7047797ad4c644cfde4d09abb30dfc498094ac /engines/titanic/game | |
parent | 700b77e1eaea257f322efdb2336b8a46dd3b91ec (diff) | |
download | scummvm-rg350-96825e282392d24e683c0e9cb7b7a1ac9aa4f467.tar.gz scummvm-rg350-96825e282392d24e683c0e9cb7b7a1ac9aa4f467.tar.bz2 scummvm-rg350-96825e282392d24e683c0e9cb7b7a1ac9aa4f467.zip |
TITANIC: More saveable classes implemented
Diffstat (limited to 'engines/titanic/game')
-rw-r--r-- | engines/titanic/game/bottom_of_well_monitor.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/game/bottom_of_well_monitor.h | 1 | ||||
-rw-r--r-- | engines/titanic/game/brain_slot.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/game/brain_slot.h | 5 | ||||
-rw-r--r-- | engines/titanic/game/code_wheel.cpp | 48 | ||||
-rw-r--r-- | engines/titanic/game/code_wheel.h | 56 | ||||
-rw-r--r-- | engines/titanic/game/head_slot.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/game/missiveomat_button.cpp | 41 | ||||
-rw-r--r-- | engines/titanic/game/missiveomat_button.h | 54 | ||||
-rw-r--r-- | engines/titanic/game/ship_setting_button.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/game/ship_setting_button.h | 6 |
11 files changed, 231 insertions, 4 deletions
diff --git a/engines/titanic/game/bottom_of_well_monitor.cpp b/engines/titanic/game/bottom_of_well_monitor.cpp index daca5dbb5f..b48b5ad291 100644 --- a/engines/titanic/game/bottom_of_well_monitor.cpp +++ b/engines/titanic/game/bottom_of_well_monitor.cpp @@ -24,14 +24,21 @@ namespace Titanic { +int CBottomOfWellMonitor::_v1; +int CBottomOfWellMonitor::_v2; + void CBottomOfWellMonitor::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); + file->writeNumberLine(_v1, indent); + file->writeNumberLine(_v2, indent); file->writeNumberLine(_value, indent); CGameObject::save(file, indent); } void CBottomOfWellMonitor::load(SimpleFile *file) { file->readNumber(); + _v1 = file->readNumber(); + _v2 = file->readNumber(); _value = file->readNumber(); CGameObject::load(file); } diff --git a/engines/titanic/game/bottom_of_well_monitor.h b/engines/titanic/game/bottom_of_well_monitor.h index de07aacf35..f1a9f5d710 100644 --- a/engines/titanic/game/bottom_of_well_monitor.h +++ b/engines/titanic/game/bottom_of_well_monitor.h @@ -29,6 +29,7 @@ namespace Titanic { class CBottomOfWellMonitor : public CGameObject { public: + static int _v1, _v2; int _value; public: CBottomOfWellMonitor() : _value(1) {} diff --git a/engines/titanic/game/brain_slot.cpp b/engines/titanic/game/brain_slot.cpp index f8a029ed67..f655a963d5 100644 --- a/engines/titanic/game/brain_slot.cpp +++ b/engines/titanic/game/brain_slot.cpp @@ -30,7 +30,7 @@ int CBrainSlot::_v2; void CBrainSlot::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); file->writeNumberLine(_value1, indent); - file->writeNumberLine(_value2, indent); + file->writeQuotedLine(_value2, indent); file->writeNumberLine(_v1, indent); file->writeNumberLine(_v2, indent); @@ -40,7 +40,7 @@ void CBrainSlot::save(SimpleFile *file, int indent) const { void CBrainSlot::load(SimpleFile *file) { file->readNumber(); _value1 = file->readNumber(); - _value2 = file->readNumber(); + _value2 = file->readString(); _v1 = file->readNumber(); _v2 = file->readNumber(); diff --git a/engines/titanic/game/brain_slot.h b/engines/titanic/game/brain_slot.h index 982541f945..fa197a85d7 100644 --- a/engines/titanic/game/brain_slot.h +++ b/engines/titanic/game/brain_slot.h @@ -31,9 +31,10 @@ class CBrainSlot : public CGameObject { public: static int _v1, _v2; public: - int _value1, _value2; + int _value1; + CString _value2; public: - CBrainSlot() : CGameObject(), _value1(0), _value2(0) {} + CBrainSlot() : CGameObject(), _value1(0) {} /** * Return the class name diff --git a/engines/titanic/game/code_wheel.cpp b/engines/titanic/game/code_wheel.cpp new file mode 100644 index 0000000000..a10a70c974 --- /dev/null +++ b/engines/titanic/game/code_wheel.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 "titanic/game/code_wheel.h" + +namespace Titanic { + +CodeWheel::CodeWheel() : CBomb(), _field108(0), _field10C(4), _field110(0) { +} + +void CodeWheel::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_field108, indent); + file->writeNumberLine(_field10C, indent); + file->writeNumberLine(_field110, indent); + + CBomb::save(file, indent); +} + +void CodeWheel::load(SimpleFile *file) { + file->readNumber(); + _field108 = file->readNumber(); + _field10C = file->readNumber(); + _field110 = file->readNumber(); + + CBomb::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/code_wheel.h b/engines/titanic/game/code_wheel.h new file mode 100644 index 0000000000..70879826e9 --- /dev/null +++ b/engines/titanic/game/code_wheel.h @@ -0,0 +1,56 @@ +/* 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_CODE_WHEEL_H +#define TITANIC_CODE_WHEEL_H + +#include "titanic/game/bomb.h" + +namespace Titanic { + +class CodeWheel : public CBomb { +private: + int _field108; + int _field10C; + int _field110; +public: + CodeWheel(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CodeWheel"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_CODE_WHEEL_H */ diff --git a/engines/titanic/game/head_slot.cpp b/engines/titanic/game/head_slot.cpp index c037238e7c..4cb15ccd1e 100644 --- a/engines/titanic/game/head_slot.cpp +++ b/engines/titanic/game/head_slot.cpp @@ -24,6 +24,8 @@ namespace Titanic { +int CHeadSlot::_v1; + CHeadSlot::CHeadSlot() : CGameObject(), _string1("NotWorking"), _string2("NULL"), _fieldBC(0), _fieldD8(0), _fieldDC(27), _fieldE0(56), _fieldE4(82), _fieldE8(112), _fieldEC(0) { diff --git a/engines/titanic/game/missiveomat_button.cpp b/engines/titanic/game/missiveomat_button.cpp new file mode 100644 index 0000000000..8f0918a294 --- /dev/null +++ b/engines/titanic/game/missiveomat_button.cpp @@ -0,0 +1,41 @@ +/* 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/game/missiveomat_button.h" + +namespace Titanic { + +void CMissiveOMatButton::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldFC, indent); + + CEditControl::save(file, indent); +} + +void CMissiveOMatButton::load(SimpleFile *file) { + file->readNumber(); + _fieldFC = file->readNumber(); + + CEditControl::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/missiveomat_button.h b/engines/titanic/game/missiveomat_button.h new file mode 100644 index 0000000000..f383e88798 --- /dev/null +++ b/engines/titanic/game/missiveomat_button.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_MISSIVEOMAT_BUTTON_H +#define TITANIC_MISSIVEOMAT_BUTTON_H + +#include "titanic/gfx/edit_control.h" + +namespace Titanic { + +class CMissiveOMatButton : public CEditControl { +public: + int _fieldFC; +public: + CMissiveOMatButton() : CEditControl(), _fieldFC(2) {} + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CMissiveOMatButton"; } + + /** + * Save the data for the class to file + */ + virtual void save(SimpleFile *file, int indent) const; + + /** + * Load the data for the class from file + */ + virtual void load(SimpleFile *file); +}; + +} // End of namespace Titanic + +#endif /* TITANIC_MISSIVEOMAT_BUTTON_H */ diff --git a/engines/titanic/game/ship_setting_button.cpp b/engines/titanic/game/ship_setting_button.cpp index c1318b1bc4..95507f3c90 100644 --- a/engines/titanic/game/ship_setting_button.cpp +++ b/engines/titanic/game/ship_setting_button.cpp @@ -24,13 +24,24 @@ namespace Titanic { +CShipSettingButton::CShipSettingButton() : CGameObject(), _fieldC8(0), _fieldCC(0) { +} + void CShipSettingButton::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); + file->writeQuotedLine(_string1, indent); + file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_fieldCC, indent); + CGameObject::save(file, indent); } void CShipSettingButton::load(SimpleFile *file) { file->readNumber(); + _string1 = file->readString(); + _fieldC8 = file->readNumber(); + _fieldCC = file->readNumber(); + CGameObject::load(file); } diff --git a/engines/titanic/game/ship_setting_button.h b/engines/titanic/game/ship_setting_button.h index 008ab783df..fb8d533a7f 100644 --- a/engines/titanic/game/ship_setting_button.h +++ b/engines/titanic/game/ship_setting_button.h @@ -28,7 +28,13 @@ namespace Titanic { class CShipSettingButton : public CGameObject { +private: + CString _string1; + int _fieldC8; + int _fieldCC; public: + CShipSettingButton(); + /** * Return the class name */ |