aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/core
diff options
context:
space:
mode:
authorPaul Gilbert2016-08-08 23:19:42 -0400
committerPaul Gilbert2016-08-08 23:19:42 -0400
commit5b8fdfe366b9acb2fd1d80cd0839e2af61238f08 (patch)
tree32960daa44d203e39fbcbbed801fd517040a771a /engines/titanic/core
parent0b952c3ceded860f2051c77fefb17593dfb5ff05 (diff)
downloadscummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.tar.gz
scummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.tar.bz2
scummvm-rg350-5b8fdfe366b9acb2fd1d80cd0839e2af61238f08.zip
TITANIC: Implemented more sound classes
Diffstat (limited to 'engines/titanic/core')
-rw-r--r--engines/titanic/core/game_object.cpp13
-rw-r--r--engines/titanic/core/game_object.h5
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index c7742cb8db..95ebe6a1e7 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -1248,6 +1248,19 @@ CRoomItem *CGameObject::getHiddenRoom() const {
return root ? root->findHiddenRoom() : nullptr;
}
+CRoomItem *CGameObject::locateRoom(const CString &name) const {
+ if (name.empty())
+ return nullptr;
+
+ CProjectItem *project = getRoot();
+ for (CRoomItem *room = project->findFirstRoom(); room; room = project->findNextRoom(room)) {
+ if (!room->getName().compareToIgnoreCase(name))
+ return room;
+ }
+
+ return nullptr;
+}
+
CGameObject *CGameObject::getHiddenObject(const CString &name) const {
CRoomItem *room = getHiddenRoom();
return room ? static_cast<CGameObject *>(findUnder(room, name)) : nullptr;
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index bcfc989288..322b62636c 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -393,6 +393,11 @@ protected:
CRoomItem *getHiddenRoom() const;
/**
+ * Locates a room with the given name
+ */
+ CRoomItem *locateRoom(const CString &name) const;
+
+ /**
* Scan the specified room for an item by name
*/
CTreeItem *findUnder(CTreeItem *parent, const CString &name) const;