mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
[discord] let's rewrite this to do the same but different
This commit is contained in:
parent
9aa7b2bd62
commit
ec53480a66
@ -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);
|
||||
|
14
retroarch.c
14
retroarch.c
@ -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;
|
||||
}
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user