diff options
author | Travis Howell | 2006-01-10 12:34:20 +0000 |
---|---|---|
committer | Travis Howell | 2006-01-10 12:34:20 +0000 |
commit | 9bbd060f7fcc750434b99a64fa59feb56ec08406 (patch) | |
tree | 640f84ca5ccd24841f67484a6a77be4fad048ee1 /scumm | |
parent | 71af473b7601eff1640fc2f489760733ab712cb9 (diff) | |
download | scummvm-rg350-9bbd060f7fcc750434b99a64fa59feb56ec08406.tar.gz scummvm-rg350-9bbd060f7fcc750434b99a64fa59feb56ec08406.tar.bz2 scummvm-rg350-9bbd060f7fcc750434b99a64fa59feb56ec08406.zip |
Small correction.
svn-id: r19970
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/resource_v7he.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp index 031e39db3e..89431825da 100644 --- a/scumm/resource_v7he.cpp +++ b/scumm/resource_v7he.cpp @@ -1800,6 +1800,7 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { byte *sdat1Ptr, *sdat2Ptr; byte *src, *dst, *tmp; int len, offs, size; + int sdat1size, sdat2size; if (snd2id == -1) { _sndPtrOffs = 0; @@ -1813,9 +1814,6 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { _sndTmrOffs = 0; } - res.lock(rtSound, snd1id); - res.lock(rtSound, snd2id); - snd1Ptr = getResourceAddress(rtSound, snd1id); assert(snd1Ptr); snd2Ptr = getResourceAddress(rtSound, snd2id); @@ -1846,8 +1844,8 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { free(data); dst = sbng1Ptr + 8; - while ((offs = READ_LE_UINT16(dst)) != 0) - dst += offs; + while ((size = READ_LE_UINT16(dst)) != 0) + dst += size; } else { dst = sbng1Ptr + 8; } @@ -1872,7 +1870,6 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { } } - int sdat1size, sdat2size; sdat1Ptr = heFindResource(MKID('SDAT'), snd1Ptr); assert(sdat1Ptr); sdat2Ptr = heFindResource(MKID('SDAT'), snd2Ptr); @@ -1882,11 +1879,6 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { sdat2size = READ_BE_UINT32(sdat2Ptr + 4) - 8; debug(0, "SDAT size1 %d size2 %d", sdat1size, sdat2size); - if (sdat1size <= 0) { - debug(0, "createSound: Invalid offset (%d) for sound (%d)", snd1id, sdat1size); - return; - } - if (sdat2size < sdat1size) { src = sdat2Ptr + 8; dst = sdat1Ptr + 8 + _sndPtrOffs; @@ -1894,7 +1886,7 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { memcpy(dst, src, len); - _sndPtrOffs += len; + _sndPtrOffs += sdat2size; _sndTmrOffs += sdat2size; } else { src = sdat2Ptr + 8; @@ -1911,7 +1903,7 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { memcpy(dst, src, len); } - _sndPtrOffs += sdat2size - sdat1size; + _sndPtrOffs = sdat2size - sdat1size; _sndTmrOffs += sdat2size; } } |