Skip to content

Commit

Permalink
Fix rich presence
Browse files Browse the repository at this point in the history
  • Loading branch information
OFFTKP committed Aug 13, 2024
1 parent ef1293c commit fbc7795
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ endif()

if(ENABLE_RETRO_ACHIEVEMENTS)
add_definitions(-DENABLE_RETRO_ACHIEVEMENTS=1)
add_definitions(-DRC_DISABLE_LUA)
add_definitions(-DRC_CLIENT_SUPPORTS_HASH)
find_package(Lua 5.1 REQUIRED)
set(LINK_LIBS ${LINK_LIBS} ${LUA_LIBRARIES})
set(RCHEEVOS_SRC src/rcheevos/src/rapi/rc_api_common.c
src/rcheevos/src/rapi/rc_api_editor.c
src/rcheevos/src/rapi/rc_api_info.c
Expand Down
7 changes: 4 additions & 3 deletions src/retro_achievements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,15 +684,16 @@ namespace
type = http_request_e::POST;
}

url += "?" + post_data;
std::vector<std::pair<std::string, std::string>> headers;
#ifndef EMSCRIPTEN
// TODO(paris): When setting User-Agent from browser side, it sends a CORS
// preflight request which is makes the request fail.
headers.push_back({"User-Agent", "SkyEmu/4.0"});
#endif
headers.push_back({"Content-Type", "application/x-www-form-urlencoded"});
headers.push_back({"Content-Length", std::to_string(post_data.size())});

https_request(type, url, {}, headers,
https_request(type, url, post_data, headers,
[callback, callback_data](const std::vector<uint8_t>& result) {
if (result.empty())
{
Expand Down Expand Up @@ -1424,7 +1425,7 @@ void retro_achievements_draw_notifications(float left, float top, float screen_w
float image_height = screen_width * 0.05f * easing;
float placard_width =
padding_adj + screen_width * 0.30f * easing + padding_adj; // notifications that have the same width are more appealing
float wrap_width = placard_width - padding_adj * 2 - image_width;
float wrap_width = placard_width - padding_adj * 3 - image_width;
float title_font_size = 0.02f * screen_width * easing;
float submessage_font_size = 0.015f * screen_width * easing;

Expand Down

0 comments on commit fbc7795

Please sign in to comment.