aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/scumm.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-08-05 13:33:42 +0100
committerEugene Sandulenko2011-08-06 11:30:42 +0100
commit0dafa7f80fbc271e599092e81655d8073ab91abe (patch)
tree1d33034c8c8dc5258417431c6023567a4501be6f /engines/scumm/scumm.cpp
parent6e795a89b0d45c79f99dcd9d50fda467e9a2466e (diff)
downloadscummvm-rg350-0dafa7f80fbc271e599092e81655d8073ab91abe.tar.gz
scummvm-rg350-0dafa7f80fbc271e599092e81655d8073ab91abe.tar.bz2
scummvm-rg350-0dafa7f80fbc271e599092e81655d8073ab91abe.zip
ALL: Reduce audio/ header dependency
Diffstat (limited to 'engines/scumm/scumm.cpp')
-rw-r--r--engines/scumm/scumm.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index d546f039fe..54c99144c8 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -299,7 +299,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
_haveActorSpeechMsg = false;
_useTalkAnims = false;
_defaultTalkDelay = 0;
- _musicType = MDT_NONE;
_saveSound = 0;
memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
memset(_scaleSlots, 0, sizeof(_scaleSlots));
@@ -1746,36 +1745,36 @@ void ScummEngine::setupMusic(int midi) {
switch (MidiDriver::getMusicType(dev)) {
case MT_NULL:
- _musicType = MDT_NONE;
+ _sound->_musicType = MDT_NONE;
break;
case MT_PCSPK:
- _musicType = MDT_PCSPK;
+ _sound->_musicType = MDT_PCSPK;
break;
case MT_PCJR:
- _musicType = MDT_PCJR;
+ _sound->_musicType = MDT_PCJR;
break;
case MT_CMS:
_musicType = MDT_CMS;
break;
case MT_TOWNS:
- _musicType = MDT_TOWNS;
+ _sound->_musicType = MDT_TOWNS;
break;
case MT_ADLIB:
- _musicType = MDT_ADLIB;
+ _sound->_musicType = MDT_ADLIB;
break;
case MT_C64:
- _musicType = MDT_C64;
+ _sound->_musicType = MDT_C64;
break;
case MT_APPLEIIGS:
- _musicType = MDT_APPLEIIGS;
+ _sound->_musicType = MDT_APPLEIIGS;
break;
default:
- _musicType = MDT_MIDI;
+ _sound->_musicType = MDT_MIDI;
break;
}
if ((_game.id == GID_MONKEY_EGA || (_game.id == GID_LOOM && _game.version == 3))
- && (_game.platform == Common::kPlatformPC) && _musicType == MDT_MIDI) {
+ && (_game.platform == Common::kPlatformPC) && _sound->_musicType == MDT_MIDI) {
Common::String fileName;
bool missingFile = false;
if (_game.id == GID_LOOM) {
@@ -1805,7 +1804,7 @@ void ScummEngine::setupMusic(int midi) {
"but %s is missing. Using AdLib instead."), fileName.c_str()),
_("OK"));
dialog.runModal();
- _musicType = MDT_ADLIB;
+ _sound->_musicType = MDT_ADLIB;
}
}
@@ -1819,9 +1818,9 @@ void ScummEngine::setupMusic(int midi) {
* automatically when samples need to be generated */
if (!_mixer->isReady()) {
warning("Sound mixer initialization failed");
- if (_musicType == MDT_ADLIB || _musicType == MDT_PCSPK || _musicType == MDT_PCJR || _musicType == MDT_CMS) {
+ if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR || _sound->_musicType == MDT_CMS) {
dev = 0;
- _musicType = MDT_NONE;
+ _sound->_musicType = MDT_NONE;
warning("MIDI driver depends on sound mixer, switching to null MIDI driver");
}
}
@@ -1853,9 +1852,9 @@ void ScummEngine::setupMusic(int midi) {
_musicEngine = new Player_V1(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);
} else if (_game.version <= 2) {
_musicEngine = new Player_V2(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);
- } else if ((_musicType == MDT_PCSPK || _musicType == MDT_PCJR) && (_game.version > 2 && _game.version <= 4)) {
+ } else if ((_sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR) && (_game.version > 2 && _game.version <= 4)) {
_musicEngine = new Player_V2(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);
- } else if (_musicType == MDT_CMS) {
+ } else if (_sound->_musicType == MDT_CMS) {
_musicEngine = new Player_V2CMS(this, _mixer);
} else if (_game.platform == Common::kPlatform3DO && _game.heversion <= 62) {
// 3DO versions use digital music and sound samples.
@@ -1867,15 +1866,15 @@ void ScummEngine::setupMusic(int midi) {
MidiDriver *nativeMidiDriver = 0;
MidiDriver *adlibMidiDriver = 0;
- if (_musicType != MDT_ADLIB && _musicType != MDT_TOWNS && _musicType != MDT_PCSPK)
+ if (_sound->_musicType != MDT_ADLIB && _sound->_musicType != MDT_TOWNS && _sound->_musicType != MDT_PCSPK)
nativeMidiDriver = MidiDriver::createMidi(dev);
if (nativeMidiDriver != NULL && _native_mt32)
nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
- bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && _musicType != MDT_PCSPK && (midi & MDT_ADLIB);
- if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS || multi_midi) {
- adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB));
+ bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB);
+ if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) {
+ adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_sound->_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB));
adlibMidiDriver->property(MidiDriver::PROP_OLD_ADLIB, (_game.features & GF_SMALL_HEADER) ? 1 : 0);
- } else if (_musicType == MDT_PCSPK) {
+ } else if (_sound->_musicType == MDT_PCSPK) {
adlibMidiDriver = new PcSpkDriver(_mixer);
}
@@ -1905,7 +1904,7 @@ void ScummEngine::setupMusic(int midi) {
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
_imuse->property(IMuse::PROP_RECYCLE_PLAYERS, 1);
}
- if (_musicType == MDT_PCSPK)
+ if (_sound->_musicType == MDT_PCSPK)
_imuse->property(IMuse::PROP_PC_SPEAKER, 1);
}
}