aboutsummaryrefslogtreecommitdiff
path: root/common/bitstream.h
diff options
context:
space:
mode:
authorEugene Sandulenko2016-09-11 16:58:54 +0200
committerGitHub2016-09-11 16:58:54 +0200
commit0733cf65ba8f6babdf35547b49cd2d57c9daf646 (patch)
tree61c24edbc0a1080711c93c674b9848f4a16efb50 /common/bitstream.h
parent49bc276ea3e297c23098d4f0e6ab331f0b89f6ee (diff)
parent08143af48293b007027d11271d3f66f7ad3107e6 (diff)
downloadscummvm-rg350-0733cf65ba8f6babdf35547b49cd2d57c9daf646.tar.gz
scummvm-rg350-0733cf65ba8f6babdf35547b49cd2d57c9daf646.tar.bz2
scummvm-rg350-0733cf65ba8f6babdf35547b49cd2d57c9daf646.zip
Merge pull request #826 from dreammaster/indeo
IMAGE: Indeo 4 & 5 decoders
Diffstat (limited to 'common/bitstream.h')
-rw-r--r--common/bitstream.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/bitstream.h b/common/bitstream.h
index b789f2ac8d..325118bbee 100644
--- a/common/bitstream.h
+++ b/common/bitstream.h
@@ -28,6 +28,7 @@
#include "common/scummsys.h"
#include "common/textconsole.h"
#include "common/stream.h"
+#include "common/types.h"
namespace Common {
@@ -88,8 +89,8 @@ protected:
template<int valueBits, bool isLE, bool isMSB2LSB>
class BitStreamImpl : public BitStream {
private:
- SeekableReadStream *_stream; ///< The input stream.
- bool _disposeAfterUse; ///< Should we delete the stream on destruction?
+ SeekableReadStream *_stream; ///< The input stream.
+ DisposeAfterUse::Flag _disposeAfterUse; ///< Should we delete the stream on destruction?
uint32 _value; ///< Current value.
uint8 _inValue; ///< Position within the current value.
@@ -132,7 +133,7 @@ private:
public:
/** Create a bit stream using this input data stream and optionally delete it on destruction. */
- BitStreamImpl(SeekableReadStream *stream, bool disposeAfterUse = false) :
+ BitStreamImpl(SeekableReadStream *stream, DisposeAfterUse::Flag disposeAfterUse = DisposeAfterUse::NO) :
_stream(stream), _disposeAfterUse(disposeAfterUse), _value(0), _inValue(0) {
if ((valueBits != 8) && (valueBits != 16) && (valueBits != 32))
@@ -141,14 +142,14 @@ public:
/** Create a bit stream using this input data stream. */
BitStreamImpl(SeekableReadStream &stream) :
- _stream(&stream), _disposeAfterUse(false), _value(0), _inValue(0) {
+ _stream(&stream), _disposeAfterUse(DisposeAfterUse::NO), _value(0), _inValue(0) {
if ((valueBits != 8) && (valueBits != 16) && (valueBits != 32))
error("BitStreamImpl: Invalid memory layout %d, %d, %d", valueBits, isLE, isMSB2LSB);
}
~BitStreamImpl() {
- if (_disposeAfterUse)
+ if (_disposeAfterUse == DisposeAfterUse::YES)
delete _stream;
}