aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-02-14 15:14:30 +0000
committerPaweł Kołodziejski2004-02-14 15:14:30 +0000
commitabdb4fbe8784593d57e8e80afe8196a8cfc50dc8 (patch)
tree0309a496ccc4157f6517a2e921684ca1b1847a96 /scumm
parent0459089ca8da0b5b735e5708ad878b690373d3cf (diff)
downloadscummvm-rg350-abdb4fbe8784593d57e8e80afe8196a8cfc50dc8.tar.gz
scummvm-rg350-abdb4fbe8784593d57e8e80afe8196a8cfc50dc8.tar.bz2
scummvm-rg350-abdb4fbe8784593d57e8e80afe8196a8cfc50dc8.zip
fixed bug #892426 - improved FT sound loops
svn-id: r12886
Diffstat (limited to 'scumm')
-rw-r--r--scumm/imuse_digi/dimuse.cpp13
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp20
2 files changed, 17 insertions, 16 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp
index aa81af9c35..95ed94c433 100644
--- a/scumm/imuse_digi/dimuse.cpp
+++ b/scumm/imuse_digi/dimuse.cpp
@@ -208,19 +208,6 @@ void IMuseDigital::callback() {
void IMuseDigital::switchToNextRegion(int track) {
int num_regions = _sound->getNumRegions(_track[track].soundHandle);
- int num_jumps = _sound->getNumJumps(_track[track].soundHandle);
- if (_vm->_gameId == GID_FT) {
- if (_track[track].curRegion == -1) {
- _track[track].curRegion = 0;
- _track[track].regionOffset = 0;
- return;
- }
- if (num_jumps != 0)
- _track[track].regionOffset = 0;
- else
- _track[track].toBeRemoved = true;
- return;
- }
if (++_track[track].curRegion == num_regions) {
_track[track].toBeRemoved = true;
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index 6ea582b5c5..9d6201a755 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -49,16 +49,30 @@ ImuseDigiSndMgr::~ImuseDigiSndMgr() {
void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
if (READ_UINT32(ptr) == MKID('Crea')) {
- int size = 0, rate = 0, loops = 0;
- _sounds[slot].resPtr = readVOCFromMemory(ptr, size, rate, loops);
+ int size = 0, rate = 0, loops = 0, begin_loop = 0, end_loop = 0;
+ _sounds[slot].resPtr = readVOCFromMemory(ptr, size, rate, loops, begin_loop, end_loop);
_sounds[slot].freeResPtr = true;
_sounds[slot].bits = 8;
_sounds[slot].freq = rate;
_sounds[slot].channels = 1;
+ _sounds[slot].region[0].offset = 0;
_sounds[slot].region[0].length = size;
_sounds[slot].numRegions++;
- if (loops != 0)
+ if (loops != 0) {
+ if (begin_loop == 0) {
+ _sounds[slot].region[1].offset = end_loop;
+ _sounds[slot].numRegions++;
+ } else {
+ _sounds[slot].region[0].length = begin_loop;
+ _sounds[slot].region[1].offset = begin_loop;
+ _sounds[slot].region[1].length = end_loop - begin_loop;
+ _sounds[slot].region[2].offset = end_loop;
+ _sounds[slot].numRegions += 2;
+ }
+ _sounds[slot].jump[0].dest = begin_loop;
+ _sounds[slot].jump[0].offset = end_loop;
_sounds[slot].numJumps++;
+ }
} else if (READ_UINT32(ptr) == MKID('iMUS')) {
uint32 tag;
int32 size = 0;