[discord] let's rewrite this to do the same but different

This commit is contained in:
radius 2019-01-05 15:11:58 -05:00
parent 9aa7b2bd62
commit ec53480a66
3 changed files with 13 additions and 8 deletions

View File

@ -350,7 +350,7 @@ void discord_init(void)
Discord_Initialize(settings->arrays.discord_app_id, &handlers, 0, NULL);
char command[PATH_MAX_LENGTH];
strlcpy(command, _argv, sizeof(command));
strlcpy(command, get_retroarch_launch_arguments(), sizeof(command));
RARCH_LOG("[Discord] registering startup command: %s\n", command);
Discord_Register(settings->arrays.discord_app_id, command);

View File

@ -276,6 +276,8 @@ static retro_time_t frame_limit_last_time = 0.0;
extern bool input_driver_flushing_input;
static char launch_arguments[4096];
#ifdef HAVE_DYNAMIC
bool retroarch_core_set_on_cmdline(void)
{
@ -641,11 +643,10 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
char buf[4096];
for (unsigned i = 0; i < argc; i++)
{
snprintf(buf, sizeof(buf), "%s %s", _argv, argv[i]);
strlcpy(_argv, buf, sizeof(_argv));
snprintf(buf, sizeof(buf), "%s %s", launch_arguments, argv[i]);
strlcpy(launch_arguments, buf, sizeof(launch_arguments));
}
_argc = argc;
string_trim_whitespace_left(_argv);
string_trim_whitespace_left(launch_arguments);
const struct option opts[] = {
#ifdef HAVE_DYNAMIC
@ -3663,3 +3664,8 @@ struct retro_system_info *runloop_get_libretro_system_info(void)
struct retro_system_info *system = &runloop_system.info;
return system;
}
char *get_retroarch_launch_arguments(void)
{
return launch_arguments;
}

View File

@ -305,9 +305,6 @@ typedef struct global
#endif
} global_t;
unsigned _argc;
char _argv[4096];
bool rarch_ctl(enum rarch_ctl_state state, void *data);
int retroarch_get_capabilities(enum rarch_capabilities type,
@ -394,6 +391,8 @@ void rarch_menu_running_finished(void);
bool retroarch_is_on_main_thread(void);
char *get_retroarch_launch_arguments(void);
rarch_system_info_t *runloop_get_system_info(void);
struct retro_system_info *runloop_get_libretro_system_info(void);