mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 06:18:34 +00:00
Start setting up all the code needed for bundle assets
extraction
This commit is contained in:
parent
003dec7710
commit
0679916db1
@ -667,7 +667,10 @@ static void config_set_defaults(void)
|
||||
*global->record.output_dir = '\0';
|
||||
*global->record.config_dir = '\0';
|
||||
|
||||
*settings->bundle_assets_last_extracted_version = '\0';
|
||||
settings->bundle_assets_extract_version_current = 0;
|
||||
settings->bundle_assets_extract_last_version = 0;
|
||||
*settings->bundle_assets_src_path = '\0';
|
||||
*settings->bundle_assets_dst_path = '\0';
|
||||
*settings->playlist_names = '\0';
|
||||
*settings->playlist_cores = '\0';
|
||||
*settings->core_options_path = '\0';
|
||||
@ -1236,9 +1239,6 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
if (!rarch_ctl(RARCH_CTL_IS_FORCE_FULLSCREEN, NULL))
|
||||
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(conf, "bundle_assets_last_extracted_version",
|
||||
settings->bundle_assets_last_extracted_version, sizeof(settings->bundle_assets_last_extracted_version));
|
||||
config_get_array(conf, "playlist_names", settings->playlist_names, sizeof(settings->playlist_names));
|
||||
config_get_array(conf, "playlist_cores", settings->playlist_cores, sizeof(settings->playlist_cores));
|
||||
|
||||
@ -1602,6 +1602,12 @@ static bool config_load_file(const char *path, bool set_defaults)
|
||||
settings->rewind_buffer_size = buffer_size * UINT64_C(1000000);
|
||||
}
|
||||
|
||||
CONFIG_GET_BOOL_BASE(conf, settings, bundle_assets_extract_enable, "bundle_assets_extract_enable");
|
||||
CONFIG_GET_INT_BASE(conf, settings, bundle_assets_extract_version_current, "bundle_assets_extract_version_current");
|
||||
CONFIG_GET_INT_BASE(conf, settings, bundle_assets_extract_last_version, "bundle_assets_extract_last_version");
|
||||
config_get_array(conf, "bundle_assets_src_path", settings->bundle_assets_src_path, sizeof(settings->bundle_assets_src_path));
|
||||
config_get_array(conf, "bundle_assets_dst_path", settings->bundle_assets_dst_path, sizeof(settings->bundle_assets_dst_path));
|
||||
|
||||
CONFIG_GET_INT_BASE(conf, settings, rewind_granularity, "rewind_granularity");
|
||||
CONFIG_GET_FLOAT_BASE(conf, settings, slowmotion_ratio, "slowmotion_ratio");
|
||||
if (settings->slowmotion_ratio < 1.0f)
|
||||
@ -2531,7 +2537,10 @@ bool config_save_file(const char *path)
|
||||
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_int(conf, "bundle_assets_extract_version_current", settings->bundle_assets_extract_version_current);
|
||||
config_set_int(conf, "bundle_assets_extract_last_version", settings->bundle_assets_extract_last_version);
|
||||
config_set_string(conf, "bundle_assets_src_path", settings->bundle_assets_src_path);
|
||||
config_set_string(conf, "bundle_assets_dst_path", settings->bundle_assets_dst_path);
|
||||
config_set_string(conf, "playlist_names", settings->playlist_names);
|
||||
config_set_string(conf, "playlist_cores", settings->playlist_cores);
|
||||
config_set_float(conf, "video_refresh_rate", settings->video.refresh_rate);
|
||||
|
@ -303,7 +303,10 @@ typedef struct settings
|
||||
int state_slot;
|
||||
|
||||
bool bundle_assets_extract_enable;
|
||||
char bundle_assets_last_extracted_version[PATH_MAX_LENGTH];
|
||||
unsigned bundle_assets_extract_version_current;
|
||||
unsigned bundle_assets_extract_last_version;
|
||||
char bundle_assets_src_path[PATH_MAX_LENGTH];
|
||||
char bundle_assets_dst_path[PATH_MAX_LENGTH];
|
||||
|
||||
char core_options_path[PATH_MAX_LENGTH];
|
||||
char content_history_path[PATH_MAX_LENGTH];
|
||||
|
@ -212,6 +212,7 @@ void menu_free(menu_handle_t *menu)
|
||||
#if 0
|
||||
static void bundle_decompressed(void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
decompress_task_data_t *dec = (decompress_task_data_t*)task_data;
|
||||
|
||||
if (dec && !err)
|
||||
@ -226,6 +227,8 @@ static void bundle_decompressed(void *task_data, void *user_data, const char *er
|
||||
free(dec->source_file);
|
||||
free(dec);
|
||||
}
|
||||
|
||||
settings->bundle_assets_extract_last_version = settings->bundle_assets_extract_version_current;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -270,13 +273,12 @@ void *menu_init(const void *data)
|
||||
menu->help_screen_type = MENU_HELP_WELCOME;
|
||||
settings->menu_show_start_screen = false;
|
||||
|
||||
/* FIXME: figure out bundle_path */
|
||||
#if 0
|
||||
if (settings->bundle_assets_extract_enable &&
|
||||
(strcmp(PACKAGE_VERSION, settings->bundle_assets_last_extracted_version) != 0)
|
||||
settings->bundle_assets_extract_version_current != settings->bundle_assets_extract_last_version
|
||||
)
|
||||
{
|
||||
rarch_task_push_decompress(bundle_path, settings->core_assets_directory, NULL,
|
||||
rarch_task_push_decompress(settings->bundle_assets_src_path, settings->bundle_assets_dst_path, NULL,
|
||||
bundle_decompressed);
|
||||
}
|
||||
#endif
|
||||
|
@ -13,6 +13,7 @@ import android.media.AudioManager;
|
||||
import android.media.AudioTrack;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.content.pm.PackageManager.NameNotFoundException;
|
||||
import android.util.Log;
|
||||
|
||||
/**
|
||||
@ -143,6 +144,19 @@ public final class UserPreferences
|
||||
config.setString("libretro_directory", coreDir);
|
||||
config.setInt("audio_out_rate", getOptimalSamplingRate(ctx));
|
||||
|
||||
try
|
||||
{
|
||||
int version = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0).versionCode;
|
||||
final String dst_path = dataDir + "/assets/";
|
||||
|
||||
config.setString("bundle_assets_src_path", ctx.getApplicationInfo().sourceDir);
|
||||
config.setString("bundle_assets_dst_path", dst_path);
|
||||
config.setInt("bundle_assets_extract_version_current", version);
|
||||
}
|
||||
catch (NameNotFoundException ignored)
|
||||
{
|
||||
}
|
||||
|
||||
// Refactor this entire mess and make this usable for per-core config
|
||||
if (Build.VERSION.SDK_INT >= 17 && prefs.getBoolean("audio_latency_auto", true))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user