aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/core/node_item.cpp6
-rw-r--r--engines/titanic/core/node_item.h5
-rw-r--r--engines/titanic/core/project_item.cpp64
-rw-r--r--engines/titanic/core/project_item.h15
-rw-r--r--engines/titanic/core/saveable_object.cpp4
-rw-r--r--engines/titanic/core/saveable_object.h2
-rw-r--r--engines/titanic/core/tree_item.cpp20
-rw-r--r--engines/titanic/core/tree_item.h10
-rw-r--r--engines/titanic/core/view_item.cpp6
-rw-r--r--engines/titanic/core/view_item.h3
-rw-r--r--engines/titanic/game/room_item.h2
-rw-r--r--engines/titanic/game_manager.cpp44
-rw-r--r--engines/titanic/game_manager.h16
-rw-r--r--engines/titanic/game_state_sub.cpp5
-rw-r--r--engines/titanic/game_state_sub.h2
-rw-r--r--engines/titanic/game_view.cpp28
-rw-r--r--engines/titanic/game_view.h21
-rw-r--r--engines/titanic/main_game_window.cpp10
-rw-r--r--engines/titanic/main_game_window.h4
-rw-r--r--engines/titanic/messages/messages.cpp2
-rw-r--r--engines/titanic/messages/messages.h3
-rw-r--r--engines/titanic/pet_control/pet_control.cpp2
-rw-r--r--engines/titanic/pet_control/pet_control.h2
-rw-r--r--engines/titanic/sound/sound.h5
-rw-r--r--engines/titanic/sound/sound_manager.h6
-rw-r--r--engines/titanic/true_talk/true_talk_manager.h5
26 files changed, 245 insertions, 47 deletions
diff --git a/engines/titanic/core/node_item.cpp b/engines/titanic/core/node_item.cpp
index f44be6ddaf..22c9b9b37f 100644
--- a/engines/titanic/core/node_item.cpp
+++ b/engines/titanic/core/node_item.cpp
@@ -24,7 +24,7 @@
namespace Titanic {
-CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _field2C(0) {
+CNodeItem::CNodeItem() : CNamedItem(), _field24(0), _field28(0), _nodeNumber(0) {
}
void CNodeItem::save(SimpleFile *file, int indent) const {
@@ -34,7 +34,7 @@ void CNodeItem::save(SimpleFile *file, int indent) const {
file->writeNumberLine(_field28, indent + 1);
file->writeQuotedLine("N", indent);
- file->writeNumberLine(_field2C, indent + 1);
+ file->writeNumberLine(_nodeNumber, indent + 1);
CNamedItem::save(file, indent);
}
@@ -46,7 +46,7 @@ void CNodeItem::load(SimpleFile *file) {
_field28 = file->readNumber();
file->readBuffer();
- _field2C = file->readNumber();
+ _nodeNumber = file->readNumber();
CNamedItem::load(file);
}
diff --git a/engines/titanic/core/node_item.h b/engines/titanic/core/node_item.h
index 45309a1891..4f0391ae88 100644
--- a/engines/titanic/core/node_item.h
+++ b/engines/titanic/core/node_item.h
@@ -28,10 +28,11 @@
namespace Titanic {
class CNodeItem : public CNamedItem {
-private:
+protected:
int _field24;
int _field28;
- int _field2C;
+public:
+ int _nodeNumber;
public:
CLASSDEF
CNodeItem();
diff --git a/engines/titanic/core/project_item.cpp b/engines/titanic/core/project_item.cpp
index 18b0c42815..bf31388963 100644
--- a/engines/titanic/core/project_item.cpp
+++ b/engines/titanic/core/project_item.cpp
@@ -25,7 +25,9 @@
#include "titanic/game_manager.h"
#include "titanic/titanic.h"
#include "titanic/core/dont_save_file_item.h"
+#include "titanic/core/node_item.h"
#include "titanic/core/project_item.h"
+#include "titanic/core/view_item.h"
#include "titanic/pet_control/pet_control.h"
namespace Titanic {
@@ -177,7 +179,7 @@ void CProjectItem::loadGame(int slotId) {
newProject->destroyAll();
// Post-load processing
- gameLoaded();
+ postLoad();
}
void CProjectItem::saveGame(int slotId) {
@@ -251,7 +253,6 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
item->saveHeader(file, 0);
item->save(file, 1);
item->saveFooter(file, 0);
-
CTreeItem *child = item->getFirstChild();
if (child) {
@@ -271,14 +272,14 @@ void CProjectItem::saveData(SimpleFile *file, CTreeItem *item) const {
}
}
-void CProjectItem::gameLoaded() {
+void CProjectItem::postLoad() {
CGameManager *gameManager = getGameManager();
if (gameManager)
- gameManager->gameLoaded();
+ gameManager->postLoad(this);
CPetControl *petControl = getPetControl();
if (petControl)
- petControl->gameLoaded();
+ petControl->postLoad();
}
CPetControl *CProjectItem::getPetControl() const {
@@ -300,10 +301,10 @@ CPetControl *CProjectItem::getPetControl() const {
}
CRoomItem *CProjectItem::findFirstRoom() const {
- return dynamic_cast<CRoomItem *>(findChildInstance(*CRoomItem::_type));
+ return dynamic_cast<CRoomItem *>(findChildInstance(CRoomItem::_type));
}
-CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) const {
+CTreeItem *CProjectItem::findChildInstance(ClassDef *classDef) const {
CTreeItem *treeItem = getFirstChild();
if (treeItem == nullptr)
return nullptr;
@@ -322,10 +323,10 @@ CTreeItem *CProjectItem::findChildInstance(ClassDef &classDef) const {
}
CRoomItem *CProjectItem::findNextRoom(CRoomItem *priorRoom) const {
- return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(*CRoomItem::_type, priorRoom));
+ return dynamic_cast<CRoomItem *>(findSiblingInstanceOf(CRoomItem::_type, priorRoom));
}
-CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const {
+CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef *classDef, CTreeItem *startItem) const {
CTreeItem *treeItem = startItem->getParent()->getNextSibling();
if (treeItem == nullptr)
return nullptr;
@@ -335,7 +336,7 @@ CTreeItem *CProjectItem::findSiblingInstanceOf(ClassDef &classDef, CTreeItem *st
CDontSaveFileItem *CProjectItem::getDontSaveFileItem() const {
for (CTreeItem *treeItem = getFirstChild(); treeItem; treeItem = treeItem->getNextSibling()) {
- if (treeItem->isInstanceOf(*CDontSaveFileItem::_type))
+ if (treeItem->isInstanceOf(CDontSaveFileItem::_type))
return dynamic_cast<CDontSaveFileItem *>(treeItem);
}
@@ -346,4 +347,47 @@ CRoomItem *CProjectItem::findHiddenRoom() {
return dynamic_cast<CRoomItem *>(findByName("HiddenRoom"));
}
+CViewItem *CProjectItem::findView(int roomNumber, int nodeNumber, int viewNumber) {
+ CTreeItem *treeItem = getFirstChild();
+ CRoomItem *roomItem = nullptr;
+
+ // Scan for the specified room
+ if (treeItem) {
+ do {
+ CTreeItem *childItem = treeItem->getFirstChild();
+ CRoomItem *rItem = dynamic_cast<CRoomItem *>(childItem);
+ if (rItem && rItem->_roomNumber == roomNumber) {
+ roomItem = rItem;
+ break;
+ }
+ } while ((treeItem = treeItem->getNextSibling()) != nullptr);
+ }
+ if (!roomItem)
+ return nullptr;
+
+ // Scan for the specified node within the room
+ CNodeItem *nodeItem = nullptr;
+
+ CNodeItem *nItem = dynamic_cast<CNodeItem *>(
+ roomItem->findChildInstanceOf(CNodeItem::_type));
+ for (; nItem && !nodeItem; nItem = dynamic_cast<CNodeItem *>(
+ findNextInstanceOf(CNodeItem::_type, nItem))) {
+ if (nItem->_nodeNumber == nodeNumber)
+ nodeItem = nItem;
+ }
+ if (!nodeItem)
+ return nullptr;
+
+ // Scan for the specified view within the node
+ CViewItem *viewItem = dynamic_cast<CViewItem *>(
+ nodeItem->findChildInstanceOf(CViewItem::_type));
+ for (; viewItem; viewItem = dynamic_cast<CViewItem *>(
+ findNextInstanceOf(CViewItem::_type, viewItem))) {
+ if (viewItem->_viewNumber == viewNumber)
+ return viewItem;
+ }
+
+ return nullptr;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/core/project_item.h b/engines/titanic/core/project_item.h
index f4148b0678..65fe8b88bd 100644
--- a/engines/titanic/core/project_item.h
+++ b/engines/titanic/core/project_item.h
@@ -34,6 +34,7 @@ namespace Titanic {
class CGameManager;
class CPetControl;
+class CViewItem;
/**
* File list item
@@ -81,12 +82,12 @@ private:
/**
* Finds the first child instance of a given class type
*/
- CTreeItem *findChildInstance(ClassDef &classDef) const;
+ CTreeItem *findChildInstance(ClassDef *classDef) const;
/**
* Finds the next sibling occurance of a given class type
*/
- CTreeItem *findSiblingInstanceOf(ClassDef &classDef, CTreeItem *startItem) const;
+ CTreeItem *findSiblingInstanceOf(ClassDef *classDef, CTreeItem *startItem) const;
private:
/**
* Load project data from the passed file
@@ -101,7 +102,7 @@ private:
/**
* Does post-loading processing
*/
- void gameLoaded();
+ void postLoad();
public:
CLASSDEF
CProjectItem();
@@ -171,7 +172,15 @@ public:
*/
CDontSaveFileItem *getDontSaveFileItem() const;
+ /**
+ * Finds the hidden room node of the project
+ */
CRoomItem *findHiddenRoom();
+
+ /**
+ * Finds a view
+ */
+ CViewItem *findView(int roomNumber, int nodeNumber, int viewNumber);
};
} // End of namespace Titanic
diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp
index 8e3ab1e067..8e9ec4e1d6 100644
--- a/engines/titanic/core/saveable_object.cpp
+++ b/engines/titanic/core/saveable_object.cpp
@@ -1581,9 +1581,9 @@ void CSaveableObject::saveFooter(SimpleFile *file, int indent) const {
file->writeClassEnd(indent);
}
-bool CSaveableObject::isInstanceOf(const ClassDef &classDef) {
+bool CSaveableObject::isInstanceOf(const ClassDef *classDef) {
for (ClassDef *def = getType(); def != nullptr; def = def->_parent) {
- if (def == &classDef)
+ if (def == classDef)
return true;
}
diff --git a/engines/titanic/core/saveable_object.h b/engines/titanic/core/saveable_object.h
index c4615c52b2..1fb509bf20 100644
--- a/engines/titanic/core/saveable_object.h
+++ b/engines/titanic/core/saveable_object.h
@@ -80,7 +80,7 @@ public:
CLASSDEF
virtual ~CSaveableObject() {}
- bool isInstanceOf(const ClassDef &classDef);
+ bool isInstanceOf(const ClassDef *classDef);
/**
* Save the data for the class to file
diff --git a/engines/titanic/core/tree_item.cpp b/engines/titanic/core/tree_item.cpp
index 31deab860d..ffcee40c6a 100644
--- a/engines/titanic/core/tree_item.cpp
+++ b/engines/titanic/core/tree_item.cpp
@@ -88,6 +88,26 @@ CTreeItem *CTreeItem::scan(CTreeItem *item) const {
return nullptr;
}
+CTreeItem *CTreeItem::findChildInstanceOf(ClassDef *classDef) const {
+ for (CTreeItem *treeItem = _firstChild; treeItem; treeItem = treeItem->getNextSibling()) {
+ if (treeItem->isInstanceOf(classDef))
+ return treeItem;
+ }
+
+ return nullptr;
+}
+
+CTreeItem *CTreeItem::findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const {
+ CTreeItem *treeItem = startItem ? startItem->getNextSibling() : getFirstChild();
+
+ for (; treeItem; treeItem = treeItem->getNextSibling()) {
+ if (treeItem->isInstanceOf(classDef))
+ return treeItem;
+ }
+
+ return nullptr;
+}
+
void CTreeItem::addUnder(CTreeItem *newParent) {
if (newParent->_firstChild)
addSibling(newParent->getLastSibling());
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index afca5254df..e218cf3dbb 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -119,6 +119,16 @@ public:
CTreeItem *scan(CTreeItem *item) const;
/**
+ * Find the first child item that is of a given type
+ */
+ CTreeItem *findChildInstanceOf(ClassDef *classDef) const;
+
+ /**
+ * Find the next sibling item that is of the given type
+ */
+ CTreeItem *findNextInstanceOf(ClassDef *classDef, CTreeItem *startItem) const;
+
+ /**
* Adds the item under another tree item
*/
void addUnder(CTreeItem *newParent);
diff --git a/engines/titanic/core/view_item.cpp b/engines/titanic/core/view_item.cpp
index e64229e3d3..5253f24749 100644
--- a/engines/titanic/core/view_item.cpp
+++ b/engines/titanic/core/view_item.cpp
@@ -27,7 +27,7 @@ namespace Titanic {
CViewItem::CViewItem() : CNamedItem() {
_field24 = 0;
_field28 = 0.0;
- _field30 = 0;
+ _viewNumber = 0;
_field50 = 0;
_field54 = 0;
setData(0.0);
@@ -44,7 +44,7 @@ void CViewItem::save(SimpleFile *file, int indent) const {
_resourceKey.save(file, indent);
file->writeQuotedLine("V", indent);
file->writeFloatLine(_field28, indent + 1);
- file->writeNumberLine(_field30, indent + 1);
+ file->writeNumberLine(_viewNumber, indent + 1);
CNamedItem::save(file, indent);
}
@@ -60,7 +60,7 @@ void CViewItem::load(SimpleFile *file) {
default:
file->readBuffer();
setData(file->readFloat());
- _field30 = file->readNumber();
+ _viewNumber = file->readNumber();
break;
}
diff --git a/engines/titanic/core/view_item.h b/engines/titanic/core/view_item.h
index a5ce575171..805b7a4f9c 100644
--- a/engines/titanic/core/view_item.h
+++ b/engines/titanic/core/view_item.h
@@ -34,11 +34,12 @@ private:
protected:
int _field24;
double _field28;
- int _field30;
CResourceKey _resourceKey;
int _field50;
int _field54;
public:
+ int _viewNumber;
+public:
CLASSDEF
CViewItem();
diff --git a/engines/titanic/game/room_item.h b/engines/titanic/game/room_item.h
index 7441ed01bc..2235f6a5d2 100644
--- a/engines/titanic/game/room_item.h
+++ b/engines/titanic/game/room_item.h
@@ -32,7 +32,7 @@
namespace Titanic {
class CRoomItem : public CNamedItem {
-private:
+public:
Common::Rect _roomRect;
CMovieClipList _clipList;
int _roomNumber;
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index b677bf28e0..d8409e6864 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -21,18 +21,33 @@
*/
#include "titanic/game_manager.h"
+#include "titanic/game_view.h"
#include "titanic/screen_manager.h"
#include "titanic/core/project_item.h"
#include "titanic/messages/messages.h"
+
namespace Titanic {
+void CGameManagerList::postLoad(uint ticks, CProjectItem *project) {
+ for (iterator i = begin(); i != end(); ++i)
+ (*i)->postLoad(ticks, project);
+}
+
+/*------------------------------------------------------------------------*/
+
+void CGameManagerListItem::postLoad(uint ticks, CProjectItem *project) {
+ warning("TODO");
+}
+
+/*------------------------------------------------------------------------*/
+
CGameManager::CGameManager(CProjectItem *project, CGameView *gameView):
_project(project), _gameView(gameView), _trueTalkManager(this),
_inputHandler(this), _inputTranslator(&_inputHandler),
_gameState(this), _sound(this), _musicRoom(this),
- _field30(0), _field34(0), _field48(0),
- _field4C(0), _field50(0), _field54(0), _tickCount(0) {
+ _field30(0), _field34(0), _field48(0), _field4C(0),
+ _field50(0), _field54(0), _tickCount1(0), _tickCount2(0) {
_videoSurface = CScreenManager::_screenManagerPtr->createSurface(600, 340);
_project->setGameManager(this);
}
@@ -44,14 +59,29 @@ void CGameManager::load(SimpleFile *file) {
_list.load(file);
_trueTalkManager.load(file);
_sound.load(file);
-
}
-void CGameManager::gameLoaded() {
- // TODO
+void CGameManager::postLoad(CProjectItem *project) {
+ if (_gameView) {
+ _gameView->postLoad();
+
+ if (!_gameView->_fieldC) {
+ int v = fn2();
+ if (v)
+ _gameView->proc3(v);
+ }
+ }
+
+ // Signal to anything interested that the game has been loaded
+ CLoadSuccessMsg msg(_tickCount1 - _tickCount2);
+ msg.execute(project, nullptr, MSGFLAG_SCAN);
- //CLoadSuccessMsg msg(0);
+ // Signal to any registered list items
+ _list.postLoad(_tickCount1, _project);
+ // Signal the true talk manager and sound
+ _trueTalkManager.postLoad();
+ _sound.postLoad();
}
-} // End of namespace Titanic z
+} // End of namespace Titanic
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index 37a4a415fb..1d2a88e626 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -39,14 +39,19 @@ class CProjectItem;
class CGameView;
class CGameManagerListItem : public ListItem {
+private:
+ static int _v1;
+public:
+ void postLoad(uint ticks, CProjectItem *project);
};
class CGameManagerList : public List<CGameManagerListItem> {
+public:
+ void postLoad(uint ticks, CProjectItem *project);
};
class CGameManager {
private:
- CProjectItem *_project;
CGameView *_gameView;
CGameState _gameState;
CSound _sound;
@@ -63,7 +68,10 @@ private:
int _field50;
int _field54;
CVideoSurface *_videoSurface;
- int _tickCount;
+ uint _tickCount1;
+ uint _tickCount2;
+public:
+ CProjectItem *_project;
public:
CGameManager(CProjectItem *project, CGameView *gameView);
~CGameManager();
@@ -76,7 +84,9 @@ public:
/**
* Called after loading a game has finished
*/
- void gameLoaded();
+ void postLoad(CProjectItem *project);
+
+ int fn2() { return _gameState._sub.fn2(); }
};
} // End of namespace Titanic
diff --git a/engines/titanic/game_state_sub.cpp b/engines/titanic/game_state_sub.cpp
index 212fcce676..2e379a0edd 100644
--- a/engines/titanic/game_state_sub.cpp
+++ b/engines/titanic/game_state_sub.cpp
@@ -42,4 +42,9 @@ void CGameStateSub::load(SimpleFile *file) {
_fieldC = file->readNumber();
}
+int CGameStateSub::fn2() {
+ warning("TODO");
+ return 0;
+}
+
} // End of namespace Titanic z
diff --git a/engines/titanic/game_state_sub.h b/engines/titanic/game_state_sub.h
index 2ea6bd60b0..82917d9021 100644
--- a/engines/titanic/game_state_sub.h
+++ b/engines/titanic/game_state_sub.h
@@ -49,6 +49,8 @@ public:
* Load the data for the class from file
*/
void load(SimpleFile *file);
+
+ int fn2();
};
} // End of namespace Titanic
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index d8410f1457..a0542b548f 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -22,20 +22,44 @@
#include "titanic/game_view.h"
#include "titanic/game_manager.h"
+#include "titanic/main_game_window.h"
namespace Titanic {
-CGameView::CGameView() : _gameManager(nullptr), _field8(0), _fieldC(0) {
+CGameView::CGameView() : _gameManager(nullptr), _fieldC(nullptr),
+ _field8(0) {
}
void CGameView::setGameManager(CGameManager *gameManager) {
_gameManager = gameManager;
}
+void CGameView::postLoad() {
+ if (_fieldC)
+ warning("TODO");
+
+ _fieldC = nullptr;
+}
+
+void CGameView::deleteView(int roomNumber, int nodeNumber, int viewNumber) {
+ CViewItem *view = _gameManager->_project->findView(roomNumber, nodeNumber, viewNumber);
+ if (view)
+ delete view;
+}
+
+
/*------------------------------------------------------------------------*/
-CTitanicGameView::CTitanicGameView(CMainGameWindow *gameWindow) :
+CSTGameView::CSTGameView(CMainGameWindow *gameWindow) :
CGameView(), _gameWindow(gameWindow) {
}
+void CSTGameView::proc3(int v) {
+ _gameWindow->fn1(v);
+}
+
+void CSTGameView::proc4() {
+ _gameWindow->fn2();
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 588cf938e3..5a2c04a9c8 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -24,6 +24,7 @@
#define TITANIC_GAME_VIEW_H
#include "common/scummsys.h"
+#include "titanic/core/view_item.h"
namespace Titanic {
@@ -34,7 +35,8 @@ class CGameView {
protected:
CGameManager *_gameManager;
int _field8;
- int _fieldC;
+public:
+ void *_fieldC;
public:
CGameView();
@@ -42,13 +44,26 @@ public:
* Set the game manager
*/
void setGameManager(CGameManager *gameManager);
+
+ /**
+ * Called after loading a game has finished
+ */
+ void postLoad();
+
+ virtual void deleteView(int roomNumber, int nodeNumber, int viewNumber);
+
+ virtual void proc3(int v) = 0;
+ virtual void proc4() = 0;
};
-class CTitanicGameView: public CGameView {
+class CSTGameView: public CGameView {
private:
CMainGameWindow *_gameWindow;
public:
- CTitanicGameView(CMainGameWindow *gameWindow);
+ CSTGameView(CMainGameWindow *gameWindow);
+
+ virtual void proc3(int v);
+ virtual void proc4();
};
} // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index c4eec39445..32647051d7 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -58,7 +58,7 @@ void CMainGameWindow::applicationStarting() {
// TODO: Clear surfaces
// Create game view and manager
- _gameView = new CTitanicGameView(this);
+ _gameView = new CSTGameView(this);
_gameManager = new CGameManager(_project, _gameView);
_gameView->setGameManager(_gameManager);
@@ -80,4 +80,12 @@ int CMainGameWindow::selectSavegame() {
return -1;
}
+void CMainGameWindow::fn1(int v) {
+ warning("TODO");
+}
+
+void CMainGameWindow::fn2() {
+ warning("TODO");
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 4796a4fdcb..e6e724191a 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -68,6 +68,10 @@ public:
* Called when the application starts
*/
void applicationStarting();
+
+ void fn1(int v);
+
+ void fn2();
};
} // End of namespace Titanic
diff --git a/engines/titanic/messages/messages.cpp b/engines/titanic/messages/messages.cpp
index 1f7a5a07d4..1e49994915 100644
--- a/engines/titanic/messages/messages.cpp
+++ b/engines/titanic/messages/messages.cpp
@@ -50,7 +50,7 @@ bool CMessage::execute(CTreeItem *target, const ClassDef *classDef, int flags) {
if (flags & MSGFLAG_SCAN)
nextItem = item->scan(target);
- if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(*classDef)) {
+ if (!(flags & MSGFLAG_CLASS_DEF) || item->isInstanceOf(classDef)) {
bool handled = perform(item);
if (handled) {
diff --git a/engines/titanic/messages/messages.h b/engines/titanic/messages/messages.h
index 1908b7351c..80ce590b87 100644
--- a/engines/titanic/messages/messages.h
+++ b/engines/titanic/messages/messages.h
@@ -42,7 +42,8 @@ public:
CLASSDEF
CMessage();
- bool execute(CTreeItem *target, const ClassDef *classDef, int flags);
+ bool execute(CTreeItem *target, const ClassDef *classDef = nullptr,
+ int flags = MSGFLAG_SCAN | MSGFLAG_BREAK_IF_HANDLED);
virtual bool perform(CTreeItem *treeItem) { return false; }
diff --git a/engines/titanic/pet_control/pet_control.cpp b/engines/titanic/pet_control/pet_control.cpp
index e123e99dc5..7ed223d595 100644
--- a/engines/titanic/pet_control/pet_control.cpp
+++ b/engines/titanic/pet_control/pet_control.cpp
@@ -49,7 +49,7 @@ void CPetControl::load(SimpleFile *file) {
CGameObject::load(file);
}
-void CPetControl::gameLoaded() {
+void CPetControl::postLoad() {
// TODO
}
diff --git a/engines/titanic/pet_control/pet_control.h b/engines/titanic/pet_control/pet_control.h
index 0eb2034675..70f6850bc7 100644
--- a/engines/titanic/pet_control/pet_control.h
+++ b/engines/titanic/pet_control/pet_control.h
@@ -79,7 +79,7 @@ public:
/**
* Called after loading a game has finished
*/
- void gameLoaded();
+ void postLoad();
};
} // End of namespace Titanic
diff --git a/engines/titanic/sound/sound.h b/engines/titanic/sound/sound.h
index 6ae4019557..a78bc79741 100644
--- a/engines/titanic/sound/sound.h
+++ b/engines/titanic/sound/sound.h
@@ -46,6 +46,11 @@ public:
* Load the data for the class from file
*/
void load(SimpleFile *file);
+
+ /**
+ * Called when loading a game is complete
+ */
+ void postLoad() { _soundManager.postLoad(); }
};
} // End of namespace Titanic
diff --git a/engines/titanic/sound/sound_manager.h b/engines/titanic/sound/sound_manager.h
index 4936625245..cb88b6684c 100644
--- a/engines/titanic/sound/sound_manager.h
+++ b/engines/titanic/sound/sound_manager.h
@@ -64,7 +64,11 @@ public:
*/
void load(SimpleFile *file) {}
- virtual void proc25() {}
+ /**
+ * Called after loading of a game is completed
+ */
+ virtual void postLoad() {}
+
virtual void proc26() {}
/**
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index 274b5ccc65..904f3c479b 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -78,6 +78,11 @@ public:
void load(SimpleFile *file);
/**
+ * Called when loading a game is complete
+ */
+ void postLoad() {}
+
+ /**
* Returns the scripts for the manager
*/
TTScripts &getScripts() { return _scripts; }