diff options
author | Eugene Sandulenko | 2014-06-09 11:40:20 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-06-09 22:33:45 +0300 |
commit | c41ebe6f452d40cb84359aeff909e21cf6c4db29 (patch) | |
tree | 9c6621305e41ce0441a707d857443ea6514cb3de /common | |
parent | 9d33b09885d4205d54cd577a0bbef5172f00e4a3 (diff) | |
download | scummvm-rg350-c41ebe6f452d40cb84359aeff909e21cf6c4db29.tar.gz scummvm-rg350-c41ebe6f452d40cb84359aeff909e21cf6c4db29.tar.bz2 scummvm-rg350-c41ebe6f452d40cb84359aeff909e21cf6c4db29.zip |
COMMON: Added align() method for BitStream
Diffstat (limited to 'common')
-rw-r--r-- | common/bitstream.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/common/bitstream.h b/common/bitstream.h index 0fe16b5beb..b789f2ac8d 100644 --- a/common/bitstream.h +++ b/common/bitstream.h @@ -52,6 +52,9 @@ public: /** Skip the specified amount of bits. */ virtual void skip(uint32 n) = 0; + /** Skip the bits to closest data value border. */ + virtual void align() = 0; + /** Read a bit from the bit stream. */ virtual uint32 getBit() = 0; @@ -276,6 +279,12 @@ public: getBit(); } + /** Skip the bits to closest data value border. */ + void align() { + while (_inValue) + getBit(); + } + /** Return the stream position in bits. */ uint32 pos() const { if (_stream->pos() == 0) |