aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-10-28 20:19:35 -0400
committerPaul Gilbert2016-10-28 20:19:35 -0400
commitf7c7f11435c96781d02c8c44c29e9da08392eec2 (patch)
treeb56fbe645b3f902a29310e847baf1c7007799cab /engines
parentaee3599e6bc2fd2cf8cd627de7f607365302efa6 (diff)
downloadscummvm-rg350-f7c7f11435c96781d02c8c44c29e9da08392eec2.tar.gz
scummvm-rg350-f7c7f11435c96781d02c8c44c29e9da08392eec2.tar.bz2
scummvm-rg350-f7c7f11435c96781d02c8c44c29e9da08392eec2.zip
TITANIC: Renames and adding debugging
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/game/maitred/maitred_prod_receptor.cpp4
-rw-r--r--engines/titanic/npcs/doorbot.cpp9
-rw-r--r--engines/titanic/npcs/parrot.cpp6
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp16
-rw-r--r--engines/titanic/npcs/true_talk_npc.h2
-rw-r--r--engines/titanic/titanic.cpp12
7 files changed, 33 insertions, 20 deletions
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index af1ec9ca6f..1ccf5bae0a 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -645,6 +645,8 @@ void CGameObject::playMovie(int startFrame, int endFrame, int initialFrame, uint
}
void CGameObject::playClip(const CString &name, uint flags) {
+ debugC(ERROR_DETAILED, kDebugScripts, "playClip - %s", name.c_str());
+
_frameNumber = -1;
CMovieClip *clip = _movieClips.findByName(name);
if (clip)
@@ -652,6 +654,8 @@ void CGameObject::playClip(const CString &name, uint flags) {
}
void CGameObject::playClip(uint startFrame, uint endFrame) {
+ debugC(ERROR_DETAILED, kDebugScripts, "playClip - %d to %d", startFrame, endFrame);
+
CMovieClip *clip = new CMovieClip("", startFrame, endFrame);
CGameManager *gameManager = getGameManager();
CRoomItem *room = gameManager->getRoom();
diff --git a/engines/titanic/game/maitred/maitred_prod_receptor.cpp b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
index 95e029af44..6f64a76d7f 100644
--- a/engines/titanic/game/maitred/maitred_prod_receptor.cpp
+++ b/engines/titanic/game/maitred/maitred_prod_receptor.cpp
@@ -81,7 +81,7 @@ bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) {
prodMsg._value = 125;
CMaitreD *maitreD = dynamic_cast<CMaitreD *>(findRoomObject("MaitreD"));
- if (maitreD && maitreD->_field100 <= 0)
+ if (maitreD && maitreD->_speechCounter == 0)
prodMsg.execute(this);
return true;
@@ -90,7 +90,7 @@ bool CMaitreDProdReceptor::MouseMoveMsg(CMouseMoveMsg *msg) {
bool CMaitreDProdReceptor::ProdMaitreDMsg(CProdMaitreDMsg *msg) {
if (_fieldC4) {
CMaitreD *maitreD = static_cast<CMaitreD *>(findRoomObject("MaitreD"));
- if (maitreD->_field100 <= 0) {
+ if (maitreD->_speechCounter == 0) {
CViewItem *view = findView();
startTalking(maitreD, msg->_value, view);
diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp
index d26f4bb828..4e08dda446 100644
--- a/engines/titanic/npcs/doorbot.cpp
+++ b/engines/titanic/npcs/doorbot.cpp
@@ -22,6 +22,7 @@
#include "titanic/npcs/doorbot.h"
#include "titanic/core/room_item.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -81,6 +82,8 @@ void CDoorbot::load(SimpleFile *file) {
}
bool CDoorbot::MovieEndMsg(CMovieEndMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot MovieEndMsg flags=%x v=%d", _npcFlags, _field108);
+
if (_npcFlags & NPCFLAG_DOORBOT_INTRO) {
switch (_field108) {
case 3:
@@ -539,13 +542,15 @@ bool CDoorbot::EnterViewMsg(CEnterViewMsg *msg) {
}
bool CDoorbot::ActMsg(CActMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "CDoorbot ActMsg action=%s v108=%d v110=%d v114=%d",
+ msg->_action.c_str(), _field108, _field110, _field114);
+
if (msg->_action == "DoorbotPlayerPressedTopButton") {
disableMouse();
startTalking(this, 221471);
} else if (msg->_action == "DoorbotPlayerPressedMiddleButton") {
startTalking(this, 221470);
- }
- else if (msg->_action == "DoorbotPlayerPressedBottomButton") {
+ } else if (msg->_action == "DoorbotPlayerPressedBottomButton") {
startTalking(this, 221469);
} else if (msg->_action == "DoorbotReachedEmbLobby") {
startTalking(this, 221472);
diff --git a/engines/titanic/npcs/parrot.cpp b/engines/titanic/npcs/parrot.cpp
index 97a1944fef..7db0fbd0aa 100644
--- a/engines/titanic/npcs/parrot.cpp
+++ b/engines/titanic/npcs/parrot.cpp
@@ -202,7 +202,7 @@ bool CParrot::ActMsg(CActMsg *msg) {
}
bool CParrot::MouseButtonDownMsg(CMouseButtonDownMsg *msg) {
- if (!(_npcFlags & NPCFLAG_2000000) && _field100 <= 0) {
+ if (!(_npcFlags & NPCFLAG_2000000) && _speechCounter == 0) {
CTrueTalkTriggerActionMsg triggerMsg(280250, 280250, 1);
triggerMsg.execute(this);
}
@@ -354,7 +354,7 @@ bool CParrot::EnterViewMsg(CEnterViewMsg *msg) {
loadFrame(0);
endTalking(this, true, findView());
- if (_field100 > 0) {
+ if (_speechCounter > 0) {
playRandomClip(NAMES, MOVIE_NOTIFY_OBJECT);
} else {
startTalking(this, 280258, findView());
@@ -425,7 +425,7 @@ bool CParrot::ParrotSpeakMsg(CParrotSpeakMsg *msg) {
}
// Don't have the parrot speak too often
- if ((getTicksCount() - _field120) < 20000 || _field100)
+ if ((getTicksCount() - _field120) < 20000 || _speechCounter)
return true;
playSound("z#475.wav", 50);
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 41186ac46c..b405ad42b6 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -24,6 +24,7 @@
#include "titanic/core/view_item.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/game_manager.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -41,7 +42,7 @@ END_MESSAGE_MAP()
CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
_assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _speechDuration(0), _startTicks(0),
- _fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
+ _fieldF4(0), _fieldF8(0), _speechTimerId(0), _speechCounter(0), _field104(0) {
}
void CTrueTalkNPC::save(SimpleFile *file, int indent) {
@@ -55,7 +56,7 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) {
file->writeNumberLine(_fieldF4, indent);
file->writeNumberLine(_fieldF8, indent);
file->writeNumberLine(_speechTimerId, indent);
- file->writeNumberLine(_field100, indent);
+ file->writeNumberLine(_speechCounter, indent);
file->writeNumberLine(_field104, indent);
CCharacter::save(file, indent);
@@ -72,7 +73,7 @@ void CTrueTalkNPC::load(SimpleFile *file) {
_fieldF4 = file->readNumber();
_fieldF8 = file->readNumber();
_speechTimerId = file->readNumber();
- _field100 = file->readNumber();
+ _speechCounter = file->readNumber();
_field104 = file->readNumber();
CCharacter::load(file);
@@ -95,8 +96,10 @@ bool CTrueTalkNPC::DismissBotMsg(CDismissBotMsg *msg) {
}
bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechStartedMsg flags=%x", getName().c_str(), _npcFlags);
+
_npcFlags |= NPCFLAG_SPEAKING;
- ++_field100;
+ ++_speechCounter;
if (!(_npcFlags & NPCFLAG_8)) {
// Stop any previous animation
@@ -125,8 +128,9 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
}
bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
+ debugC(ERROR_DETAILED, kDebugScripts, "%s TrueTalkNotifySpeechEndedMsg flags=%x dialogId=%d", getName().c_str(), _npcFlags, msg->_dialogueId);
_npcFlags &= ~NPCFLAG_SPEAKING;
- --_field100;
+ --_speechCounter;
_speechDuration = 0;
if (!(_npcFlags & NPCFLAG_8)) {
@@ -171,7 +175,7 @@ bool CTrueTalkNPC::NPCQueueIdleAnimMsg(CNPCQueueIdleAnimMsg *msg) {
bool CTrueTalkNPC::TimerMsg(CTimerMsg *msg) {
if (_npcFlags & NPCFLAG_4) {
- if (_field100 > 0)
+ if (_speechCounter > 0)
return false;
CNPCPlayIdleAnimationMsg idleMsg;
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 3adf055449..e044f10b15 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -66,7 +66,7 @@ protected:
protected:
void processInput(CTextInputMsg *msg, CViewItem *view);
public:
- int _field100;
+ int _speechCounter;
public:
CLASSDEF;
CTrueTalkNPC();
diff --git a/engines/titanic/titanic.cpp b/engines/titanic/titanic.cpp
index 84f52c84df..88cc25af43 100644
--- a/engines/titanic/titanic.cpp
+++ b/engines/titanic/titanic.cpp
@@ -60,6 +60,12 @@ TitanicEngine::TitanicEngine(OSystem *syst, const TitanicGameDescription *gameDe
_scriptHandler = nullptr;
_script = nullptr;
CMusicRoom::_musicHandler = nullptr;
+
+ // Set up debug channels
+ DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
+ DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
+ DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
+ DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
}
TitanicEngine::~TitanicEngine() {
@@ -78,12 +84,6 @@ void TitanicEngine::initializePath(const Common::FSNode &gamePath) {
}
void TitanicEngine::initialize() {
- // Set up debug channels
- DebugMan.addDebugChannel(kDebugCore, "core", "Core engine debug level");
- DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
- DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
- DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
-
_debugger = new Debugger(this);
_filesManager = new CFilesManager(this);