aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorFlorian Kagerer2008-06-01 15:11:08 +0000
committerFlorian Kagerer2008-06-01 15:11:08 +0000
commit0485fbfc5be33b7219dd117fd4a14d77393e9bb2 (patch)
treef4112eee3dcacda9b5c9b370841f9cce6dd1296b /engines/kyra
parent22d63345e33795c3ce2de4bb67db160ef8b8ea6d (diff)
downloadscummvm-rg350-0485fbfc5be33b7219dd117fd4a14d77393e9bb2.tar.gz
scummvm-rg350-0485fbfc5be33b7219dd117fd4a14d77393e9bb2.tar.bz2
scummvm-rg350-0485fbfc5be33b7219dd117fd4a14d77393e9bb2.zip
- fix 'order of evaluation' bug (MSVC release build)
svn-id: r32467
Diffstat (limited to 'engines/kyra')
-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;