diff options
author | Max Horn | 2003-03-06 02:50:50 +0000 |
---|---|---|
committer | Max Horn | 2003-03-06 02:50:50 +0000 |
commit | 255e15248b87823fd737927f0c0cf39b2659be10 (patch) | |
tree | e5aa4ae092317dd7ef4d266d6b8c6500297dde7c /sky/rnc_deco.cpp | |
parent | 32b84fe2baa72e3bdf08ca8b0b215be9f12f6948 (diff) | |
download | scummvm-rg350-255e15248b87823fd737927f0c0cf39b2659be10.tar.gz scummvm-rg350-255e15248b87823fd737927f0c0cf39b2659be10.tar.bz2 scummvm-rg350-255e15248b87823fd737927f0c0cf39b2659be10.zip |
a little cleanup, but this should really be turned into a decoder class
svn-id: r6705
Diffstat (limited to 'sky/rnc_deco.cpp')
-rw-r--r-- | sky/rnc_deco.cpp | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/sky/rnc_deco.cpp b/sky/rnc_deco.cpp index 6604de71d6..6f502f0ddd 100644 --- a/sky/rnc_deco.cpp +++ b/sky/rnc_deco.cpp @@ -48,24 +48,14 @@ uint16 len_table[TABLE_SIZE/2]; uint16 crc_table[0x100]; #endif -uint32 unpack_len = 0; -uint32 pack_len = 0; -uint16 pack_paras = 0; -uint16 counts = 0; uint16 bit_buffl = 0; uint16 bit_buffh = 0; -uint8 blocks = 0; uint8 bit_count = 0; -#ifdef CHECKSUMS -uint16 crc_u = 0; -uint16 crc_p = 0; -#endif - uint8 *esiptr, *ediptr; //these need to be global because input_bits() uses them -void init_crc(void) +void init_crc() { uint16 cnt=0; uint16 tmp1=0; @@ -199,6 +189,15 @@ int UnpackM1(void *input, void *output, uint16 key) uint8 *inputHigh, *outputLow, *outputHigh; uint8 *inputptr = (uint8 *)input; + uint32 unpack_len = 0; + uint32 pack_len = 0; + uint16 counts = 0; + +#ifdef CHECKSUMS + uint16 crc_u = 0; + uint16 crc_p = 0; +#endif + if (CHECKSUMS) init_crc(); @@ -212,7 +211,7 @@ int UnpackM1(void *input, void *output, uint16 key) unpack_len = READ_BE_UINT32(inputptr); inputptr += 4; pack_len = READ_BE_UINT32(inputptr); inputptr += 4; - blocks = *(inputptr+5); + uint8 blocks = *(inputptr+5); if (CHECKSUMS) { //read CRC's |