diff options
author | Willem Jan Palenstijn | 2009-07-20 20:55:28 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-07-20 20:55:28 +0000 |
commit | f9208f1bb0e083a4e7ebc30051599cdbfbcf9d26 (patch) | |
tree | 459333eb2d5a132a7b921214f9c21c0f803752f9 /engines/scumm/resource_v4.cpp | |
parent | b40dc424b3ec2121b6cc62f3648d014f25583256 (diff) | |
download | scummvm-rg350-f9208f1bb0e083a4e7ebc30051599cdbfbcf9d26.tar.gz scummvm-rg350-f9208f1bb0e083a4e7ebc30051599cdbfbcf9d26.tar.bz2 scummvm-rg350-f9208f1bb0e083a4e7ebc30051599cdbfbcf9d26.zip |
Make ScummFile::eos() consistent with Stream::eos().
Remove usage of ioFailed from SCUMM engine.
Fix reading up to the end of a SCUMM SubFile.
This hopefully fixes #2820957.
svn-id: r42632
Diffstat (limited to 'engines/scumm/resource_v4.cpp')
-rw-r--r-- | engines/scumm/resource_v4.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/engines/scumm/resource_v4.cpp b/engines/scumm/resource_v4.cpp index 28e0fb05b5..75858f7b42 100644 --- a/engines/scumm/resource_v4.cpp +++ b/engines/scumm/resource_v4.cpp @@ -61,11 +61,11 @@ void ScummEngine_v4::readIndexFile() { closeRoom(); openRoom(0); - while (!_fileHandle->eos()) { + while (true) { // Figure out the sizes of various resources itemsize = _fileHandle->readUint32LE(); blocktype = _fileHandle->readUint16LE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; switch (blocktype) { @@ -95,16 +95,15 @@ void ScummEngine_v4::readIndexFile() { _fileHandle->seek(itemsize - 8, SEEK_CUR); } - _fileHandle->clearIOFailed(); _fileHandle->seek(0, SEEK_SET); readMAXS(0); allocateArrays(); - while (1) { + while (true) { itemsize = _fileHandle->readUint32LE(); - if (_fileHandle->ioFailed()) + if (_fileHandle->eos() || _fileHandle->err()) break; blocktype = _fileHandle->readUint16LE(); |