From f878820bbee1e7e4659ca601872674082334fa63 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Tue, 24 Jun 2008 21:15:30 +0000 Subject: Created Global Main Menu Dialog. Made a uniform _quit flag for engines. So far agi, agos, and cine are now using the new _quit flag. svn-id: r32770 --- engines/engine.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 757a77f82b..29135d9323 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -36,7 +36,9 @@ #include "common/savefile.h" #include "common/system.h" #include "gui/message.h" +#include "gui/newgui.h" #include "sound/mixer.h" +#include "engines/dialogs.h" #ifdef _WIN32_WCE extern bool isSmartphone(void); @@ -54,7 +56,10 @@ Engine::Engine(OSystem *syst) _saveFileMan(_system->getSavefileManager()), _targetName(ConfMan.getActiveDomainName()), _gameDataPath(ConfMan.get("path")), - _pauseLevel(0) { + _pauseLevel(0), + _mainMenuDialog(NULL), + _quit(false), + _rtl(false) { g_engine = this; _autosavePeriod = ConfMan.getInt("autosave_period"); @@ -210,3 +215,21 @@ void Engine::pauseEngineIntern(bool pause) { // By default, just (un)pause all digital sounds _mixer->pauseAll(pause); } + +void Engine::mainMenuDialog() { + if (!_mainMenuDialog) + _mainMenuDialog = new MainMenuDialog(this); + runDialog(*_mainMenuDialog); +} + +int Engine::runDialog(Dialog &dialog) { + + pauseEngine(true); + + int result = dialog.runModal(); + + pauseEngine(false); + + return 0; +} + -- cgit v1.2.3 From e36166bda291f6f0af8af3328efce5aa4b83cd9a Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Thu, 26 Jun 2008 23:22:28 +0000 Subject: Added syncSoundSettings() to Engine, sound settings can now be modified from the global main menu for most engines svn-id: r32815 --- engines/engine.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/engine.cpp') 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); +} -- cgit v1.2.3 From e808cdf7a08d641389ecc81063b3b1016c7bc8cf Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 9 Jul 2008 02:27:05 +0000 Subject: Reimplemented pushEvent() and artificialEventQueue to work with Events instead of EventTypes. Reimplemented Queue as a List instead of Array. Updated AGOS, AGI, CINE, GOB, and KYRA to work with the current implementation of the GMM svn-id: r32971 --- engines/engine.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 3a13c275ba..ffc044a508 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -246,3 +246,10 @@ void Engine::syncSoundSettings() { _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX); _mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech); } + +void Engine::quitGame() { + Common::Event event; + + event.type = Common::EVENT_QUIT; + _eventMan->pushEvent(event); +} -- cgit v1.2.3 From e30d16ddc25f784273ad20ca9833825580240a6f Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Tue, 5 Aug 2008 21:56:45 +0000 Subject: Fixed more warnings svn-id: r33649 --- engines/engine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index ffc044a508..6943227594 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -228,7 +228,7 @@ int Engine::runDialog(Dialog &dialog) { pauseEngine(true); - int result = dialog.runModal(); + dialog.runModal(); pauseEngine(false); -- cgit v1.2.3 From f41471d34bb6afb1dc0b6604b1952d10ef583765 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 6 Aug 2008 21:47:20 +0000 Subject: Engine::runDialog() returns a value now svn-id: r33672 --- engines/engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 6943227594..8f2c1be8eb 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -228,11 +228,11 @@ int Engine::runDialog(Dialog &dialog) { pauseEngine(true); - dialog.runModal(); + int result = dialog.runModal(); pauseEngine(false); - return 0; + return result; } void Engine::syncSoundSettings() { -- cgit v1.2.3 From 8d8c46e36fade04d4452f0ce1fbdd3ee942ac898 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Wed, 13 Aug 2008 20:45:00 +0000 Subject: Cleanup: Got rid of _quit and _rtl variables in engine.h/.cpp which are not used anymore. Found some _quit flags in Agos and Gob and replaced with bool quit() where appropriate svn-id: r33848 --- engines/engine.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 8f2c1be8eb..e3f53670b5 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -57,9 +57,7 @@ Engine::Engine(OSystem *syst) _targetName(ConfMan.getActiveDomainName()), _gameDataPath(ConfMan.get("path")), _pauseLevel(0), - _mainMenuDialog(NULL), - _quit(false), - _rtl(false) { + _mainMenuDialog(NULL) { g_engine = this; _autosavePeriod = ConfMan.getInt("autosave_period"); -- cgit v1.2.3 From ec8dac5540d87925525523eb1715abc1ec271261 Mon Sep 17 00:00:00 2001 From: Christopher Page Date: Sat, 16 Aug 2008 02:53:16 +0000 Subject: Added a MetaEngineFeature for RTL support, the RTL button is disabled in the GMM if the engine doesn't support it svn-id: r33921 --- engines/engine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index e3f53670b5..4840b19838 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -39,6 +39,7 @@ #include "gui/newgui.h" #include "sound/mixer.h" #include "engines/dialogs.h" +#include "engines/metaengine.h" #ifdef _WIN32_WCE extern bool isSmartphone(void); @@ -251,3 +252,13 @@ void Engine::quitGame() { event.type = Common::EVENT_QUIT; _eventMan->pushEvent(event); } + +bool Engine::hasFeature(int f) { + const EnginePlugin *plugin = 0; + Common::String gameid = ConfMan.get("gameid"); + gameid.toLowercase(); + EngineMan.findGame(gameid, &plugin); + + return ( (*plugin)->hasFeature((MetaEngine::MetaEngineFeature)f) ); +} + -- cgit v1.2.3 From f5462901b24f5a1191f3d68d866e4ee75a006347 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 7 Sep 2008 15:16:45 +0000 Subject: Temporary workaround for bug #2098279: ALL: Game path with no trailing backslash fails svn-id: r34408 --- engines/engine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 4840b19838..95081e6645 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -56,7 +56,11 @@ Engine::Engine(OSystem *syst) _eventMan(_system->getEventManager()), _saveFileMan(_system->getSavefileManager()), _targetName(ConfMan.getActiveDomainName()), - _gameDataPath(ConfMan.get("path")), + + // FIXME: Temporary workaround for "missing" slashes at the end + // of _gameDataPath. This can go once we completed the transition + // to the new Archive/SearchPath system. See also bug #2098279. + _gameDataPath(ConfMan.get("path") + '/'), _pauseLevel(0), _mainMenuDialog(NULL) { -- cgit v1.2.3 From f6c4df8281b00f92ccc040f99e33b28d933b9fa3 Mon Sep 17 00:00:00 2001 From: Lars Persson Date: Sun, 7 Sep 2008 19:19:45 +0000 Subject: Symbian already store all paths with a trailing "\". Quick fix waiting for proper solution svn-id: r34423 --- engines/engine.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 95081e6645..2c6df225e5 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -60,7 +60,11 @@ Engine::Engine(OSystem *syst) // FIXME: Temporary workaround for "missing" slashes at the end // of _gameDataPath. This can go once we completed the transition // to the new Archive/SearchPath system. See also bug #2098279. +#ifdef __SYMBIAN32__ + _gameDataPath(ConfMan.get("path")), +#else _gameDataPath(ConfMan.get("path") + '/'), +#endif _pauseLevel(0), _mainMenuDialog(NULL) { -- cgit v1.2.3 From 2bc093828f0c626c7dd57f9cb300284b8563e411 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 7 Sep 2008 22:10:58 +0000 Subject: Replaced Engine::_gameDataPath (a String) by Engine::_gameDataDir (an FSNode); adapted code to that (by using getChild() to get subdirs, not string concatenation svn-id: r34434 --- engines/engine.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'engines/engine.cpp') diff --git a/engines/engine.cpp b/engines/engine.cpp index 2c6df225e5..1d3368b10d 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -56,15 +56,7 @@ Engine::Engine(OSystem *syst) _eventMan(_system->getEventManager()), _saveFileMan(_system->getSavefileManager()), _targetName(ConfMan.getActiveDomainName()), - - // FIXME: Temporary workaround for "missing" slashes at the end - // of _gameDataPath. This can go once we completed the transition - // to the new Archive/SearchPath system. See also bug #2098279. -#ifdef __SYMBIAN32__ - _gameDataPath(ConfMan.get("path")), -#else - _gameDataPath(ConfMan.get("path") + '/'), -#endif + _gameDataDir(ConfMan.get("path")), _pauseLevel(0), _mainMenuDialog(NULL) { @@ -158,12 +150,12 @@ void Engine::checkCD() { char buffer[MAXPATHLEN]; int i; - if (strlen(_gameDataPath.c_str()) == 0) { + if (_gameDataDir.getPath().empty()) { // That's it! I give up! if (getcwd(buffer, MAXPATHLEN) == NULL) return; } else - strncpy(buffer, _gameDataPath.c_str(), MAXPATHLEN); + strncpy(buffer, _gameDataDir.getPath().c_str(), MAXPATHLEN); for (i = 0; i < MAXPATHLEN - 1; i++) { if (buffer[i] == '\\') -- cgit v1.2.3