move around RA code (#894)

* move around RA code

* more

* more

* more
This commit is contained in:
Logan McNaughton
2026-05-15 14:36:11 +02:00
committed by GitHub
parent c8f485cd93
commit 93bf103f03
6 changed files with 39 additions and 42 deletions
+10 -10
View File
@@ -130,9 +130,12 @@ static void load_game_callback(int result, const char *error_message,
notify_load_game(userdata);
}
void ra_welcome() {
if (!g_client)
void ra_welcome(const char **game_title, const char **game_image_url) {
if (!g_client) {
*game_title = NULL;
*game_image_url = NULL;
return;
}
char buffer[512];
@@ -142,11 +145,16 @@ void ra_welcome() {
rdp_onscreen_message(buffer, MESSAGE_LONG);
free(error_message);
rc_client_set_userdata(g_client, NULL);
*game_title = NULL;
*game_image_url = NULL;
return;
}
const rc_client_game_t *game = rc_client_get_game_info(g_client);
if (!game) {
*game_title = NULL;
*game_image_url = NULL;
return;
}
@@ -166,15 +174,7 @@ void ra_welcome() {
"Game has no achievements");
}
rdp_onscreen_message(buffer, MESSAGE_LONG);
}
void ra_get_game_info(const char **game_title, const char **game_image_url) {
const rc_client_game_t *game = rc_client_get_game_info(g_client);
if (!game) {
*game_title = NULL;
*game_image_url = NULL;
return;
}
*game_title = game->title;
*game_image_url = game->badge_url;
}
+1 -2
View File
@@ -4,7 +4,7 @@
void ra_init_client(bool hardcore, bool challenge, bool leaderboard);
void ra_shutdown_client();
void ra_welcome();
void ra_welcome(const char **game_title, const char **game_image_url);
bool ra_get_hardcore();
void ra_load_game(const uint8_t *rom, size_t rom_size, void *userdata);
void ra_unload_game();
@@ -24,7 +24,6 @@ void ra_save_state(uint8_t *state, size_t state_size);
void ra_load_state(const uint8_t *state, size_t state_size);
const char *ra_get_rich_presence();
void ra_get_game_info(const char **game_title, const char **game_image_url);
#ifdef __cplusplus
extern "C" {