aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/pet_control/pet_control.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-05 12:14:52 -0500
committerPaul Gilbert2016-03-05 12:14:52 -0500
commit03d3d5b539500a77c894ef4479bbe14e1b392fa3 (patch)
tree8f0427662be29ea1c6fc0dc8945a111f348ec07f /engines/titanic/pet_control/pet_control.cpp
parent7e966dbc5e9285da69a55312a81ff280845752ea (diff)
downloadscummvm-rg350-03d3d5b539500a77c894ef4479bbe14e1b392fa3.tar.gz
scummvm-rg350-03d3d5b539500a77c894ef4479bbe14e1b392fa3.tar.bz2
scummvm-rg350-03d3d5b539500a77c894ef4479bbe14e1b392fa3.zip
TITANIC: Implemented remaining CPetControl classes loading
Diffstat (limited to 'engines/titanic/pet_control/pet_control.cpp')
-rw-r--r--engines/titanic/pet_control/pet_control.cpp31
1 files changed, 19 insertions, 12 deletions
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index 354ed393a8..e123e99dc5 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -36,14 +36,14 @@ void CPetControl::save(SimpleFile *file, int indent) const {
void CPetControl::load(SimpleFile *file) {
int val = file->readNumber();
- // TODO: sub_43A9E0
+ bool valid = isValid();
- if (!val) {
+ if (!valid) {
_fieldBC = file->readNumber();
_string1 = file->readString();
_string2 = file->readString();
- loadSubObjects(file);
+ loadSubObjects(file, 0);
}
CGameObject::load(file);
@@ -53,15 +53,22 @@ void CPetControl::gameLoaded() {
// TODO
}
-void CPetControl::loadSubObjects(SimpleFile *file) {
- _sub1.load(file);
- _sub2.load(file);
- _sub3.load(file);
- _sub4.load(file);
- _sub5.load(file);
- _sub6.load(file);
- _sub7.load(file);
- _sub8.load(file);
+bool CPetControl::isValid() const {
+ return _sub1.isValid() && _sub2.isValid()
+ && _sub3.isValid() && _sub4.isValid()
+ && _sub5.isValid() && _sub6.isValid()
+ && _sub7.isValid() && _sub8.isValid();
+}
+
+void CPetControl::loadSubObjects(SimpleFile *file, int param) {
+ _sub1.load(file, param);
+ _sub2.load(file, param);
+ _sub3.load(file, param);
+ _sub4.load(file, param);
+ _sub5.load(file, param);
+ _sub6.load(file, param);
+ _sub7.load(file, param);
+ _sub8.load(file, param);
}
void CPetControl::saveSubObjects(SimpleFile *file, int indent) const {