[Scummvm-cvs-logs] SF.net SVN: scummvm:[43671] scummvm/trunk/engines/groovie/vdx.cpp
scott_t at users.sourceforge.net
scott_t at users.sourceforge.net
Sun Aug 23 16:54:56 CEST 2009
Revision: 43671
http://scummvm.svn.sourceforge.net/scummvm/?rev=43671&view=rev
Author: scott_t
Date: 2009-08-23 14:54:56 +0000 (Sun, 23 Aug 2009)
Log Message:
-----------
T7G: Load VDX frame chunks into a MemoryStream rather than streaming straight from disk (Fix #2839528)
Modified Paths:
--------------
scummvm/trunk/engines/groovie/vdx.cpp
Modified: scummvm/trunk/engines/groovie/vdx.cpp
===================================================================
--- scummvm/trunk/engines/groovie/vdx.cpp 2009-08-23 14:51:04 UTC (rev 43670)
+++ scummvm/trunk/engines/groovie/vdx.cpp 2009-08-23 14:54:56 UTC (rev 43671)
@@ -118,6 +118,7 @@
bool VDXPlayer::playFrameInternal() {
byte currRes = 0x80;
+ Common::ReadStream *vdxData = 0;
while (!_file->eos() && currRes == 0x80) {
currRes = _file->readByte();
@@ -130,7 +131,9 @@
uint8 lengthbits = _file->readByte();
// Read the chunk data and decompress if needed
- Common::ReadStream *vdxData = new Common::SubReadStream(_file, compSize);
+ if (compSize)
+ vdxData = _file->readStream(compSize);
+
if (lengthmask && lengthbits) {
Common::ReadStream *decompData = new LzssReadStream(vdxData, lengthmask, lengthbits);
delete vdxData;
@@ -157,7 +160,9 @@
default:
error("Groovie::VDX: Invalid resource type: %d", currRes);
}
- delete vdxData;
+ if (vdxData)
+ delete vdxData;
+ vdxData = 0;
}
// Wait until the current frame can be shown
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list