diff options
author | Max Horn | 2009-12-15 08:18:57 +0000 |
---|---|---|
committer | Max Horn | 2009-12-15 08:18:57 +0000 |
commit | f692015301e6122b7d071a0ce52c81faa6c3b69f (patch) | |
tree | e72e430a064eb6e8cf70610cb0e8e7154a9ee57d /engines/tinsel | |
parent | eb9b31782f094578d0d824962a5660d697e71486 (diff) | |
download | scummvm-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/tinsel')
-rw-r--r-- | engines/tinsel/handle.cpp | 2 | ||||
-rw-r--r-- | engines/tinsel/music.cpp | 4 | ||||
-rw-r--r-- | engines/tinsel/pcode.cpp | 2 | ||||
-rw-r--r-- | engines/tinsel/saveload.cpp | 2 | ||||
-rw-r--r-- | engines/tinsel/sound.cpp | 14 | ||||
-rw-r--r-- | engines/tinsel/strres.cpp | 2 |
6 files changed, 13 insertions, 13 deletions
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp index 82d77a2904..9366d06be6 100644 --- a/engines/tinsel/handle.cpp +++ b/engines/tinsel/handle.cpp @@ -133,7 +133,7 @@ void SetupHandleTable() { handleTable[i].flags2 = t2Flag ? f.readUint32LE() : 0; } - if (f.ioFailed()) { + if (f.eos() || f.err()) { // index file is corrupt error(FILE_IS_CORRUPT, (TinselV1PSX? PSX_INDEX_FILENAME : INDEX_FILENAME)); } diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index a231c42013..6a50295afd 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -370,7 +370,7 @@ void OpenMidiFiles() { // gen length of the largest sequence midiBuffer.size = midiStream.readUint32LE(); - if (midiStream.ioFailed()) + if (midiStream.eos() || midiStream.err()) error(FILE_IS_CORRUPT, MIDI_FILE); if (midiBuffer.size) { @@ -860,7 +860,7 @@ bool PCMMusicPlayer::getNextChunk() { error(CANNOT_FIND_FILE, _fileName); file.seek(sampleOffset); - if (file.ioFailed() || (uint32)file.pos() != sampleOffset) + if (file.eos() || file.err() || (uint32)file.pos() != sampleOffset) error(FILE_IS_CORRUPT, _fileName); buffer = (byte *) malloc(sampleCLength); diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp index 29f1753249..9cdec86d8f 100644 --- a/engines/tinsel/pcode.cpp +++ b/engines/tinsel/pcode.cpp @@ -406,7 +406,7 @@ void RegisterGlobals(int num) { for (int i = 0; i < length; ++i) pGlobals[i] = f.readSint32LE(); - if (f.ioFailed()) + if (f.eos() || f.err()) error(FILE_IS_CORRUPT, GLOBALS_FILENAME); f.close(); diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp index 0e529cb3cc..6072bbca12 100644 --- a/engines/tinsel/saveload.cpp +++ b/engines/tinsel/saveload.cpp @@ -467,7 +467,7 @@ static bool DoRestore() { if (id != (uint32)0xFEEDFACE) error("Incompatible saved game"); - bool failed = f->ioFailed(); + bool failed = (f->eos() || f->err()); delete f; diff --git a/engines/tinsel/sound.cpp b/engines/tinsel/sound.cpp index d8ed39006a..ece054138a 100644 --- a/engines/tinsel/sound.cpp +++ b/engines/tinsel/sound.cpp @@ -98,12 +98,12 @@ bool SoundManager::playSample(int id, Audio::Mixer::SoundType type, Audio::Sound // move to correct position in the sample file _sampleStream.seek(dwSampleIndex); - if (_sampleStream.ioFailed() || (uint32)_sampleStream.pos() != dwSampleIndex) + if (_sampleStream.eos() || _sampleStream.err() || (uint32)_sampleStream.pos() != dwSampleIndex) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); // read the length of the sample uint32 sampleLen = _sampleStream.readUint32LE(); - if (_sampleStream.ioFailed()) + if (_sampleStream.eos() || _sampleStream.err()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); if (TinselV1PSX) { @@ -244,12 +244,12 @@ bool SoundManager::playSample(int id, int sub, bool bLooped, int x, int y, int p // move to correct position in the sample file _sampleStream.seek(dwSampleIndex); - if (_sampleStream.ioFailed() || (uint32)_sampleStream.pos() != dwSampleIndex) + if (_sampleStream.eos() || _sampleStream.err() || (uint32)_sampleStream.pos() != dwSampleIndex) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); // read the length of the sample uint32 sampleLen = _sampleStream.readUint32LE(); - if (_sampleStream.ioFailed()) + if (_sampleStream.eos() || _sampleStream.err()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); if (sampleLen & 0x80000000) { @@ -263,11 +263,11 @@ bool SoundManager::playSample(int id, int sub, bool bLooped, int x, int y, int p for (int32 i = 0; i < sub; i++) { sampleLen = _sampleStream.readUint32LE(); _sampleStream.skip(sampleLen); - if (_sampleStream.ioFailed()) + if (_sampleStream.eos() || _sampleStream.err()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); } sampleLen = _sampleStream.readUint32LE(); - if (_sampleStream.ioFailed()) + if (_sampleStream.eos() || _sampleStream.err()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); } @@ -553,7 +553,7 @@ void SoundManager::openSampleFiles() { /* // gen length of the largest sample sampleBuffer.size = _sampleStream.readUint32LE(); - if (_sampleStream.ioFailed()) + if (_sampleStream.eos() || _sampleStream.err()) error(FILE_IS_CORRUPT, _vm->getSampleFile(sampleLanguage)); */ } diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp index 570c30d84c..8f9f72f446 100644 --- a/engines/tinsel/strres.cpp +++ b/engines/tinsel/strres.cpp @@ -112,7 +112,7 @@ void ChangeLanguage(LANGUAGE newLang) { // first long is the filelength and for uncompressed files it is the chunk // identifier textLen = f.readUint32LE(); - if (f.ioFailed()) + if (f.eos() || f.err()) error(FILE_IS_CORRUPT, _vm->getTextFile(newLang)); if (textLen == CHUNK_STRING || textLen == CHUNK_MBSTRING) { |