aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/barchive.cpp
diff options
context:
space:
mode:
authorDenis Kasak2009-07-02 10:39:51 +0000
committerDenis Kasak2009-07-02 10:39:51 +0000
commit35a677fb08402b5a9fd07366d60651bcc2f598ce (patch)
tree9d3d089804defa9d353dc47a654e23d06f284f62 /engines/draci/barchive.cpp
parentfed2281125f862f6f0356d8d40642a90ce772394 (diff)
downloadscummvm-rg350-35a677fb08402b5a9fd07366d60651bcc2f598ce.tar.gz
scummvm-rg350-35a677fb08402b5a9fd07366d60651bcc2f598ce.tar.bz2
scummvm-rg350-35a677fb08402b5a9fd07366d60651bcc2f598ce.zip
Added BArchive::clearCache() method for clearing the data cache of opened files.
svn-id: r42019
Diffstat (limited to 'engines/draci/barchive.cpp')
-rw-r--r--engines/draci/barchive.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/draci/barchive.cpp b/engines/draci/barchive.cpp
index 4b9a1d9807..c6d6354716 100644
--- a/engines/draci/barchive.cpp
+++ b/engines/draci/barchive.cpp
@@ -377,6 +377,18 @@ BAFile *BArchive::loadFileDFW(unsigned int i) const {
return _files + i;
}
+
+/**
+ * Clears the cache of the open files inside the archive without closing it.
+ * If the files are subsequently accessed, they are read from the disk.
+ */
+void BArchive::clearCache() {
+
+ // Delete all cached data
+ for (unsigned int i = 0; i < _fileCount; ++i) {
+ _files[i].closeFile();
+ }
+}
BAFile *BArchive::operator[](unsigned int i) const {