TITANIC: Fix updating mixer during cutscenes, ending NPC speech
This commit is contained in:
parent
302562de38
commit
b4beb09c94
4 changed files with 11 additions and 6 deletions
|
@ -125,12 +125,17 @@ void Events::sleep(uint time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Events::waitForPress(uint expiry) {
|
bool Events::waitForPress(uint expiry) {
|
||||||
|
CGameManager *gameManager = g_vm->_window->_gameManager;
|
||||||
uint32 delayEnd = g_system->getMillis() + expiry;
|
uint32 delayEnd = g_system->getMillis() + expiry;
|
||||||
|
|
||||||
while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
|
while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd) {
|
||||||
g_system->delayMillis(10);
|
g_system->delayMillis(10);
|
||||||
checkForNextFrameCounter();
|
checkForNextFrameCounter();
|
||||||
|
|
||||||
|
// Regularly update the sound mixer
|
||||||
|
if (gameManager)
|
||||||
|
gameManager->_sound.updateMixer();
|
||||||
|
|
||||||
Common::Event event;
|
Common::Event event;
|
||||||
if (g_system->getEventManager()->pollEvent(event)) {
|
if (g_system->getEventManager()->pollEvent(event)) {
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
|
|
|
@ -327,7 +327,7 @@ MESSAGE1(CTriggerNPCEvent, int, value, 0);
|
||||||
MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
|
MESSAGE4(CTrueTalkGetAnimSetMsg, int, value1, 0, uint, index, 0, uint, startFrame, 0, uint, endFrame, 0);
|
||||||
MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
|
MESSAGE2(CTrueTalkGetAssetDetailsMsg, CString, filename, "", int, numValue, 0);
|
||||||
MESSAGE2(CTrueTalkGetStateValueMsg, int, stateNum, 0, int, stateVal, -1000);
|
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);
|
MESSAGE3(CTrueTalkNotifySpeechStartedMsg, uint, speechDuration, 0, uint, dialogueId, 0, int, value, 0);
|
||||||
MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
|
MESSAGE1(CTrueTalkQueueUpAnimSetMsg, int, value, 0);
|
||||||
MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
|
MESSAGE0(CTrueTalkSelfQueueAnimSetMsg);
|
||||||
|
|
|
@ -40,13 +40,13 @@ TTtalker::~TTtalker() {
|
||||||
petControl->convAddLine(_line);
|
petControl->convAddLine(_line);
|
||||||
|
|
||||||
// Notify the end of the speech
|
// Notify the end of the speech
|
||||||
CTrueTalkNotifySpeechEndedMsg endedMsg(_field24, _dialogueId);
|
CTrueTalkNotifySpeechEndedMsg endedMsg(_talkEndState, _dialogueId);
|
||||||
endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
|
endedMsg.execute(_npc, nullptr, MSGFLAG_BREAK_IF_HANDLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TTtalker::endSpeech(int val) {
|
void TTtalker::endSpeech(int val) {
|
||||||
_done = true;
|
_done = true;
|
||||||
_field24 = val;
|
_talkEndState = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace Titanic
|
} // End of namespace Titanic
|
||||||
|
|
|
@ -37,13 +37,13 @@ public:
|
||||||
CTrueTalkNPC *_npc;
|
CTrueTalkNPC *_npc;
|
||||||
CString _line;
|
CString _line;
|
||||||
int _dialogueId;
|
int _dialogueId;
|
||||||
int _field24;
|
int _talkEndState;
|
||||||
int _done;
|
int _done;
|
||||||
public:
|
public:
|
||||||
TTtalker() : _owner(nullptr), _npc(nullptr),
|
TTtalker() : _owner(nullptr), _npc(nullptr),
|
||||||
_dialogueId(0), _field24(0), _done(0) {}
|
_dialogueId(0), _talkEndState(0), _done(0) {}
|
||||||
TTtalker(CTrueTalkManager *owner, CTrueTalkNPC *npc) :
|
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();
|
~TTtalker();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue