Skip to content

Commit

Permalink
ACCESS: Fix speakText behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent c82fb8c commit 5520a76
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions engines/access/access.cpp
Expand Up @@ -216,27 +216,25 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
s->_printOrg = Common::Point(s->_printStart.x, s->_printOrg.y + 9);

if ((s->_printOrg.y > _printEnd) && (!lastLine)) {
if (!_sound->_isVoice) {
_events->waitKeyMouse();
} else {
while (!shouldQuit()) {
_sound->freeSounds();
Resource *sound = _sound->loadSound(_narateFile + 99, _sndSubFile);
_sound->_soundTable.push_back(SoundEntry(sound, 1));
_sound->playSound(0);
_scripts->cmdFreeSound();

_events->pollEvents();

if (_events->isKeyMousePressed()) {
_sndSubFile += soundsLeft;
_events->clearEvents();
while (!shouldQuit()) {
_sound->freeSounds();
Resource *sound = _sound->loadSound(_narateFile + 99, _sndSubFile);
_sound->_soundTable.push_back(SoundEntry(sound, 1));
_sound->playSound(0);
_scripts->cmdFreeSound();

_events->pollEvents();

if (_events->isKeyMousePressed()) {
_sndSubFile += soundsLeft;
break;
} else {
++_sndSubFile;
--soundsLeft;
if (soundsLeft == 0)
break;
} else {
++_sndSubFile;
--soundsLeft;
if (soundsLeft == 0)
break;
}
_events->clearEvents();
}
}

Expand All @@ -253,11 +251,6 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
if (soundsLeft == 0)
return;

if (!_sound->_isVoice) {
_events->waitKeyMouse();
return;
}

for (;;) {
_sound->freeSounds();
Resource *res = _sound->loadSound(_narateFile + 99, _sndSubFile);
Expand Down

0 comments on commit 5520a76

Please sign in to comment.