From 9a2785bc3b3829688ffceccfc6563ed4c69cdc49 Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Tue, 14 Jul 2009 15:02:17 +0000 Subject: Partially fix automatic restarting of AGI games (Addresses bug #2798797 ('AGI: larry 1 doesn't restart after dying') but doesn't fully fix it. There seems to be more to the problem still. Automatic restarting after dying of an STD doesn't take away the STD-condition and Larry continues to die in a loop). svn-id: r42482 --- engines/agi/op_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/agi') diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 97255097bc..7012174c20 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1256,7 +1256,7 @@ cmd(restart_game) { int sel; g_sound->stopSound(); - sel = g_agi->getflag(fAutoRestart) ? 1 : + sel = g_agi->getflag(fAutoRestart) ? 0 : g_agi->selectionBox(" Restart game, or continue? \n\n\n", buttons); if (sel == 0) { -- cgit v1.2.3 From 3a3b71622ae653588ca3f1673e5674a789c6d46b Mon Sep 17 00:00:00 2001 From: Kari Salminen Date: Tue, 14 Jul 2009 23:03:40 +0000 Subject: Remove ioFailed() usage from AGI engine. svn-id: r42495 --- engines/agi/graphics.cpp | 2 +- engines/agi/sound.cpp | 8 ++++---- engines/agi/wagparser.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/agi') diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index ad2c264184..3461bb473e 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -846,7 +846,7 @@ void GfxMgr::setAGIPal(int p0) { //Chunks4-7 are duplicates of chunks0-3 - if (agipal.ioFailed()) { + if (agipal.eos() || agipal.err()) { warning("Couldn't read AGIPAL palette from '%s'. Not changing palette", filename); return; } diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp index fb73c6b71f..5a39b663a5 100644 --- a/engines/agi/sound.cpp +++ b/engines/agi/sound.cpp @@ -133,7 +133,7 @@ bool IIgsEnvelope::read(Common::SeekableReadStream &stream) { seg[segNum].inc = stream.readUint16LE(); } - return !stream.ioFailed(); + return !(stream.eos() || stream.err()); } /** Reads an Apple IIGS wave information structure from the given stream. */ @@ -154,7 +154,7 @@ bool IIgsWaveInfo::read(Common::SeekableReadStream &stream, bool ignoreAddr) { if (ignoreAddr) addr = 0; - return !stream.ioFailed(); + return !(stream.eos() || stream.err()); } bool IIgsWaveInfo::finalize(Common::SeekableReadStream &uint8Wave) { @@ -219,7 +219,7 @@ bool IIgsInstrumentHeader::read(Common::SeekableReadStream &stream, bool ignoreA byte wac = stream.readByte(); // Read A wave count byte wbc = stream.readByte(); // Read B wave count oscList.read(stream, wac, ignoreAddr); // Read the oscillators - return (wac == wbc) && !stream.ioFailed(); // A and B wave counts must match + return (wac == wbc) && !(stream.eos() || stream.err()); // A and B wave counts must match } bool IIgsInstrumentHeader::finalize(Common::SeekableReadStream &uint8Wave) { @@ -1158,7 +1158,7 @@ bool SoundMgr::convertWave(Common::SeekableReadStream &source, int8 *dest, uint // Convert the wave from 8-bit unsigned to 8-bit signed format for (uint i = 0; i < length; i++) dest[i] = (int8) ((int) source.readByte() - 128); - return !source.ioFailed(); + return !(source.eos() || source.err()); } bool IIgsSoundMgr::loadWaveFile(const Common::FSNode &wavePath, const IIgsExeInfo &exeInfo) { diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp index e6ed5345e0..d243439dff 100644 --- a/engines/agi/wagparser.cpp +++ b/engines/agi/wagparser.cpp @@ -70,7 +70,7 @@ bool WagProperty::read(Common::SeekableReadStream &stream) { _propNum = stream.readByte(); _propSize = stream.readUint16LE(); - if (stream.ioFailed()) { // Check that we got the whole header + if (stream.eos() || stream.err()) { // Check that we got the whole header _readOk = false; return _readOk; } -- cgit v1.2.3