diff options
Diffstat (limited to 'engines/bladerunner')
-rw-r--r-- | engines/bladerunner/slice_animations.cpp | 12 | ||||
-rw-r--r-- | engines/bladerunner/slice_animations.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp index 411e6a07a1..f452947f2f 100644 --- a/engines/bladerunner/slice_animations.cpp +++ b/engines/bladerunner/slice_animations.cpp @@ -103,13 +103,15 @@ bool SliceAnimations::openFrames(int fileNumber) { } } + warning("opening: %d", fileNumber); + if (_framesPageFile._fileNumber == 0) // HDFRAMES.DAT return true; if (_framesPageFile._fileNumber == fileNumber) return true; - _framesPageFile._fileNumber = fileNumber; + _framesPageFile.close(); if (fileNumber == 1 && _framesPageFile.open("CDFRAMES.DAT")) // For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT return true; @@ -139,11 +141,17 @@ bool SliceAnimations::PageFile::open(const Common::String &name) { _pageOffsets[pageNumber] = dataOffset + i * _sliceAnimations->_pageSize; } - debug("PageFile::Open: page file \"%s\" opened with %d pages", name.c_str(), pageCount); + debug(5, "PageFile::Open: page file \"%s\" opened with %d pages", name.c_str(), pageCount); return true; } +void SliceAnimations::PageFile::close() { + if (_file.isOpen()) { + _file.close(); + } +} + void *SliceAnimations::PageFile::loadPage(uint32 pageNumber) { if (_pageOffsets[pageNumber] == -1) return nullptr; diff --git a/engines/bladerunner/slice_animations.h b/engines/bladerunner/slice_animations.h index eafba1bb14..0732e596ea 100644 --- a/engines/bladerunner/slice_animations.h +++ b/engines/bladerunner/slice_animations.h @@ -72,6 +72,7 @@ class SliceAnimations { PageFile(SliceAnimations *sliceAnimations) : _sliceAnimations(sliceAnimations), _fileNumber(-1) {} bool open(const Common::String &name); + void close(); void *loadPage(uint32 page); }; |