From 0b1db713ac0273b2bab7ce6bbab8e42a053a7842 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 8 Oct 2021 12:58:43 -0500 Subject: [PATCH] lsteamclient: Also convert paths from GetGlyphForXboxOrigin CW-Bug-Id: #19517 --- ...cppISteamController_SteamController007.cpp | 5 --- ...cppISteamController_SteamController008.cpp | 5 --- lsteamclient/cppISteamInput_SteamInput001.cpp | 5 --- lsteamclient/cppISteamInput_SteamInput002.cpp | 5 --- lsteamclient/cppISteamInput_SteamInput005.cpp | 5 --- lsteamclient/gen_wrapper.py | 15 ++++++--- lsteamclient/steamclient_manual_150.cpp | 14 +++++++++ lsteamclient/steamclient_manual_151.cpp | 7 +++++ lsteamclient/steamclient_manual_152.cpp | 31 +++++++++++++++++++ lsteamclient/steamclient_private.h | 1 + 10 files changed, 63 insertions(+), 30 deletions(-) diff --git a/lsteamclient/cppISteamController_SteamController007.cpp b/lsteamclient/cppISteamController_SteamController007.cpp index c6ec970a..489cfd2f 100644 --- a/lsteamclient/cppISteamController_SteamController007.cpp +++ b/lsteamclient/cppISteamController_SteamController007.cpp @@ -156,11 +156,6 @@ const char * cppISteamController_SteamController007_GetStringForXboxOrigin(void return ((ISteamController*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); } -const char * cppISteamController_SteamController007_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); -} - EControllerActionOrigin cppISteamController_SteamController007_GetActionOriginFromXboxOrigin(void *linux_side, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin) { return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin); diff --git a/lsteamclient/cppISteamController_SteamController008.cpp b/lsteamclient/cppISteamController_SteamController008.cpp index 1f08973d..5fdef439 100644 --- a/lsteamclient/cppISteamController_SteamController008.cpp +++ b/lsteamclient/cppISteamController_SteamController008.cpp @@ -156,11 +156,6 @@ const char * cppISteamController_SteamController008_GetStringForXboxOrigin(void return ((ISteamController*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); } -const char * cppISteamController_SteamController008_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); -} - EControllerActionOrigin cppISteamController_SteamController008_GetActionOriginFromXboxOrigin(void *linux_side, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin) { return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput001.cpp b/lsteamclient/cppISteamInput_SteamInput001.cpp index 74664599..069dac13 100644 --- a/lsteamclient/cppISteamInput_SteamInput001.cpp +++ b/lsteamclient/cppISteamInput_SteamInput001.cpp @@ -156,11 +156,6 @@ const char * cppISteamInput_SteamInput001_GetStringForXboxOrigin(void *linux_sid return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); } -const char * cppISteamInput_SteamInput001_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); -} - EInputActionOrigin cppISteamInput_SteamInput001_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput002.cpp b/lsteamclient/cppISteamInput_SteamInput002.cpp index c7f6466f..82a7796e 100644 --- a/lsteamclient/cppISteamInput_SteamInput002.cpp +++ b/lsteamclient/cppISteamInput_SteamInput002.cpp @@ -156,11 +156,6 @@ const char * cppISteamInput_SteamInput002_GetStringForXboxOrigin(void *linux_sid return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); } -const char * cppISteamInput_SteamInput002_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); -} - EInputActionOrigin cppISteamInput_SteamInput002_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput005.cpp b/lsteamclient/cppISteamInput_SteamInput005.cpp index f24d9ec9..7cfb9dd9 100644 --- a/lsteamclient/cppISteamInput_SteamInput005.cpp +++ b/lsteamclient/cppISteamInput_SteamInput005.cpp @@ -196,11 +196,6 @@ const char * cppISteamInput_SteamInput005_GetStringForXboxOrigin(void *linux_sid return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); } -const char * cppISteamInput_SteamInput005_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); -} - EInputActionOrigin cppISteamInput_SteamInput005_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 4db76531..1c72ae92 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -220,16 +220,19 @@ manually_handled_methods = { "ReceiveMessagesOnChannel" ], "cppISteamInput_SteamInput001": [ - "GetGlyphForActionOrigin" + "GetGlyphForActionOrigin", + "GetGlyphForXboxOrigin" ], "cppISteamInput_SteamInput002": [ - "GetGlyphForActionOrigin" + "GetGlyphForActionOrigin", + "GetGlyphForXboxOrigin" ], "cppISteamInput_SteamInput005": [ "EnableActionEventCallbacks", "GetGlyphPNGForActionOrigin", "GetGlyphSVGForActionOrigin", - "GetGlyphForActionOrigin_Legacy" + "GetGlyphForActionOrigin_Legacy", + "GetGlyphForXboxOrigin" ], "cppISteamController_SteamController005": [ "GetGlyphForActionOrigin" @@ -238,10 +241,12 @@ manually_handled_methods = { "GetGlyphForActionOrigin" ], "cppISteamController_SteamController007": [ - "GetGlyphForActionOrigin" + "GetGlyphForActionOrigin", + "GetGlyphForXboxOrigin" ], "cppISteamController_SteamController008": [ - "GetGlyphForActionOrigin" + "GetGlyphForActionOrigin", + "GetGlyphForXboxOrigin" ], } diff --git a/lsteamclient/steamclient_manual_150.cpp b/lsteamclient/steamclient_manual_150.cpp index f804ae35..2260682f 100644 --- a/lsteamclient/steamclient_manual_150.cpp +++ b/lsteamclient/steamclient_manual_150.cpp @@ -369,6 +369,13 @@ const char * cppISteamInput_SteamInput001_GetGlyphForActionOrigin(void *linux_si return steamclient_isteaminput_getglyph(eOrigin, path_result); } +const char * cppISteamInput_SteamInput001_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); + return steamclient_isteaminput_getglyph_xbox(eOrigin, path_result); +} + const char * cppISteamController_SteamController007_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) { const char *path_result; @@ -376,4 +383,11 @@ const char * cppISteamController_SteamController007_GetGlyphForActionOrigin(void return steamclient_isteamcontroller_getglyph(eOrigin, path_result); } +const char * cppISteamController_SteamController007_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); + return steamclient_isteaminput_getglyph_xbox(eOrigin, path_result); +} + } diff --git a/lsteamclient/steamclient_manual_151.cpp b/lsteamclient/steamclient_manual_151.cpp index 74feffc5..7b6ba9fd 100644 --- a/lsteamclient/steamclient_manual_151.cpp +++ b/lsteamclient/steamclient_manual_151.cpp @@ -27,4 +27,11 @@ const char * cppISteamInput_SteamInput002_GetGlyphForActionOrigin(void *linux_si return steamclient_isteaminput_getglyph(eOrigin, path_result); } +const char * cppISteamInput_SteamInput002_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); + return steamclient_isteaminput_getglyph_xbox(eOrigin, path_result); +} + } diff --git a/lsteamclient/steamclient_manual_152.cpp b/lsteamclient/steamclient_manual_152.cpp index 27cb6eb5..8851fa39 100644 --- a/lsteamclient/steamclient_manual_152.cpp +++ b/lsteamclient/steamclient_manual_152.cpp @@ -42,6 +42,7 @@ void cppISteamInput_SteamInput005_EnableActionEventCallbacks(void *linux_side, w /***** convert and cache ISteamInput glyph paths *****/ static std::unordered_map cached_input_glyphs; +static std::unordered_map cached_input_glyphs_xbox; static std::unordered_map cached_input_glyphs_svg; static std::unordered_map cached_input_glyphs_png[3 /* ESteamInputGlyphSize */]; @@ -93,6 +94,22 @@ const char *steamclient_isteaminput_getglyph(int origin, const char *lin_path) return cached_input_glyphs[origin]; } +const char *steamclient_isteaminput_getglyph_xbox(int origin, const char *lin_path) +{ + if(!lin_path) + return NULL; + + if(cached_input_glyphs_xbox.find(origin) == cached_input_glyphs_xbox.end()){ + char *dos_path = (char *)HeapAlloc(GetProcessHeap(), 0, PATH_MAX); + + steamclient_unix_path_to_dos_path(1, lin_path, dos_path, PATH_MAX, 0); + + cached_input_glyphs_xbox[origin] = dos_path; + } + + return cached_input_glyphs_xbox[origin]; +} + const char * cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags) { const char *path_result; @@ -114,6 +131,13 @@ const char * cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(void *l return steamclient_isteaminput_getglyph(eOrigin, path_result); } +const char * cppISteamInput_SteamInput005_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); + return steamclient_isteaminput_getglyph_xbox(eOrigin, path_result); +} + /***** convert and cache ISteamController glyph paths *****/ static std::unordered_map cached_controller_glyphs; @@ -140,4 +164,11 @@ const char * cppISteamController_SteamController008_GetGlyphForActionOrigin(void return steamclient_isteamcontroller_getglyph(eOrigin, path_result); } +const char * cppISteamController_SteamController008_GetGlyphForXboxOrigin(void *linux_side, EXboxOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForXboxOrigin((EXboxOrigin)eOrigin); + return steamclient_isteaminput_getglyph_xbox(eOrigin, path_result); +} + } diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index a2c245ca..707fdf96 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -44,6 +44,7 @@ const char **steamclient_dos_to_unix_stringlist(const char **src); void steamclient_free_stringlist(const char **out); const char *steamclient_isteamcontroller_getglyph(int origin, const char *lin_path); const char *steamclient_isteaminput_getglyph(int origin, const char *lin_path); +const char *steamclient_isteaminput_getglyph_xbox(int origin, const char *lin_path); uint32 manual_convert_nNativeKeyCode(uint32 win_vk); void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version);