diff options
Diffstat (limited to 'engines/parallaction/archive.cpp')
-rw-r--r-- | engines/parallaction/archive.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/engines/parallaction/archive.cpp b/engines/parallaction/archive.cpp index 5fb69cb852..9d3aced9eb 100644 --- a/engines/parallaction/archive.cpp +++ b/engines/parallaction/archive.cpp @@ -27,6 +27,9 @@ namespace Parallaction { +Archive::Archive() { + resetArchivedFile(); +} void Archive::open(const char *file) { debugC(1, kDebugDisk, "open archive '%s'", file); @@ -67,11 +70,14 @@ void Archive::close() { if (!_archive.isOpen()) return; + resetArchivedFile(); + _archive.close(); } bool Archive::openArchivedFile(const char *name) { + resetArchivedFile(); uint16 i = 0; for ( ; i < MAX_ARCHIVE_ENTRIES; i++) { @@ -93,26 +99,23 @@ bool Archive::openArchivedFile(const char *name) { return true; } - -void Archive::closeArchivedFile() { +void Archive::resetArchivedFile() { _file = false; _fileIndex = 0; _fileCursor = 0; _fileOffset = 0; _fileEndOffset = 0; - return; } +void Archive::closeArchivedFile() { + resetArchivedFile(); +} -uint16 Archive::getArchivedFileLength(const char *name) { -// printf("getArchivedFileLength(%s)\n", name); - for (uint16 i = 0; i < MAX_ARCHIVE_ENTRIES; i++) { - if (!scumm_stricmp(_archiveDir[i], name)) - return _archiveLenghts[i]; - } +uint16 Archive::getArchivedFileLength() { +// printf("getArchivedFileLength(%s)\n", name); - return 0; + return (_file == true ? _fileEndOffset - _fileOffset : 0); } |