ALL: Reduce audio/ header dependency
This commit is contained in:
parent
6e795a89b0
commit
0dafa7f80f
22 changed files with 58 additions and 56 deletions
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
#include "audio/fmopl.h"
|
#include "audio/fmopl.h"
|
||||||
|
#include "audio/mixer.h"
|
||||||
#include "audio/mods/soundfx.h"
|
#include "audio/mods/soundfx.h"
|
||||||
|
|
||||||
namespace Cruise {
|
namespace Cruise {
|
||||||
|
|
|
@ -23,10 +23,6 @@
|
||||||
#ifndef CRUISE_SOUND_H
|
#ifndef CRUISE_SOUND_H
|
||||||
#define CRUISE_SOUND_H
|
#define CRUISE_SOUND_H
|
||||||
|
|
||||||
#include "audio/mididrv.h"
|
|
||||||
#include "audio/midiparser.h"
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
#include "common/config-manager.h"
|
#include "common/config-manager.h"
|
||||||
#include "common/serializer.h"
|
#include "common/serializer.h"
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "audio/mididrv.h"
|
||||||
|
#include "audio/mixer.h"
|
||||||
|
|
||||||
#include "groovie/groovie.h"
|
#include "groovie/groovie.h"
|
||||||
#include "groovie/cursor.h"
|
#include "groovie/cursor.h"
|
||||||
#include "groovie/detection.h"
|
#include "groovie/detection.h"
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "audio/mididrv.h"
|
||||||
|
#include "audio/mixer.h"
|
||||||
|
|
||||||
#include "groovie/music.h"
|
#include "groovie/music.h"
|
||||||
#include "groovie/groovie.h"
|
#include "groovie/groovie.h"
|
||||||
#include "groovie/resource.h"
|
#include "groovie/resource.h"
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include "common/array.h"
|
#include "common/array.h"
|
||||||
#include "common/mutex.h"
|
#include "common/mutex.h"
|
||||||
#include "audio/mididrv.h"
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
class MidiParser;
|
class MidiParser;
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "audio/mididrv.h"
|
||||||
|
#include "audio/mixer.h"
|
||||||
|
|
||||||
#include "groovie/script.h"
|
#include "groovie/script.h"
|
||||||
#include "groovie/cell.h"
|
#include "groovie/cell.h"
|
||||||
#include "groovie/cursor.h"
|
#include "groovie/cursor.h"
|
||||||
|
|
|
@ -30,10 +30,11 @@
|
||||||
#include "common/mutex.h"
|
#include "common/mutex.h"
|
||||||
#include "common/singleton.h"
|
#include "common/singleton.h"
|
||||||
#include "common/ptr.h"
|
#include "common/ptr.h"
|
||||||
|
|
||||||
#include "audio/mididrv.h"
|
#include "audio/mididrv.h"
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
class MidiParser;
|
class MidiParser;
|
||||||
|
class MidiChannel;
|
||||||
|
|
||||||
namespace Lure {
|
namespace Lure {
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
#include "audio/mididrv.h"
|
|
||||||
|
|
||||||
#include "engines/engine.h"
|
#include "engines/engine.h"
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
#include "common/list.h"
|
#include "common/list.h"
|
||||||
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
namespace Mohawk {
|
namespace Mohawk {
|
||||||
|
|
||||||
class CSTimeCase;
|
class CSTimeCase;
|
||||||
|
|
|
@ -33,8 +33,6 @@
|
||||||
#include "common/queue.h"
|
#include "common/queue.h"
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
#include "livingbooks_code.h"
|
#include "livingbooks_code.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
#include "mohawk/sound.h"
|
#include "mohawk/sound.h"
|
||||||
#include "mohawk/video.h"
|
#include "mohawk/video.h"
|
||||||
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
namespace Mohawk {
|
namespace Mohawk {
|
||||||
|
|
||||||
MohawkEngine::MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
|
MohawkEngine::MohawkEngine(OSystem *syst, const MohawkGameDescription *gamedesc) : Engine(syst), _gameDescription(gamedesc) {
|
||||||
|
|
|
@ -20,19 +20,20 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mohawk/sound.h"
|
|
||||||
|
|
||||||
#include "common/debug.h"
|
#include "common/debug.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
|
|
||||||
|
#include "audio/midiparser.h"
|
||||||
#include "audio/musicplugin.h"
|
#include "audio/musicplugin.h"
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
#include "audio/decoders/mp3.h"
|
#include "audio/decoders/mp3.h"
|
||||||
#include "audio/decoders/raw.h"
|
#include "audio/decoders/raw.h"
|
||||||
#include "audio/decoders/wave.h"
|
#include "audio/decoders/wave.h"
|
||||||
|
|
||||||
|
#include "mohawk/sound.h"
|
||||||
|
|
||||||
namespace Mohawk {
|
namespace Mohawk {
|
||||||
|
|
||||||
Sound::Sound(MohawkEngine* vm) : _vm(vm) {
|
Sound::Sound(MohawkEngine* vm) : _vm(vm) {
|
||||||
|
|
|
@ -27,14 +27,15 @@
|
||||||
#include "common/str.h"
|
#include "common/str.h"
|
||||||
|
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
#include "audio/decoders/adpcm.h"
|
|
||||||
#include "audio/mididrv.h"
|
|
||||||
#include "audio/midiparser.h"
|
|
||||||
#include "audio/mixer.h"
|
#include "audio/mixer.h"
|
||||||
|
#include "audio/decoders/adpcm.h"
|
||||||
|
|
||||||
#include "mohawk/mohawk.h"
|
#include "mohawk/mohawk.h"
|
||||||
#include "mohawk/resource.h"
|
#include "mohawk/resource.h"
|
||||||
|
|
||||||
|
class MidiDriver;
|
||||||
|
class MidiParser;
|
||||||
|
|
||||||
namespace Mohawk {
|
namespace Mohawk {
|
||||||
|
|
||||||
#define MAX_CHANNELS 2 // Can there be more than 2?
|
#define MAX_CHANNELS 2 // Can there be more than 2?
|
||||||
|
|
|
@ -26,10 +26,9 @@
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
#include "common/mutex.h"
|
#include "common/mutex.h"
|
||||||
|
|
||||||
|
#include "audio/mixer.h"
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
#include "audio/decoders/iff_sound.h"
|
#include "audio/decoders/iff_sound.h"
|
||||||
#include "audio/mixer.h"
|
|
||||||
#include "audio/mididrv.h"
|
|
||||||
|
|
||||||
#define PATH_LEN 200
|
#define PATH_LEN 200
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
#include "common/memstream.h"
|
#include "common/memstream.h"
|
||||||
#include "common/textconsole.h"
|
#include "common/textconsole.h"
|
||||||
#include "audio/mididrv.h"
|
|
||||||
|
|
||||||
#include "saga/gfx.h"
|
#include "saga/gfx.h"
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include "common/savefile.h"
|
#include "common/savefile.h"
|
||||||
#include "common/system.h"
|
#include "common/system.h"
|
||||||
|
|
||||||
|
#include "audio/mididrv.h"
|
||||||
|
|
||||||
#include "scumm/detection.h"
|
#include "scumm/detection.h"
|
||||||
#include "scumm/detection_tables.h"
|
#include "scumm/detection_tables.h"
|
||||||
#include "scumm/he/intern_he.h"
|
#include "scumm/he/intern_he.h"
|
||||||
|
|
|
@ -299,7 +299,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
|
||||||
_haveActorSpeechMsg = false;
|
_haveActorSpeechMsg = false;
|
||||||
_useTalkAnims = false;
|
_useTalkAnims = false;
|
||||||
_defaultTalkDelay = 0;
|
_defaultTalkDelay = 0;
|
||||||
_musicType = MDT_NONE;
|
|
||||||
_saveSound = 0;
|
_saveSound = 0;
|
||||||
memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
|
memset(_extraBoxFlags, 0, sizeof(_extraBoxFlags));
|
||||||
memset(_scaleSlots, 0, sizeof(_scaleSlots));
|
memset(_scaleSlots, 0, sizeof(_scaleSlots));
|
||||||
|
@ -1746,36 +1745,36 @@ void ScummEngine::setupMusic(int midi) {
|
||||||
|
|
||||||
switch (MidiDriver::getMusicType(dev)) {
|
switch (MidiDriver::getMusicType(dev)) {
|
||||||
case MT_NULL:
|
case MT_NULL:
|
||||||
_musicType = MDT_NONE;
|
_sound->_musicType = MDT_NONE;
|
||||||
break;
|
break;
|
||||||
case MT_PCSPK:
|
case MT_PCSPK:
|
||||||
_musicType = MDT_PCSPK;
|
_sound->_musicType = MDT_PCSPK;
|
||||||
break;
|
break;
|
||||||
case MT_PCJR:
|
case MT_PCJR:
|
||||||
_musicType = MDT_PCJR;
|
_sound->_musicType = MDT_PCJR;
|
||||||
break;
|
break;
|
||||||
case MT_CMS:
|
case MT_CMS:
|
||||||
_musicType = MDT_CMS;
|
_musicType = MDT_CMS;
|
||||||
break;
|
break;
|
||||||
case MT_TOWNS:
|
case MT_TOWNS:
|
||||||
_musicType = MDT_TOWNS;
|
_sound->_musicType = MDT_TOWNS;
|
||||||
break;
|
break;
|
||||||
case MT_ADLIB:
|
case MT_ADLIB:
|
||||||
_musicType = MDT_ADLIB;
|
_sound->_musicType = MDT_ADLIB;
|
||||||
break;
|
break;
|
||||||
case MT_C64:
|
case MT_C64:
|
||||||
_musicType = MDT_C64;
|
_sound->_musicType = MDT_C64;
|
||||||
break;
|
break;
|
||||||
case MT_APPLEIIGS:
|
case MT_APPLEIIGS:
|
||||||
_musicType = MDT_APPLEIIGS;
|
_sound->_musicType = MDT_APPLEIIGS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_musicType = MDT_MIDI;
|
_sound->_musicType = MDT_MIDI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_game.id == GID_MONKEY_EGA || (_game.id == GID_LOOM && _game.version == 3))
|
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;
|
Common::String fileName;
|
||||||
bool missingFile = false;
|
bool missingFile = false;
|
||||||
if (_game.id == GID_LOOM) {
|
if (_game.id == GID_LOOM) {
|
||||||
|
@ -1805,7 +1804,7 @@ void ScummEngine::setupMusic(int midi) {
|
||||||
"but %s is missing. Using AdLib instead."), fileName.c_str()),
|
"but %s is missing. Using AdLib instead."), fileName.c_str()),
|
||||||
_("OK"));
|
_("OK"));
|
||||||
dialog.runModal();
|
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 */
|
* automatically when samples need to be generated */
|
||||||
if (!_mixer->isReady()) {
|
if (!_mixer->isReady()) {
|
||||||
warning("Sound mixer initialization failed");
|
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;
|
dev = 0;
|
||||||
_musicType = MDT_NONE;
|
_sound->_musicType = MDT_NONE;
|
||||||
warning("MIDI driver depends on sound mixer, switching to null MIDI driver");
|
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);
|
_musicEngine = new Player_V1(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);
|
||||||
} else if (_game.version <= 2) {
|
} else if (_game.version <= 2) {
|
||||||
_musicEngine = new Player_V2(this, _mixer, MidiDriver::getMusicType(dev) != MT_PCSPK);
|
_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);
|
_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);
|
_musicEngine = new Player_V2CMS(this, _mixer);
|
||||||
} else if (_game.platform == Common::kPlatform3DO && _game.heversion <= 62) {
|
} else if (_game.platform == Common::kPlatform3DO && _game.heversion <= 62) {
|
||||||
// 3DO versions use digital music and sound samples.
|
// 3DO versions use digital music and sound samples.
|
||||||
|
@ -1867,15 +1866,15 @@ void ScummEngine::setupMusic(int midi) {
|
||||||
MidiDriver *nativeMidiDriver = 0;
|
MidiDriver *nativeMidiDriver = 0;
|
||||||
MidiDriver *adlibMidiDriver = 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);
|
nativeMidiDriver = MidiDriver::createMidi(dev);
|
||||||
if (nativeMidiDriver != NULL && _native_mt32)
|
if (nativeMidiDriver != NULL && _native_mt32)
|
||||||
nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
|
nativeMidiDriver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE);
|
||||||
bool multi_midi = ConfMan.getBool("multi_midi") && _musicType != MDT_NONE && _musicType != MDT_PCSPK && (midi & MDT_ADLIB);
|
bool multi_midi = ConfMan.getBool("multi_midi") && _sound->_musicType != MDT_NONE && _sound->_musicType != MDT_PCSPK && (midi & MDT_ADLIB);
|
||||||
if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS || multi_midi) {
|
if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS || multi_midi) {
|
||||||
adlibMidiDriver = MidiDriver::createMidi(MidiDriver::detectDevice(_musicType == MDT_TOWNS ? MDT_TOWNS : MDT_ADLIB));
|
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);
|
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);
|
adlibMidiDriver = new PcSpkDriver(_mixer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1905,7 +1904,7 @@ void ScummEngine::setupMusic(int midi) {
|
||||||
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
|
_imuse->property(IMuse::PROP_LIMIT_PLAYERS, 1);
|
||||||
_imuse->property(IMuse::PROP_RECYCLE_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);
|
_imuse->property(IMuse::PROP_PC_SPEAKER, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,6 @@
|
||||||
#include "scumm/detection.h"
|
#include "scumm/detection.h"
|
||||||
#include "scumm/script.h"
|
#include "scumm/script.h"
|
||||||
|
|
||||||
#include "audio/mididrv.h"
|
|
||||||
|
|
||||||
#ifdef __DS__
|
#ifdef __DS__
|
||||||
/* This disables the dual layer mode which is used in FM-Towns versions
|
/* This disables the dual layer mode which is used in FM-Towns versions
|
||||||
* of SCUMM games and which emulates the behavior of the original code.
|
* of SCUMM games and which emulates the behavior of the original code.
|
||||||
|
@ -1085,7 +1083,6 @@ protected:
|
||||||
int _saveSound;
|
int _saveSound;
|
||||||
bool _native_mt32;
|
bool _native_mt32;
|
||||||
bool _enable_gs;
|
bool _enable_gs;
|
||||||
MidiDriverFlags _musicType;
|
|
||||||
bool _copyProtection;
|
bool _copyProtection;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -84,6 +84,8 @@ Sound::Sound(ScummEngine *parent, Audio::Mixer *mixer)
|
||||||
memset(_soundQue, 0, sizeof(_soundQue));
|
memset(_soundQue, 0, sizeof(_soundQue));
|
||||||
memset(_soundQue2, 0, sizeof(_soundQue2));
|
memset(_soundQue2, 0, sizeof(_soundQue2));
|
||||||
memset(_mouthSyncTimes, 0, sizeof(_mouthSyncTimes));
|
memset(_mouthSyncTimes, 0, sizeof(_mouthSyncTimes));
|
||||||
|
|
||||||
|
_musicType = MDT_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sound::~Sound() {
|
Sound::~Sound() {
|
||||||
|
@ -1094,7 +1096,7 @@ int ScummEngine::readSoundResource(ResId idx) {
|
||||||
switch (basetag) {
|
switch (basetag) {
|
||||||
case MKTAG('M','I','D','I'):
|
case MKTAG('M','I','D','I'):
|
||||||
case MKTAG('i','M','U','S'):
|
case MKTAG('i','M','U','S'):
|
||||||
if (_musicType != MDT_PCSPK && _musicType != MDT_PCJR) {
|
if (_sound->_musicType != MDT_PCSPK && _sound->_musicType != MDT_PCJR) {
|
||||||
_fileHandle->seek(-8, SEEK_CUR);
|
_fileHandle->seek(-8, SEEK_CUR);
|
||||||
_fileHandle->read(_res->createResource(rtSound, idx, total_size + 8), total_size + 8);
|
_fileHandle->read(_res->createResource(rtSound, idx, total_size + 8), total_size + 8);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1118,7 +1120,7 @@ int ScummEngine::readSoundResource(ResId idx) {
|
||||||
break;
|
break;
|
||||||
case MKTAG('A','D','L',' '):
|
case MKTAG('A','D','L',' '):
|
||||||
pri = 1;
|
pri = 1;
|
||||||
if (_musicType == MDT_ADLIB || _musicType == MDT_TOWNS)
|
if (_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS)
|
||||||
pri = 10;
|
pri = 10;
|
||||||
break;
|
break;
|
||||||
case MKTAG('A','M','I',' '):
|
case MKTAG('A','M','I',' '):
|
||||||
|
@ -1137,7 +1139,7 @@ int ScummEngine::readSoundResource(ResId idx) {
|
||||||
break;
|
break;
|
||||||
case MKTAG('S','P','K',' '):
|
case MKTAG('S','P','K',' '):
|
||||||
pri = -1;
|
pri = -1;
|
||||||
if (_musicType == MDT_PCSPK || _musicType == MDT_PCJR)
|
if (_sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR)
|
||||||
pri = 11;
|
pri = 11;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1145,7 +1147,7 @@ int ScummEngine::readSoundResource(ResId idx) {
|
||||||
// We only allow SPK resources for PC Speaker, PCJr and CMS here
|
// We only allow SPK resources for PC Speaker, PCJr and CMS here
|
||||||
// since other resource would sound horribly with their output
|
// since other resource would sound horribly with their output
|
||||||
// drivers.
|
// drivers.
|
||||||
if ((_musicType == MDT_PCSPK || _musicType == MDT_PCJR || _musicType == MDT_CMS) && pri != 11)
|
if ((_sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR || _sound->_musicType == MDT_CMS) && pri != 11)
|
||||||
pri = -1;
|
pri = -1;
|
||||||
|
|
||||||
// We only allow ADL resources when AdLib or FM-Towns is used as
|
// We only allow ADL resources when AdLib or FM-Towns is used as
|
||||||
|
@ -1155,7 +1157,7 @@ int ScummEngine::readSoundResource(ResId idx) {
|
||||||
// only contains a ROL resource for sound id 60. Formerly we tried
|
// only contains a ROL resource for sound id 60. Formerly we tried
|
||||||
// to play that via the AdLib or FM-Towns audio driver resulting
|
// to play that via the AdLib or FM-Towns audio driver resulting
|
||||||
// in strange noises. Now we behave like the original did.
|
// in strange noises. Now we behave like the original did.
|
||||||
if ((_musicType == MDT_ADLIB || _musicType == MDT_TOWNS) && pri != 10)
|
if ((_sound->_musicType == MDT_ADLIB || _sound->_musicType == MDT_TOWNS) && pri != 10)
|
||||||
pri = -1;
|
pri = -1;
|
||||||
|
|
||||||
debugC(DEBUG_RESOURCE, " tag: %s, total_size=%d, pri=%d", tag2str(tag), size, pri);
|
debugC(DEBUG_RESOURCE, " tag: %s, total_size=%d, pri=%d", tag2str(tag), size, pri);
|
||||||
|
@ -2095,7 +2097,7 @@ int ScummEngine::readSoundResourceSmallHeader(ResId idx) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_musicType == MDT_PCSPK || _musicType == MDT_PCJR) && wa_offs != 0) {
|
if ((_sound->_musicType == MDT_PCSPK || _sound->_musicType == MDT_PCJR) && wa_offs != 0) {
|
||||||
if (_game.features & GF_OLD_BUNDLE) {
|
if (_game.features & GF_OLD_BUNDLE) {
|
||||||
_fileHandle->seek(wa_offs, SEEK_SET);
|
_fileHandle->seek(wa_offs, SEEK_SET);
|
||||||
_fileHandle->read(_res->createResource(rtSound, idx, wa_size), wa_size);
|
_fileHandle->read(_res->createResource(rtSound, idx, wa_size), wa_size);
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include "common/scummsys.h"
|
#include "common/scummsys.h"
|
||||||
#include "audio/audiostream.h"
|
#include "audio/audiostream.h"
|
||||||
|
#include "audio/mididrv.h"
|
||||||
#include "audio/mixer.h"
|
#include "audio/mixer.h"
|
||||||
#include "scumm/saveload.h"
|
#include "scumm/saveload.h"
|
||||||
|
|
||||||
|
@ -90,6 +91,8 @@ public:
|
||||||
byte _sfxMode;
|
byte _sfxMode;
|
||||||
uint _lastSound;
|
uint _lastSound;
|
||||||
|
|
||||||
|
MidiDriverFlags _musicType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Sound(ScummEngine *parent, Audio::Mixer *mixer);
|
Sound(ScummEngine *parent, Audio::Mixer *mixer);
|
||||||
virtual ~Sound();
|
virtual ~Sound();
|
||||||
|
|
|
@ -25,9 +25,12 @@
|
||||||
#include "scumm/scumm.h"
|
#include "scumm/scumm.h"
|
||||||
#include "scumm/scumm_v0.h"
|
#include "scumm/scumm_v0.h"
|
||||||
#include "scumm/scumm_v8.h"
|
#include "scumm/scumm_v8.h"
|
||||||
|
#include "scumm/sound.h"
|
||||||
#include "scumm/he/intern_he.h"
|
#include "scumm/he/intern_he.h"
|
||||||
#include "scumm/he/logic_he.h"
|
#include "scumm/he/logic_he.h"
|
||||||
|
|
||||||
|
#include "audio/mididrv.h"
|
||||||
|
|
||||||
namespace Scumm {
|
namespace Scumm {
|
||||||
|
|
||||||
void ScummEngine::setupScummVars() {
|
void ScummEngine::setupScummVars() {
|
||||||
|
@ -722,7 +725,7 @@ void ScummEngine::resetScummVars() {
|
||||||
// 2 CMS
|
// 2 CMS
|
||||||
// 3 AdLib
|
// 3 AdLib
|
||||||
// 4 Roland
|
// 4 Roland
|
||||||
switch (_musicType) {
|
switch (_sound->_musicType) {
|
||||||
case MDT_NONE:
|
case MDT_NONE:
|
||||||
case MDT_PCSPK:
|
case MDT_PCSPK:
|
||||||
VAR(VAR_SOUNDCARD) = 0;
|
VAR(VAR_SOUNDCARD) = 0;
|
||||||
|
|
|
@ -31,9 +31,6 @@
|
||||||
#include "common/random.h"
|
#include "common/random.h"
|
||||||
#include "common/util.h"
|
#include "common/util.h"
|
||||||
|
|
||||||
#include "audio/mididrv.h"
|
|
||||||
#include "audio/mixer.h"
|
|
||||||
|
|
||||||
#include "engines/engine.h"
|
#include "engines/engine.h"
|
||||||
#include "tinsel/debugger.h"
|
#include "tinsel/debugger.h"
|
||||||
#include "tinsel/graphics.h"
|
#include "tinsel/graphics.h"
|
||||||
|
@ -53,6 +50,7 @@ namespace Tinsel {
|
||||||
|
|
||||||
class BMVPlayer;
|
class BMVPlayer;
|
||||||
class Config;
|
class Config;
|
||||||
|
class MidiDriver;
|
||||||
class MidiMusicPlayer;
|
class MidiMusicPlayer;
|
||||||
class PCMMusicPlayer;
|
class PCMMusicPlayer;
|
||||||
class Scheduler;
|
class Scheduler;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue