aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/npcs
diff options
context:
space:
mode:
authorPaul Gilbert2016-09-02 20:10:48 -0400
committerPaul Gilbert2016-09-02 20:10:48 -0400
commit6e5072e1b253038d1eb05e66937637069a3a84f8 (patch)
tree30244e044c8041dd1652d092c6cbd64aa75394ca /engines/titanic/npcs
parenta4d577beffbd33e0472efe5b3d3a99cb97b8ecb5 (diff)
downloadscummvm-rg350-6e5072e1b253038d1eb05e66937637069a3a84f8.tar.gz
scummvm-rg350-6e5072e1b253038d1eb05e66937637069a3a84f8.tar.bz2
scummvm-rg350-6e5072e1b253038d1eb05e66937637069a3a84f8.zip
TITANIC: Figured out sound durations for speeches & SFX
Diffstat (limited to 'engines/titanic/npcs')
-rw-r--r--engines/titanic/npcs/true_talk_npc.cpp26
-rw-r--r--engines/titanic/npcs/true_talk_npc.h4
2 files changed, 15 insertions, 15 deletions
diff --git a/engines/titanic/npcs/true_talk_npc.cpp b/engines/titanic/npcs/true_talk_npc.cpp
index 97913dffea..c677687b27 100644
--- a/engines/titanic/npcs/true_talk_npc.cpp
+++ b/engines/titanic/npcs/true_talk_npc.cpp
@@ -40,7 +40,7 @@ BEGIN_MESSAGE_MAP(CTrueTalkNPC, CCharacter)
END_MESSAGE_MAP()
CTrueTalkNPC::CTrueTalkNPC() : _assetName("z451.dlg"),
- _assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _soundId(0), _fieldF0(0),
+ _assetNumber(0x11170), _fieldE4(0), _npcFlags(0), _speechDuration(0), _startTicks(0),
_fieldF4(0), _fieldF8(0), _speechTimerId(0), _field100(0), _field104(0) {
}
@@ -50,8 +50,8 @@ void CTrueTalkNPC::save(SimpleFile *file, int indent) {
file->writeQuotedLine(_assetName, indent);
file->writeNumberLine(_fieldE4, indent);
file->writeNumberLine(_npcFlags, indent);
- file->writeNumberLine(_soundId, indent);
- file->writeNumberLine(_fieldF0, indent);
+ file->writeNumberLine(_speechDuration, indent);
+ file->writeNumberLine(_startTicks, indent);
file->writeNumberLine(_fieldF4, indent);
file->writeNumberLine(_fieldF8, indent);
file->writeNumberLine(_speechTimerId, indent);
@@ -67,8 +67,8 @@ void CTrueTalkNPC::load(SimpleFile *file) {
_assetName = file->readString();
_fieldE4 = file->readNumber();
_npcFlags = file->readNumber();
- _soundId = file->readNumber();
- _fieldF0 = file->readNumber();
+ _speechDuration = file->readNumber();
+ _startTicks = file->readNumber();
_fieldF4 = file->readNumber();
_fieldF8 = file->readNumber();
_speechTimerId = file->readNumber();
@@ -102,18 +102,18 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
if (_speechTimerId)
stopTimer(_speechTimerId);
- _soundId = msg->_soundId;
- _fieldF0 = getTicksCount();
+ _speechDuration = msg->_speechDuration;
+ _startTicks = getTicksCount();
if (hasActiveMovie() || (_npcFlags & NPCFLAG_2)) {
_npcFlags &= ~NPCFLAG_2;
stopMovie();
- CNPCPlayTalkingAnimationMsg msg1(_soundId, 0, 0);
+ CNPCPlayTalkingAnimationMsg msg1(_speechDuration, 0, 0);
msg1.execute(this);
if (msg1._names) {
- CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
+ CNPCPlayAnimationMsg msg2(msg1._names, msg1._speechDuration);
msg2.execute(this);
}
}
@@ -125,7 +125,7 @@ bool CTrueTalkNPC::TrueTalkNotifySpeechStartedMsg(CTrueTalkNotifySpeechStartedMs
bool CTrueTalkNPC::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) {
_npcFlags &= ~NPCFLAG_SPEAKING;
--_field100;
- _soundId = 0;
+ _speechDuration = 0;
if (!(_npcFlags & NPCFLAG_8)) {
CNPCPlayTalkingAnimationMsg msg1(0, 2, 0);
@@ -147,13 +147,13 @@ bool CTrueTalkNPC::MovieEndMsg(CMovieEndMsg *msg) {
return false;
}
- int diff = getTicksCount() - _fieldF0;
- int ticks = MAX((int)_soundId - diff, 0);
+ int diff = getTicksCount() - _startTicks;
+ int ticks = MAX((int)_speechDuration - diff, 0);
CNPCPlayTalkingAnimationMsg msg1(ticks, ticks > 1000 ? 2 : 1, 0);
msg1.execute(this);
if (msg1._names) {
- CNPCPlayAnimationMsg msg2(msg1._names, msg1._value1);
+ CNPCPlayAnimationMsg msg2(msg1._names, ticks);
msg2.execute(this);
}
diff --git a/engines/titanic/npcs/true_talk_npc.h b/engines/titanic/npcs/true_talk_npc.h
index 5254eaf9b7..1e06e9c690 100644
--- a/engines/titanic/npcs/true_talk_npc.h
+++ b/engines/titanic/npcs/true_talk_npc.h
@@ -57,8 +57,8 @@ protected:
CString _assetName;
int _fieldE4;
uint _npcFlags;
- uint _soundId;
- int _fieldF0;
+ uint _speechDuration;
+ uint _startTicks;
int _fieldF4;
int _fieldF8;
int _speechTimerId;