aboutsummaryrefslogtreecommitdiff
path: root/sky/disk.cpp
diff options
context:
space:
mode:
authorJoost Peters2005-02-11 11:14:33 +0000
committerJoost Peters2005-02-11 11:14:33 +0000
commit6565ed2871601a2954986b6c25bcad980109b35c (patch)
treeb06f7d5ec54ba09848834a94b9f44ee9b83c31c8 /sky/disk.cpp
parent420712fb283f5cb20471894b81f0a2392e583b56 (diff)
downloadscummvm-rg350-6565ed2871601a2954986b6c25bcad980109b35c.tar.gz
scummvm-rg350-6565ed2871601a2954986b6c25bcad980109b35c.tar.bz2
scummvm-rg350-6565ed2871601a2954986b6c25bcad980109b35c.zip
Make rnc unpacker a member of Disk class so it reuses the same object, and change rnc code to only build the crc table once instead of for every unpack operation.
This should speed it up a bit. svn-id: r16771
Diffstat (limited to 'sky/disk.cpp')
-rw-r--r--sky/disk.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/sky/disk.cpp b/sky/disk.cpp
index 020368df60..f41a27a906 100644
--- a/sky/disk.cpp
+++ b/sky/disk.cpp
@@ -153,11 +153,10 @@ uint8 *Disk::loadFile(uint16 fileNr) {
uint8 *uncompDest = (uint8 *)malloc(decompSize);
- RncDecoder rncDecoder;
int32 unpackLen;
if ((fileFlags >> 22) & 0x1) { //do we include the header?
// don't return the file's header
- unpackLen = rncDecoder.unpackM1(fileDest + sizeof(dataFileHeader), uncompDest, 0);
+ unpackLen = _rncDecoder.unpackM1(fileDest + sizeof(dataFileHeader), uncompDest, 0);
} else {
#ifdef SCUMM_BIG_ENDIAN
// Convert dataFileHeader to BE (it only consists of 16 bit words)
@@ -166,7 +165,7 @@ uint8 *Disk::loadFile(uint16 fileNr) {
*(headPtr + i) = READ_LE_UINT16(headPtr + i);
#endif
memcpy(uncompDest, fileDest, sizeof(dataFileHeader));
- unpackLen = rncDecoder.unpackM1(fileDest + sizeof(dataFileHeader), uncompDest + sizeof(dataFileHeader), 0);
+ unpackLen = _rncDecoder.unpackM1(fileDest + sizeof(dataFileHeader), uncompDest + sizeof(dataFileHeader), 0);
if (unpackLen)
unpackLen += sizeof(dataFileHeader);
}