[Scummvm-git-logs] scummvm master -> 0018fa34341a12d5d51390e25aca57a237f152ba
sdelamarre
noreply at scummvm.org
Sat Aug 19 15:22:27 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0018fa3434 GOB: Use buffered stream for chunk unpacking
Commit: 0018fa34341a12d5d51390e25aca57a237f152ba
https://github.com/scummvm/scummvm/commit/0018fa34341a12d5d51390e25aca57a237f152ba
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-08-19T23:22:23+08:00
Commit Message:
GOB: Use buffered stream for chunk unpacking
This leads to a massive speedup on atari: between the credits screen and
the actual game loading takes 3m30s (!), with this change it takes 5s (!!!)
Changed paths:
engines/gob/dataio.cpp
diff --git a/engines/gob/dataio.cpp b/engines/gob/dataio.cpp
index f2def479277..1644a7ee037 100644
--- a/engines/gob/dataio.cpp
+++ b/engines/gob/dataio.cpp
@@ -21,6 +21,7 @@
#include "common/endian.h"
#include "common/types.h"
+#include "common/bufferedstream.h"
#include "common/memstream.h"
#include "common/substream.h"
@@ -418,12 +419,15 @@ Common::SeekableReadStream *DataIO::getFile(File &file) {
Common::SeekableReadStream *rawData =
new Common::SafeSeekableSubReadStream(&file.archive->file, file.offset, file.offset + file.size);
+ Common::SeekableReadStream *bufferedRawData =
+ Common::wrapBufferedSeekableReadStream(rawData, 4096, DisposeAfterUse::NO);
+
if (file.compression == 0)
- return rawData;
+ return bufferedRawData;
- Common::SeekableReadStream *unpackedData = unpack(*rawData, file.compression);
+ Common::SeekableReadStream *unpackedData = unpack(*bufferedRawData, file.compression);
- delete rawData;
+ delete bufferedRawData;
return unpackedData;
}
More information about the Scummvm-git-logs
mailing list