aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPeter Kohaut2019-01-27 01:02:44 +0100
committerPeter Kohaut2019-01-27 11:49:00 +0100
commitd3f456a328fbde0787f4f15494e235b91c4ec73e (patch)
treeef0685582be54ebfdd89633a6364b78e0322a33c /engines
parentde1dabd072d0b24d0d2a847a290d7eefc84b7e6e (diff)
downloadscummvm-rg350-d3f456a328fbde0787f4f15494e235b91c4ec73e.tar.gz
scummvm-rg350-d3f456a328fbde0787f4f15494e235b91c4ec73e.tar.bz2
scummvm-rg350-d3f456a328fbde0787f4f15494e235b91c4ec73e.zip
BLADERUNNER: Implement CD switching in outtake player
Diffstat (limited to 'engines')
-rw-r--r--engines/bladerunner/outtake.cpp47
1 files changed, 35 insertions, 12 deletions
diff --git a/engines/bladerunner/outtake.cpp b/engines/bladerunner/outtake.cpp
index fc610b20e9..8d7b92ad9d 100644
--- a/engines/bladerunner/outtake.cpp
+++ b/engines/bladerunner/outtake.cpp
@@ -23,6 +23,7 @@
#include "bladerunner/outtake.h"
#include "bladerunner/bladerunner.h"
+#include "bladerunner/chapters.h"
#include "bladerunner/subtitles.h"
#include "bladerunner/vqa_player.h"
@@ -42,11 +43,19 @@ OuttakePlayer::~OuttakePlayer() {
}
void OuttakePlayer::play(const Common::String &name, bool noLocalization, int container) {
+ Common::String oldOuttakeFile = Common::String::format("OUTTAKE%d.MIX", _vm->_chapters->currentResourceId());
+ Common::String newOuttakeFile = Common::String::format("OUTTAKE%d.MIX", container);
+
if (container > 0) {
- debug("OuttakePlayer::play TODO");
- return;
+ if (_vm->isArchiveOpen(oldOuttakeFile)) {
+ _vm->closeArchive(oldOuttakeFile);
+ }
+
+ _vm->openArchive(newOuttakeFile);
}
+ _vm->playerLosesControl();
+
Common::String resName = name;
if (!noLocalization) {
resName = resName + "_" + _vm->_languageCode;
@@ -54,18 +63,18 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co
Common::String resNameNoVQASuffix = resName;
resName = resName + ".VQA";
- VQAPlayer vqa_player(_vm, &_surfaceVideo, resName); // in original game _surfaceFront is used here, but for proper subtitles rendering we need separate surface
+ _vm->_mixer->stopAll();
- vqa_player.open();
+ VQAPlayer vqaPlayer(_vm, &_surfaceVideo, resName); // in original game _surfaceFront is used here, but for proper subtitles rendering we need separate surface
+ vqaPlayer.open();
- _vm->_mixer->stopAll();
- while (!_vm->shouldQuit()) {
- Common::Event event;
- while (_vm->_system->getEventManager()->pollEvent(event))
- if (event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE)
- return;
+ _vm->_vqaIsPlaying = true;
+ _vm->_vqaStopIsRequested = false;
+
+ while (!_vm->_vqaStopIsRequested && !_vm->shouldQuit()) {
+ _vm->handleEvents();
- int frame = vqa_player.update();
+ int frame = vqaPlayer.update();
blit(_surfaceVideo, _vm->_surfaceFront); // This helps to make subtitles disappear properly, if the video is rendered in separate surface and then pushed to the front surface
if (frame == -3) { // end of video
break;
@@ -80,7 +89,21 @@ void OuttakePlayer::play(const Common::String &name, bool noLocalization, int co
_vm->_system->delayMillis(10);
}
- // TODO: scene video is played fast after end of outtake, fix it (visible in tb07)
+ _vm->_vqaIsPlaying = false;
+ _vm->_vqaStopIsRequested = false;
+ vqaPlayer.close();
+
+ // TODO: scene video is played fast after end of outtake - visible in tb07
+
+ _vm->playerGainsControl();
+
+ if (container > 0) {
+ if (_vm->isArchiveOpen(newOuttakeFile)) {
+ _vm->closeArchive(newOuttakeFile);
+ }
+
+ _vm->openArchive(oldOuttakeFile);
+ }
}
} // End of namespace BladeRunner