aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-02-15 17:01:35 +0000
committerMax Horn2008-02-15 17:01:35 +0000
commit88bb567e182ffd6bdc17a2c7c06990686677d81c (patch)
tree59045356b76adcb0309b7ef3cf5b5772a2883ccc
parent98c661d70fca0dafc0a769c918cbb03d44642b96 (diff)
downloadscummvm-rg350-88bb567e182ffd6bdc17a2c7c06990686677d81c.tar.gz
scummvm-rg350-88bb567e182ffd6bdc17a2c7c06990686677d81c.tar.bz2
scummvm-rg350-88bb567e182ffd6bdc17a2c7c06990686677d81c.zip
Merged lots of _mixer->isReady() warnings into a single one in Engine constructor
svn-id: r30871
-rw-r--r--base/main.cpp4
-rw-r--r--engines/agi/agi.cpp4
-rw-r--r--engines/agi/preagi.cpp4
-rw-r--r--engines/agos/agos.cpp3
-rw-r--r--engines/cine/cine.cpp4
-rw-r--r--engines/cruise/cruise.cpp4
-rw-r--r--engines/drascula/drascula.cpp4
-rw-r--r--engines/engine.cpp10
-rw-r--r--engines/kyra/kyra.cpp3
-rw-r--r--engines/lure/lure.cpp6
-rw-r--r--engines/queen/queen.cpp2
-rw-r--r--engines/saga/saga.cpp5
-rw-r--r--engines/sky/sky.cpp3
-rw-r--r--engines/sword1/sword1.cpp3
-rw-r--r--engines/sword2/sword2.cpp4
15 files changed, 11 insertions, 52 deletions
diff --git a/base/main.cpp b/base/main.cpp
index f51e97dfdd..4e330c0178 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -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) {
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index f0c3f62e30..0a5ef71f0e 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -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"));
diff --git a/engines/agi/preagi.cpp b/engines/agi/preagi.cpp
index d8a304c001..f2301e012a 100644
--- a/engines/agi/preagi.cpp
+++ b/engines/agi/preagi.cpp
@@ -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"));
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 12e91b9fd0..e6b5461717 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -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"));
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 5633df82af..8037502b96 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -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"));
diff --git a/engines/cruise/cruise.cpp b/engines/cruise/cruise.cpp
index 43e74a4300..f9487165e1 100644
--- a/engines/cruise/cruise.cpp
+++ b/engines/cruise/cruise.cpp
@@ -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,
diff --git a/engines/drascula/drascula.cpp b/engines/drascula/drascula.cpp
index 8a7ca55439..6e2a990270 100644
--- a/engines/drascula/drascula.cpp
+++ b/engines/drascula/drascula.cpp
@@ -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"));
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 6f40e936b6..757a77f82b 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -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() {
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp
index ba3383ccd2..0cadaa02a6 100644
--- a/engines/kyra/kyra.cpp
+++ b/engines/kyra/kyra.cpp
@@ -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"));
diff --git a/engines/lure/lure.cpp b/engines/lure/lure.cpp
index 627431e86e..de213b4f5a 100644
--- a/engines/lure/lure.cpp
+++ b/engines/lure/lure.cpp
@@ -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() {
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index ee71c18a62..cd492b7934 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -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);
diff --git a/engines/saga/saga.cpp b/engines/saga/saga.cpp
index 0420f6a0b9..33d78a2e11 100644
--- a/engines/saga/saga.cpp
+++ b/engines/saga/saga.cpp
@@ -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");
}
diff --git a/engines/sky/sky.cpp b/engines/sky/sky.cpp
index 1653d8b223..9c0f3de9e6 100644
--- a/engines/sky/sky.cpp
+++ b/engines/sky/sky.cpp
@@ -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;
}
diff --git a/engines/sword1/sword1.cpp b/engines/sword1/sword1.cpp
index f446258fc9..f58f39c986 100644
--- a/engines/sword1/sword1.cpp
+++ b/engines/sword1/sword1.cpp
@@ -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/");
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index 2634a96962..d86c5b6c9e 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -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();