aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/inter_v2.cpp')
-rw-r--r--engines/gob/inter_v2.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp
index 58970d9fcd..23abc38f6c 100644
--- a/engines/gob/inter_v2.cpp
+++ b/engines/gob/inter_v2.cpp
@@ -1903,25 +1903,27 @@ bool Inter_v2::o2_readData(OpFuncParams &params) {
if (handle < 0)
return false;
+ DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
+
_vm->_draw->animateCursor(4);
if (offset < 0)
- _vm->_dataIO->seekData(handle, -offset - 1, SEEK_END);
+ stream->seek(-offset - 1, SEEK_END);
else
- _vm->_dataIO->seekData(handle, offset, SEEK_SET);
+ stream->seek(offset);
if (((dataVar >> 2) == 59) && (size == 4)) {
- WRITE_VAR(59, _vm->_dataIO->readUint32(handle));
+ WRITE_VAR(59, stream->readUint32LE());
// The scripts in some versions divide through 256^3 then,
// effectively doing a LE->BE conversion
if ((_vm->_platform != Common::kPlatformPC) && (VAR(59) < 256))
WRITE_VAR(59, SWAP_BYTES_32(VAR(59)));
} else
- retSize = _vm->_dataIO->readData(handle, buf, size);
+ retSize = stream->read(buf, size);
if (retSize == size)
WRITE_VAR(1, 0);
- _vm->_dataIO->closeData(handle);
+ delete stream;
return false;
}