Revert "Move path settings to paths.c"

This reverts commit 3a7e9a7052a472ae2ce8d1919b127558b05b6d56.
This commit is contained in:
twinaphex 2016-10-01 08:17:13 +02:00
parent 0f26cade79
commit 7d20224ff0
8 changed files with 25 additions and 70 deletions

View File

@ -1327,8 +1327,12 @@ static int generic_action_ok(const char *path,
break;
#endif
case ACTION_OK_LOAD_RECORD_CONFIGFILE:
flush_char = msg_hash_to_str(flush_id);
path_set(RARCH_PATH_RECORD_CONFIG, action_path);
{
global_t *global = global_get_ptr();
flush_char = msg_hash_to_str(flush_id);
strlcpy(global->record.config, action_path,
sizeof(global->record.config));
}
break;
case ACTION_OK_LOAD_REMAPPING_FILE:
{

View File

@ -4392,8 +4392,8 @@ static bool setting_append_list(
CONFIG_PATH(
list, list_info,
path_get_record_config_ptr(),
path_get_record_config_size(),
global->record.config,
sizeof(global->record.config),
msg_hash_to_str(MENU_ENUM_LABEL_RECORD_CONFIG),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RECORD_CONFIG),
"",
@ -4407,8 +4407,8 @@ static bool setting_append_list(
CONFIG_STRING(
list, list_info,
path_get_record_ptr(),
path_get_record_size(),
global->record.path,
sizeof(global->record.path),
msg_hash_to_str(MENU_ENUM_LABEL_RECORD_PATH),
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RECORD_PATH),
"",

40
paths.c
View File

@ -51,8 +51,6 @@
/* For --subsystem content. */
static struct string_list *subsystem_fullpaths = NULL;
static char path_record[PATH_MAX_LENGTH] = {0};
static char path_record_config[PATH_MAX_LENGTH] = {0};
static char path_server[PATH_MAX_LENGTH] = {0};
static char path_savefile[PATH_MAX_LENGTH] = {0};
static char path_savestate[PATH_MAX_LENGTH] = {0};
@ -492,15 +490,7 @@ void path_fill_names(void)
}
}
char *path_get_record_ptr(void)
{
return path_record;
}
char *path_get_record_config_ptr(void)
{
return path_record_config;
}
/* Core file path */
char *path_get_core_ptr(void)
{
@ -516,10 +506,6 @@ const char *path_get(enum rarch_path_type type)
{
switch (type)
{
case RARCH_PATH_RECORD:
return path_record;
case RARCH_PATH_RECORD_CONFIG:
return path_record_config;
case RARCH_PATH_SAVEFILE:
return path_savefile;
case RARCH_PATH_SAVESTATE:
@ -562,16 +548,6 @@ const char *path_get(enum rarch_path_type type)
return NULL;
}
size_t path_get_record_size(void)
{
return sizeof(path_record);
}
size_t path_get_record_config_size(void)
{
return sizeof(path_record_config);
}
size_t path_get_server_size(void)
{
return sizeof(path_server);
@ -700,14 +676,6 @@ bool path_is_empty(enum rarch_path_type type)
{
switch (type)
{
case RARCH_PATH_RECORD:
if (string_is_empty(path_record))
return true;
break;
case RARCH_PATH_RECORD_CONFIG:
if (string_is_empty(path_record_config))
return true;
break;
case RARCH_PATH_SAVEFILE:
if (string_is_empty(path_savefile))
return true;
@ -777,12 +745,6 @@ void path_clear(enum rarch_path_type type)
{
switch (type)
{
case RARCH_PATH_RECORD:
*path_record = '\0';
break;
case RARCH_PATH_RECORD_CONFIG:
*path_record_config = '\0';
break;
case RARCH_PATH_SAVEFILE:
*path_savefile = '\0';
break;

12
paths.h
View File

@ -50,9 +50,7 @@ enum rarch_path_type
RARCH_PATH_CORE_OPTIONS,
RARCH_PATH_DEFAULT_SHADER_PRESET,
RARCH_PATH_BASENAME,
RARCH_PATH_SUBSYSTEM,
RARCH_PATH_RECORD,
RARCH_PATH_RECORD_CONFIG
RARCH_PATH_SUBSYSTEM
};
void path_deinit_subsystem(void);
@ -78,20 +76,12 @@ void path_set_basename(const char *path);
/* get size functions */
size_t path_get_record_size(void);
size_t path_get_record_config_size(void);
size_t path_get_server_size(void);
size_t path_get_core_size(void);
/* get ptr functions */
char *path_get_record_ptr(void);
char *path_get_record_config_ptr(void);
char *path_get_core_ptr(void);
char *path_get_server_ptr(void);

View File

@ -33,7 +33,6 @@
#include "../runloop.h"
#include "../verbosity.h"
#include "../msg_hash.h"
#include "../paths.h"
#include "../list_special.h"
@ -332,13 +331,12 @@ bool recording_init(void)
(float)av_info->timing.fps,
(float)av_info->timing.sample_rate);
strlcpy(recording_file, path_get(RARCH_PATH_RECORD), sizeof(recording_file));
strlcpy(recording_file, global->record.path, sizeof(recording_file));
if (recording_use_output_dir)
fill_pathname_join(recording_file,
global->record.output_dir,
path_get(RARCH_PATH_RECORD),
sizeof(recording_file));
global->record.path, sizeof(recording_file));
params.out_width = av_info->geometry.base_width;
params.out_height = av_info->geometry.base_height;
@ -352,8 +350,8 @@ bool recording_init(void)
FFEMU_PIX_ARGB8888 : FFEMU_PIX_RGB565;
params.config = NULL;
if (!path_is_empty(RARCH_PATH_RECORD_CONFIG))
params.config = path_get(RARCH_PATH_RECORD_CONFIG);
if (*global->record.config)
params.config = global->record.config;
if (video_driver_supports_recording())
{
@ -426,7 +424,7 @@ bool recording_init(void)
RARCH_LOG("%s %s @ %ux%u. (FB size: %ux%u pix_fmt: %u)\n",
msg_hash_to_str(MSG_RECORDING_TO),
path_get(RARCH_PATH_RECORD),
global->record.path,
params.out_width, params.out_height,
params.fb_width, params.fb_height,
(unsigned)params.pix_fmt);

View File

@ -611,7 +611,8 @@ static void retroarch_parse_input(int argc, char *argv[])
break;
case 'r':
path_set(RARCH_PATH_RECORD, optarg);
strlcpy(global->record.path, optarg,
sizeof(global->record.path));
{
bool *recording_enabled = recording_is_enabled();
@ -787,7 +788,8 @@ static void retroarch_parse_input(int argc, char *argv[])
break;
case RA_OPT_RECORDCONFIG:
path_set(RARCH_PATH_RECORD_CONFIG, optarg);
strlcpy(global->record.config, optarg,
sizeof(global->record.config));
break;
case RA_OPT_MAX_FRAMES:

View File

@ -752,8 +752,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
path_clear(RARCH_PATH_IPS);
path_clear(RARCH_PATH_UPS);
path_clear(RARCH_PATH_BPS);
path_clear(RARCH_PATH_RECORD);
path_clear(RARCH_PATH_RECORD_CONFIG);
runloop_overrides_active = false;
core_unset_input_descriptors();

View File

@ -153,14 +153,15 @@ typedef struct global
/* Recording. */
struct
{
char output_dir[PATH_MAX_LENGTH];
char config_dir[PATH_MAX_LENGTH];
char path[PATH_MAX_LENGTH];
char config[PATH_MAX_LENGTH];
unsigned width;
unsigned height;
size_t gpu_width;
size_t gpu_height;
char output_dir[PATH_MAX_LENGTH];
char config_dir[PATH_MAX_LENGTH];
bool use_output_dir;
} record;