CLOUD: Add USE_CLOUD feature

Adds USE_CLOUD in both configure and create_project.
This commit is contained in:
Alexander Tkachev 2016-05-11 22:52:14 +06:00
parent 6c83930126
commit fade746f37
8 changed files with 69 additions and 31 deletions

View file

@ -19,6 +19,12 @@ MODULE_OBJS := \
saves/default/default-saves.o \ saves/default/default-saves.o \
timer/default/default-timer.o timer/default/default-timer.o
ifdef USE_CLOUD
MODULE_OBJS += \
cloud/manager.o \
cloud/storage.o \
cloud/dropbox/dropboxstorage.o
endif
ifdef USE_ELF_LOADER ifdef USE_ELF_LOADER
MODULE_OBJS += \ MODULE_OBJS += \
@ -249,13 +255,5 @@ MODULE_OBJS += \
saves/recorder/recorder-saves.o saves/recorder/recorder-saves.o
endif endif
# I don't have any define, so I'd just add my files without any
# ifndef USE_CLOUD ?
MODULE_OBJS += \
cloud/manager.o \
cloud/storage.o \
cloud/dropbox/storage.o
# endif
# Include common rules # Include common rules
include $(srcdir)/rules.mk include $(srcdir)/rules.mk

View file

@ -159,11 +159,10 @@ void OSystem_SDL::init() {
_taskbarManager = new Common::TaskbarManager(); _taskbarManager = new Common::TaskbarManager();
#endif #endif
//TODO: define USE_CLOUD #if defined(USE_CLOUD)
//#if defined(USE_CLOUD)
if (_cloudThread == 0) if (_cloudThread == 0)
_cloudThread = new Cloud::Manager(); _cloudThread = new Cloud::Manager();
//#endif #endif
} }

View file

@ -476,11 +476,10 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
dlg.runModal(); dlg.runModal();
} }
#endif #endif
//TODO: define USE_CLOUD #ifdef USE_CLOUD
//#ifdef USE_CLOUD
system.getCloudManager()->syncSaves(); system.getCloudManager()->syncSaves();
//#endif #endif
// Unless a game was specified, show the launcher dialog // Unless a game was specified, show the launcher dialog
if (0 == ConfMan.getActiveDomain()) if (0 == ConfMan.getActiveDomain())

View file

@ -153,5 +153,26 @@ const char *gScummVMFeatures = ""
#ifdef ENABLE_VKEYBD #ifdef ENABLE_VKEYBD
"virtual keyboard " "virtual keyboard "
#endif
#ifdef USE_CLOUD
"cloud ("
#ifdef USE_LIBCURL
"servers"
#ifdef USE_SDL_NET
" "
#endif
#endif
#ifdef USE_SDL_NET
"local"
#endif
") "
#else
#ifdef USE_LIBCURL
"libcurl "
#endif
#ifdef USE_SDL_NET
"SDL_net "
#endif
#endif #endif
; ;

View file

@ -62,9 +62,8 @@ MODULE_OBJS += \
updates.o updates.o
endif endif
#TODO define USE_CLOUD ifdef USE_CLOUD
#ifdef USE_CLOUD endif
#endif
# Include common rules # Include common rules
include $(srcdir)/rules.mk include $(srcdir)/rules.mk

View file

@ -56,10 +56,9 @@ class HardwareInputSet;
class Keymap; class Keymap;
class KeymapperDefaultBindings; class KeymapperDefaultBindings;
#endif #endif
//TODO: define USE_CLOUD #if defined(USE_CLOUD)
//#if defined(USE_CLOUD)
class CloudManager; class CloudManager;
//#endif #endif
} }
class AudioCDManager; class AudioCDManager;
@ -182,15 +181,14 @@ protected:
Common::UpdateManager *_updateManager; Common::UpdateManager *_updateManager;
#endif #endif
//TODO: define USE_CLOUD #if defined(USE_CLOUD)
//#if defined(USE_CLOUD)
/** /**
* No default value is provided for _cloudThread by OSystem. * No default value is provided for _cloudThread by OSystem.
* *
* @note _cloudThread is deleted by the OSystem destructor. * @note _cloudThread is deleted by the OSystem destructor.
*/ */
Common::CloudManager *_cloudThread; Common::CloudManager *_cloudThread;
//#endif #endif
/** /**
* No default value is provided for _fsFactory by OSystem. * No default value is provided for _fsFactory by OSystem.
@ -1130,8 +1128,7 @@ public:
} }
#endif #endif
//TODO: define USE_CLOUD #if defined(USE_CLOUD)
//#if defined(USE_CLOUD)
/** /**
* Returns the CloudManager, used to sync save games and * Returns the CloudManager, used to sync save games and
* upload/download files from user's cloud storage. * upload/download files from user's cloud storage.
@ -1141,7 +1138,7 @@ public:
virtual Common::CloudManager *getCloudManager() { virtual Common::CloudManager *getCloudManager() {
return _cloudThread; return _cloudThread;
} }
//#endif #endif
/** /**
* Returns the FilesystemFactory object, depending on the current architecture. * Returns the FilesystemFactory object, depending on the current architecture.

22
configure vendored
View file

@ -4190,6 +4190,28 @@ echo "$_libcurl"
define_in_config_if_yes "$_libcurl" "USE_LIBCURL" define_in_config_if_yes "$_libcurl" "USE_LIBCURL"
#
# Check whether to build cloud integration support
#
echo_n "Cloud integration"
if test "$_cloud" = "no"; then
echo "no"
else
if test "_sdl_net" = "yes" -or "_libcurl" = "yes"; then
_cloud=yes
if test "_sdl_net" = "yes"; then
echo "local"
fi
if test "_libcurl" = "yes"; then
echo "servers"
fi
else
_cloud=no
echo "no"
fi
fi
define_in_config_if_yes $_cloud 'USE_CLOUD'
# #
# Check is NSDockTilePlugIn protocol is supported # Check is NSDockTilePlugIn protocol is supported
# #

View file

@ -1000,10 +1000,12 @@ const Feature s_features[] = {
{ "png", "USE_PNG", "libpng16", true, "libpng support" }, { "png", "USE_PNG", "libpng16", true, "libpng support" },
{ "faad", "USE_FAAD", "libfaad", false, "AAC support" }, { "faad", "USE_FAAD", "libfaad", false, "AAC support" },
{ "mpeg2", "USE_MPEG2", "libmpeg2", false, "MPEG-2 support" }, { "mpeg2", "USE_MPEG2", "libmpeg2", false, "MPEG-2 support" },
{ "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" }, { "theora", "USE_THEORADEC", "libtheora_static", true, "Theora decoding support" },
{ "freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" }, { "freetype", "USE_FREETYPE2", "freetype", true, "FreeType support" },
{ "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" }, { "jpeg", "USE_JPEG", "jpeg-static", true, "libjpeg support" },
{"fluidsynth", "USE_FLUIDSYNTH", "libfluidsynth", true, "FluidSynth support" }, {"fluidsynth", "USE_FLUIDSYNTH", "libfluidsynth", true, "FluidSynth support" },
{ "libcurl", "USE_LIBCURL", "libcurl", true, "libcurl support" },
{ "sdlnet", "USE_SDL_NET", "SDL_net", true, "SDL_net support" },
// Feature flags // Feature flags
{ "bink", "USE_BINK", "", true, "Bink video support" }, { "bink", "USE_BINK", "", true, "Bink video support" },
@ -1015,6 +1017,7 @@ const Feature s_features[] = {
{ "opengl", "USE_OPENGL", "", true, "OpenGL support" }, { "opengl", "USE_OPENGL", "", true, "OpenGL support" },
{ "opengles", "USE_GLES", "", true, "forced OpenGL ES mode" }, { "opengles", "USE_GLES", "", true, "forced OpenGL ES mode" },
{ "taskbar", "USE_TASKBAR", "", true, "Taskbar integration support" }, { "taskbar", "USE_TASKBAR", "", true, "Taskbar integration support" },
{ "cloud", "USE_CLOUD", "", true, "Cloud integration support" },
{ "translation", "USE_TRANSLATION", "", true, "Translation support" }, { "translation", "USE_TRANSLATION", "", true, "Translation support" },
{ "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"}, { "vkeybd", "ENABLE_VKEYBD", "", false, "Virtual keyboard support"},
{ "keymapper", "ENABLE_KEYMAPPER", "", false, "Keymapper support"}, { "keymapper", "ENABLE_KEYMAPPER", "", false, "Keymapper support"},