aboutsummaryrefslogtreecommitdiff
path: root/engines/dm/lzw.cpp
diff options
context:
space:
mode:
authorStrangerke2016-09-04 00:13:19 +0200
committerStrangerke2016-09-04 00:13:19 +0200
commitef144e1e8b90badc0bbbe2e7b624fd4ac08c7bc6 (patch)
tree72af00f04ecc6d39284e4542ae882475dafff6d2 /engines/dm/lzw.cpp
parent3ecc98e83203b70378adef1efe572ec436e4343a (diff)
downloadscummvm-rg350-ef144e1e8b90badc0bbbe2e7b624fd4ac08c7bc6.tar.gz
scummvm-rg350-ef144e1e8b90badc0bbbe2e7b624fd4ac08c7bc6.tar.bz2
scummvm-rg350-ef144e1e8b90badc0bbbe2e7b624fd4ac08c7bc6.zip
DM: Polishing in LZWdecompressor
Diffstat (limited to 'engines/dm/lzw.cpp')
-rw-r--r--engines/dm/lzw.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/engines/dm/lzw.cpp b/engines/dm/lzw.cpp
index a93b0c875a..dc5055f687 100644
--- a/engines/dm/lzw.cpp
+++ b/engines/dm/lzw.cpp
@@ -106,28 +106,25 @@ int16 LZWdecompressor::getNextInputCode(Common::MemoryReadStream &inputStream, i
}
void LZWdecompressor::outputCharacter(byte character, byte **out) {
- byte *L1558_pc_Output = *out;
+ byte *output = *out;
if (false == _repetitionEnabled) {
- if (character == 0x90) {
+ if (character == 0x90)
_repetitionEnabled = true;
- } else {
- *L1558_pc_Output++ = _charToRepeat = character;
- }
- *out = L1558_pc_Output;
- return;
+ else
+ *output++ = _charToRepeat = character;
} else {
if (character) { /* If character following 0x90 is not 0x00 then it is the repeat count */
- while (--character) {
- *L1558_pc_Output++ = _charToRepeat;
- }
- } else { /* else output a 0x90 character */
- *L1558_pc_Output++ = 0x90;
- }
+ while (--character)
+ *output++ = _charToRepeat;
+ } else /* else output a 0x90 character */
+ *output++ = 0x90;
+
_repetitionEnabled = false;
- *out = L1558_pc_Output;
- return;
}
+
+ *out = output;
+ return;
}
int32 LZWdecompressor::decompress(Common::MemoryReadStream &inStream, int32 inputByteCount, byte *out) {