aboutsummaryrefslogtreecommitdiff
path: root/engines/cge/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cge/sound.cpp')
-rw-r--r--engines/cge/sound.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/cge/sound.cpp b/engines/cge/sound.cpp
index 93ccbe9c80..9cb741454c 100644
--- a/engines/cge/sound.cpp
+++ b/engines/cge/sound.cpp
@@ -55,12 +55,12 @@ Sound::~Sound() {
}
void Sound::close() {
- _vm->_midiPlayer.killMidi();
+ _vm->_midiPlayer->killMidi();
}
void Sound::open() {
setRepeat(1);
- play((*_fx)[30000], 8);
+ play((*_vm->_fx)[30000], 8);
}
void Sound::setRepeat(int16 count) {
@@ -103,7 +103,7 @@ void Sound::sndDigiStop(SmpInfo *PSmpInfo) {
_audioStream = NULL;
}
-Fx::Fx(int size) : _current(NULL) {
+Fx::Fx(CGEEngine *vm, int size) : _current(NULL), _vm(vm) {
_cache = new Handler[size];
for (_size = 0; _size < size; _size++) {
_cache[_size]._ref = 0;
@@ -144,7 +144,7 @@ void Fx::preload(int ref0) {
for (int ref = ref0; ref < ref0 + 10; ref++) {
sprintf(filename, "FX%05d.WAV", ref);
- EncryptedStream file = filename;
+ EncryptedStream file(_vm, filename);
DataCk *wav = loadWave(&file);
if (wav) {
Handler *p = &_cache[find(0)];
@@ -162,7 +162,7 @@ DataCk *Fx::load(int idx, int ref) {
char filename[12];
sprintf(filename, "FX%05d.WAV", ref);
- EncryptedStream file = filename;
+ EncryptedStream file(_vm, filename);
DataCk *wav = loadWave(&file);
if (wav) {
Handler *p = &_cache[idx];
@@ -195,7 +195,7 @@ DataCk *Fx::operator[](int ref) {
return _current;
}
-MusicPlayer::MusicPlayer() {
+MusicPlayer::MusicPlayer(CGEEngine *vm) : _vm(vm) {
_data = NULL;
_isGM = false;
@@ -230,14 +230,14 @@ void MusicPlayer::killMidi() {
void MusicPlayer::loadMidi(int ref) {
// Work out the filename and check the given MIDI file exists
Common::String filename = Common::String::format("%.2d.MID", ref);
- if (!_resman->exist(filename.c_str()))
+ if (!_vm->_resman->exist(filename.c_str()))
return;
// Stop any currently playing MIDI file
killMidi();
// Read in the data for the file
- EncryptedStream mid(filename.c_str());
+ EncryptedStream mid(_vm, filename.c_str());
_dataSize = mid.size();
_data = (byte *)malloc(_dataSize);
mid.read(_data, _dataSize);