aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-02-28 22:16:02 -0500
committerPaul Gilbert2016-02-28 22:16:02 -0500
commit95ebd2394bd4bd84f7894a94baf9fa1423345fad (patch)
tree9287b2398e68018ab3547d2eadf1e47dcdad0697
parent6eb777fe362d77189425c2ae137bedab0af5ee5f (diff)
downloadscummvm-rg350-95ebd2394bd4bd84f7894a94baf9fa1423345fad.tar.gz
scummvm-rg350-95ebd2394bd4bd84f7894a94baf9fa1423345fad.tar.bz2
scummvm-rg350-95ebd2394bd4bd84f7894a94baf9fa1423345fad.zip
TITANIC: Loading bugfixes and implemented CBrain descendents
-rw-r--r--engines/titanic/carry/auditory_centre.cpp37
-rw-r--r--engines/titanic/carry/auditory_centre.h50
-rw-r--r--engines/titanic/carry/brain.cpp7
-rw-r--r--engines/titanic/carry/brain.h3
-rw-r--r--engines/titanic/carry/central_core.cpp37
-rw-r--r--engines/titanic/carry/central_core.h50
-rw-r--r--engines/titanic/carry/speech_centre.cpp45
-rw-r--r--engines/titanic/carry/speech_centre.h57
-rw-r--r--engines/titanic/carry/vision_centre.cpp37
-rw-r--r--engines/titanic/carry/vision_centre.h50
-rw-r--r--engines/titanic/core/saveable_object.cpp15
-rw-r--r--engines/titanic/module.mk6
-rw-r--r--engines/titanic/moves/move_player_in_parrot_room.cpp4
13 files changed, 389 insertions, 9 deletions
diff --git a/engines/titanic/carry/auditory_centre.cpp b/engines/titanic/carry/auditory_centre.cpp
new file mode 100644
index 0000000000..e5dedcd654
--- /dev/null
+++ b/engines/titanic/carry/auditory_centre.cpp
@@ -0,0 +1,37 @@
+/* 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/carry/auditory_centre.h"
+
+namespace Titanic {
+
+void CAuditoryCentre::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ CBrain::save(file, indent);
+}
+
+void CAuditoryCentre::load(SimpleFile *file) {
+ file->readNumber();
+ CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/auditory_centre.h b/engines/titanic/carry/auditory_centre.h
new file mode 100644
index 0000000000..9708b6fbfa
--- /dev/null
+++ b/engines/titanic/carry/auditory_centre.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_AUDITORY_CENTRE_H
+#define TITANIC_AUDITORY_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CAuditoryCentre : public CBrain {
+public:
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CAuditoryCentre"; }
+
+ /**
+ * 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_AUDITORY_CENTRE_H */
diff --git a/engines/titanic/carry/brain.cpp b/engines/titanic/carry/brain.cpp
index f37549c94c..0d1cdf7518 100644
--- a/engines/titanic/carry/brain.cpp
+++ b/engines/titanic/carry/brain.cpp
@@ -24,13 +24,12 @@
namespace Titanic {
-CBrain::CBrain() : CCarry(), _field12C(0),
- _field130(0), _field134(0), _field138(0) {
+CBrain::CBrain() : CCarry(), _field134(0), _field138(0) {
}
void CBrain::save(SimpleFile *file, int indent) const {
file->writeNumberLine(1, indent);
- file->writeNumberLine(_field12C, indent);
+ file->writePoint(_pos1, indent);
file->writeNumberLine(_field134, indent);
file->writeNumberLine(_field138, indent);
@@ -39,7 +38,7 @@ void CBrain::save(SimpleFile *file, int indent) const {
void CBrain::load(SimpleFile *file) {
file->readNumber();
- _field12C = file->readNumber();
+ _pos1 = file->readPoint();
_field134 = file->readNumber();
_field138 = file->readNumber();
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 903723050c..b5ec70e836 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -29,8 +29,7 @@ namespace Titanic {
class CBrain : public CCarry {
private:
- int _field12C;
- int _field130;
+ Common::Point _pos1;
int _field134;
int _field138;
public:
diff --git a/engines/titanic/carry/central_core.cpp b/engines/titanic/carry/central_core.cpp
new file mode 100644
index 0000000000..97309e0a86
--- /dev/null
+++ b/engines/titanic/carry/central_core.cpp
@@ -0,0 +1,37 @@
+/* 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/carry/central_core.h"
+
+namespace Titanic {
+
+void CCentralCore::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ CBrain::save(file, indent);
+}
+
+void CCentralCore::load(SimpleFile *file) {
+ file->readNumber();
+ CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/central_core.h b/engines/titanic/carry/central_core.h
new file mode 100644
index 0000000000..277b302e5b
--- /dev/null
+++ b/engines/titanic/carry/central_core.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_CENTRAL_CORE_H
+#define TITANIC_CENTRAL_CORE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CCentralCore : public CBrain {
+public:
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CCentralCore"; }
+
+ /**
+ * 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_CENTRAL_CORE_H */
diff --git a/engines/titanic/carry/speech_centre.cpp b/engines/titanic/carry/speech_centre.cpp
new file mode 100644
index 0000000000..c5875bd22c
--- /dev/null
+++ b/engines/titanic/carry/speech_centre.cpp
@@ -0,0 +1,45 @@
+/* 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/carry/speech_centre.h"
+
+namespace Titanic {
+
+void CSpeechCentre::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ file->writeNumberLine(_field13C, indent);
+ file->writeQuotedLine(_string1, indent);
+ file->writeNumberLine(_field14C, indent);
+
+ CCarry::save(file, indent);
+}
+
+void CSpeechCentre::load(SimpleFile *file) {
+ file->readNumber();
+ _field13C = file->readNumber();
+ _string1 = file->readString();
+ _field14C = file->readNumber();
+
+ CCarry::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/speech_centre.h b/engines/titanic/carry/speech_centre.h
new file mode 100644
index 0000000000..4b5ced53a0
--- /dev/null
+++ b/engines/titanic/carry/speech_centre.h
@@ -0,0 +1,57 @@
+/* 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_SPEECH_CENTRE_H
+#define TITANIC_SPEECH_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CSpeechCentre : public CBrain {
+private:
+ int _field13C;
+ CString _string1;
+ int _field14C;
+public:
+ CSpeechCentre() : CBrain(), _string1("Summer"),
+ _field13C(1), _field14C(0) {}
+
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CSpeechCentre"; }
+
+ /**
+ * 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_SPEECH_CENTRE_H */
diff --git a/engines/titanic/carry/vision_centre.cpp b/engines/titanic/carry/vision_centre.cpp
new file mode 100644
index 0000000000..b85f99fbf1
--- /dev/null
+++ b/engines/titanic/carry/vision_centre.cpp
@@ -0,0 +1,37 @@
+/* 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/carry/vision_centre.h"
+
+namespace Titanic {
+
+void CVisionCentre::save(SimpleFile *file, int indent) const {
+ file->writeNumberLine(1, indent);
+ CBrain::save(file, indent);
+}
+
+void CVisionCentre::load(SimpleFile *file) {
+ file->readNumber();
+ CBrain::load(file);
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/carry/vision_centre.h b/engines/titanic/carry/vision_centre.h
new file mode 100644
index 0000000000..ce21fe547c
--- /dev/null
+++ b/engines/titanic/carry/vision_centre.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_VISION_CENTRE_H
+#define TITANIC_VISION_CENTRE_H
+
+#include "titanic/carry/brain.h"
+
+namespace Titanic {
+
+class CVisionCentre : public CBrain {
+public:
+ /**
+ * Return the class name
+ */
+ virtual const char *getClassName() const { return "CVisionCentre"; }
+
+ /**
+ * 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_VISION_CENTRE_H */
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index f76340c83b..f36b7acc62 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -21,11 +21,13 @@
*/
#include "titanic/carry/arm.h"
+#include "titanic/carry/auditory_centre.h"
#include "titanic/carry/bowl_ear.h"
#include "titanic/carry/brain.h"
#include "titanic/carry/bridge_piece.h"
#include "titanic/carry/carry.h"
#include "titanic/carry/carry_parrot.h"
+#include "titanic/carry/central_core.h"
#include "titanic/carry/chicken.h"
#include "titanic/carry/crushed_tv.h"
#include "titanic/carry/eye.h"
@@ -48,7 +50,9 @@
#include "titanic/carry/phonograph_ear.h"
#include "titanic/carry/photograph.h"
#include "titanic/carry/plug_in.h"
+#include "titanic/carry/speech_centre.h"
#include "titanic/carry/sweets.h"
+#include "titanic/carry/vision_centre.h"
#include "titanic/core/saveable_object.h"
#include "titanic/core/background.h"
@@ -75,6 +79,7 @@
#include "titanic/game/cdrom_computer.h"
#include "titanic/game/cdrom_tray.h"
#include "titanic/game/computer_screen.h"
+#include "titanic/game/cookie.h"
#include "titanic/game/credits.h"
#include "titanic/game/credits_button.h"
#include "titanic/game/dead_area.h"
@@ -198,10 +203,12 @@ Common::HashMap<Common::String, CSaveableObject::CreateFunction> *
#define ADDFN(T) (*_classList)[#T] = Function##T
DEFFN(CArm);
+DEFFN(CAuditoryCentre);
DEFFN(CBowlEar);
DEFFN(CBrain);
DEFFN(CBridgePiece);
DEFFN(CCarryParrot);
+DEFFN(CCentralCore);
DEFFN(CChicken);
DEFFN(CCrushedTV);
DEFFN(CEar);
@@ -223,7 +230,9 @@ DEFFN(CPhonographCylinder);
DEFFN(CPhonographEar);
DEFFN(CPhotograph);
DEFFN(CPlugIn);
+DEFFN(CSpeechCentre);
DEFFN(CSweets);
+DEFFN(CVisionCentre);
DEFFN(CBackground);
DEFFN(CClickResponder);
@@ -248,6 +257,7 @@ DEFFN(CBowlUnlocker);
DEFFN(CCDROM);
DEFFN(CCDROMComputer);
DEFFN(CCDROMTray);
+DEFFN(CCookie);
DEFFN(CComputerScreen);
DEFFN(CCredits);
DEFFN(CCreditsButton);
@@ -535,10 +545,12 @@ DEFFN(CAutoMusicPlayer);
void CSaveableObject::initClassList() {
_classList = new Common::HashMap<Common::String, CreateFunction>();
ADDFN(CArm);
+ ADDFN(CAuditoryCentre);
ADDFN(CBowlEar);
ADDFN(CBrain);
ADDFN(CBridgePiece);
ADDFN(CCarryParrot);
+ ADDFN(CCentralCore);
ADDFN(CChicken);
ADDFN(CCrushedTV);
ADDFN(CEar);
@@ -560,7 +572,9 @@ void CSaveableObject::initClassList() {
ADDFN(CPhonographEar);
ADDFN(CPhotograph);
ADDFN(CPlugIn);
+ ADDFN(CSpeechCentre);
ADDFN(CSweets);
+ ADDFN(CVisionCentre);
ADDFN(CBackground);
ADDFN(CClickResponder);
@@ -586,6 +600,7 @@ void CSaveableObject::initClassList() {
ADDFN(CCDROMComputer);
ADDFN(CCDROMTray);
ADDFN(CComputerScreen);
+ ADDFN(CCookie);
ADDFN(CCredits);
ADDFN(CCreditsButton);
ADDFN(CDeadArea);
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 97fe788719..a5a5db4874 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -15,12 +15,14 @@ MODULE_OBJS := \
string.o \
titanic.o \
video_surface.o \
+ carry/auditory_centre.o \
carry/arm.o \
carry/bowl_ear.o \
carry/brain.o \
carry/bridge_piece.o \
carry/carry.o \
- carry/carry_parrot.oo \
+ carry/carry_parrot.o \
+ carry/central_core.o \
carry/chicken.o \
carry/crushed_tv.o \
carry/ear.o \
@@ -44,8 +46,10 @@ MODULE_OBJS := \
carry/phonograph_ear.o \
carry/photograph.o \
carry/plug_in.o \
+ carry/speech_centre.o \
carry/sweets.o \
carry/test_carry.o \
+ carry/vision_centre.o \
core/background.o \
core/click_responder.o \
core/dont_save_file_item.o \
diff --git a/engines/titanic/moves/move_player_in_parrot_room.cpp b/engines/titanic/moves/move_player_in_parrot_room.cpp
index cfe4cb689f..91c1706abf 100644
--- a/engines/titanic/moves/move_player_in_parrot_room.cpp
+++ b/engines/titanic/moves/move_player_in_parrot_room.cpp
@@ -29,12 +29,12 @@ CMovePlayerInParrotRoom::CMovePlayerInParrotRoom() : CMovePlayerTo() {
void CMovePlayerInParrotRoom::save(SimpleFile *file, int indent) const {
file->writeNumberLine(1, indent);
- CGameObject::save(file, indent);
+ CMovePlayerTo::save(file, indent);
}
void CMovePlayerInParrotRoom::load(SimpleFile *file) {
file->readNumber();
- CGameObject::load(file);
+ CMovePlayerTo::load(file);
}
} // End of namespace Titanic