diff options
author | Travis Howell | 2006-01-06 23:54:42 +0000 |
---|---|---|
committer | Travis Howell | 2006-01-06 23:54:42 +0000 |
commit | bdec54aa7e8d864cf48b282683c7db2bedc2f3f1 (patch) | |
tree | b65bcf1936fd949701fafb47e5dae807e8ce1ea3 | |
parent | ea5b4693903f4956ba23dacc0b32af8d134ba6d4 (diff) | |
download | scummvm-rg350-bdec54aa7e8d864cf48b282683c7db2bedc2f3f1.tar.gz scummvm-rg350-bdec54aa7e8d864cf48b282683c7db2bedc2f3f1.tar.bz2 scummvm-rg350-bdec54aa7e8d864cf48b282683c7db2bedc2f3f1.zip |
Rename variables.
svn-id: r19935
-rw-r--r-- | scumm/intern.h | 2 | ||||
-rw-r--r-- | scumm/resource_v7he.cpp | 57 | ||||
-rw-r--r-- | scumm/scumm.cpp | 4 |
3 files changed, 30 insertions, 33 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 3d7a7c61ac..47e2266e40 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -1087,7 +1087,7 @@ protected: const OpcodeEntryV80he *_opcodesV80he; int32 _heSndResId; - int _curSndId, _sndOffs1, _sndOffs2; + int _curSndId, _sndPtrOffs, _sndTmrOffs; public: ScummEngine_v80he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex); diff --git a/scumm/resource_v7he.cpp b/scumm/resource_v7he.cpp index 7c245780c5..031e39db3e 100644 --- a/scumm/resource_v7he.cpp +++ b/scumm/resource_v7he.cpp @@ -1799,18 +1799,18 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { byte *sbng1Ptr, *sbng2Ptr; byte *sdat1Ptr, *sdat2Ptr; byte *src, *dst, *tmp; - int curOffs, len, offs, size; + int len, offs, size; if (snd2id == -1) { - _sndOffs1 = 0; - _sndOffs2 = 0; + _sndPtrOffs = 0; + _sndTmrOffs = 0; return; } if (snd1id != _curSndId) { _curSndId = snd1id; - _sndOffs1 = 0; - _sndOffs2 = 0; + _sndPtrOffs = 0; + _sndTmrOffs = 0; } res.lock(rtSound, snd1id); @@ -1833,7 +1833,7 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { if (sbng1Ptr != NULL && sbng2Ptr != NULL) { if (chan != -1 && _sound->_heChannel[chan].codeOffs > 0) { - curOffs = _sound->_heChannel[chan].codeOffs; + int curOffs = _sound->_heChannel[chan].codeOffs; src = snd1Ptr + curOffs; dst = sbng1Ptr + 8; @@ -1863,59 +1863,56 @@ void ScummEngine_v80he::createSound(int snd1id, int snd2id) { len = tmp - sbng2Ptr - 6; memcpy(dst, src, len); - int time; - while (READ_LE_UINT16(dst) != 0) { + int32 time; + while ((size = READ_LE_UINT16(dst)) != 0) { time = READ_LE_UINT32(dst + 2); - time += _sndOffs2; - size = READ_LE_UINT16(dst); + time += _sndTmrOffs; WRITE_LE_UINT32(dst + 2, time); dst += size; } } - int size1, size2; - + int sdat1size, sdat2size; sdat1Ptr = heFindResource(MKID('SDAT'), snd1Ptr); assert(sdat1Ptr); sdat2Ptr = heFindResource(MKID('SDAT'), snd2Ptr); assert(sdat2Ptr); - size1 = READ_BE_UINT32(sdat1Ptr + 4) - 8 - _sndOffs1; - size2 = READ_BE_UINT32(sdat2Ptr + 4) - 8; - - debug(0, "SDAT size1 %d size2 %d", size1, size2); + sdat1size = READ_BE_UINT32(sdat1Ptr + 4) - 8 - _sndPtrOffs; + sdat2size = READ_BE_UINT32(sdat2Ptr + 4) - 8; - if (size1 <= 0) { - debug(0, "createSound: Invalid offset (%d) for sound (%d)", snd1id, size1); + 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 (size2 < size1) { + if (sdat2size < sdat1size) { src = sdat2Ptr + 8; - dst = sdat1Ptr + 8 + _sndOffs1; - len = size2; + dst = sdat1Ptr + 8 + _sndPtrOffs; + len = sdat2size; memcpy(dst, src, len); - _sndOffs1 += size2; - _sndOffs2 += size2; + _sndPtrOffs += len; + _sndTmrOffs += sdat2size; } else { src = sdat2Ptr + 8; - dst = sdat1Ptr + 8 + _sndOffs1; - len = size1; + dst = sdat1Ptr + 8 + _sndPtrOffs; + len = sdat1size; memcpy(dst, src, len); - if (size2 != size1) { - src = sdat2Ptr + 8 + size1; + if (sdat2size != sdat1size) { + src = sdat2Ptr + 8 + sdat1size; dst = sdat1Ptr + 8; - len = size2 - size1; + len = sdat2size - sdat1size; memcpy(dst, src, len); } - _sndOffs1 += size2 - size1; - _sndOffs2 += size2; + _sndPtrOffs += sdat2size - sdat1size; + _sndTmrOffs += sdat2size; } } diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 343f5b36f4..0a6ebd28f5 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -1609,8 +1609,8 @@ ScummEngine_v80he::ScummEngine_v80he(GameDetector *detector, OSystem *syst, cons : ScummEngine_v72he(detector, syst, gs, md5sum, substResFileNameIndex) { _heSndResId = 0; _curSndId = 0; - _sndOffs1 = 0; - _sndOffs2 = 0; + _sndPtrOffs = 0; + _sndTmrOffs = 0; } ScummEngine_v90he::ScummEngine_v90he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16], int substResFileNameIndex) |