diff options
author | Paul Gilbert | 2016-05-05 19:11:28 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:38:29 -0400 |
commit | b1290d6dd93f2f442bb9649685a9fa713b14821d (patch) | |
tree | 440af6f41639ad5e55badfbf00fa693c02960377 | |
parent | d463be89fac3af6f33ef3c5179594e86cd806f83 (diff) | |
download | scummvm-rg350-b1290d6dd93f2f442bb9649685a9fa713b14821d.tar.gz scummvm-rg350-b1290d6dd93f2f442bb9649685a9fa713b14821d.tar.bz2 scummvm-rg350-b1290d6dd93f2f442bb9649685a9fa713b14821d.zip |
TITANIC: Cleanup & renames for starting conversations
-rw-r--r-- | engines/titanic/carry/carry_parrot.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/core/game_object.cpp | 11 | ||||
-rw-r--r-- | engines/titanic/core/game_object.h | 11 | ||||
-rw-r--r-- | engines/titanic/game/computer_screen.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.cpp | 7 | ||||
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.h | 10 |
6 files changed, 32 insertions, 19 deletions
diff --git a/engines/titanic/carry/carry_parrot.cpp b/engines/titanic/carry/carry_parrot.cpp index 6bf536ea7a..aa75688fab 100644 --- a/engines/titanic/carry/carry_parrot.cpp +++ b/engines/titanic/carry/carry_parrot.cpp @@ -167,9 +167,9 @@ bool CCarryParrot::PassOnDragStartMsg(CPassOnDragStartMsg *msg) { return CCarry::PassOnDragStartMsg(msg); } - CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6)); + CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6)); if (npc) - trueTalkFn1(npc, 0x446BF, 0); + startTalking(npc, 0x446BF, 0); _fieldE0 = 0; playSound("z#475.wav", 100, 0, 0); @@ -198,9 +198,9 @@ bool CCarryParrot::UseWithCharMsg(CUseWithCharMsg *msg) { bool CCarryParrot::ActMsg(CActMsg *msg) { if (msg->_action == "FreeParrot" && (CParrot::_v4 == 4 || CParrot::_v4 == 1)) { - CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(_string6)); + CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(_string6)); if (npc) - trueTalkFn1(npc, 0x446BF, 0); + startTalking(npc, 0x446BF, 0); setVisible(false); _fieldE0 = 0; diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 6f70742d79..ff7e2288f8 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -24,6 +24,7 @@ #include "titanic/core/mail_man.h" #include "titanic/core/resource_key.h" #include "titanic/core/room_item.h" +#include "titanic/npcs/true_talk_npc.h" #include "titanic/pet_control/pet_control.h" #include "titanic/support/files_manager.h" #include "titanic/support/screen_manager.h" @@ -706,17 +707,17 @@ void CGameObject::incState38() { getGameManager()->_gameState.inc38(); } -void CGameObject::trueTalkFn1(const CString &name, int val2, int val3) { - CGameObject *npc = static_cast<CGameObject *>(getRoot()->findByName(name)); - trueTalkFn1(npc, val2, val3); +void CGameObject::startTalking(const CString &npcName, int val2, int val3) { + CTrueTalkNPC *npc = static_cast<CTrueTalkNPC *>(getRoot()->findByName(npcName)); + startTalking(npc, val2, val3); } -void CGameObject::trueTalkFn1(CGameObject *npc, int val2, int val3) { +void CGameObject::startTalking(CTrueTalkNPC *npc, int val2, int val3) { CGameManager *gameManager = getGameManager(); if (gameManager) { CTrueTalkManager *talkManager = gameManager->getTalkManager(); if (talkManager) - talkManager->fn1(npc, val2, val3); + talkManager->start(npc, val2, val3); } } diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index 98973b38c3..97d3ca45eb 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -37,6 +37,7 @@ enum Found { FOUND_NONE = 0, FOUND_GLOBAL = 1, FOUND_ROOM = 2, FOUND_PET = 3, FO class CVideoSurface; class CMouseDragStartMsg; +class CTrueTalkNPC; class OSMovie; class CGameObject : public CNamedItem { @@ -216,9 +217,15 @@ protected: */ void moveToView(); - void trueTalkFn1(const CString &name, int val2, int val3); + /** + * Start a conversation with the NPC + */ + void startTalking(const CString &name, int val2, int val3); - void trueTalkFn1(CGameObject *npc, int val2, int val3); + /** + * Start a conversation with the NPC + */ + void startTalking(CTrueTalkNPC *npc, int val2, int val3); /** * Load the surface diff --git a/engines/titanic/game/computer_screen.cpp b/engines/titanic/game/computer_screen.cpp index 8879136103..846858be0e 100644 --- a/engines/titanic/game/computer_screen.cpp +++ b/engines/titanic/game/computer_screen.cpp @@ -114,11 +114,11 @@ bool CComputerScreen::TimerMsg(CTimerMsg *msg) { playSound("y#662.wav"); soundFn3(handle, 10, 2); playClip(392, 450); - trueTalkFn1("Doorbot", 0x3611A, 0); + startTalking("Doorbot", 0x3611A, 0); sleep(8000); playClip(450, 492); - trueTalkFn1("DOorbot", 0x36121, 0); + startTalking("Doorbot", 0x36121, 0); playClip(492, 522); soundFn3(handle, 30, 2); diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index c9343d1f39..6abce89148 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -22,6 +22,7 @@ #include "titanic/true_talk/true_talk_manager.h" #include "titanic/core/tree_item.h" +#include "titanic/npcs/true_talk_npc.h" #include "titanic/game_manager.h" #define MKTAG_BE(a3,a2,a1,a0) ((uint32)((a3) | ((a2) << 8) | ((a1) << 16) | ((a0) << 24))) @@ -41,7 +42,7 @@ bool CTrueTalkManager::_v10; int CTrueTalkManager::_v11[41]; CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : - _gameManager(owner), _scripts(&_titleEngine) { + _gameManager(owner), _scripts(&_titleEngine), _currentCharId(0) { } void CTrueTalkManager::save(SimpleFile *file) const { @@ -192,7 +193,7 @@ void CTrueTalkManager::update2() { //warning("CTrueTalkManager::update2"); } -void CTrueTalkManager::fn1(CGameObject *npc, int val2, int val3) { +void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) { warning("CTrueTalkManager::fn1"); } @@ -219,7 +220,7 @@ TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const { return nullptr; } -TTNamedScript *CTrueTalkManager::getNpcScript(CGameObject *npc) const { +TTNamedScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const { CString npcName = npc->getName(); TTNamedScript *script = getTalker(npcName); diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h index 991bf1608f..5507cf2a4c 100644 --- a/engines/titanic/true_talk/true_talk_manager.h +++ b/engines/titanic/true_talk/true_talk_manager.h @@ -31,13 +31,14 @@ namespace Titanic { class CGameManager; class CTreeItem; -class CGameObject; +class CTrueTalkNPC; class CTrueTalkManager { private: CGameManager *_gameManager; CTitleEngine _titleEngine; TTScripts _scripts; + int _currentCharId; private: /** * Loads the statics for the class @@ -62,7 +63,7 @@ private: /** * Gets the script associated with an NPC game object */ - TTNamedScript *getNpcScript(CGameObject *npc) const; + TTNamedScript *getNpcScript(CTrueTalkNPC *npc) const; /** * Gets the script associated with the current room @@ -129,7 +130,10 @@ public: void update2(); - void fn1(CGameObject *npc, int val2, int val3); + /** + * Start a TrueTalk conversation + */ + void start(CTrueTalkNPC *npc, int val2, int val3); /** * Return a TrueTalk talker/script |