diff options
Diffstat (limited to 'engines/scumm/scumm.cpp')
-rw-r--r-- | engines/scumm/scumm.cpp | 88 |
1 files changed, 24 insertions, 64 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 0f01e39459..3b83019275 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)); @@ -1669,43 +1668,8 @@ void ScummEngine_v90he::resetScumm() { _sprite->resetTables(0); memset(&_wizParams, 0, sizeof(_wizParams)); - if (_game.heversion >= 98) { - switch (_game.id) { - case GID_PUTTRACE: - _logicHE = new LogicHErace(this); - break; - - case GID_FUNSHOP: - _logicHE = new LogicHEfunshop(this); - break; - - case GID_FOOTBALL: - _logicHE = new LogicHEfootball(this); - break; - - case GID_SOCCER: - case GID_SOCCERMLS: - case GID_SOCCER2004: - _logicHE = new LogicHEsoccer(this); - break; - - case GID_BASEBALL2001: - _logicHE = new LogicHEbaseball2001(this); - break; - - case GID_BASKETBALL: - _logicHE = new LogicHEbasketball(this); - break; - - case GID_MOONBASE: - _logicHE = new LogicHEmoonbase(this); - break; - - default: - _logicHE = new LogicHE(this); - break; - } - } + if (_game.heversion >= 98) + _logicHE = LogicHE::makeLogicHE(this); } void ScummEngine_v99he::resetScumm() { @@ -1746,40 +1710,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: -#if 1 - _musicType = MDT_ADLIB; -#else - _musicType = MDT_CMS; // Still has number of bugs, disable by default -#endif + case MT_CMS: + _sound->_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) { @@ -1809,7 +1769,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; } } @@ -1823,9 +1783,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"); } } @@ -1857,9 +1817,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. @@ -1871,15 +1831,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); } @@ -1909,7 +1869,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); } } |