[Scummvm-cvs-logs] SF.net SVN: scummvm: [30871] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Feb 15 18:01:36 CET 2008


Revision: 30871
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30871&view=rev
Author:   fingolfin
Date:     2008-02-15 09:01:35 -0800 (Fri, 15 Feb 2008)

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

Modified Paths:
--------------
    scummvm/trunk/base/main.cpp
    scummvm/trunk/engines/agi/agi.cpp
    scummvm/trunk/engines/agi/preagi.cpp
    scummvm/trunk/engines/agos/agos.cpp
    scummvm/trunk/engines/cine/cine.cpp
    scummvm/trunk/engines/cruise/cruise.cpp
    scummvm/trunk/engines/drascula/drascula.cpp
    scummvm/trunk/engines/engine.cpp
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/lure/lure.cpp
    scummvm/trunk/engines/queen/queen.cpp
    scummvm/trunk/engines/saga/saga.cpp
    scummvm/trunk/engines/sky/sky.cpp
    scummvm/trunk/engines/sword1/sword1.cpp
    scummvm/trunk/engines/sword2/sword2.cpp

Modified: scummvm/trunk/base/main.cpp
===================================================================
--- scummvm/trunk/base/main.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/base/main.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -201,11 +201,9 @@
 	// 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) {

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/agi/agi.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -622,10 +622,6 @@
 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"));
 

Modified: scummvm/trunk/engines/agi/preagi.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/agi/preagi.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -54,10 +54,6 @@
 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"));
 

Modified: scummvm/trunk/engines/agos/agos.cpp
===================================================================
--- scummvm/trunk/engines/agos/agos.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/agos/agos.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -545,9 +545,6 @@
 	_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"));
 

Modified: scummvm/trunk/engines/cine/cine.cpp
===================================================================
--- scummvm/trunk/engines/cine/cine.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/cine/cine.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -56,10 +56,6 @@
 	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"));
 

Modified: scummvm/trunk/engines/cruise/cruise.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/cruise/cruise.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -54,10 +54,6 @@
 	    "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,

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -56,10 +56,6 @@
 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"));
 

Modified: scummvm/trunk/engines/engine.cpp
===================================================================
--- scummvm/trunk/engines/engine.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/engine.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -58,6 +58,16 @@
 
 	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() {

Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -82,9 +82,6 @@
 	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"));

Modified: scummvm/trunk/engines/lure/lure.cpp
===================================================================
--- scummvm/trunk/engines/lure/lure.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/lure/lure.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -48,12 +48,6 @@
 	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() {

Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/queen/queen.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -424,8 +424,6 @@
 		_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);

Modified: scummvm/trunk/engines/saga/saga.cpp
===================================================================
--- scummvm/trunk/engines/saga/saga.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/saga/saga.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -108,11 +108,6 @@
 	// 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");
 }

Modified: scummvm/trunk/engines/sky/sky.cpp
===================================================================
--- scummvm/trunk/engines/sky/sky.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/sky/sky.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -371,9 +371,6 @@
 		_system->initSize(320, 200);
 	_system->endGFXTransaction();
 
-	if (!_mixer->isReady())
-		warning("Sound initialisation failed");
-
 	if (ConfMan.getBool("sfx_mute")) {
 		SkyEngine::_systemVars.systemFlags |= SF_FX_OFF;
 	}

Modified: scummvm/trunk/engines/sword1/sword1.cpp
===================================================================
--- scummvm/trunk/engines/sword1/sword1.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/sword1/sword1.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -201,9 +201,6 @@
 	else
 		_features = 0;
 
-	if (!_mixer->isReady())
-		warning("Sound initialization failed");
-
 	// Add default file directories
 	Common::File::addDefaultDirectory(_gameDataPath + "CLUSTERS/");
 	Common::File::addDefaultDirectory(_gameDataPath + "MUSIC/");

Modified: scummvm/trunk/engines/sword2/sword2.cpp
===================================================================
--- scummvm/trunk/engines/sword2/sword2.cpp	2008-02-15 16:50:24 UTC (rev 30870)
+++ scummvm/trunk/engines/sword2/sword2.cpp	2008-02-15 17:01:35 UTC (rev 30871)
@@ -328,10 +328,6 @@
 	_sound = new Sound(this);
 	_mouse = new Mouse(this);
 
-	// Setup mixer
-	if (!_mixer->isReady())
-		warning("Sound initialization failed");
-
 	registerDefaultSettings();
 	readSettings();
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list