From 782c394dd78e31f1d4bca76d75e7cd91cd490f14 Mon Sep 17 00:00:00 2001 From: Greg Frieger Date: Sat, 14 Mar 2009 08:43:28 +0000 Subject: - LZS Decompressor added - Some code clean-up svn-id: r39385 --- engines/sci/scicore/decompressor.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engines/sci/scicore/decompressor.h') diff --git a/engines/sci/scicore/decompressor.h b/engines/sci/scicore/decompressor.h index 5d54212a95..c471b41cec 100644 --- a/engines/sci/scicore/decompressor.h +++ b/engines/sci/scicore/decompressor.h @@ -77,12 +77,17 @@ protected: byte getByteLSB(); void fetchBitsMSB(); - void fetchBitsLSB(); + void fetchBitsLSB(); //! put byte to _dest stream /** @param b - byte to put */ virtual void putByte(byte b); + // Returns true if all expected data has been unpacked to _dest + // and there is no more data in _src + bool isFinished() { + return (_dwWrote == _szUnpacked) && (_dwRead >= _szPacked); + } uint32 _dwBits; // bits buffer byte _nBits; // # of bits in buffer @@ -165,7 +170,12 @@ protected: class DecompressorLZS : public Decompressor { public: int unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked); +protected: + int unpackLZS(); + uint16 getCompLen(); + void copyComp(int offs, int clen); }; + } // End of namespace Sci #endif // SCI_SCICORE_DECOMPRESSOR_H -- cgit v1.2.3