diff options
Diffstat (limited to 'engines/access/amazon/amazon_logic.cpp')
-rw-r--r-- | engines/access/amazon/amazon_logic.cpp | 87 |
1 files changed, 41 insertions, 46 deletions
diff --git a/engines/access/amazon/amazon_logic.cpp b/engines/access/amazon/amazon_logic.cpp index e6a96b67d6..de53da51cd 100644 --- a/engines/access/amazon/amazon_logic.cpp +++ b/engines/access/amazon/amazon_logic.cpp @@ -317,8 +317,8 @@ void Opening::doTitle() { _vm->_events->hideCursor(); if (!_vm->isDemo()) { - _vm->_sound->queueSound(0, 98, 30); - _vm->_sound->queueSound(1, 98, 8); + _vm->_sound->loadSoundTable(0, 98, 30); + _vm->_sound->loadSoundTable(1, 98, 8); _vm->_files->_setPaletteFlag = false; _vm->_files->loadScreen(0, 3); @@ -326,30 +326,18 @@ void Opening::doTitle() { _vm->_buffer2.copyFrom(*_vm->_screen); _vm->_buffer1.copyFrom(*_vm->_screen); screen.forceFadeIn(); - _vm->_sound->playSound(1); - // WORKAROUND: This delay has been added to replace original game delay that - // came from loading resources, since nowadays it would be too fast to be visible - // nowadays to be visible. - _vm->_events->_vbCount = 70; - while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0) - _vm->_events->pollEventsAndWait(); - if (_vm->shouldQuit()) - return; + _vm->_sound->playSound(1, true); Resource *spriteData = _vm->_files->loadFile(0, 2); _vm->_objectsTable[0] = new SpriteResource(_vm, spriteData); delete spriteData; - _vm->_sound->playSound(1); - _vm->_files->_setPaletteFlag = false; _vm->_files->loadScreen(0, 4); - _vm->_sound->playSound(1); _vm->_buffer2.copyFrom(*_vm->_screen); _vm->_buffer1.copyFrom(*_vm->_screen); - _vm->_sound->playSound(1); const int COUNTDOWN[6] = { 2, 0x80, 1, 0x7d, 0, 0x87 }; for (_pCount = 0; _pCount < 3 && !_vm->shouldQuit(); ++_pCount) { @@ -359,7 +347,6 @@ void Opening::doTitle() { _vm->_buffer2.plotImage(_vm->_objectsTable[0], id, Common::Point(xp, 71)); _vm->_buffer2.copyTo(_vm->_screen); - _vm->_sound->playSound(1); _vm->_events->_vbCount = 70; while (!_vm->shouldQuit() && _vm->_events->_vbCount > 0 && !_skipStart) { _vm->_events->pollEventsAndWait(); @@ -371,6 +358,7 @@ void Opening::doTitle() { return; _vm->_sound->stopSound(); + _vm->_sound->checkSoundQueue(); // HACK: Clear sound 1 from the queue _vm->_sound->playSound(0); screen.forceFadeOut(); _vm->_events->_vbCount = 100; @@ -389,7 +377,7 @@ void Opening::doTitle() { _vm->_buffer1.blitFrom(*_vm->_screen); screen.forceFadeIn(); _vm->_midi->newMusic(1, 0); - _vm->_events->_vbCount = 700; + _vm->_events->_vbCount = 950; while (!_vm->shouldQuit() && (_vm->_events->_vbCount > 0) && !_vm->_events->isKeyMousePressed()) { _vm->_events->pollEventsAndWait(); } @@ -493,12 +481,12 @@ void Opening::doTent() { _vm->_screen->setDisplayScan(); _vm->_screen->forceFadeOut(); _vm->_events->hideCursor(); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 39), 1)); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 14), 1)); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 15), 1)); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 16), 1)); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 31), 2)); - _vm->_sound->_soundTable.push_back(SoundEntry(_vm->_sound->loadSound(98, 52), 2)); + _vm->_sound->loadSoundTable(0, 98, 39); + _vm->_sound->loadSoundTable(1, 98, 14); + _vm->_sound->loadSoundTable(2, 98, 15); + _vm->_sound->loadSoundTable(3, 98, 16); + _vm->_sound->loadSoundTable(4, 98, 31, 2); + _vm->_sound->loadSoundTable(5, 98, 52, 2); _vm->_sound->playSound(0); _vm->_files->_setPaletteFlag = false; @@ -508,40 +496,47 @@ void Opening::doTent() { _vm->_screen->forceFadeIn(); _vm->_video->setVideo(_vm->_screen, Common::Point(126, 73), FileIdent(2, 1), 10); + int previousFrame = -1; while (!_vm->shouldQuit() && !_vm->_video->_videoEnd) { _vm->_video->playVideo(); - if ((_vm->_video->_videoFrame == 32) || (_vm->_video->_videoFrame == 34)) - _vm->_sound->playSound(4); - else if (_vm->_video->_videoFrame == 36) { - if (step != 2) { - _vm->_sound->playSound(2); - step = 2; - } - } else if (_vm->_video->_videoFrame == 18) { - if (step != 1) { - _vm->_midi->newMusic(73, 1); - _vm->_midi->newMusic(11, 0); - step = 1; - _vm->_sound->playSound(1); + if (previousFrame != _vm->_video->_videoFrame) { + previousFrame = _vm->_video->_videoFrame; + + if ((_vm->_video->_videoFrame == 32) || (_vm->_video->_videoFrame == 34)) + _vm->_sound->playSound(4); + else if (_vm->_video->_videoFrame == 36) { + if (step != 2) { + _vm->_sound->playSound(2); + step = 2; + } + } else if (_vm->_video->_videoFrame == 18) { + if (step != 1) { + _vm->_midi->newMusic(73, 1); + _vm->_midi->newMusic(11, 0); + step = 1; + _vm->_sound->playSound(1); + } } } - _vm->_events->pollEventsAndWait(); } _vm->_sound->playSound(5); _vm->_video->setVideo(_vm->_screen, Common::Point(43, 11), FileIdent(2, 2), 10); + previousFrame = -1; while (!_vm->shouldQuit() && !_vm->_video->_videoEnd) { _vm->_video->playVideo(); - if (_vm->_video->_videoFrame == 26) { - _vm->_sound->playSound(5); - } else if (_vm->_video->_videoFrame == 15) { - if (step !=3) { - _vm->_sound->playSound(3); - step = 3; + if (previousFrame != _vm->_video->_videoFrame) { + previousFrame = _vm->_video->_videoFrame; + if (_vm->_video->_videoFrame == 26) { + _vm->_sound->playSound(5); + } else if (_vm->_video->_videoFrame == 15) { + if (step !=3) { + _vm->_sound->playSound(3); + step = 3; + } } } - _vm->_events->pollEventsAndWait(); } @@ -1035,7 +1030,7 @@ void Guard::setHorizontalCode() { if (_bottomRight.x < screen._orgX1) _gCode2 |= 8; - else if (_bottomRight.y > screen._orgX2) + else if (_bottomRight.x > screen._orgX2) _gCode2 |= 2; } @@ -1601,7 +1596,7 @@ void River::moveCanoe() { moveCanoe2(); } else { if (events._leftButton && pt.y >= 140) { - if (pt.x < RMOUSE[8][0]) { + if (pt.x < _vm->_room->_rMouse[8][0]) { // Disk icon wasn't clicked _vm->_scripts->printString(BAR_MESSAGE); } else { |