[Scummvm-git-logs] scummvm master -> 13656c4c313b266186e1d35d0e438b9ba6a58416
bluegr
noreply at scummvm.org
Mon Nov 14 02:28:15 UTC 2022
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a4150f1495 MADS: Fix dialog speech timing in Phantom. Some more renaming
6c1b052325 MADS: Stop speech when dialog is closed
13656c4c31 MADS: Add missing code for stamp animations
Commit: a4150f1495de506b13268d4f035c24bea22e728e
https://github.com/scummvm/scummvm/commit/a4150f1495de506b13268d4f035c24bea22e728e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-11-14T04:27:45+02:00
Commit Message:
MADS: Fix dialog speech timing in Phantom. Some more renaming
Changed paths:
engines/mads/conversations.cpp
engines/mads/conversations.h
diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp
index a5689b0296a..3eb919bf34c 100644
--- a/engines/mads/conversations.cpp
+++ b/engines/mads/conversations.cpp
@@ -348,11 +348,11 @@ void GameConversations::update(bool flag) {
ConvDialog &dialog = _runningConv->_data._dialogs[_verbId];
if (dialog._speechIndex) {
- _runningConv->_cnd._messageList3.clear();
- _runningConv->_cnd._messageList3.push_back(dialog._speechIndex);
+ _runningConv->_cnd._playerSpeechList.clear();
+ _runningConv->_cnd._playerSpeechList.push_back(dialog._speechIndex);
}
- generateText(dialog._textLineIndex, _runningConv->_cnd._messageList3);
+ generateText(dialog._textLineIndex, _runningConv->_cnd._playerSpeechList);
_currentMode = CONVMODE_NEXT;
if (_heroTrigger) {
@@ -369,7 +369,7 @@ void GameConversations::update(bool flag) {
removeActiveWindow();
_personSpeaking = 0;
executeEntry(_verbId);
- generateMessage(_runningConv->_cnd._messageList1, _runningConv->_cnd._messageList3);
+ generateMessage(_runningConv->_cnd._playerMessageList, _runningConv->_cnd._playerSpeechList);
if (_heroTrigger && _popupVisible) {
_vm->_game->_scene._action._activeAction._verbId = _verbId;
@@ -387,7 +387,7 @@ void GameConversations::update(bool flag) {
removeActiveWindow();
_personSpeaking = _speakerVal;
- generateMessage(_runningConv->_cnd._messageList2, _runningConv->_cnd._messageList4);
+ generateMessage(_runningConv->_cnd._actorMessageList, _runningConv->_cnd._actorSpeechList);
_currentMode = CONVMODE_NEXT;
@@ -454,15 +454,15 @@ void GameConversations::generateMessage(Common::Array<int> &messageList, Common:
}
}
- // Show the dialog
- _popupVisible = true;
- _dialog->show();
-
// Play the speech if one was provided
if (voiceList.size() > 0) {
_vm->_audio->setSoundGroup(_runningConv->_data._speechFile);
_vm->_audio->playSound(voiceList[0] - 1);
}
+
+ // Show the dialog
+ _popupVisible = true;
+ _dialog->show();
}
bool GameConversations::nextNode() {
@@ -475,10 +475,10 @@ int GameConversations::executeEntry(int index) {
ConvDialog &dlg = _runningConv->_data._dialogs[index];
ConversationVar &var0 = _runningConv->_cnd._vars[0];
- _runningConv->_cnd._messageList1.clear();
- _runningConv->_cnd._messageList2.clear();
- _runningConv->_cnd._messageList3.clear();
- _runningConv->_cnd._messageList4.clear();
+ _runningConv->_cnd._playerMessageList.clear();
+ _runningConv->_cnd._actorMessageList.clear();
+ _runningConv->_cnd._playerSpeechList.clear();
+ _runningConv->_cnd._actorSpeechList.clear();
_nextStartNode->_val = var0._val;
bool flag = true;
@@ -563,23 +563,23 @@ void GameConversations::scriptMessage(ScriptEntry &scrEntry) {
int entryVal = scrEntry._entries2[randomIndex]._v2;
if (scrEntry._command == CMD_MESSAGE1) {
- _runningConv->_cnd._messageList2.push_back(entryVal);
+ _runningConv->_cnd._actorMessageList.push_back(entryVal);
if (scrEntry._entries2.size() <= 1) {
for (uint idx = 0; idx < scrEntry._entries.size(); ++idx)
- _runningConv->_cnd._messageList4.push_back(scrEntry._entries[idx]);
+ _runningConv->_cnd._actorSpeechList.push_back(scrEntry._entries[idx]);
}
else if (scrEntry._entries.size() > 0 && randomIndex < (int)scrEntry._entries.size()) {
- _runningConv->_cnd._messageList4.push_back(entryVal);
+ _runningConv->_cnd._actorSpeechList.push_back(entryVal);
}
} else {
- _runningConv->_cnd._messageList1.push_back(entryVal);
+ _runningConv->_cnd._playerMessageList.push_back(entryVal);
if (scrEntry._entries2.size() <= 1) {
for (uint idx = 0; idx < scrEntry._entries.size(); ++idx)
- _runningConv->_cnd._messageList3.push_back(scrEntry._entries[idx]);
+ _runningConv->_cnd._playerSpeechList.push_back(scrEntry._entries[idx]);
} else if (scrEntry._entries.size() > 0 && randomIndex < (int)scrEntry._entries.size()) {
- _runningConv->_cnd._messageList3.push_back(entryVal);
+ _runningConv->_cnd._playerSpeechList.push_back(entryVal);
}
}
}
@@ -755,31 +755,31 @@ void ConversationConditionals::load(const Common::String &filename) {
convFile->skip(4);
- _messageList1.resize(convFile->readUint16LE());
- _messageList2.resize(convFile->readUint16LE());
- _messageList3.resize(convFile->readUint16LE());
- _messageList4.resize(convFile->readUint16LE());
+ _playerMessageList.resize(convFile->readUint16LE());
+ _actorMessageList.resize(convFile->readUint16LE());
+ _playerSpeechList.resize(convFile->readUint16LE());
+ _actorSpeechList.resize(convFile->readUint16LE());
convFile->skip(20);
for (uint idx = 0; idx < 10; ++idx) {
int v = convFile->readUint16LE();
- if (idx < _messageList1.size())
- _messageList1[idx] = v;
+ if (idx < _playerMessageList.size())
+ _playerMessageList[idx] = v;
}
for (uint idx = 0; idx < 10; ++idx) {
int v = convFile->readUint16LE();
- if (idx < _messageList2.size())
- _messageList2[idx] = v;
+ if (idx < _actorMessageList.size())
+ _actorMessageList[idx] = v;
}
for (uint idx = 0; idx < 10; ++idx) {
int v = convFile->readUint16LE();
- if (idx < _messageList3.size())
- _messageList3[idx] = v;
+ if (idx < _playerSpeechList.size())
+ _playerSpeechList[idx] = v;
}
for (uint idx = 0; idx < 10; ++idx) {
int v = convFile->readUint16LE();
- if (idx < _messageList4.size())
- _messageList4[idx] = v;
+ if (idx < _actorSpeechList.size())
+ _actorSpeechList[idx] = v;
}
delete convFile;
diff --git a/engines/mads/conversations.h b/engines/mads/conversations.h
index f347306a039..1adf75bd124 100644
--- a/engines/mads/conversations.h
+++ b/engines/mads/conversations.h
@@ -276,10 +276,10 @@ struct ConversationConditionals {
int _numImports;
int _currentNode;
- Common::Array<int> _messageList1;
- Common::Array<int> _messageList2;
- Common::Array<int> _messageList3;
- Common::Array<int> _messageList4;
+ Common::Array<int> _playerMessageList;
+ Common::Array<int> _actorMessageList;
+ Common::Array<int> _playerSpeechList;
+ Common::Array<int> _actorSpeechList;
/**
* Constructor
Commit: 6c1b05232522935e1cade1296448a6fbee3727b0
https://github.com/scummvm/scummvm/commit/6c1b05232522935e1cade1296448a6fbee3727b0
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-11-14T04:27:46+02:00
Commit Message:
MADS: Stop speech when dialog is closed
Changed paths:
engines/mads/conversations.cpp
diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp
index 3eb919bf34c..21b98f45e3d 100644
--- a/engines/mads/conversations.cpp
+++ b/engines/mads/conversations.cpp
@@ -463,6 +463,9 @@ void GameConversations::generateMessage(Common::Array<int> &messageList, Common:
// Show the dialog
_popupVisible = true;
_dialog->show();
+
+ if (voiceList.size() > 0)
+ _vm->_audio->stop();
}
bool GameConversations::nextNode() {
Commit: 13656c4c313b266186e1d35d0e438b9ba6a58416
https://github.com/scummvm/scummvm/commit/13656c4c313b266186e1d35d0e438b9ba6a58416
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-11-14T04:27:46+02:00
Commit Message:
MADS: Add missing code for stamp animations
An example is the animation played when trying to open the locked door
in Phantom scene 102
Changed paths:
engines/mads/sequence.cpp
engines/mads/sprites.cpp
engines/mads/sprites.h
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index baa793d011d..316006ae39d 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -220,7 +220,15 @@ bool SequenceList::loadSprites(int seqIndex) {
bool result = false;
int idx = -1;
- scene._spriteSlots.deleteTimer(seqIndex);
+ int deleted = scene._spriteSlots.deleteTimer(seqIndex);
+
+ if (deleted >= 0) {
+ if (seqEntry._animType == ANIMTYPE_STAMP) {
+ scene._spriteSlots[deleted]._flags = IMG_STATIC;
+ return false;
+ }
+ }
+
if (seqEntry._doneFlag) {
remove(seqIndex);
return false;
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index 6bfcd717dba..a06cb189c9b 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -211,14 +211,17 @@ void SpriteSlots::fullRefresh(bool clearAll) {
push_back(SpriteSlot(IMG_REFRESH, -1));
}
-void SpriteSlots::deleteTimer(int seqIndex) {
+int SpriteSlots::deleteTimer(int seqIndex) {
+ int deleted = -1;
for (uint idx = 0; idx < size(); ++idx) {
SpriteSlot &slot = (*this)[idx];
if (slot._seqIndex == seqIndex) {
slot._flags = IMG_ERASE;
- return;
+ deleted = idx;
}
}
+
+ return deleted;
}
int SpriteSlots::add() {
diff --git a/engines/mads/sprites.h b/engines/mads/sprites.h
index 6eecde557f6..f3828ec2068 100644
--- a/engines/mads/sprites.h
+++ b/engines/mads/sprites.h
@@ -177,7 +177,7 @@ public:
/**
* Delete a timer entry with the given Id
*/
- void deleteTimer(int seqIndex);
+ int deleteTimer(int seqIndex);
/**
* Add a new slot entry and return it's index
More information about the Scummvm-git-logs
mailing list