From 925f41b9c4055d39498c61c8f22388176ee25cce Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 20 Jun 2013 17:21:37 -0400 Subject: FULLPIPE: Made MfcArchive work with both files and archives --- engines/fullpipe/utils.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'engines/fullpipe/utils.cpp') diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp index 26c03ceeea..468d03b6f9 100644 --- a/engines/fullpipe/utils.cpp +++ b/engines/fullpipe/utils.cpp @@ -30,12 +30,14 @@ namespace Fullpipe { bool CObject::loadFile(const char *fname) { - MfcArchive file; + Common::File file; if (!file.open(fname)) return false; - return load(file); + MfcArchive archive(&file); + + return load(archive); } bool CObList::load(MfcArchive &file) { @@ -201,7 +203,7 @@ static CObject *createObject(int objectId) { return 0; } -MfcArchive::MfcArchive() { +MfcArchive::MfcArchive(Common::SeekableReadStream *stream) { for (int i = 0; classMap[i].name; i++) { _classMap[classMap[i].name] = classMap[i].id; } @@ -209,6 +211,8 @@ MfcArchive::MfcArchive() { _lastIndex = 1; _level = 0; + _stream = stream; + _objectMap.push_back(0); _objectIdMap.push_back(kNullObject); } -- cgit v1.2.3