aboutsummaryrefslogtreecommitdiff
path: root/base/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'base/main.cpp')
-rw-r--r--base/main.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 349f719ed5..c52888a827 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -51,6 +51,7 @@
#include "common/textconsole.h"
#include "common/tokenizer.h"
#include "common/translation.h"
+#include "common/osd_message_queue.h"
#include "gui/gui-manager.h"
#include "gui/error.h"
@@ -66,6 +67,15 @@
#endif
#include "backends/keymapper/keymapper.h"
+#ifdef USE_CLOUD
+#ifdef USE_LIBCURL
+#include "backends/cloud/cloudmanager.h"
+#include "backends/networking/curl/connectionmanager.h"
+#endif
+#ifdef USE_SDL_NET
+#include "backends/networking/sdl_net/localwebserver.h"
+#endif
+#endif
#if defined(_WIN32_WCE)
#include "backends/platform/wince/CELauncherDialog.h"
@@ -283,6 +293,8 @@ static void setupGraphics(OSystem &system) {
system.setFeatureState(OSystem::kFeatureAspectRatioCorrection, ConfMan.getBool("aspect_ratio"));
if (ConfMan.hasKey("fullscreen"))
system.setFeatureState(OSystem::kFeatureFullscreenMode, ConfMan.getBool("fullscreen"));
+ if (ConfMan.hasKey("filtering"))
+ system.setFeatureState(OSystem::kFeatureFilteringMode, ConfMan.getBool("filtering"));
system.endGFXTransaction();
// When starting up launcher for the first time, the user might have specified
@@ -391,6 +403,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
} else if (ConfMan.hasKey("debugflags"))
specialDebug = ConfMan.get("debugflags");
+ if (settings.contains("debug-channels-only"))
+ gDebugChannelsOnly = true;
+
+
PluginManager::instance().init();
PluginManager::instance().loadAllPlugins(); // load plugins for cached plugin manager
@@ -462,6 +478,8 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
g_eventRec.RegisterEventSource();
#endif
+ Common::OSDMessageQueue::instance().registerEventSource();
+
// Now as the event manager is created, setup the keymapper
setupKeymapper(system);
@@ -472,6 +490,11 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
}
#endif
+#if defined(USE_CLOUD) && defined(USE_LIBCURL)
+ CloudMan.init();
+ CloudMan.syncSaves();
+#endif
+
// Unless a game was specified, show the launcher dialog
if (0 == ConfMan.getActiveDomain())
launcherDialog();
@@ -580,11 +603,22 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
launcherDialog();
}
}
+#ifdef USE_CLOUD
+#ifdef USE_SDL_NET
+ Networking::LocalWebserver::destroy();
+#endif
+#ifdef USE_LIBCURL
+ Networking::ConnectionManager::destroy();
+ //I think it's important to destroy it after ConnectionManager
+ Cloud::CloudManager::destroy();
+#endif
+#endif
PluginManager::instance().unloadAllPlugins();
PluginManager::destroy();
GUI::GuiManager::destroy();
Common::ConfigManager::destroy();
Common::DebugManager::destroy();
+ Common::OSDMessageQueue::destroy();
#ifdef ENABLE_EVENTRECORDER
GUI::EventRecorder::destroy();
#endif