diff options
Diffstat (limited to 'engines/parallaction/sound.cpp')
-rw-r--r-- | engines/parallaction/sound.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/engines/parallaction/sound.cpp b/engines/parallaction/sound.cpp index 90cd2b9129..698373d541 100644 --- a/engines/parallaction/sound.cpp +++ b/engines/parallaction/sound.cpp @@ -312,9 +312,13 @@ void DosSoundMan::playLocationMusic(const char *location) { AmigaSoundMan::AmigaSoundMan(Parallaction *vm) : SoundMan(vm) { _musicStream = 0; _channels[0].data = 0; + _channels[0].dispose = false; _channels[1].data = 0; + _channels[1].dispose = false; _channels[2].data = 0; + _channels[2].dispose = false; _channels[3].data = 0; + _channels[3].dispose = false; } AmigaSoundMan::~AmigaSoundMan() { @@ -340,7 +344,7 @@ void AmigaSoundMan::loadChannelData(const char *filename, Channel *ch) { ch->header.samplesPerHiCycle = 0; ch->header.samplesPerSec = 11934; ch->header.volume = 160; - ch->data = new int8[AMIGABEEP_SIZE * NUM_REPEATS]; + ch->data = (int8*)malloc(AMIGABEEP_SIZE * NUM_REPEATS); int8* odata = ch->data; for (uint i = 0; i < NUM_REPEATS; i++) { memcpy(odata, res_amigaBeep, AMIGABEEP_SIZE); @@ -364,6 +368,8 @@ void AmigaSoundMan::playSfx(const char *filename, uint channel, bool looping, in return; } + stopSfx(channel); + debugC(1, kDebugAudio, "AmigaSoundMan::playSfx(%s, %i)", filename, channel); Channel *ch = &_channels[channel]; |