diff options
author | Paul Gilbert | 2016-03-02 23:40:06 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-03-02 23:40:06 -0500 |
commit | e688850e932f0c8be6d10a73fe416c90799733b0 (patch) | |
tree | 48f01b46022f32b5b83089a830df8d5fa11a6192 /engines/titanic/game | |
parent | 3ae4e63c80cda635f941370e72536988bde67698 (diff) | |
download | scummvm-rg350-e688850e932f0c8be6d10a73fe416c90799733b0.tar.gz scummvm-rg350-e688850e932f0c8be6d10a73fe416c90799733b0.tar.bz2 scummvm-rg350-e688850e932f0c8be6d10a73fe416c90799733b0.zip |
TITANIC: Implemented more saveable classes
Diffstat (limited to 'engines/titanic/game')
13 files changed, 191 insertions, 26 deletions
diff --git a/engines/titanic/game/gondolier_base.cpp b/engines/titanic/game/gondolier/gondolier_base.cpp index 59c9b5cd0c..bf54ed4d8d 100644 --- a/engines/titanic/game/gondolier_base.cpp +++ b/engines/titanic/game/gondolier/gondolier_base.cpp @@ -20,7 +20,7 @@ * */ -#include "titanic/game/gondolier_base.h" +#include "titanic/game/gondolier/gondolier_base.h" namespace Titanic { diff --git a/engines/titanic/game/gondolier_base.h b/engines/titanic/game/gondolier/gondolier_base.h index 3f0cede70d..3f0cede70d 100644 --- a/engines/titanic/game/gondolier_base.h +++ b/engines/titanic/game/gondolier/gondolier_base.h diff --git a/engines/titanic/game/pet_graphic.cpp b/engines/titanic/game/gondolier/gondolier_chest.cpp index 38226c9678..441a8bac31 100644 --- a/engines/titanic/game/pet_graphic.cpp +++ b/engines/titanic/game/gondolier/gondolier_chest.cpp @@ -20,18 +20,18 @@ * */ -#include "titanic/game/pet_graphic.h" +#include "titanic/game/gondolier/gondolier_chest.h" namespace Titanic { -void CPetGraphic::save(SimpleFile *file, int indent) const { +void CGondolierChest::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); - CGameObject::save(file, indent); + CGondolierBase::save(file, indent); } -void CPetGraphic::load(SimpleFile *file) { +void CGondolierChest::load(SimpleFile *file) { file->readNumber(); - CGameObject::load(file); + CGondolierBase::load(file); } } // End of namespace Titanic diff --git a/engines/titanic/game/pet_graphic2.h b/engines/titanic/game/gondolier/gondolier_chest.h index aabf058cf6..277faf994f 100644 --- a/engines/titanic/game/pet_graphic2.h +++ b/engines/titanic/game/gondolier/gondolier_chest.h @@ -20,19 +20,19 @@ * */ -#ifndef TITANIC_PET_GRAPHIC2_H -#define TITANIC_PET_GRAPHIC2_H +#ifndef TITANIC_GONDOLIER_CHEST_H +#define TITANIC_GONDOLIER_CHEST_H -#include "titanic/core/game_object.h" +#include "titanic/game/gondolier/gondolier_base.h" namespace Titanic { -class CPetGraphic2 : public CGameObject { +class CGondolierChest : public CGondolierBase { public: /** * Return the class name */ - virtual const char *getClassName() const { return "CNutReplacer"; } + virtual const char *getClassName() const { return "CGondolierChest"; } /** * Save the data for the class to file @@ -47,4 +47,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_PET_GRAPHIC2_H */ +#endif /* TITANIC_GONDOLIER_CHEST_H */ diff --git a/engines/titanic/game/pet_graphic2.cpp b/engines/titanic/game/gondolier/gondolier_face.cpp index a8d244e102..6db23d8a1a 100644 --- a/engines/titanic/game/pet_graphic2.cpp +++ b/engines/titanic/game/gondolier/gondolier_face.cpp @@ -20,18 +20,20 @@ * */ -#include "titanic/game/pet_graphic2.h" +#include "titanic/game/gondolier/gondolier_face.h" namespace Titanic { -void CPetGraphic2::save(SimpleFile *file, int indent) const { +void CGondolierFace::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); - CGameObject::save(file, indent); + file->writeNumberLine(_fieldBC, indent); + CGondolierBase::save(file, indent); } -void CPetGraphic2::load(SimpleFile *file) { +void CGondolierFace::load(SimpleFile *file) { file->readNumber(); - CGameObject::load(file); + _fieldBC = file->readNumber(); + CGondolierBase::load(file); } } // End of namespace Titanic diff --git a/engines/titanic/game/pet_graphic.h b/engines/titanic/game/gondolier/gondolier_face.h index 28b5d9aeca..5007431337 100644 --- a/engines/titanic/game/pet_graphic.h +++ b/engines/titanic/game/gondolier/gondolier_face.h @@ -20,19 +20,23 @@ * */ -#ifndef TITANIC_PET_GRAPHIC_H -#define TITANIC_PET_GRAPHIC_H +#ifndef TITANIC_GONDOLIER_FACE_H +#define TITANIC_GONDOLIER_FACE_H -#include "titanic/core/game_object.h" +#include "titanic/game/gondolier/gondolier_base.h" namespace Titanic { -class CPetGraphic : public CGameObject { +class CGondolierFace : public CGondolierBase { +private: + int _fieldBC; public: + CGondolierFace() : CGondolierBase(), _fieldBC(0) {} + /** * Return the class name */ - virtual const char *getClassName() const { return "CPetGraphic"; } + virtual const char *getClassName() const { return "CGondolierMixer"; } /** * Save the data for the class to file @@ -47,4 +51,4 @@ public: } // End of namespace Titanic -#endif /* TITANIC_PET_GRAPHIC_H */ +#endif /* TITANIC_GONDOLIER_FACE_H */ diff --git a/engines/titanic/game/gondolier_mixer.cpp b/engines/titanic/game/gondolier/gondolier_mixer.cpp index 33cc883bb0..e81ad34c87 100644 --- a/engines/titanic/game/gondolier_mixer.cpp +++ b/engines/titanic/game/gondolier/gondolier_mixer.cpp @@ -20,7 +20,7 @@ * */ -#include "titanic/game/gondolier_mixer.h" +#include "titanic/game/gondolier/gondolier_mixer.h" namespace Titanic { diff --git a/engines/titanic/game/gondolier_mixer.h b/engines/titanic/game/gondolier/gondolier_mixer.h index dfc46210c3..5b92bc2fb8 100644 --- a/engines/titanic/game/gondolier_mixer.h +++ b/engines/titanic/game/gondolier/gondolier_mixer.h @@ -23,7 +23,7 @@ #ifndef TITANIC_GONDOLIER_MIXER_H #define TITANIC_GONDOLIER_MIXER_H -#include "titanic/game/gondolier_base.h" +#include "titanic/game/gondolier/gondolier_base.h" namespace Titanic { diff --git a/engines/titanic/game/gondolier/gondolier_slider.cpp b/engines/titanic/game/gondolier/gondolier_slider.cpp new file mode 100644 index 0000000000..dff464ce64 --- /dev/null +++ b/engines/titanic/game/gondolier/gondolier_slider.cpp @@ -0,0 +1,82 @@ +/* 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/gondolier/gondolier_slider.h" + +namespace Titanic { + +CGondolierSlider::CGondolierSlider() : CGondolierBase(), + _fieldBC(0), _fieldC0(0), _fieldC4(0), _fieldC8(0), + _fieldCC(0), _fieldD0(0), _fieldD4(0), _fieldD8(0), + _fieldDC(0), _fieldE0(0), _fieldE4(0), _fieldE8(0), + _fieldEC(0), _string1("NULL"), _fieldFC(0), _field118(0) { +} + +void CGondolierSlider::save(SimpleFile *file, int indent) const { + file->writeNumberLine(1, indent); + file->writeNumberLine(_fieldBC, indent); + file->writeNumberLine(_fieldC0, indent); + file->writeNumberLine(_fieldC4, indent); + file->writeNumberLine(_fieldC8, indent); + file->writeNumberLine(_fieldCC, indent); + file->writeNumberLine(_fieldD0, indent); + file->writeNumberLine(_fieldD4, indent); + file->writeNumberLine(_fieldD8, indent); + file->writeNumberLine(_fieldDC, indent); + file->writeNumberLine(_fieldE0, indent); + file->writeNumberLine(_fieldE4, indent); + file->writeNumberLine(_fieldE8, indent); + file->writeNumberLine(_fieldCC, indent); + file->writeQuotedLine(_string1, indent); + file->writeNumberLine(_fieldFC, indent); + file->writeQuotedLine(_string2, indent); + file->writeQuotedLine(_string3, indent); + file->writeNumberLine(_field118, indent); + + CGondolierBase::save(file, indent); +} + +void CGondolierSlider::load(SimpleFile *file) { + file->readNumber(); + _fieldBC = file->readNumber(); + _fieldC0 = file->readNumber(); + _fieldC4 = file->readNumber(); + _fieldC8 = file->readNumber(); + _fieldCC = file->readNumber(); + _fieldD0 = file->readNumber(); + _fieldD4 = file->readNumber(); + _fieldD8 = file->readNumber(); + _fieldDC = file->readNumber(); + _fieldE0 = file->readNumber(); + _fieldE4 = file->readNumber(); + _fieldE8 = file->readNumber(); + _fieldEC = file->readNumber(); + _string1 = file->readString(); + _fieldFC = file->readNumber(); + _string2 = file->readString(); + _string3 = file->readString(); + _field118 = file->readNumber(); + + CGondolierBase::load(file); +} + +} // End of namespace Titanic diff --git a/engines/titanic/game/gondolier/gondolier_slider.h b/engines/titanic/game/gondolier/gondolier_slider.h new file mode 100644 index 0000000000..9522483dc0 --- /dev/null +++ b/engines/titanic/game/gondolier/gondolier_slider.h @@ -0,0 +1,71 @@ +/* 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_GONDOLIER_SLIDER_H +#define TITANIC_GONDOLIER_SLIDER_H + +#include "titanic/game/gondolier/gondolier_base.h" + +namespace Titanic { + +class CGondolierSlider : public CGondolierBase { +private: + int _fieldBC; + int _fieldC0; + int _fieldC4; + int _fieldC8; + int _fieldCC; + int _fieldD0; + int _fieldD4; + int _fieldD8; + int _fieldDC; + int _fieldE0; + int _fieldE4; + int _fieldE8; + int _fieldEC; + CString _string1; + int _fieldFC; + CString _string2; + CString _string3; + int _field118; +public: + CGondolierSlider(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CGondolierSlider"; } + + /** + * 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_GONDOLIER_SLIDER_H */ diff --git a/engines/titanic/game/music_system_lock.cpp b/engines/titanic/game/music_system_lock.cpp index a5419d983f..6bd83f6811 100644 --- a/engines/titanic/game/music_system_lock.cpp +++ b/engines/titanic/game/music_system_lock.cpp @@ -33,7 +33,7 @@ void CMusicSystemLock::save(SimpleFile *file, int indent) const { void CMusicSystemLock::load(SimpleFile *file) { file->readNumber(); _value = file->readNumber(); - CGameObject::load(file); + CDropTarget::load(file); } } // End of namespace Titanic diff --git a/engines/titanic/game/phonograph_lid.cpp b/engines/titanic/game/phonograph_lid.cpp index c7c1bd3328..a228af8c70 100644 --- a/engines/titanic/game/phonograph_lid.cpp +++ b/engines/titanic/game/phonograph_lid.cpp @@ -26,11 +26,13 @@ namespace Titanic { void CPhonographLid::save(SimpleFile *file, int indent) const { file->writeNumberLine(1, indent); + file->writeNumberLine(_value, indent); CGameObject::save(file, indent); } void CPhonographLid::load(SimpleFile *file) { file->readNumber(); + _value = file->readNumber(); CGameObject::load(file); } diff --git a/engines/titanic/game/phonograph_lid.h b/engines/titanic/game/phonograph_lid.h index 040fec447a..2252551ad7 100644 --- a/engines/titanic/game/phonograph_lid.h +++ b/engines/titanic/game/phonograph_lid.h @@ -28,7 +28,11 @@ namespace Titanic { class CPhonographLid : public CGameObject { +private: + int _value; public: + CPhonographLid() : CGameObject(), _value(0) {} + /** * Return the class name */ |