Start adding preliminary bundle extraction code

This commit is contained in:
twinaphex 2015-07-08 16:45:04 +02:00
parent e3661c1e3d
commit cbc79e0d67
8 changed files with 37 additions and 9 deletions

View File

@ -337,6 +337,16 @@ static const bool pointer_enable = true;
static const bool pointer_enable = false;
#endif
/* Certain platforms might have assets stored in the bundle that
* we need to extract to a user-writable directory on first boot.
*
* Examples include: Android, iOS/OSX) */
#if defined(ANDROID)
static bool bundle_assets_extract_enable = true;
#else
static bool bundle_assets_extract_enable = false;
#endif
static const bool def_history_list_enable = true;
static const unsigned int def_user_language = 0;

View File

@ -469,6 +469,7 @@ static void config_set_defaults(void)
settings->video.black_frame_insertion = black_frame_insertion;
settings->video.swap_interval = swap_interval;
settings->video.threaded = video_threaded;
settings->bundle_assets_extract_enable = bundle_assets_extract_enable;
if (g_defaults.settings.video_threaded_enable != video_threaded)
settings->video.threaded = g_defaults.settings.video_threaded_enable;
@ -670,6 +671,7 @@ static void config_set_defaults(void)
*global->record.output_dir = '\0';
*global->record.config_dir = '\0';
*settings->bundle_assets_last_extracted_version = '\0';
*settings->core_options_path = '\0';
*settings->content_history_path = '\0';
*settings->content_history_directory = '\0';
@ -1223,6 +1225,9 @@ static bool config_load_file(const char *path, bool set_defaults)
if (!global->force_fullscreen)
CONFIG_GET_BOOL_BASE(conf, settings, video.fullscreen, "video_fullscreen");
CONFIG_GET_BOOL_BASE(conf, settings, bundle_assets_extract_enable, "bundle_assets_extract_enable");
CONFIG_GET_PATH_BASE(conf, settings, bundle_assets_last_extracted_version, "bundle_assets_last_extracted_version");
CONFIG_GET_BOOL_BASE(conf, settings, video.windowed_fullscreen, "video_windowed_fullscreen");
CONFIG_GET_INT_BASE (conf, settings, video.monitor_index, "video_monitor_index");
CONFIG_GET_BOOL_BASE(conf, settings, video.disable_composition, "video_disable_composition");
@ -2404,6 +2409,8 @@ bool config_save_file(const char *path)
config_set_bool(conf, "video_force_srgb_disable",
settings->video.force_srgb_disable);
config_set_bool(conf, "video_fullscreen", settings->video.fullscreen);
config_set_bool(conf, "bundle_assets_extract_enable", settings->bundle_assets_extract_enable);
config_set_string(conf, "bundle_assets_last_extracted_version", settings->bundle_assets_last_extracted_version);
config_set_float(conf, "video_refresh_rate", settings->video.refresh_rate);
config_set_int(conf, "video_monitor_index",
settings->video.monitor_index);

View File

@ -276,6 +276,9 @@ typedef struct settings
int state_slot;
bool bundle_assets_extract_enable;
char bundle_assets_last_extracted_version[PATH_MAX_LENGTH];
char core_options_path[PATH_MAX_LENGTH];
char content_history_path[PATH_MAX_LENGTH];
char content_history_directory[PATH_MAX_LENGTH];

View File

@ -439,9 +439,9 @@ static bool device_is_game_console(const char *name)
static char screenshot_dir[PATH_MAX_LENGTH];
static char downloads_dir[PATH_MAX_LENGTH];
static char apk_path[PATH_MAX_LENGTH];
char apk_path[PATH_MAX_LENGTH];
static char sdcard_dir[PATH_MAX_LENGTH];
static char app_dir[PATH_MAX_LENGTH];
char app_dir[PATH_MAX_LENGTH];
static void frontend_android_get_environment_settings(int *argc,
char *argv[], void *data, void *params_data)

View File

@ -213,7 +213,7 @@ static int action_iterate_help(char *s, size_t len, const char *label)
desc[0], desc[1], desc[2], desc[3], desc[4], desc[5], desc[6], desc[7]);
}
break;
case MENU_HELP_EXTRACTING:
case MENU_HELP_EXTRACT:
strlcpy(s, "Extracting, please wait...\n", len);
break;
default:

View File

@ -534,7 +534,6 @@ static void *glui_init(void)
glui_handle_t *glui = NULL;
const video_driver_t *video_driver = NULL;
menu_handle_t *menu = NULL;
settings_t *settings = config_get_ptr();
gl_t *gl = (gl_t*)
video_driver_get_ptr(&video_driver);
@ -559,10 +558,6 @@ static void *glui_init(void)
glui_layout(menu, glui);
glui_allocate_white_texture(glui);
if (settings->menu.wallpaper[0] != '\0')
rarch_main_data_msg_queue_push(DATA_TYPE_IMAGE,
settings->menu.wallpaper, "cb_menu_wallpaper", 0, 1, true);
return menu;
error:
if (menu)

View File

@ -27,6 +27,7 @@
#include "../frontend/frontend.h"
#include "../retroarch.h"
#include "../performance.h"
#include "../runloop_data.h"
static void menu_environment_get(int *argc, char *argv[],
void *args, void *params_data)
@ -231,6 +232,18 @@ void *menu_init(const void *data)
menu->help_screen_type = MENU_HELP_DEFAULT;
settings->menu_show_start_screen = false;
#if 0
if (settings->bundle_assets_extract_enable &&
(strcmp(PACKAGE_VERSION, settings->bundle_assets_last_extracted_version) != 0)
)
{
menu->push_help_screen = true;
menu->help_screen_type = MENU_HELP_EXTRACT;
rarch_main_data_msg_queue_push(DATA_TYPE_FILE, "cb_bundle_extract", "cb_bundle_extract", 0, 1, true);
}
#endif
menu_shader_manager_init(menu);
if (!menu_display_init(menu))

View File

@ -53,7 +53,7 @@ typedef enum
typedef enum
{
MENU_HELP_DEFAULT = 0,
MENU_HELP_EXTRACTING,
MENU_HELP_EXTRACT,
MENU_HELP_LAST
} menu_help_type_t;