~ubuntu-branches/debian/jessie/scummvm/jessie

« back to all changes in this revision

Viewing changes to common/dcl.cpp

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2011-11-05 10:29:43 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: package-import@ubuntu.com-20111105102943-zfm3dhlvy5b01u7v
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 * along with this program; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
20
 *
21
 
 * $URL$
22
 
 * $Id$
23
 
 *
24
21
 */
25
22
 
26
23
#include "common/dcl.h"
33
30
 
34
31
class DecompressorDCL {
35
32
public:
36
 
        bool unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
 
33
        bool unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
37
34
 
38
35
protected:
39
36
        /**
44
41
         * @param nUnpacket     size of unpacked data
45
42
         * @return 0 on success, non-zero on error
46
43
         */
47
 
        void init(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
 
44
        void init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);
48
45
 
49
46
        /**
50
47
         * Get a number of bits from _src stream, starting with the least
76
73
        uint32 _szUnpacked;     ///< size of the decompressed data
77
74
        uint32 _dwRead;         ///< number of bytes read from _src
78
75
        uint32 _dwWrote;        ///< number of bytes written to _dest
79
 
        Common::ReadStream *_src;
 
76
        ReadStream *_src;
80
77
        byte *_dest;
81
78
};
82
79
 
83
 
void DecompressorDCL::init(Common::ReadStream *src, byte *dest, uint32 nPacked,
84
 
                        uint32 nUnpacked) {
 
80
void DecompressorDCL::init(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
85
81
        _src = src;
86
82
        _dest = dest;
87
83
        _szPacked = nPacked;
336
332
#define DCL_BINARY_MODE 0
337
333
#define DCL_ASCII_MODE 1
338
334
 
339
 
bool DecompressorDCL::unpack(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
 
335
bool DecompressorDCL::unpack(ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked) {
340
336
        init(src, dest, nPacked, nUnpacked);
341
337
 
342
338
        int value;