Use runloop_get_libretro_system_info in more places - clean some code up

This commit is contained in:
twinaphex 2018-10-30 17:11:07 +01:00
parent 51430e9e5f
commit a662b62d19
17 changed files with 169 additions and 223 deletions

View File

@ -2445,17 +2445,12 @@ TODO: Add a setting for these tweaks */
break;
case CMD_EVENT_ADD_TO_FAVORITES:
{
global_t *global = global_get_ptr();
rarch_system_info_t *sys_info = runloop_get_system_info();
const char *core_name = NULL;
const char *core_path = NULL;
const char *label = NULL;
if (sys_info)
{
core_name = sys_info->info.library_name;
core_path = path_get(RARCH_PATH_CORE);
}
/* TODO/FIXME - does path_get(RARCH_PATH_CORE) depend on the system info struct? Investigate */
global_t *global = global_get_ptr();
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *label = NULL;
const char *core_path = system ? path_get(RARCH_PATH_CORE) : NULL;
const char *core_name = system ? system->library_name : NULL;
if (!string_is_empty(global->name.label))
label = global->name.label;

View File

@ -349,8 +349,6 @@ static int general_push(menu_displaylist_info_t *info,
char *newstring2 = NULL;
core_info_list_t *list = NULL;
menu_handle_t *menu = NULL;
rarch_system_info_t *system = runloop_get_system_info();
struct retro_system_info *system_menu = &system->info;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return menu_cbs_exit();
@ -406,32 +404,35 @@ static int general_push(menu_displaylist_info_t *info,
switch (id)
{
case PUSH_ARCHIVE_OPEN:
if (system_menu && system_menu->valid_extensions)
{
if (*system_menu->valid_extensions)
strlcpy(newstring2, system_menu->valid_extensions,
struct retro_system_info *system = runloop_get_libretro_system_info();
if (system && system->valid_extensions)
{
if (*system->valid_extensions)
strlcpy(newstring2, system->valid_extensions,
PATH_MAX_LENGTH * sizeof(char));
}
else
{
strlcpy(newstring2, system->valid_extensions,
PATH_MAX_LENGTH * sizeof(char));
}
else
{
strlcpy(newstring2, system->valid_extensions,
PATH_MAX_LENGTH * sizeof(char));
}
}
break;
case PUSH_DEFAULT:
{
bool new_exts_allocated = false;
char *new_exts = NULL;
bool new_exts_allocated = false;
char *new_exts = NULL;
struct retro_system_info *system = runloop_get_libretro_system_info();
if (menu_setting_get_browser_selection_type(info->setting) == ST_DIR)
{
}
else if (system_menu && system_menu->valid_extensions)
else if (system && system->valid_extensions)
{
if (*system_menu->valid_extensions)
if (*system->valid_extensions)
{
new_exts = strdup(system_menu->valid_extensions);
new_exts = strdup(system->valid_extensions);
new_exts_allocated = true;
}
}
@ -478,16 +479,17 @@ static int general_push(menu_displaylist_info_t *info,
size_t path_size = PATH_MAX_LENGTH * sizeof(char);
char *newstring = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
struct string_list *str_list2 = string_list_new();
struct retro_system_info *system = runloop_get_libretro_system_info();
newstring[0] = '\0';
attr.i = 0;
if (system_menu && system_menu->valid_extensions)
if (system && system->valid_extensions)
{
if (!string_is_empty(system_menu->valid_extensions))
if (!string_is_empty(system->valid_extensions))
{
unsigned x;
struct string_list *str_list = string_split(system_menu->valid_extensions, "|");
struct string_list *str_list = string_split(system->valid_extensions, "|");
for (x = 0; x < str_list->size; x++)
{

View File

@ -1091,11 +1091,6 @@ static void menu_action_setting_disp_set_label_core_option_create(
const char *path,
char *s2, size_t len2)
{
rarch_system_info_t *system = runloop_get_system_info();
if (!system)
return;
*s = '\0';
*w = 19;

View File

@ -2211,15 +2211,12 @@ static int generic_action_ok_shader_preset_save(const char *path,
char directory[PATH_MAX_LENGTH];
char file[PATH_MAX_LENGTH];
char tmp[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
const char *core_name = NULL;
rarch_system_info_t *info = runloop_get_system_info();
settings_t *settings = config_get_ptr();
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
directory[0] = file[0] = tmp[0] = '\0';
if (info)
core_name = info->info.library_name;
if (!string_is_empty(core_name))
{
fill_pathname_join(
@ -2296,15 +2293,12 @@ static int generic_action_ok_remap_file_operation(const char *path,
char directory[PATH_MAX_LENGTH];
char file[PATH_MAX_LENGTH];
char content_dir[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
const char *core_name = NULL;
rarch_system_info_t *info = runloop_get_system_info();
settings_t *settings = config_get_ptr();
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
directory[0] = file[0] = '\0';
if (info)
core_name = info->info.library_name;
if (!string_is_empty(core_name))
fill_pathname_join(
directory,

View File

@ -1016,23 +1016,13 @@ static size_t materialui_list_get_size(void *data, enum menu_list_type type)
static int materialui_get_core_title(char *s, size_t len)
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *info = runloop_get_system_info();
struct retro_system_info *system = &info->info;
const char *core_name = system->library_name;
const char *core_version = system->library_version;
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
const char *core_version = system ? system->library_version : NULL;
if (!settings->bools.menu_core_enable)
return -1;
if (info)
{
if (string_is_empty(core_name))
core_name = info->info.library_name;
if (!core_version)
core_version = info->info.library_version;
}
if (string_is_empty(core_name))
core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
if (!core_version)

View File

@ -2936,14 +2936,14 @@ static int menu_displaylist_parse_horizontal_content_actions(
static int menu_displaylist_parse_information_list(
menu_displaylist_info_t *info)
{
core_info_t *core_info = NULL;
rarch_system_info_t *system = runloop_get_system_info();
core_info_t *core_info = NULL;
struct retro_system_info *system = runloop_get_libretro_system_info();
core_info_get_current_core(&core_info);
if ( system &&
(!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
(!string_is_empty(system->library_name) &&
!string_is_equal(system->library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE))
)
&& core_info && core_info->config_data
@ -3293,8 +3293,9 @@ static int menu_displaylist_parse_options_remappings(
menu_handle_t *menu,
menu_displaylist_info_t *info)
{
unsigned device;
unsigned p, retro_id;
rarch_system_info_t *system = NULL;
settings_t *settings = config_get_ptr();
unsigned max_users = *(input_driver_get_uint(INPUT_ACTION_MAX_USERS));
for (p = 0; p < max_users; p++)
@ -3364,76 +3365,69 @@ static int menu_displaylist_parse_options_remappings(
MENU_SETTING_ACTION, 0, 0);
}
system = runloop_get_system_info();
if (system)
for (p = 0; p < max_users; p++)
{
settings_t *settings = config_get_ptr();
unsigned device;
for (p = 0; p < max_users; p++)
device = settings->uints.input_libretro_device[p];
device &= RETRO_DEVICE_MASK;
if (device == RETRO_DEVICE_JOYPAD || device == RETRO_DEVICE_ANALOG)
{
device = settings->uints.input_libretro_device[p];
device &= RETRO_DEVICE_MASK;
if (device == RETRO_DEVICE_JOYPAD || device == RETRO_DEVICE_ANALOG)
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND + 8; retro_id++)
{
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND + 8; retro_id++)
{
char desc_label[64];
char descriptor[255];
const struct retro_keybind *auto_bind = NULL;
const struct retro_keybind *keybind = NULL;
char desc_label[64];
char descriptor[255];
const struct retro_keybind *auto_bind = NULL;
const struct retro_keybind *keybind = NULL;
keybind = &input_config_binds[p][retro_id];
auto_bind = (const struct retro_keybind*)
input_config_get_bind_auto(p, retro_id);
keybind = &input_config_binds[p][retro_id];
auto_bind = (const struct retro_keybind*)
input_config_get_bind_auto(p, retro_id);
input_config_get_bind_string(descriptor,
input_config_get_bind_string(descriptor,
keybind, auto_bind, sizeof(descriptor));
if(!strstr(descriptor, "Auto"))
{
const struct retro_keybind *keyptr =
&input_config_binds[p][retro_id];
if(!strstr(descriptor, "Auto"))
{
const struct retro_keybind *keyptr =
&input_config_binds[p][retro_id];
snprintf(desc_label, sizeof(desc_label), "%s %s", msg_hash_to_str(keyptr->enum_idx), descriptor);
strlcpy(descriptor, desc_label, sizeof(descriptor));
}
menu_entries_append_enum(info->list, descriptor, "",
MSG_UNKNOWN,
MENU_SETTINGS_INPUT_DESC_BEGIN +
(p * (RARCH_FIRST_CUSTOM_BIND + 8)) + retro_id, 0, 0);
snprintf(desc_label, sizeof(desc_label), "%s %s", msg_hash_to_str(keyptr->enum_idx), descriptor);
strlcpy(descriptor, desc_label, sizeof(descriptor));
}
menu_entries_append_enum(info->list, descriptor, "",
MSG_UNKNOWN,
MENU_SETTINGS_INPUT_DESC_BEGIN +
(p * (RARCH_FIRST_CUSTOM_BIND + 8)) + retro_id, 0, 0);
}
else if (device == RETRO_DEVICE_KEYBOARD)
}
else if (device == RETRO_DEVICE_KEYBOARD)
{
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
{
for (retro_id = 0; retro_id < RARCH_FIRST_CUSTOM_BIND; retro_id++)
{
char descriptor[255];
const struct retro_keybind *auto_bind = NULL;
const struct retro_keybind *keybind = NULL;
char descriptor[255];
const struct retro_keybind *auto_bind = NULL;
const struct retro_keybind *keybind = NULL;
keybind = &input_config_binds[p][retro_id];
auto_bind = (const struct retro_keybind*)
input_config_get_bind_auto(p, retro_id);
keybind = &input_config_binds[p][retro_id];
auto_bind = (const struct retro_keybind*)
input_config_get_bind_auto(p, retro_id);
input_config_get_bind_string(descriptor,
input_config_get_bind_string(descriptor,
keybind, auto_bind, sizeof(descriptor));
if(!strstr(descriptor, "Auto"))
{
const struct retro_keybind *keyptr =
&input_config_binds[p][retro_id];
if(!strstr(descriptor, "Auto"))
{
const struct retro_keybind *keyptr =
&input_config_binds[p][retro_id];
strlcpy(descriptor, msg_hash_to_str(keyptr->enum_idx), sizeof(descriptor));
}
menu_entries_append_enum(info->list, descriptor, "",
MSG_UNKNOWN,
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN +
(p * RARCH_FIRST_CUSTOM_BIND) + retro_id, 0, 0);
strlcpy(descriptor, msg_hash_to_str(keyptr->enum_idx), sizeof(descriptor));
}
menu_entries_append_enum(info->list, descriptor, "",
MSG_UNKNOWN,
MENU_SETTINGS_INPUT_DESC_KBD_BEGIN +
(p * RARCH_FIRST_CUSTOM_BIND) + retro_id, 0, 0);
}
}
}
@ -4893,8 +4887,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
if (cores_names_size == 0)
{
rarch_system_info_t *system_info = runloop_get_system_info();
struct retro_system_info *system = &system_info->info;
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
if (!path_is_empty(RARCH_PATH_CORE))
@ -5008,12 +5001,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
0);
{
const char *core_name = NULL;
rarch_system_info_t *system_info = runloop_get_system_info();
struct retro_system_info *system = &system_info->info;
if (system)
core_name = system->library_name;
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
if (!string_is_empty(core_name))
file_list_set_alt_at_offset(info->list, 0,
@ -7325,19 +7314,21 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, info->list);
{
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
rarch_system_info_t *sys_info = runloop_get_system_info();
if (system)
if (sys_info)
{
if (!string_is_empty(system->info.library_name) &&
!string_is_equal(system->info.library_name,
struct retro_system_info *system = runloop_get_libretro_system_info();
if (!string_is_empty(system->library_name) &&
!string_is_equal(system->library_name,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE)))
if (!rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL))
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_CONTENT_SETTINGS,
PARSE_ACTION, false);
if (system->load_no_content)
if (sys_info->load_no_content)
menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_START_CORE, PARSE_ACTION, false);
}

View File

@ -416,9 +416,9 @@ int menu_entries_get_core_name(char *s, size_t len)
* (shown at the top of the UI). */
int menu_entries_get_core_title(char *s, size_t len)
{
const char *core_name = NULL;
const char *core_version = NULL;
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
const char *core_version = system ? system->library_version : NULL;
#if _MSC_VER == 1200
const char *extra_version = " msvc6";
#elif _MSC_VER == 1300
@ -443,19 +443,8 @@ int menu_entries_get_core_title(char *s, size_t len)
const char *extra_version = "";
#endif
if (system)
{
core_name = system->library_name;
core_version = system->library_version;
}
if (string_is_empty(core_name) && system)
core_name = system->library_name;
if (string_is_empty(core_name))
core_name = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
if (!core_version && system)
core_version = system->library_version;
if (!core_version)
core_version = "";

View File

@ -65,7 +65,6 @@ void filebrowser_parse(menu_displaylist_info_t *info, unsigned type_data)
unsigned files_count = 0;
unsigned dirs_count = 0;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
enum menu_displaylist_ctl_state type = (enum menu_displaylist_ctl_state)
type_data;
const char *path = info ? info->path : NULL;
@ -84,6 +83,7 @@ void filebrowser_parse(menu_displaylist_info_t *info, unsigned type_data)
str_list = file_archive_get_file_list(path, info->exts);
else
{
rarch_system_info_t *system = runloop_get_system_info();
const struct retro_subsystem_info *subsystem = system->subsystem.data + content_get_subsystem();
if (subsystem)
@ -94,6 +94,7 @@ void filebrowser_parse(menu_displaylist_info_t *info, unsigned type_data)
{
if (filebrowser_types == FILEBROWSER_SELECT_FILE_SUBSYSTEM)
{
rarch_system_info_t *system = runloop_get_system_info();
const struct retro_subsystem_info *subsystem =
system->subsystem.data + content_get_subsystem();

View File

@ -244,7 +244,6 @@ bool netplay_lan_ad_server(netplay_t *netplay)
struct timeval tmp_tv = {0};
struct sockaddr their_addr;
socklen_t addr_size;
rarch_system_info_t *info = NULL;
unsigned k = 0;
char reply_addr[NETPLAY_HOST_STR_LEN], port_str[6];
struct addrinfo *our_addr, hints = {0};
@ -308,11 +307,11 @@ bool netplay_lan_ad_server(netplay_t *netplay)
if (strstr(interfaces.entries[k].host, sub) &&
!strstr(interfaces.entries[k].host, "127.0.0.1"))
{
struct retro_system_info *info = runloop_get_libretro_system_info();
RARCH_LOG ("[discovery] query received on common interface: %s/%s (theirs / ours) \n",
reply_addr, interfaces.entries[k].host);
info = runloop_get_system_info();
/* Now build our response */
content_crc = content_get_crc();
@ -335,9 +334,9 @@ bool netplay_lan_ad_server(netplay_t *netplay)
if (info)
{
strlcpy(ad_packet_buffer.core, info->info.library_name,
strlcpy(ad_packet_buffer.core, info->library_name,
NETPLAY_HOST_STR_LEN);
strlcpy(ad_packet_buffer.core_version, info->info.library_version,
strlcpy(ad_packet_buffer.core_version, info->library_version,
NETPLAY_HOST_STR_LEN);
}

View File

@ -852,25 +852,25 @@ void netplay_get_architecture(char *frontend_architecture, size_t size)
static void netplay_announce(void)
{
char buf [2048];
char url [2048] = "http://lobby.libretro.com/add/";
char *username = NULL;
char *corename = NULL;
char *gamename = NULL;
char *coreversion = NULL;
char *frontend_ident = NULL;
settings_t *settings = config_get_ptr();
rarch_system_info_t *system = runloop_get_system_info();
uint32_t content_crc = content_get_crc();
char frontend_architecture[PATH_MAX_LENGTH];
char url [2048] = "http://lobby.libretro.com/add/";
char *username = NULL;
char *corename = NULL;
char *gamename = NULL;
char *coreversion = NULL;
char *frontend_ident = NULL;
settings_t *settings = config_get_ptr();
struct retro_system_info *system = runloop_get_libretro_system_info();
uint32_t content_crc = content_get_crc();
netplay_get_architecture(frontend_architecture, sizeof(frontend_architecture));
net_http_urlencode(&username, settings->paths.username);
net_http_urlencode(&corename, system->info.library_name);
net_http_urlencode(&corename, system->library_name);
net_http_urlencode(&gamename,
!string_is_empty(path_basename(path_get(RARCH_PATH_BASENAME))) ?
path_basename(path_get(RARCH_PATH_BASENAME)) : "N/A");
net_http_urlencode(&coreversion, system->info.library_version);
net_http_urlencode(&coreversion, system->library_version);
net_http_urlencode(&frontend_ident, frontend_architecture);
buf[0] = '\0';

View File

@ -500,20 +500,20 @@ bool netplay_handshake_info(netplay_t *netplay,
struct netplay_connection *connection)
{
struct info_buf_s info_buf;
uint32_t content_crc = 0;
rarch_system_info_t *core_info = runloop_get_system_info();
uint32_t content_crc = 0;
struct retro_system_info *system = runloop_get_libretro_system_info();
memset(&info_buf, 0, sizeof(info_buf));
info_buf.cmd[0] = htonl(NETPLAY_CMD_INFO);
info_buf.cmd[1] = htonl(sizeof(info_buf) - 2*sizeof(uint32_t));
/* Get our core info */
if (core_info)
if (system)
{
strlcpy(info_buf.core_name,
core_info->info.library_name, sizeof(info_buf.core_name));
system->library_name, sizeof(info_buf.core_name));
strlcpy(info_buf.core_version,
core_info->info.library_version, sizeof(info_buf.core_version));
system->library_version, sizeof(info_buf.core_version));
}
else
{
@ -836,9 +836,9 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
struct info_buf_s info_buf;
uint32_t cmd_size;
ssize_t recvd;
uint32_t content_crc = 0;
const char *dmsg = NULL;
rarch_system_info_t *core_info = runloop_get_system_info();
uint32_t content_crc = 0;
const char *dmsg = NULL;
struct retro_system_info *system = runloop_get_libretro_system_info();
RECV(&info_buf, sizeof(info_buf.cmd)) {}
@ -876,11 +876,10 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
}
/* Check the core info */
if (core_info)
if (system)
{
if (strncmp(info_buf.core_name,
core_info->info.library_name, sizeof(info_buf.core_name)))
system->library_name, sizeof(info_buf.core_name)))
{
/* Wrong core! */
dmsg = msg_hash_to_str(MSG_NETPLAY_DIFFERENT_CORES);
@ -890,7 +889,7 @@ bool netplay_handshake_pre_info(netplay_t *netplay,
return false;
}
if (strncmp(info_buf.core_version,
core_info->info.library_version, sizeof(info_buf.core_version)))
system->library_version, sizeof(info_buf.core_version)))
{
dmsg = msg_hash_to_str(MSG_NETPLAY_DIFFERENT_CORE_VERSIONS);
RARCH_WARN("%s\n", dmsg);

View File

@ -66,7 +66,6 @@ void path_set_redirect(void)
global_t *global = global_get_ptr();
const char *old_savefile_dir = dir_get(RARCH_DIR_SAVEFILE);
const char *old_savestate_dir = dir_get(RARCH_DIR_SAVESTATE);
rarch_system_info_t *info = runloop_get_system_info();
struct retro_system_info *system = runloop_get_libretro_system_info();
settings_t *settings = config_get_ptr();

View File

@ -1526,6 +1526,8 @@ static bool task_load_content_callback(content_ctx_info_t *content_info,
if (sys_info)
{
struct retro_system_info *system = runloop_get_libretro_system_info();
content_ctx.history_list_enable = settings->bools.history_list_enable;
content_ctx.set_supports_no_game_enable = settings->bools.set_supports_no_game_enable;
@ -1533,11 +1535,11 @@ static bool task_load_content_callback(content_ctx_info_t *content_info,
content_ctx.directory_system = strdup(settings->paths.directory_system);
if (!string_is_empty(settings->paths.directory_cache))
content_ctx.directory_cache = strdup(settings->paths.directory_cache);
if (!string_is_empty(sys_info->info.valid_extensions))
content_ctx.valid_extensions = strdup(sys_info->info.valid_extensions);
if (!string_is_empty(system->valid_extensions))
content_ctx.valid_extensions = strdup(system->valid_extensions);
content_ctx.block_extract = sys_info->info.block_extract;
content_ctx.need_fullpath = sys_info->info.need_fullpath;
content_ctx.block_extract = system->block_extract;
content_ctx.need_fullpath = system->need_fullpath;
content_ctx.subsystem.data = sys_info->subsystem.data;
content_ctx.subsystem.size = sys_info->subsystem.size;
@ -1918,6 +1920,8 @@ bool content_init(void)
if (sys_info)
{
struct retro_system_info *system = runloop_get_libretro_system_info();
content_ctx.history_list_enable = settings->bools.history_list_enable;
content_ctx.set_supports_no_game_enable = settings->bools.set_supports_no_game_enable;
@ -1925,11 +1929,11 @@ bool content_init(void)
content_ctx.directory_system = strdup(settings->paths.directory_system);
if (!string_is_empty(settings->paths.directory_cache))
content_ctx.directory_cache = strdup(settings->paths.directory_cache);
if (!string_is_empty(sys_info->info.valid_extensions))
content_ctx.valid_extensions = strdup(sys_info->info.valid_extensions);
if (!string_is_empty(system->valid_extensions))
content_ctx.valid_extensions = strdup(system->valid_extensions);
content_ctx.block_extract = sys_info->info.block_extract;
content_ctx.need_fullpath = sys_info->info.need_fullpath;
content_ctx.block_extract = system->block_extract;
content_ctx.need_fullpath = system->need_fullpath;
content_ctx.subsystem.data = sys_info->subsystem.data;
content_ctx.subsystem.size = sys_info->subsystem.size;

View File

@ -222,10 +222,11 @@ void CoreOptionsDialog::buildLayout()
if (settings->bools.game_specific_options)
{
rarch_system_info_t *system = runloop_get_system_info();
QString contentLabel;
QString label;
rarch_system_info_t *system = runloop_get_system_info();
/* TODO/FIXME - why have this check here? system is not used */
if (system)
contentLabel = QFileInfo(path_get(RARCH_PATH_BASENAME)).completeBaseName();

View File

@ -724,15 +724,12 @@ void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type
char directory[PATH_MAX_LENGTH];
char file[PATH_MAX_LENGTH];
char tmp[PATH_MAX_LENGTH];
settings_t *settings = config_get_ptr();
const char *core_name = NULL;
rarch_system_info_t *info = runloop_get_system_info();
settings_t *settings = config_get_ptr();
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
directory[0] = file[0] = tmp[0] = '\0';
if (info)
core_name = info->info.library_name;
if (!string_is_empty(core_name))
{
fill_pathname_join(
@ -757,17 +754,15 @@ void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type
fill_pathname_join(file, directory, core_name, sizeof(file));
break;
case SHADER_PRESET_SAVE_GAME:
{
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
fill_pathname_join(file, directory, game_name, sizeof(file));
break;
}
{
const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME));
fill_pathname_join(file, directory, game_name, sizeof(file));
break;
}
case SHADER_PRESET_SAVE_PARENT:
{
fill_pathname_parent_dir_name(tmp, path_get(RARCH_PATH_BASENAME), sizeof(tmp));
fill_pathname_join(file, directory, tmp, sizeof(file));
break;
}
case SHADER_PRESET_SAVE_NORMAL:
default:
if (!string_is_empty(path))
@ -821,13 +816,13 @@ void ShaderParamsDialog::onShaderClearAllPassesClicked()
void ShaderParamsDialog::onShaderRemovePassClicked()
{
#ifdef HAVE_MENU
QAction *action = qobject_cast<QAction*>(sender());
QVariant passVariant;
struct video_shader *menu_shader = NULL;
struct video_shader *video_shader = NULL;
int pass = 0;
int i;
bool ok = false;
QVariant passVariant;
QAction *action = qobject_cast<QAction*>(sender());
struct video_shader *menu_shader = NULL;
struct video_shader *video_shader = NULL;
int pass = 0;
bool ok = false;
getShaders(&menu_shader, &video_shader);

View File

@ -1,6 +1,6 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2018 - Brad Parker
* Copyright (C) 2018 - Brad Parker
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
@ -1297,7 +1297,7 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
{
QHash<QString, QString> hash;
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME)) + ":";
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME)) + ":";
hash["value"] = core_info->systemname;
infoList.append(hash);
@ -1307,7 +1307,7 @@ QVector<QHash<QString, QString> > MainWindow::getCoreInfo()
{
QHash<QString, QString> hash;
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER)) + ":";
hash["key"] = QString(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER)) + ":";
hash["value"] = core_info->system_manufacturer;
infoList.append(hash);
@ -2778,10 +2778,10 @@ void MainWindow::onStopClicked()
void MainWindow::setCurrentCoreLabel()
{
rarch_system_info_t *system = runloop_get_system_info();
bool update = false;
QString libraryName = system->info.library_name;
const char *no_core_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
bool update = false;
struct retro_system_info *system = runloop_get_libretro_system_info();
QString libraryName = system->library_name;
const char *no_core_str = msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_CORE);
if (m_statusLabel->text().isEmpty() || (m_currentCore != no_core_str && libraryName.isEmpty()))
{
@ -2793,8 +2793,8 @@ void MainWindow::setCurrentCoreLabel()
{
if (m_currentCore != libraryName && !libraryName.isEmpty())
{
m_currentCore = system->info.library_name;
m_currentCoreVersion = (string_is_empty(system->info.library_version) ? "" : system->info.library_version);
m_currentCore = system->library_name;
m_currentCoreVersion = (string_is_empty(system->library_version) ? "" : system->library_version);
update = true;
}
}

View File

@ -480,13 +480,9 @@ static char** waiting_argv;
{
if (filenames.count == 1 && [filenames objectAtIndex:0])
{
rarch_system_info_t *info = runloop_get_system_info();
struct retro_system_info *system = &info->info;
struct retro_system_info *system = runloop_get_libretro_system_info();
NSString *__core = [filenames objectAtIndex:0];
const char *core_name = NULL;
if (system)
core_name = system->library_name;
const char *core_name = system ? system->library_name : NULL;
if (core_name)
{
@ -556,12 +552,8 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result)
if (!result)
return;
rarch_system_info_t *info = runloop_get_system_info();
struct retro_system_info *system = &info->info;
const char *core_name = NULL;
if (system)
core_name = system->library_name;
struct retro_system_info *system = runloop_get_libretro_system_info();
const char *core_name = system ? system->library_name : NULL;
path_set(RARCH_PATH_CONTENT, state->result);