aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v2.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-06-07 00:21:54 +0200
committerSven Hesse2012-06-07 00:29:46 +0200
commit8c3d2fc7410ab3f55735f6a78dadbeec23c59b6c (patch)
tree34be79ca8a1f99384a79fc39ee8ad25f8e343e0e /engines/gob/inter_v2.cpp
parent4288edd5236cb0c232dea0bd818779539e9bc6f2 (diff)
downloadscummvm-rg350-8c3d2fc7410ab3f55735f6a78dadbeec23c59b6c.tar.gz
scummvm-rg350-8c3d2fc7410ab3f55735f6a78dadbeec23c59b6c.tar.bz2
scummvm-rg350-8c3d2fc7410ab3f55735f6a78dadbeec23c59b6c.zip
GOB: Add a way to reopen currently opened IMD/VMD videos
This is a workaround for how Lost in Time behaves in combination with changes I made to the DataIO code for running Urban Runner on low-memory devices. Urban Runner's intro are far to big to have them copied into memory for these devices, so I made the DataIO code return a SafeSeekableSubReadStream into the opened archive stream instead. Unfortunately, Lost in Time might not close a video file when it closes the data file which it was originally in, especially when loading a saved game. Since the video player needs to be able to gaplessly continue a video and there does not, by itself, close the video if not requested by the scripts, this leads to reading out of an already closed stream in certain cases. So, to worka round this issues, the video player tries to reopen each currently opened video after a data archive was closed, to make sure that that video is still available. If not, the video is closed.
Diffstat (limited to 'engines/gob/inter_v2.cpp')
-rw-r--r--engines/gob/inter_v2.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 1e5b7bb24c..54f6a1acc1 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1002,6 +1002,10 @@ void Inter_v2::o2_openItk() {
void Inter_v2::o2_closeItk() {
_vm->_dataIO->closeArchive(false);
+
+ // NOTE: Lost in Time might close a data file without explicitely closing a video in it.
+ // So we make sure that all open videos are still available.
+ _vm->_vidPlayer->reopenAll();
}
void Inter_v2::o2_setImdFrontSurf() {