aboutsummaryrefslogtreecommitdiff
path: root/scumm/imuse_digi
diff options
context:
space:
mode:
authorPaweł Kołodziejski2004-04-28 05:39:53 +0000
committerPaweł Kołodziejski2004-04-28 05:39:53 +0000
commit319ae4deede0e1714fd2e262d13abdbff5eea5a2 (patch)
tree5c8c129422f6910f4ce3ffa41a5760b005aca7e7 /scumm/imuse_digi
parentd6e78803db925898272e44386c90075fac6173ef (diff)
downloadscummvm-rg350-319ae4deede0e1714fd2e262d13abdbff5eea5a2.tar.gz
scummvm-rg350-319ae4deede0e1714fd2e262d13abdbff5eea5a2.tar.bz2
scummvm-rg350-319ae4deede0e1714fd2e262d13abdbff5eea5a2.zip
cleanup
svn-id: r13659
Diffstat (limited to 'scumm/imuse_digi')
-rw-r--r--scumm/imuse_digi/dimuse.cpp7
-rw-r--r--scumm/imuse_digi/dimuse_sndmgr.cpp1
-rw-r--r--scumm/imuse_digi/dimuse_track.cpp6
3 files changed, 8 insertions, 6 deletions
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp
index 27fbfca58f..c53b6fa4f8 100644
--- a/scumm/imuse_digi/dimuse.cpp
+++ b/scumm/imuse_digi/dimuse.cpp
@@ -165,10 +165,13 @@ void IMuseDigital::callback() {
int bits = _sound->getBits(_track[l]->soundHandle);
int channels = _sound->getChannels(_track[l]->soundHandle);
- int32 mixer_size = _track[l]->stream->getFreeSpace() - 4;
- if ((_track[l]->iteration / 2) > mixer_size)
+ int32 freeSpace = _track[l]->stream->getFreeSpace() - 4;
+ int32 bufferMin = (_track[l]->iteration * 3) / 4;
+ if (bufferMin > freeSpace)
continue;
+ int32 mixer_size = freeSpace;
+
if ((bits == 12) || (bits == 16)) {
if (channels == 1)
mixer_size &= ~1;
diff --git a/scumm/imuse_digi/dimuse_sndmgr.cpp b/scumm/imuse_digi/dimuse_sndmgr.cpp
index fb813c73a4..6c2f1e5fc6 100644
--- a/scumm/imuse_digi/dimuse_sndmgr.cpp
+++ b/scumm/imuse_digi/dimuse_sndmgr.cpp
@@ -85,7 +85,6 @@ void ImuseDigiSndMgr::prepareSound(byte *ptr, int slot) {
int len;
int32 offset = READ_LE_UINT16(ptr + 20);
- /* int16 version = */ READ_LE_UINT16(ptr + 22);
int16 code = READ_LE_UINT16(ptr + 24);
_sounds[slot].region = (_region *)malloc(sizeof(_region) * 70);
diff --git a/scumm/imuse_digi/dimuse_track.cpp b/scumm/imuse_digi/dimuse_track.cpp
index 948f0b3dfb..7b7ba91746 100644
--- a/scumm/imuse_digi/dimuse_track.cpp
+++ b/scumm/imuse_digi/dimuse_track.cpp
@@ -43,7 +43,7 @@ bool IMuseDigital::allocSlot(int priority) {
}
if (!found_free) {
- warning("IMuseDigital::startSound(): All slots are full");
+ debug(5, "IMuseDigital::startSound(): All slots are full");
for (l = 0; l < MAX_DIGITAL_TRACKS; l++) {
if (_track[l]->used && _track[l]->handle.isActive() &&
(lower_priority > _track[l]->priority) && (!_track[l]->stream2))
@@ -65,9 +65,9 @@ bool IMuseDigital::allocSlot(int priority) {
_track[track_id]->soundHandle = NULL;
_track[track_id]->used = false;
assert(!_track[track_id]->handle.isActive());
- warning("IMuseDigital::startSound(): Removed sound %d from track %d", _track[track_id]->soundId, track_id);
+ debug(5, "IMuseDigital::startSound(): Removed sound %d from track %d", _track[track_id]->soundId, track_id);
} else {
- warning("IMuseDigital::startSound(): Priority sound too low");
+ debug(5, "IMuseDigital::startSound(): Priority sound too low");
return false;
}
}