changes in loops in imuse

svn-id: r5082
This commit is contained in:
Paweł Kołodziejski 2002-10-03 07:42:25 +00:00
parent aeaad5169e
commit 830dfe090f
2 changed files with 11 additions and 7 deletions

View File

@ -4866,16 +4866,23 @@ void IMuseDigital::handler() {
continue;
}
if ((_channel[l]._jump[0]._numLoops == 0) && (_channel[l]._isLoop == true)) {
_channel[l]._isLoop = false;
}
uint32 new_size = _channel[l]._mixerSize;
uint32 mixer_size = new_size;
if(_channel[l]._isLoop == false) {
if (_channel[l]._isLoop == false) {
if (_channel[l]._offset + _channel[l]._mixerSize > _channel[l]._size) {
new_size = _channel[l]._size - _channel[l]._offset;
_channel[l]._toBeRemoved = true;
mixer_size = new_size;
}
} else {
if (_channel[l]._jump[0]._numLoops != 500) {
_channel[l]._jump[0]._numLoops--;
}
if (_channel[l]._offset + _channel[l]._mixerSize >= _channel[l]._jump[0]._offset) {
new_size = _channel[l]._jump[0]._offset - _channel[l]._offset;
}
@ -5008,7 +5015,7 @@ void IMuseDigital::startSound(int sound) {
_channel[l]._jump[_channel[l]._numJumps]._offset = READ_BE_UINT32(ptr); ptr += 4;
_channel[l]._jump[_channel[l]._numJumps]._dest = READ_BE_UINT32(ptr); ptr += 4;
_channel[l]._jump[_channel[l]._numJumps]._id = READ_BE_UINT32(ptr); ptr += 4;
_channel[l]._jump[_channel[l]._numJumps]._unk = READ_BE_UINT32(ptr); ptr += 4;
_channel[l]._jump[_channel[l]._numJumps]._numLoops = READ_BE_UINT32(ptr); ptr += 4;
_channel[l]._isLoop = true;
_channel[l]._numJumps++;
break;
@ -5082,10 +5089,7 @@ void IMuseDigital::stopSound(int sound) {
debug(1, "IMuseDigital::stopSound(%d)", sound);
for (int32 l = 0; l < MAX_DIGITAL_CHANNELS; l++) {
if ((_channel[l]._idSound == sound) && (_channel[l]._used == true)) {
if (_channel[l]._isLoop == false)
_channel[l]._toBeRemoved = true;
else
_channel[l]._isLoop = false;
_channel[l]._toBeRemoved = true;
}
}
}

View File

@ -76,7 +76,7 @@ private:
uint32 _offset; // jump position
uint32 _dest; // jump to
uint32 _id; // id of jump
uint32 _unk; // allmost 500 except one value: 2
uint32 _numLoops; // allmost 500 except one value: 2
};
struct channel {