aboutsummaryrefslogtreecommitdiff
path: root/backends/midi/mt32/synth.cpp
diff options
context:
space:
mode:
authorJerome Fisher2004-11-14 08:04:56 +0000
committerJerome Fisher2004-11-14 08:04:56 +0000
commit504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9 (patch)
tree010ff1888a14d19f860fd99252fc910421188d03 /backends/midi/mt32/synth.cpp
parent0ed79dfad78aeb61961c7f865e8cc7f45840fe28 (diff)
downloadscummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.tar.gz
scummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.tar.bz2
scummvm-rg350-504d54e8ab65dc68d71ac1a77ad4a393fb69e3e9.zip
- Huge cleanup of LUT stuff.
- No longer stores a sawtooth waveform twice, once with each sample negated. - More graceful handling of truncated waveformcache files. - Fixed tuning of patterns for non-32KHz sample rates (needs checking). - Note: Waveform cache format changed, will automatically be rebuilt. svn-id: r15804
Diffstat (limited to 'backends/midi/mt32/synth.cpp')
-rw-r--r--backends/midi/mt32/synth.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/backends/midi/mt32/synth.cpp b/backends/midi/mt32/synth.cpp
index 4c697b893f..9e11fb2bbf 100644
--- a/backends/midi/mt32/synth.cpp
+++ b/backends/midi/mt32/synth.cpp
@@ -117,7 +117,7 @@ Synth::Synth() {
isOpen = false;
reverbModel = NULL;
partialManager = NULL;
- memset(waveforms, 0, sizeof(waveforms));
+ memset(noteLookups, 0, sizeof(noteLookups));
memset(parts, 0, sizeof(parts));
}
@@ -690,11 +690,12 @@ void Synth::close(void) {
if (!isOpen)
return;
- for (int t = 0; t < 4; t++) {
+ for (int t = 0; t < 3; t++) {
for (int m = 0; m < NUM_NOTES; m++) {
- if (waveforms[t][m]!=NULL) {
- delete[] waveforms[t][m];
- waveforms[t][m] = NULL;
+ if (noteLookups[m].waveforms[t] != NULL) {
+ delete[] noteLookups[m].waveforms[t];
+ noteLookups[m].waveforms[t] = NULL;
+ noteLookups[m].waveformSize[t] = 0;
}
}
}