diff options
author | Joost Peters | 2005-02-11 11:14:33 +0000 |
---|---|---|
committer | Joost Peters | 2005-02-11 11:14:33 +0000 |
commit | 6565ed2871601a2954986b6c25bcad980109b35c (patch) | |
tree | b06f7d5ec54ba09848834a94b9f44ee9b83c31c8 /sky/rnc_deco.cpp | |
parent | 420712fb283f5cb20471894b81f0a2392e583b56 (diff) | |
download | scummvm-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/rnc_deco.cpp')
-rw-r--r-- | sky/rnc_deco.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sky/rnc_deco.cpp b/sky/rnc_deco.cpp index d900939488..24db371b1b 100644 --- a/sky/rnc_deco.cpp +++ b/sky/rnc_deco.cpp @@ -36,14 +36,10 @@ namespace Sky { #define HEADER_LEN 18 RncDecoder::RncDecoder() { - _bitBuffl = 0; - _bitBuffh = 0; - _bitCount = 0; + initCrc(); } -RncDecoder::~RncDecoder() { - -} +RncDecoder::~RncDecoder() { } void RncDecoder::initCrc() { uint16 cnt = 0; @@ -175,10 +171,13 @@ int32 RncDecoder::unpackM1(const void *input, void *output, uint16 key) { uint16 crcUnpacked = 0; uint16 crcPacked = 0; - initCrc(); + + _bitBuffl = 0; + _bitBuffh = 0; + _bitCount = 0; //Check for "RNC " - if (READ_BE_UINT32(inputptr) != 0x524e4301) + if (READ_BE_UINT32(inputptr) != RNC_SIGNATURE) return NOT_PACKED; inputptr += 4; |