Skip to content

Commit

Permalink
ACCESS: Cleaned up event handling for scene establish text display
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Dec 13, 2014
1 parent 40b8417 commit a1e5e8b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
10 changes: 3 additions & 7 deletions engines/access/access.cpp
Expand Up @@ -196,7 +196,7 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
int curPage = 0;
int soundsLeft = 0;

for (;;) {
while (!shouldQuit()) {
soundsLeft = _countTbl[curPage];
_events->zeroKeys();

Expand All @@ -216,7 +216,7 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
if (!_sound->_isVoice) {
_events->waitKeyMouse();
} else {
for (;;) {
while (!shouldQuit()) {
_sound->freeSounds();
Resource *sound = _sound->loadSound(_narateFile + 99, _sndSubFile);
_sound->_soundTable.push_back(SoundEntry(sound, 1));
Expand All @@ -225,11 +225,7 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {

_events->pollEvents();

if (_events->_leftButton) {
_events->debounceLeft();
_sndSubFile += soundsLeft;
break;
} else if (_events->isKeyPending()) {
if (_events->isKeyMousePressed()) {
_sndSubFile += soundsLeft;
break;
} else {
Expand Down
1 change: 1 addition & 0 deletions engines/access/amazon/amazon_game.cpp
Expand Up @@ -201,6 +201,7 @@ void AmazonEngine::loadEstablish(int estabIndex) {
void AmazonEngine::doEstablish(int screenId, int estabIndex) {
_establishMode = 1;

_events->clearEvents();
_screen->forceFadeOut();
_screen->clearScreen();
_screen->setPanel(3);
Expand Down
2 changes: 1 addition & 1 deletion engines/access/events.cpp
Expand Up @@ -299,7 +299,7 @@ void EventsManager::clearEvents() {
}

void EventsManager::waitKeyMouse() {
while (!_vm->shouldQuit() && isKeyMousePressed()) {
while (!_vm->shouldQuit() && !isKeyMousePressed()) {
pollEvents(true);
g_system->delayMillis(10);
}
Expand Down

0 comments on commit a1e5e8b

Please sign in to comment.