From 06ce0dbfddb016dc18ac38bbd938b8b5c71f454a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 25 Feb 2016 21:42:10 -0500 Subject: TITANIC: Implement TrueTalk NPC classes --- engines/titanic/npcs/barbot.h | 196 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 engines/titanic/npcs/barbot.h (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h new file mode 100644 index 0000000000..d14d5a2d1d --- /dev/null +++ b/engines/titanic/npcs/barbot.h @@ -0,0 +1,196 @@ +/* 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_BARBOT_H +#define TITANIC_BARBOT_H + +#include "titanic/npcs/true_talk_npc.h" + +namespace Titanic { + +class CBarbot : public CTrueTalkNPC { +private: + static int _v0; +private: + int _field108; + int _field10C; + int _field110; + int _field114; + int _field118; + int _field11C; + int _field120; + int _field124; + int _field128; + int _field12C; + int _field130; + int _field134; + int _field138; + int _field13C; + int _field140; + int _field144; + int _field148; + int _field14C; + int _field150; + int _field154; + int _field158; + int _field15C; + int _field160; + int _field164; + int _field168; + int _field16C; + int _field170; + int _field174; + int _field178; + int _field17C; + int _field180; + int _field184; + int _field188; + int _field18C; + int _field190; + int _field194; + int _field198; + int _field19C; + int _field1A0; + int _field1A4; + int _field1A8; + int _field1AC; + int _field1B0; + int _field1B4; + int _field1B8; + int _field1BC; + int _field1C0; + int _field1C4; + int _field1C8; + int _field1CC; + int _field1D0; + int _field1D4; + int _field1D8; + int _field1E0; + int _field1E4; + int _field1E8; + int _field1EC; + int _field1F0; + int _field1F4; + int _field1F8; + int _field1FC; + int _field200; + int _field204; + int _field208; + int _field20C; + int _field210; + int _field214; + int _field218; + int _field21C; + int _field220; + int _field224; + int _field228; + int _field22C; + int _field230; + int _field234; + int _field238; + int _field23C; + int _field240; + int _field244; + int _field248; + int _field24C; + int _field250; + int _field254; + int _field258; + int _field25C; + int _field260; + int _field264; + int _field268; + int _field26C; + int _field270; + int _field274; + int _field278; + int _field27C; + int _field280; + int _field284; + int _field288; + int _field28C; + int _field290; + int _field294; + int _field298; + int _field29C; + int _field2A0; + int _field2A4; + int _field2A8; + int _field2AC; + int _field2B0; + int _field2B4; + int _field2B8; + int _field2BC; + int _field2C0; + int _field2C4; + int _field2C8; + int _field2CC; + int _field2D0; + int _field2D4; + int _field2D8; + int _field2E0; + int _field2E4; + int _field2E8; + int _field2EC; + int _field2F0; + int _field2F4; + int _field2F8; + int _field2FC; + int _field300; + int _field304; + int _field308; + int _field30C; + int _field310; + int _field314; + int _field318; + int _field31C; + int _field320; + int _field324; + int _field328; + int _field32C; + int _field330; + int _field334; + int _field338; + int _field33C; + int _field340; +public: + CBarbot(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CBarbot"; } + + /** + * 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_BARBOT_H */ -- cgit v1.2.3 From 7375394b810f3503f168d5770555aa1932d7892d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 6 Mar 2016 19:12:49 -0500 Subject: TITANIC: Converting saveable objects hierarchy to have type data This is necessary for at least message sending, and probably other areas, that needs to be able to pass class filtering for message targets. And I could figure out a clean way to use the built-in RTTI --- engines/titanic/npcs/barbot.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index d14d5a2d1d..7e2d323d46 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -173,13 +173,9 @@ private: int _field33C; int _field340; public: + CLASSDEF CBarbot(); - /** - * Return the class name - */ - virtual const char *getClassName() const { return "CBarbot"; } - /** * Save the data for the class to file */ -- cgit v1.2.3 From a8d94d448ea977bdd5b1171e177de6dd714792a2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 17 Mar 2016 19:58:59 -0400 Subject: TITANIC: Fixes to make message handling const, adding CEnterRoomMsg handlers --- engines/titanic/npcs/barbot.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 7e2d323d46..160edd63d9 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -24,10 +24,11 @@ #define TITANIC_BARBOT_H #include "titanic/npcs/true_talk_npc.h" +#include "titanic/messages/messages.h" namespace Titanic { -class CBarbot : public CTrueTalkNPC { +class CBarbot : public CTrueTalkNPC, CEnterRoomMsgTarget { private: static int _v0; private: @@ -172,6 +173,8 @@ private: int _field338; int _field33C; int _field340; +protected: + virtual bool handleEvent(const CEnterRoomMsg &msg); public: CLASSDEF CBarbot(); -- cgit v1.2.3 From 4f5202f958d55ccfda6e67a6b8933630de240e87 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 18 Mar 2016 23:18:59 -0400 Subject: TITANIC: Remove const prefix from passed messages Turns out that some of the messages have properties that the objects that handle them can set. For example, the CMouseDragStartMsg has a _dragItem property that an item that allows dragging will explicitly set, allowing the input handler to keep track of what was dragged. --- engines/titanic/npcs/barbot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 160edd63d9..442578ef6c 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -174,7 +174,7 @@ private: int _field33C; int _field340; protected: - virtual bool handleEvent(const CEnterRoomMsg &msg); + virtual bool handleEvent(CEnterRoomMsg &msg); public: CLASSDEF CBarbot(); -- cgit v1.2.3 From 66e198d665a8aacd1724848a40e6533f3d5cfebc Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 24 Mar 2016 07:49:59 -0400 Subject: TITANIC: Cleanup and fixes for message hierarchy --- engines/titanic/npcs/barbot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 442578ef6c..d407ef74c8 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -174,7 +174,7 @@ private: int _field33C; int _field340; protected: - virtual bool handleEvent(CEnterRoomMsg &msg); + virtual bool handleMessage(CEnterRoomMsg &msg); public: CLASSDEF CBarbot(); -- cgit v1.2.3 From d9cc2908f8a9a7fa2d196c82571d32b5ef20ad9b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 24 Mar 2016 12:51:44 -0400 Subject: TITANIC: Make all use of message targets public inheritance --- engines/titanic/npcs/barbot.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index d407ef74c8..0cad69a758 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -28,7 +28,8 @@ namespace Titanic { -class CBarbot : public CTrueTalkNPC, CEnterRoomMsgTarget { +class CBarbot : public CTrueTalkNPC, + public CEnterRoomMsgTarget { private: static int _v0; private: -- cgit v1.2.3 From 51dc36a9a52f95815b4b1109b080d070247bf247 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 6 Apr 2016 23:28:42 -0400 Subject: TITANIC: Furhter in-progress message handling conversion --- engines/titanic/npcs/barbot.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 0cad69a758..158db10f7a 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -28,8 +28,7 @@ namespace Titanic { -class CBarbot : public CTrueTalkNPC, - public CEnterRoomMsgTarget { +class CBarbot : public CTrueTalkNPC { private: static int _v0; private: -- cgit v1.2.3 From 9f1bab55972b8a6f88b83c2391c40a038ffb509d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 7 Apr 2016 22:03:35 -0400 Subject: TITANIC: Converting other message stubs to new format --- engines/titanic/npcs/barbot.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 158db10f7a..fa06f8f638 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -29,6 +29,7 @@ namespace Titanic { class CBarbot : public CTrueTalkNPC { + bool EnterRoomMsg(CEnterRoomMsg *msg); private: static int _v0; private: @@ -173,8 +174,6 @@ private: int _field338; int _field33C; int _field340; -protected: - virtual bool handleMessage(CEnterRoomMsg &msg); public: CLASSDEF CBarbot(); -- cgit v1.2.3 From 5ccc0a66da38d23520234e7060efaf966d3345b9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Jun 2016 19:53:16 -0400 Subject: TITANIC: Removed const modifier from all saveable objects Turns out that CGameObject::save regenerates the _movieRangeInfo list. So the const suffix can no longer be used for the entire hierarchy --- engines/titanic/npcs/barbot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index fa06f8f638..27a091ef29 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -181,7 +181,7 @@ public: /** * Save the data for the class to file */ - virtual void save(SimpleFile *file, int indent) const; + virtual void save(SimpleFile *file, int indent); /** * Load the data for the class from file -- cgit v1.2.3 From 4d79ee16c07e2398e9058fe93947b4704cd6048a Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Jul 2016 20:30:56 -0400 Subject: TITANIC: Add semicolon after CLASSDEF macro usage --- engines/titanic/npcs/barbot.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/npcs/barbot.h') diff --git a/engines/titanic/npcs/barbot.h b/engines/titanic/npcs/barbot.h index 27a091ef29..7557fdd2c6 100644 --- a/engines/titanic/npcs/barbot.h +++ b/engines/titanic/npcs/barbot.h @@ -175,7 +175,7 @@ private: int _field33C; int _field340; public: - CLASSDEF + CLASSDEF; CBarbot(); /** -- cgit v1.2.3