aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/file-manager.cpp5
-rw-r--r--engines/hdb/file-manager.h2
2 files changed, 5 insertions, 2 deletions
diff --git a/engines/hdb/file-manager.cpp b/engines/hdb/file-manager.cpp
index e38d44f40e..bc751749f5 100644
--- a/engines/hdb/file-manager.cpp
+++ b/engines/hdb/file-manager.cpp
@@ -96,7 +96,7 @@ void FileMan::seek(int32 offset, int flag) {
_mpcFile->seek(offset, flag);
}
-Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType type) {
+Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType type, int *length) {
Common::String fileString;
MPCEntry *file = NULL;
@@ -135,6 +135,9 @@ Common::SeekableReadStream *FileMan::findFirstData(const char *string, DataType
_mpcFile->read(buffer, file->length);
+ if (length)
+ *length = file->ulength;
+
// Return buffer wrapped in a MemoryReadStream, automatically
// uncompressed if it is zlib-compressed
return Common::wrapCompressedReadStream(new Common::MemoryReadStream(buffer, file->length, DisposeAfterUse::NO), file->length);
diff --git a/engines/hdb/file-manager.h b/engines/hdb/file-manager.h
index 62caaadf84..f3a65bb1b4 100644
--- a/engines/hdb/file-manager.h
+++ b/engines/hdb/file-manager.h
@@ -72,7 +72,7 @@ public:
void closeMPC();
void seek(int32 offset, int flag);
- Common::SeekableReadStream *findFirstData(const char *string, DataType type);
+ Common::SeekableReadStream *findFirstData(const char *string, DataType type, int *length = NULL);
int32 getLength(const char *string, DataType type);
int getCount(const char *subString, DataType type);
Common::Array<const char *> *findFiles(const char *string, DataType type);