aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2009-12-15 08:18:57 +0000
committerMax Horn2009-12-15 08:18:57 +0000
commitf692015301e6122b7d071a0ce52c81faa6c3b69f (patch)
treee72e430a064eb6e8cf70610cb0e8e7154a9ee57d /engines/sci
parenteb9b31782f094578d0d824962a5660d697e71486 (diff)
downloadscummvm-rg350-f692015301e6122b7d071a0ce52c81faa6c3b69f.tar.gz
scummvm-rg350-f692015301e6122b7d071a0ce52c81faa6c3b69f.tar.bz2
scummvm-rg350-f692015301e6122b7d071a0ce52c81faa6c3b69f.zip
Got rid of ReadStream::ioFailed()
svn-id: r46379
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/decompressor.cpp4
-rw-r--r--engines/sci/resource.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp
index 4731c87427..c213fca1ed 100644
--- a/engines/sci/decompressor.cpp
+++ b/engines/sci/decompressor.cpp
@@ -36,13 +36,13 @@
namespace Sci {
int Decompressor::unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
uint32 chunk;
- while (nPacked && !src->ioFailed()) {
+ while (nPacked && !(src->eos() || src->err())) {
chunk = MIN<uint32>(1024, nPacked);
src->read(dest, chunk);
nPacked -= chunk;
dest += chunk;
}
- return src->ioFailed() ? 1 : 0;
+ return (src->eos() || src->err()) ? 1 : 0;
}
void Decompressor::init(Common::ReadStream *src, byte *dest, uint32 nPacked,
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index f610252f27..1a8f819926 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -1016,7 +1016,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
id = file.readUint16LE();
offset = file.readUint32LE();
- if (file.ioFailed()) {
+ if (file.eos() || file.err()) {
warning("Error while reading %s", map->location_name.c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
@@ -1095,7 +1095,7 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) {
// in SCI32 it's a plain offset
}
}
- if (file.ioFailed()) {
+ if (file.eos() || file.err()) {
warning("Error while reading %s", map->location_name.c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
@@ -1278,7 +1278,7 @@ int ResourceManager::readAudioMapSCI1(ResourceSource *map, bool unload) {
uint32 offset = file.readUint32LE();
uint32 size = file.readUint32LE();
- if (file.ioFailed()) {
+ if (file.eos() || file.err()) {
warning("Error while reading %s", map->location_name.c_str());
return SCI_ERROR_RESMAP_NOT_FOUND;
}
@@ -1405,7 +1405,7 @@ int ResourceManager::readResourceInfo(Resource *res, Common::File *file,
return SCI_ERROR_INVALID_RESMAP_ENTRY;
}
// check if there were errors while reading
- if (file->ioFailed())
+ if ((file->eos() || file->err()))
return SCI_ERROR_IO_ERROR;
res->id = ResourceId(type, number);
res->size = szUnpacked;