diff options
-rw-r--r-- | engines/agos/agos.cpp | 23 | ||||
-rw-r--r-- | engines/agos/agos.h | 2 | ||||
-rw-r--r-- | engines/engine.cpp | 15 | ||||
-rw-r--r-- | engines/engine.h | 9 |
4 files changed, 26 insertions, 23 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp index 0b08f659f3..f888931ad0 100644 --- a/engines/agos/agos.cpp +++ b/engines/agos/agos.cpp @@ -30,10 +30,6 @@ #include "common/system.h" #include "common/events.h" -//#include "gui/message.h" -//#include "gui/newgui.h" - -//#include "agos/dialogs.h" #include "agos/debugger.h" #include "agos/intern.h" #include "agos/agos.h" @@ -197,8 +193,6 @@ AGOSEngine::AGOSEngine(OSystem *syst) _backFlag = 0; - //_mainMenuDialog = NULL; - _debugMode = 0; _startMainScript = false; _continousMainScript = false; @@ -1084,25 +1078,12 @@ uint32 AGOSEngine::getTime() const { // FIXME: calling time() is not portable, use OSystem::getMillis instead return (uint32)time(NULL); } -/* -int AGOSEngine::runDialog(Dialog &dialog) { - - pauseEngine(true); - - int result = dialog.runModal(); - pauseEngine(false); - return 0; -} -/* -void AGOSEngine::mainMenuDialog() { - if (!_mainMenuDialog) - _mainMenuDialog = new MainMenuDialog(this); - runDialog(*_mainMenuDialog); +void AGOSEngine::syncSoundSettings() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume")); _midi.setVolume(ConfMan.getInt("music_volume")); } -*/ + } // End of namespace AGOS diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 87a6d2298a..11c04cd021 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -589,6 +589,8 @@ protected: void loadSoundFile(const char *filename); + virtual void syncSoundSettings(); + int getUserFlag(Item *item, int a); int getUserFlag1(Item *item, int a); int getUserItem(Item *item, int n); diff --git a/engines/engine.cpp b/engines/engine.cpp index 29135d9323..3a13c275ba 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -77,7 +77,8 @@ Engine::Engine(OSystem *syst) Engine::~Engine() { _mixer->stopAll(); - + + delete _mainMenuDialog; g_engine = NULL; } @@ -220,6 +221,7 @@ void Engine::mainMenuDialog() { if (!_mainMenuDialog) _mainMenuDialog = new MainMenuDialog(this); runDialog(*_mainMenuDialog); + syncSoundSettings(); } int Engine::runDialog(Dialog &dialog) { @@ -233,3 +235,14 @@ int Engine::runDialog(Dialog &dialog) { return 0; } +void Engine::syncSoundSettings() { + + // Sync the engine with the config manager + int soundVolumeMusic = ConfMan.getInt("music_volume"); + int soundVolumeSFX = ConfMan.getInt("sfx_volume"); + int soundVolumeSpeech = ConfMan.getInt("speech_volume"); + + _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic); + _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); + _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); +} diff --git a/engines/engine.h b/engines/engine.h index 6918d14cd5..4be5527a8c 100644 --- a/engines/engine.h +++ b/engines/engine.h @@ -61,8 +61,8 @@ protected: Common::SaveFileManager *_saveFileMan; Dialog *_mainMenuDialog; + virtual int runDialog(Dialog &dialog); - virtual int runDialog(Dialog &dialog); const Common::String _targetName; // target name for saves const Common::String _gameDataPath; @@ -125,8 +125,15 @@ public: */ bool isPaused() const { return _pauseLevel != 0; } + + /** Run the Global Main Menu Dialog + */ void mainMenuDialog(); + /** Sync the engine's sound settings with the config manager + */ + virtual void syncSoundSettings(); + public: /** Setup the backend's graphics mode. */ |