aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/resource.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/kyra/resource.cpp b/engines/kyra/resource.cpp
index 04cfcf879a..46c73c9d3b 100644
--- a/engines/kyra/resource.cpp
+++ b/engines/kyra/resource.cpp
@@ -878,7 +878,8 @@ uint16 FileExpanderSource::keyMaskedAlign(uint16 val) {
int16 b = ((_bitsLeft << 8) | _index) - 1;
_bitsLeft = b >> 8;
_index = b & 0xff;
- return (((val & 3) + 4) << _index) + 0x101 + getKeyMasked(_index);
+ uint16 res = (((val & 3) + 4) << _index) + 0x101;
+ return res + getKeyMasked(_index);
}
void FileExpanderSource::advSrcRefresh() {
@@ -1046,7 +1047,8 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
_src->advSrcBitsByIndex(offset < 0 ? calcCmdAndIndex(_tables[5], offset) : _tables[1][offset]);
if ((offset & 0xff) >= 4) {
uint8 newIndex = ((offset & 0xff) >> 1) - 1;
- offset = (((offset & 1) + 2) << newIndex) + _src->getKeyMasked(newIndex);
+ offset = (((offset & 1) + 2) << newIndex);
+ offset += _src->getKeyMasked(newIndex);
}
uint8 *s2 = d - 1 - offset;