Merged lots of _mixer->isReady() warnings into a single one in Engine constructor

svn-id: r30871
This commit is contained in:
Max Horn 2008-02-15 17:01:35 +00:00
parent 98c661d70f
commit 88bb567e18
15 changed files with 11 additions and 52 deletions

View file

@ -201,11 +201,9 @@ static int runGame(const Plugin *plugin, OSystem &system, const Common::String &
// Inform backend that the engine is about to be run
system.engineInit();
int result;
// Init the engine (this might change the screen parameters)
// TODO: We should specify what return values
result = engine->init();
int result = engine->init();
// Run the game engine if the initialization was successful.
if (result == 0) {

View file

@ -622,10 +622,6 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));

View file

@ -54,10 +54,6 @@ namespace Agi {
PreAgiEngine::PreAgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));

View file

@ -545,9 +545,6 @@ int AGOSEngine::init() {
_system->endGFXTransaction();
// Setup mixer
if (!_mixer->isReady())
warning("Sound initialization failed. "
"Features of the game that depend on sound synchronization will most likely break");
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));

View file

@ -56,10 +56,6 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng
Common::addSpecialDebugLevel(kCineDebugSound, "Sound", "Sound debug level");
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));

View file

@ -54,10 +54,6 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc
"Script debug level");
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType,
ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType,

View file

@ -56,10 +56,6 @@ static const GameSettings drasculaSettings[] = {
DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));

View file

@ -58,6 +58,16 @@ Engine::Engine(OSystem *syst)
g_engine = this;
_autosavePeriod = ConfMan.getInt("autosave_period");
// FIXME: Get rid of the following again. It is only here temporarily.
// We really should never run with a non-working Mixer, so ought to handle
// this at a much earlier stage. If we *really* want to support systems
// without a working mixer, then we need more work. E.g. we could modify the
// Mixer to immediately drop any streams passed to it. This way, at least
// we don't crash because heaps of (sound) memory get allocated but never
// freed. Of course, there still would be problems with many games...
if (!_mixer->isReady())
warning("Sound initialization failed. This may cause severe problems in some games.");
}
Engine::~Engine() {

View file

@ -82,9 +82,6 @@ int KyraEngine::init() {
registerDefaultSettings();
// Setup mixer
if (!_mixer->isReady())
warning("Sound initialization failed.");
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));

View file

@ -48,12 +48,6 @@ LureEngine::LureEngine(OSystem *system, const LureGameDescription *gameDesc): En
Common::addSpecialDebugLevel(kLureDebugFights, "fights", "Fights debugging");
Common::addSpecialDebugLevel(kLureDebugSounds, "sounds", "Sounds debugging");
Common::addSpecialDebugLevel(kLureDebugStrings, "strings", "Strings debugging");
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
}
int LureEngine::init() {

View file

@ -424,8 +424,6 @@ int QueenEngine::init() {
_logic = new LogicGame(this);
}
if (!_mixer->isReady())
warning("Sound initialisation failed");
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
// Set mixer music volume to maximum, since music volume is regulated by MusicPlayer's MIDI messages
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, Audio::Mixer::kMaxMixerVolume);

View file

@ -108,11 +108,6 @@ SagaEngine::SagaEngine(OSystem *syst, const SAGAGameDescription *gameDesc)
// Mac CD Wyrmkeep
Common::File::addDefaultDirectory(_gameDataPath + "patch/");
// Setup mixer
if (!_mixer->isReady()) {
warning("Sound initialization failed.");
}
_displayClip.left = _displayClip.top = 0;
syst->getEventManager()->registerRandomSource(_rnd, "saga");
}

View file

@ -371,9 +371,6 @@ int SkyEngine::init() {
_system->initSize(320, 200);
_system->endGFXTransaction();
if (!_mixer->isReady())
warning("Sound initialisation failed");
if (ConfMan.getBool("sfx_mute")) {
SkyEngine::_systemVars.systemFlags |= SF_FX_OFF;
}

View file

@ -201,9 +201,6 @@ SwordEngine::SwordEngine(OSystem *syst)
else
_features = 0;
if (!_mixer->isReady())
warning("Sound initialization failed");
// Add default file directories
Common::File::addDefaultDirectory(_gameDataPath + "CLUSTERS/");
Common::File::addDefaultDirectory(_gameDataPath + "MUSIC/");

View file

@ -328,10 +328,6 @@ int Sword2Engine::init() {
_sound = new Sound(this);
_mouse = new Mouse(this);
// Setup mixer
if (!_mixer->isReady())
warning("Sound initialization failed");
registerDefaultSettings();
readSettings();