Skip to content

Commit 3bd7135

Browse files
authored
update to rcheevos 12.2 (#18554)
1 parent bfeac2e commit 3bd7135

19 files changed

Lines changed: 544 additions & 71 deletions

deps/rcheevos/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# v12.2.0
2+
* add rc_client_create_subset_list
3+
* add rc_client_begin_fetch_game_titles
4+
* greatly improve performance parsing long AddSource chains
5+
* don't send pings if not processing frames; allows server to suspend session while emulator is paused
6+
* modify validation logic to return most severe error instead of first error found
7+
* improve validation warning when 'PauseIf {recall}' attempts to use non-PauseIf Remember
8+
* fix rounding error when subtracting floats from integers
9+
* fix infinite loop processing 'Remember {recall}' with no modifiers
10+
* fix measured value jumping to 0 if all measured-generating alts are paused
11+
* fix buffer overflow converting long user names between rc_client_external versions
12+
* fix validation warning when adding differently sized values
13+
* fix validation warning when ResetIf only applies to hit count inside an AndNext chain
14+
* fix validation warning when only last node of modified memref chain differs
15+
116
# v12.1.0
217
* add rc_client_get_user_subset_summary
318
* add validation warning for using MeasuredIf without Measured

deps/rcheevos/include/rc_api_info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ typedef struct rc_api_game_title_entry_t {
211211
const char* title;
212212
/* The image name for the game badge */
213213
const char* image_name;
214+
/* The URL for the game badge image */
215+
const char* image_url;
214216
}
215217
rc_api_game_title_entry_t;
216218

deps/rcheevos/include/rc_client.h

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,22 @@ RC_EXPORT const rc_client_subset_t* RC_CCONV rc_client_get_subset_info(rc_client
364364

365365
RC_EXPORT void RC_CCONV rc_client_get_user_subset_summary(const rc_client_t* client, uint32_t subset_id, rc_client_user_game_summary_t* summary);
366366

367+
typedef struct rc_client_subset_list_t {
368+
const rc_client_subset_t** subsets;
369+
uint32_t num_subsets;
370+
} rc_client_subset_list_t;
371+
372+
/**
373+
* Creates a list of subsets for the currently loaded game.
374+
* Returns an allocated list that must be free'd by calling rc_client_destroy_subset_list.
375+
*/
376+
RC_EXPORT rc_client_subset_list_t* RC_CCONV rc_client_create_subset_list(rc_client_t* client);
377+
378+
/**
379+
* Destroys a list allocated by rc_client_create_subset_list_list.
380+
*/
381+
RC_EXPORT void RC_CCONV rc_client_destroy_subset_list(rc_client_subset_list_t* list);
382+
367383
/*****************************************************************************\
368384
| Fetch Game Hashes |
369385
\*****************************************************************************/
@@ -398,6 +414,42 @@ RC_EXPORT rc_client_async_handle_t* RC_CCONV rc_client_begin_fetch_hash_library(
398414
*/
399415
RC_EXPORT void RC_CCONV rc_client_destroy_hash_library(rc_client_hash_library_t* list);
400416

417+
/*****************************************************************************\
418+
| Fetch Game Titles |
419+
\*****************************************************************************/
420+
421+
typedef struct rc_client_game_title_entry_t {
422+
uint32_t game_id;
423+
const char* title;
424+
char badge_name[16];
425+
const char* badge_url;
426+
} rc_client_game_title_entry_t;
427+
428+
typedef struct rc_client_game_title_list_t {
429+
rc_client_game_title_entry_t* entries;
430+
uint32_t num_entries;
431+
} rc_client_game_title_list_t;
432+
433+
/**
434+
* Callback that is fired when a game titles request completes. list may be null if the query failed.
435+
*/
436+
typedef void(RC_CCONV* rc_client_fetch_game_titles_callback_t)(int result, const char* error_message,
437+
rc_client_game_title_list_t* list, rc_client_t* client,
438+
void* callback_userdata);
439+
440+
/**
441+
* Starts an asynchronous request for titles and badge names for the specified games.
442+
* The caller must provide an array of game IDs and the number of IDs in the array.
443+
*/
444+
RC_EXPORT rc_client_async_handle_t* RC_CCONV rc_client_begin_fetch_game_titles(
445+
rc_client_t* client, const uint32_t* game_ids, uint32_t num_game_ids,
446+
rc_client_fetch_game_titles_callback_t callback, void* callback_userdata);
447+
448+
/**
449+
* Destroys a previously-allocated result from the rc_client_begin_fetch_game_titles() callback.
450+
*/
451+
RC_EXPORT void RC_CCONV rc_client_destroy_game_title_list(rc_client_game_title_list_t* list);
452+
401453
/*****************************************************************************\
402454
| Achievements |
403455
\*****************************************************************************/
@@ -503,7 +555,7 @@ enum {
503555
RC_EXPORT rc_client_achievement_list_t* RC_CCONV rc_client_create_achievement_list(rc_client_t* client, int category, int grouping);
504556

505557
/**
506-
* Destroys a list allocated by rc_client_get_achievement_list.
558+
* Destroys a list allocated by rc_client_create_achievement_list.
507559
*/
508560
RC_EXPORT void RC_CCONV rc_client_destroy_achievement_list(rc_client_achievement_list_t* list);
509561

deps/rcheevos/include/rc_runtime_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ enum {
173173
RC_OPERATOR_SUB,
174174

175175
RC_OPERATOR_SUB_PARENT, /* internal use */
176+
RC_OPERATOR_ADD_ACCUMULATOR, /* internal use */
177+
RC_OPERATOR_SUB_ACCUMULATOR, /* internal use */
176178
RC_OPERATOR_INDIRECT_READ /* internal use */
177179
};
178180

deps/rcheevos/src/rapi/rc_api_info.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,8 @@ int rc_api_process_fetch_game_titles_server_response(rc_api_fetch_game_titles_re
448448
rc_json_field_t entry_fields[] = {
449449
RC_JSON_NEW_FIELD("ID"),
450450
RC_JSON_NEW_FIELD("Title"),
451-
RC_JSON_NEW_FIELD("ImageIcon")
451+
RC_JSON_NEW_FIELD("ImageIcon"),
452+
RC_JSON_NEW_FIELD("ImageUrl")
452453
};
453454

454455
memset(response, 0, sizeof(*response));
@@ -482,6 +483,10 @@ int rc_api_process_fetch_game_titles_server_response(rc_api_fetch_game_titles_re
482483
if (!rc_json_get_required_string(&entry->image_name, &response->response, &entry_fields[2], "ImageIcon"))
483484
return RC_MISSING_VALUE;
484485

486+
rc_json_get_optional_string(&entry->image_url, &response->response, &entry_fields[3], "ImageUrl", "");
487+
if (!entry->image_url[0])
488+
entry->image_url = rc_api_build_avatar_url(&response->response.buffer, RC_IMAGE_TYPE_GAME, entry->image_name);
489+
485490
++entry;
486491
}
487492
}

0 commit comments

Comments
 (0)