diff options
Diffstat (limited to 'engines/zvision/lzss_read_stream.cpp')
-rw-r--r-- | engines/zvision/lzss_read_stream.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/engines/zvision/lzss_read_stream.cpp b/engines/zvision/lzss_read_stream.cpp index 03ab12d8be..4a5a4f3657 100644 --- a/engines/zvision/lzss_read_stream.cpp +++ b/engines/zvision/lzss_read_stream.cpp @@ -45,39 +45,38 @@ uint32 LzssReadStream::decompressBytes(byte *destination, uint32 numberOfBytes) uint mask = 1; for (int i = 0; i < 8; i++) { - if ((flagbyte & mask) == mask) - { + if ((flagbyte & mask) == mask) { byte data = _source->readByte(); - if (_source->eos()) + if (_source->eos()) { return destinationCursor; + } _window[_windowCursor] = data; destination[destinationCursor++] = data; // Increment and wrap the window cursor _windowCursor = (_windowCursor + 1) & 0xFFF; - } - else - { + } else { byte low = _source->readByte(); - if (_source->eos()) + if (_source->eos()) { return destinationCursor; + } byte high = _source->readByte(); - if (_source->eos()) + if (_source->eos()) { return destinationCursor; + } uint16 length = (high & 0xF) + 2; uint16 offset = low | ((high & 0xF0)<<4); - for(int j = 0; j <= length; j++) - { + for(int j = 0; j <= length; j++) { byte temp = _window[(offset + j) & 0xFFF]; _window[_windowCursor] = temp; destination[destinationCursor++] = temp; _windowCursor = (_windowCursor + 1) & 0xFFF; } - }; + } mask = mask << 1; } |