diff options
author | Eugene Sandulenko | 2018-04-01 14:17:06 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2018-04-01 14:17:48 +0200 |
commit | b277e795aa3157511a1a3d3804f25d233c77e7f8 (patch) | |
tree | a4cd7f19e7e86a4c38a3c0d9c60a2e17c59426ee /engines/bladerunner/slice_animations.cpp | |
parent | 05adb749c4ab3f6a4447da04355af10a9c9b52c0 (diff) | |
download | scummvm-rg350-b277e795aa3157511a1a3d3804f25d233c77e7f8.tar.gz scummvm-rg350-b277e795aa3157511a1a3d3804f25d233c77e7f8.tar.bz2 scummvm-rg350-b277e795aa3157511a1a3d3804f25d233c77e7f8.zip |
BLADERUNNER: Support for CDFRAMES.DAT
Rename CDFRAMES.DAT into CDFRAMES1.DAT, CDFRAMES2.DAT etc
Diffstat (limited to 'engines/bladerunner/slice_animations.cpp')
-rw-r--r-- | engines/bladerunner/slice_animations.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/engines/bladerunner/slice_animations.cpp b/engines/bladerunner/slice_animations.cpp index 181b11d9f1..411e6a07a1 100644 --- a/engines/bladerunner/slice_animations.cpp +++ b/engines/bladerunner/slice_animations.cpp @@ -93,8 +93,28 @@ bool SliceAnimations::openCoreAnim() { return _coreAnimPageFile.open("COREANIM.DAT"); } -bool SliceAnimations::openHDFrames() { - return _framesPageFile.open("HDFRAMES.DAT"); +bool SliceAnimations::openFrames(int fileNumber) { + if (_framesPageFile._fileNumber == -1) { // Running for the first time, need to probe + // First, try HDFRAMES.DAT + if (_framesPageFile.open("HDFRAMES.DAT")) { + _framesPageFile._fileNumber = 0; + + return true; + } + } + + if (_framesPageFile._fileNumber == 0) // HDFRAMES.DAT + return true; + + if (_framesPageFile._fileNumber == fileNumber) + return true; + + _framesPageFile._fileNumber = fileNumber; + + if (fileNumber == 1 && _framesPageFile.open("CDFRAMES.DAT")) // For Chapter1 we try both CDFRAMES.DAT and CDFRAMES1.DAT + return true; + + return _framesPageFile.open(Common::String::format("CDFRAMES%d.DAT", fileNumber)); } bool SliceAnimations::PageFile::open(const Common::String &name) { @@ -119,7 +139,7 @@ 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("PageFile::Open: page file \"%s\" opened with %d pages", name.c_str(), pageCount); return true; } |