aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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