From 63db0980e5f48764667863afe15b8f43b386c1a8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 25 Feb 2016 08:48:21 -0500 Subject: TITANIC: Rename of sub-folders for better clarity --- engines/titanic/core/link_item.h | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 engines/titanic/core/link_item.h (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h new file mode 100644 index 0000000000..22c07a2132 --- /dev/null +++ b/engines/titanic/core/link_item.h @@ -0,0 +1,69 @@ +/* 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_LINK_ITEM_H +#define TITANIC_LINK_ITEM_H + +#include "titanic/core/named_item.h" + +namespace Titanic { + +class CLinkItemSub { +public: + int _field0; + int _field4; + int _field8; + int _fieldC; +public: + CLinkItemSub(); +}; + +class CLinkItem : public CNamedItem { +protected: + int _field24; + int _field28; + int _field2C; + int _field30; + int _field34; + CLinkItemSub _sub; +public: + CLinkItem(); + + /** + * Return the class name + */ + virtual const char *getClassName() const { return "CLinkItem"; } + + /** + * 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_LINK_ITEM_H */ -- cgit v1.2.3 From e03a1106628e2d3e954c67c21bada5eae07c5c7d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 4 Mar 2016 23:37:40 -0500 Subject: TITANIC: Fleshing out CPetControl support classes --- engines/titanic/core/link_item.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 22c07a2132..aeb827e69d 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -34,7 +34,9 @@ public: int _field8; int _fieldC; public: - CLinkItemSub(); + CLinkItemSub() { clear(); } + + void clear(); }; class CLinkItem : public CNamedItem { -- 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/core/link_item.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index aeb827e69d..f46f8d3ba0 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -48,13 +48,9 @@ protected: int _field34; CLinkItemSub _sub; public: + CLASSDEF CLinkItem(); - /** - * Return the class name - */ - virtual const char *getClassName() const { return "CLinkItem"; } - /** * Save the data for the class to file */ -- cgit v1.2.3 From 8b9f3dc0b8929d920cb101a06cef8ba14fee59f0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 17 Mar 2016 23:58:24 -0400 Subject: TITANIC: Fleshing out CLinkItem class --- engines/titanic/core/link_item.h | 43 ++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index f46f8d3ba0..06d55f3f44 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -27,26 +27,36 @@ namespace Titanic { -class CLinkItemSub { +class CViewItem; +class CNodeItem; +class CRoomItem; + +class CLinkItemHotspot { public: int _field0; int _field4; int _field8; int _fieldC; public: - CLinkItemSub() { clear(); } + CLinkItemHotspot() { clear(); } void clear(); }; class CLinkItem : public CNamedItem { +private: + /** + * Returns a new name for the link item, based on the + * current values for it's destination + */ + CString formName(); protected: - int _field24; - int _field28; - int _field2C; + int _roomNumber; + int _nodeNumber; + int _viewNumber; int _field30; int _field34; - CLinkItemSub _sub; + CLinkItemHotspot _hotspot; public: CLASSDEF CLinkItem(); @@ -60,6 +70,27 @@ public: * Load the data for the class from file */ virtual void load(SimpleFile *file); + + /** + * Set the destination for the link item + */ + virtual void setDestination(int roomNumber, int nodeNumber, + int viewNumber, int v); + + /** + * Get the destination view for the link item + */ + virtual CViewItem *getDestView() const; + + /** + * Get the destination node for the link item + */ + virtual CNodeItem *getDestNode() const; + + /** + * Get the destination view for the link item + */ + virtual CRoomItem *getDestRoom() const; }; } // End of namespace Titanic -- cgit v1.2.3 From 4704d72d6af60db97959c3d170a2ea524a0f0f1f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 19 Mar 2016 18:19:45 -0400 Subject: TITANIC: Implementing view item message handling --- engines/titanic/core/link_item.h | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 06d55f3f44..55219c08cc 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -31,18 +31,6 @@ class CViewItem; class CNodeItem; class CRoomItem; -class CLinkItemHotspot { -public: - int _field0; - int _field4; - int _field8; - int _fieldC; -public: - CLinkItemHotspot() { clear(); } - - void clear(); -}; - class CLinkItem : public CNamedItem { private: /** @@ -56,7 +44,7 @@ protected: int _viewNumber; int _field30; int _field34; - CLinkItemHotspot _hotspot; + Common::Rect _hotspot; public: CLASSDEF CLinkItem(); -- cgit v1.2.3 From dbd8ab0f1c11f1e749c74fe70e5fc2496332a1c5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 19 Mar 2016 20:56:29 -0400 Subject: TITANIC: Implement view change logic --- engines/titanic/core/link_item.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 55219c08cc..733a4c9bdd 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -24,6 +24,7 @@ #define TITANIC_LINK_ITEM_H #include "titanic/core/named_item.h" +#include "titanic/core/movie_clip.h" namespace Titanic { @@ -44,7 +45,8 @@ protected: int _viewNumber; int _field30; int _field34; - Common::Rect _hotspot; +public: + Common::Rect _bounds; public: CLASSDEF CLinkItem(); @@ -79,6 +81,11 @@ public: * Get the destination view for the link item */ virtual CRoomItem *getDestRoom() const; + + /** + * Get the movie clip, if any, that's used when the link is used + */ + CMovieClip *getClip() const; }; } // End of namespace Titanic -- cgit v1.2.3 From 217360d0c5a0b8289c16b22fc46782c475fcc9f5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 21 Mar 2016 20:53:49 -0400 Subject: TITANIC: Add new derived Rect and Point classes --- engines/titanic/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 733a4c9bdd..bbeef2c11c 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -46,7 +46,7 @@ protected: int _field30; int _field34; public: - Common::Rect _bounds; + Rect _bounds; public: CLASSDEF CLinkItem(); -- cgit v1.2.3 From 7d2d624908e9265be108d650a161a378add9d40d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 23 Mar 2016 20:51:42 -0400 Subject: TITANIC: More view event handling, beginnings of mouse cursor loading --- engines/titanic/core/link_item.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index bbeef2c11c..83b2ce4f06 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -23,6 +23,7 @@ #ifndef TITANIC_LINK_ITEM_H #define TITANIC_LINK_ITEM_H +#include "titanic/mouse_cursor.h" #include "titanic/core/named_item.h" #include "titanic/core/movie_clip.h" @@ -44,9 +45,9 @@ protected: int _nodeNumber; int _viewNumber; int _field30; - int _field34; public: Rect _bounds; + CursorId _cursorId; public: CLASSDEF CLinkItem(); -- cgit v1.2.3 From 1efbed540948edcbf3ac2c72c0984def044274cf Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 3 Apr 2016 16:16:35 -0400 Subject: TITANIC: Move most of the root classes into new support/ folder --- engines/titanic/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 83b2ce4f06..72829720d7 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -23,7 +23,7 @@ #ifndef TITANIC_LINK_ITEM_H #define TITANIC_LINK_ITEM_H -#include "titanic/mouse_cursor.h" +#include "titanic/support/mouse_cursor.h" #include "titanic/core/named_item.h" #include "titanic/core/movie_clip.h" -- cgit v1.2.3 From e7f2cb1ecbf2637db8dd7be3fe97d485a7c56bc8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 7 Apr 2016 23:39:26 -0400 Subject: TITANIC: Add CComputer messages, more view change logic --- engines/titanic/core/link_item.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 72829720d7..25de74104b 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -62,6 +62,11 @@ public: */ virtual void load(SimpleFile *file); + /** + * Returns true if the given item connects to another specified view + */ + virtual bool connectsTo(CViewItem *destView) const; + /** * Set the destination for the link item */ -- cgit v1.2.3 From 5c2a39e74ac1cf8b67e17fe25e00bcca487c9f99 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 28 Jun 2016 21:18:13 -0400 Subject: TITANIC: Set up empty message targets for classes without messages --- engines/titanic/core/link_item.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 25de74104b..9c376396f7 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -34,6 +34,7 @@ class CNodeItem; class CRoomItem; class CLinkItem : public CNamedItem { + DECLARE_MESSAGE_MAP private: /** * Returns a new name for the link item, based on the -- cgit v1.2.3 From ce0be01e317996c0454a85dd9a24b896e13ddc8e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 29 Jun 2016 13:08:17 -0400 Subject: TITANIC: Cleanup CGameObject list from CMovieClipList to CMovieRangeInfoList --- engines/titanic/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 9c376396f7..328d5bcc06 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -25,7 +25,7 @@ #include "titanic/support/mouse_cursor.h" #include "titanic/core/named_item.h" -#include "titanic/core/movie_clip.h" +#include "titanic/support/movie_clip.h" namespace Titanic { -- 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/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 328d5bcc06..09f3a7ab48 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -56,7 +56,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 8dd24dd94530db499ead47dc4fda62194c179efd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 23 Jul 2016 12:30:53 -0400 Subject: TITANIC: Finish CLinkItem class --- engines/titanic/core/link_item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 09f3a7ab48..f194bc1361 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -45,7 +45,7 @@ protected: int _roomNumber; int _nodeNumber; int _viewNumber; - int _field30; + int _linkMode; public: Rect _bounds; CursorId _cursorId; @@ -72,7 +72,7 @@ public: * Set the destination for the link item */ virtual void setDestination(int roomNumber, int nodeNumber, - int viewNumber, int v); + int viewNumber, int linkMode); /** * Get the destination view for the link item -- 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/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index f194bc1361..4b316809fb 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -50,7 +50,7 @@ public: Rect _bounds; CursorId _cursorId; public: - CLASSDEF + CLASSDEF; CLinkItem(); /** -- cgit v1.2.3 From 875002daea7a007c2727685a767eaaf3709a5252 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Jul 2016 20:52:21 -0400 Subject: TITANIC: Add semicolon to DECLARE_MESSAGE_MAP usage --- engines/titanic/core/link_item.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/titanic/core/link_item.h') diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h index 4b316809fb..dd93e2a0bf 100644 --- a/engines/titanic/core/link_item.h +++ b/engines/titanic/core/link_item.h @@ -34,7 +34,7 @@ class CNodeItem; class CRoomItem; class CLinkItem : public CNamedItem { - DECLARE_MESSAGE_MAP + DECLARE_MESSAGE_MAP; private: /** * Returns a new name for the link item, based on the -- cgit v1.2.3