TITANIC: Fix updating mixer during cutscenes, ending NPC speech

This commit is contained in:
Paul Gilbert 2016-09-03 17:31:37 -04:00
parent 302562de38
commit b4beb09c94
4 changed files with 11 additions and 6 deletions

View File

@ -125,12 +125,17 @@ void Events::sleep(uint time) {
}
bool Events::waitForPress(uint expiry) {
CGameManager *gameManager = g_vm->_window->_gameManager;
uint32 delayEnd = g_system->getMillis() + expiry;
while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
g_system->delayMillis(10);
checkForNextFrameCounter();
// Regularly update the sound mixer
if (gameManager)
gameManager->_sound.updateMixer();
Common::Event event;
if (g_system->getEventManager()->pollEvent(event)) {
switch (event.type) {

View File

@ -327,7 +327,7 @@ MESSAGE1(CTriggerNPCEvent, int, value, 0);
MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
MESSAGE2(CTrueTalkGetStateValueMsg, int, stateNum, 0, int, stateVal, -1000);
MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, value1, 0, int, dialogueId, 0);
MESSAGE2(CTrueTalkNotifySpeechEndedMsg, int, endState, 0, int, dialogueId, 0);
MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, speechDuration, 0, uint, dialogueId, 0, int, value, 0);
MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);

View File

@ -40,13 +40,13 @@ TTtalker::~TTtalker() {
petControl->convAddLine(_line);
// Notify the end of the speech
CTrueTalkNotifySpeechEndedMsg endedMsg(_field24, _dialogueId);
CTrueTalkNotifySpeechEndedMsg endedMsg(_talkEndState, _dialogueId);
endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
}
void TTtalker::endSpeech(int val) {
_done = true;
_field24 = val;
_talkEndState = val;
}
} // End of namespace Titanic

View File

@ -37,13 +37,13 @@ public:
CTrueTalkNPC *_npc;
CString _line;
int _dialogueId;
int _field24;
int _talkEndState;
int _done;
public:
TTtalker() : _owner(nullptr), _npc(nullptr),
_dialogueId(0), _field24(0), _done(0) {}
_dialogueId(0), _talkEndState(0), _done(0) {}
TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
_owner(owner), _npc(npc), _dialogueId(0), _field24(0), _done(0) {}
_owner(owner), _npc(npc), _dialogueId(0), _talkEndState(0), _done(0) {}
~TTtalker();
/**