diff options
author | Andrew Eikum <aeikum@codeweavers.com> | 2021-10-08 19:09:30 +0300 |
---|---|---|
committer | Andrew Eikum <aeikum@codeweavers.com> | 2021-10-08 21:03:41 +0300 |
commit | b11c5bcfb0be3b4602b9c4f1699ac0fe8ff17121 (patch) | |
tree | 40973ca5a7e998b464f08f461d44eded6ac470c7 | |
parent | 03476e7e21a885f8ae2dc2cd86d410f89b926274 (diff) |
lsteamclient: Convert glyph paths in new ISteamInput005 methods
CW-Bug-Id: #19517
-rw-r--r-- | lsteamclient/cppISteamController_SteamController005.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamController_SteamController006.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamController_SteamController007.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamController_SteamController008.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamInput_SteamInput001.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamInput_SteamInput002.cpp | 5 | ||||
-rw-r--r-- | lsteamclient/cppISteamInput_SteamInput005.cpp | 15 | ||||
-rwxr-xr-x | lsteamclient/gen_wrapper.py | 46 | ||||
-rw-r--r-- | lsteamclient/steam_defs.h | 1 | ||||
-rw-r--r-- | lsteamclient/steamclient_main.c | 15 | ||||
-rw-r--r-- | lsteamclient/steamclient_manual_141.cpp | 27 | ||||
-rw-r--r-- | lsteamclient/steamclient_manual_142.cpp | 27 | ||||
-rw-r--r-- | lsteamclient/steamclient_manual_150.cpp | 14 | ||||
-rw-r--r-- | lsteamclient/steamclient_manual_151.cpp | 30 | ||||
-rw-r--r-- | lsteamclient/steamclient_manual_152.cpp | 102 | ||||
-rw-r--r-- | lsteamclient/steamclient_private.h | 1 | ||||
-rw-r--r-- | lsteamclient/winISteamController.c | 20 | ||||
-rw-r--r-- | lsteamclient/winISteamInput.c | 15 |
18 files changed, 234 insertions, 109 deletions
diff --git a/lsteamclient/cppISteamController_SteamController005.cpp b/lsteamclient/cppISteamController_SteamController005.cpp index 4245be2b..e9d89f8d 100644 --- a/lsteamclient/cppISteamController_SteamController005.cpp +++ b/lsteamclient/cppISteamController_SteamController005.cpp @@ -135,11 +135,6 @@ const char * cppISteamController_SteamController005_GetStringForActionOrigin(voi return ((ISteamController*)linux_side)->GetStringForActionOrigin((EControllerActionOrigin)eOrigin); } -const char * cppISteamController_SteamController005_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); -} - #ifdef __cplusplus } #endif diff --git a/lsteamclient/cppISteamController_SteamController006.cpp b/lsteamclient/cppISteamController_SteamController006.cpp index 1eaf3454..51eef212 100644 --- a/lsteamclient/cppISteamController_SteamController006.cpp +++ b/lsteamclient/cppISteamController_SteamController006.cpp @@ -155,11 +155,6 @@ const char * cppISteamController_SteamController006_GetStringForActionOrigin(voi return ((ISteamController*)linux_side)->GetStringForActionOrigin((EControllerActionOrigin)eOrigin); } -const char * cppISteamController_SteamController006_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); -} - ESteamInputType cppISteamController_SteamController006_GetInputTypeForHandle(void *linux_side, ControllerHandle_t controllerHandle) { return ((ISteamController*)linux_side)->GetInputTypeForHandle((ControllerHandle_t)controllerHandle); diff --git a/lsteamclient/cppISteamController_SteamController007.cpp b/lsteamclient/cppISteamController_SteamController007.cpp index 773dc4ed..c6ec970a 100644 --- a/lsteamclient/cppISteamController_SteamController007.cpp +++ b/lsteamclient/cppISteamController_SteamController007.cpp @@ -96,11 +96,6 @@ int cppISteamController_SteamController007_GetAnalogActionOrigins(void *linux_si return ((ISteamController*)linux_side)->GetAnalogActionOrigins((ControllerHandle_t)controllerHandle, (ControllerActionSetHandle_t)actionSetHandle, (ControllerAnalogActionHandle_t)analogActionHandle, (EControllerActionOrigin *)originsOut); } -const char * cppISteamController_SteamController007_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); -} - const char * cppISteamController_SteamController007_GetStringForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) { return ((ISteamController*)linux_side)->GetStringForActionOrigin((EControllerActionOrigin)eOrigin); diff --git a/lsteamclient/cppISteamController_SteamController008.cpp b/lsteamclient/cppISteamController_SteamController008.cpp index c28b2c5f..1f08973d 100644 --- a/lsteamclient/cppISteamController_SteamController008.cpp +++ b/lsteamclient/cppISteamController_SteamController008.cpp @@ -96,11 +96,6 @@ int cppISteamController_SteamController008_GetAnalogActionOrigins(void *linux_si return ((ISteamController*)linux_side)->GetAnalogActionOrigins((ControllerHandle_t)controllerHandle, (ControllerActionSetHandle_t)actionSetHandle, (ControllerAnalogActionHandle_t)analogActionHandle, (EControllerActionOrigin *)originsOut); } -const char * cppISteamController_SteamController008_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) -{ - return ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); -} - const char * cppISteamController_SteamController008_GetStringForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) { return ((ISteamController*)linux_side)->GetStringForActionOrigin((EControllerActionOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput001.cpp b/lsteamclient/cppISteamInput_SteamInput001.cpp index ffb9c9c6..74664599 100644 --- a/lsteamclient/cppISteamInput_SteamInput001.cpp +++ b/lsteamclient/cppISteamInput_SteamInput001.cpp @@ -96,11 +96,6 @@ int cppISteamInput_SteamInput001_GetAnalogActionOrigins(void *linux_side, InputH return ((ISteamInput*)linux_side)->GetAnalogActionOrigins((InputHandle_t)inputHandle, (InputActionSetHandle_t)actionSetHandle, (InputAnalogActionHandle_t)analogActionHandle, (EInputActionOrigin *)originsOut); } -const char * cppISteamInput_SteamInput001_GetGlyphForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForActionOrigin((EInputActionOrigin)eOrigin); -} - const char * cppISteamInput_SteamInput001_GetStringForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetStringForActionOrigin((EInputActionOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput002.cpp b/lsteamclient/cppISteamInput_SteamInput002.cpp index 48687396..c7f6466f 100644 --- a/lsteamclient/cppISteamInput_SteamInput002.cpp +++ b/lsteamclient/cppISteamInput_SteamInput002.cpp @@ -96,11 +96,6 @@ int cppISteamInput_SteamInput002_GetAnalogActionOrigins(void *linux_side, InputH return ((ISteamInput*)linux_side)->GetAnalogActionOrigins((InputHandle_t)inputHandle, (InputActionSetHandle_t)actionSetHandle, (InputAnalogActionHandle_t)analogActionHandle, (EInputActionOrigin *)originsOut); } -const char * cppISteamInput_SteamInput002_GetGlyphForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForActionOrigin((EInputActionOrigin)eOrigin); -} - const char * cppISteamInput_SteamInput002_GetStringForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetStringForActionOrigin((EInputActionOrigin)eOrigin); diff --git a/lsteamclient/cppISteamInput_SteamInput005.cpp b/lsteamclient/cppISteamInput_SteamInput005.cpp index f39421c0..f24d9ec9 100644 --- a/lsteamclient/cppISteamInput_SteamInput005.cpp +++ b/lsteamclient/cppISteamInput_SteamInput005.cpp @@ -121,21 +121,6 @@ int cppISteamInput_SteamInput005_GetAnalogActionOrigins(void *linux_side, InputH return ((ISteamInput*)linux_side)->GetAnalogActionOrigins((InputHandle_t)inputHandle, (InputActionSetHandle_t)actionSetHandle, (InputAnalogActionHandle_t)analogActionHandle, (EInputActionOrigin *)originsOut); } -const char * cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags) -{ - return ((ISteamInput*)linux_side)->GetGlyphPNGForActionOrigin((EInputActionOrigin)eOrigin, (ESteamInputGlyphSize)eSize, (uint32)unFlags); -} - -const char * cppISteamInput_SteamInput005_GetGlyphSVGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, uint32 unFlags) -{ - return ((ISteamInput*)linux_side)->GetGlyphSVGForActionOrigin((EInputActionOrigin)eOrigin, (uint32)unFlags); -} - -const char * cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(void *linux_side, EInputActionOrigin eOrigin) -{ - return ((ISteamInput*)linux_side)->GetGlyphForActionOrigin_Legacy((EInputActionOrigin)eOrigin); -} - const char * cppISteamInput_SteamInput005_GetStringForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) { return ((ISteamInput*)linux_side)->GetStringForActionOrigin((EInputActionOrigin)eOrigin); diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 4e32d7e2..4db76531 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -219,8 +219,29 @@ manually_handled_methods = { "cppISteamNetworkingMessages_SteamNetworkingMessages002": [ "ReceiveMessagesOnChannel" ], + "cppISteamInput_SteamInput001": [ + "GetGlyphForActionOrigin" + ], + "cppISteamInput_SteamInput002": [ + "GetGlyphForActionOrigin" + ], "cppISteamInput_SteamInput005": [ - "EnableActionEventCallbacks" + "EnableActionEventCallbacks", + "GetGlyphPNGForActionOrigin", + "GetGlyphSVGForActionOrigin", + "GetGlyphForActionOrigin_Legacy" + ], + "cppISteamController_SteamController005": [ + "GetGlyphForActionOrigin" + ], + "cppISteamController_SteamController006": [ + "GetGlyphForActionOrigin" + ], + "cppISteamController_SteamController007": [ + "GetGlyphForActionOrigin" + ], + "cppISteamController_SteamController008": [ + "GetGlyphForActionOrigin" ], } @@ -288,16 +309,6 @@ path_conversions = [ "w2l_urls": [False], "return_is_size": True }, - { - "parent_name": "GetGlyphForActionOrigin", - "l2w_names": [None], #return value - "l2w_lens": [None], - "l2w_urls": [None], - "w2l_names": [], - "w2l_arrays": [], - "w2l_urls": [], - "return_is_size": False - }, ### ISteamGameServer::SetModDir - "Just the folder name, not the whole path. I.e. "Spacewar"." { "parent_name": "LoadURL", @@ -852,15 +863,10 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e cfile.write(" return _r;\n") if path_conv and len(path_conv["l2w_names"]) > 0: for i in range(len(path_conv["l2w_names"])): - if path_conv["l2w_names"][i]: - cfile.write(" ") - if path_conv["return_is_size"]: - cfile.write("path_result = ") - cfile.write("steamclient_unix_path_to_dos_path(path_result, %s, %s, %s, %s);\n" % (path_conv["l2w_names"][i], path_conv["l2w_names"][i], path_conv["l2w_lens"][i], to_c_bool(path_conv["l2w_urls"][i]))) - else: - #string is in return value - #ISteamController::GetGlyphForActionOrigin is the only user here for now - cfile.write(" path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result);\n") + cfile.write(" ") + if path_conv["return_is_size"]: + cfile.write("path_result = ") + cfile.write("steamclient_unix_path_to_dos_path(path_result, %s, %s, %s, %s);\n" % (path_conv["l2w_names"][i], path_conv["l2w_names"][i], path_conv["l2w_lens"][i], to_c_bool(path_conv["l2w_urls"][i]))) cfile.write(" return path_result;\n") if path_conv: for i in range(len(path_conv["w2l_names"])): diff --git a/lsteamclient/steam_defs.h b/lsteamclient/steam_defs.h index 675a242f..163bfcac 100644 --- a/lsteamclient/steam_defs.h +++ b/lsteamclient/steam_defs.h @@ -1,7 +1,6 @@ #include <stdint.h> #include <limits.h> typedef uint32_t EHTMLMouseButton, EHTMLKeyModifiers; -#define nullptr (void*)0 #ifndef __cplusplus #ifndef bool diff --git a/lsteamclient/steamclient_main.c b/lsteamclient/steamclient_main.c index 0d65faff..cd885b26 100644 --- a/lsteamclient/steamclient_main.c +++ b/lsteamclient/steamclient_main.c @@ -25,8 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(steamclient); char g_tmppath[PATH_MAX]; -static char *controller_glyphs[512]; /* at least k_EControllerActionOrigin_Count */ - static CRITICAL_SECTION steamclient_cs = { NULL, -1, 0, 0, 0, 0 }; static HANDLE steam_overlay_event; @@ -234,19 +232,6 @@ void steamclient_free_stringlist(const char **out) } } -const char *steamclient_isteamcontroller_getglyph(int origin, const char *lin_path) -{ - if(!lin_path) - return NULL; - - if(!controller_glyphs[origin]) - controller_glyphs[origin] = HeapAlloc(GetProcessHeap(), 0, PATH_MAX); - - steamclient_unix_path_to_dos_path(1, lin_path, controller_glyphs[origin], PATH_MAX, 0); - - return controller_glyphs[origin]; -} - #ifdef __linux__ static const uint32 vk_to_xkeysym[0xFF] = { 0, /* 0x0 Undefined */ diff --git a/lsteamclient/steamclient_manual_141.cpp b/lsteamclient/steamclient_manual_141.cpp new file mode 100644 index 00000000..fbb1d13c --- /dev/null +++ b/lsteamclient/steamclient_manual_141.cpp @@ -0,0 +1,27 @@ +extern "C" { +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(steamclient); +} + +#include "steam_defs.h" +#pragma push_macro("__cdecl") +#undef __cdecl +#include "steamworks_sdk_141/steam_api.h" +#pragma pop_macro("__cdecl") +#include "steamclient_private.h" + +extern "C" { + +const char * cppISteamController_SteamController005_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); + return steamclient_isteamcontroller_getglyph(eOrigin, path_result); +} + +} diff --git a/lsteamclient/steamclient_manual_142.cpp b/lsteamclient/steamclient_manual_142.cpp new file mode 100644 index 00000000..bfe235ad --- /dev/null +++ b/lsteamclient/steamclient_manual_142.cpp @@ -0,0 +1,27 @@ +extern "C" { +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(steamclient); +} + +#include "steam_defs.h" +#pragma push_macro("__cdecl") +#undef __cdecl +#include "steamworks_sdk_142/steam_api.h" +#pragma pop_macro("__cdecl") +#include "steamclient_private.h" + +extern "C" { + +const char * cppISteamController_SteamController006_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); + return steamclient_isteamcontroller_getglyph(eOrigin, path_result); +} + +} diff --git a/lsteamclient/steamclient_manual_150.cpp b/lsteamclient/steamclient_manual_150.cpp index 95633f87..f804ae35 100644 --- a/lsteamclient/steamclient_manual_150.cpp +++ b/lsteamclient/steamclient_manual_150.cpp @@ -362,4 +362,18 @@ bool cppISteamNetworkingUtils_SteamNetworkingUtils003_SetConfigValue(void *linux } } +const char * cppISteamInput_SteamInput001_GetGlyphForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForActionOrigin((EInputActionOrigin)eOrigin); + return steamclient_isteaminput_getglyph(eOrigin, path_result); +} + +const char * cppISteamController_SteamController007_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); + return steamclient_isteamcontroller_getglyph(eOrigin, path_result); +} + } diff --git a/lsteamclient/steamclient_manual_151.cpp b/lsteamclient/steamclient_manual_151.cpp new file mode 100644 index 00000000..74feffc5 --- /dev/null +++ b/lsteamclient/steamclient_manual_151.cpp @@ -0,0 +1,30 @@ +extern "C" { +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(steamclient); +} + +#include "steam_defs.h" +#pragma push_macro("__cdecl") +#undef __cdecl +#include "steamworks_sdk_151/steam_api.h" +#pragma pop_macro("__cdecl") +#include "steamclient_private.h" + +extern "C" { +#define SDKVER_151 +#include "struct_converters.h" +#include "cb_converters.h" + +const char * cppISteamInput_SteamInput002_GetGlyphForActionOrigin(void *linux_side, EInputActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForActionOrigin((EInputActionOrigin)eOrigin); + return steamclient_isteaminput_getglyph(eOrigin, path_result); +} + +} diff --git a/lsteamclient/steamclient_manual_152.cpp b/lsteamclient/steamclient_manual_152.cpp index c1974a58..27cb6eb5 100644 --- a/lsteamclient/steamclient_manual_152.cpp +++ b/lsteamclient/steamclient_manual_152.cpp @@ -16,6 +16,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(steamclient); #pragma pop_macro("__cdecl") #include "steamclient_private.h" +#include <unordered_map> + extern "C" { #define SDKVER_152 #include "struct_converters.h" @@ -38,4 +40,104 @@ void cppISteamInput_SteamInput005_EnableActionEventCallbacks(void *linux_side, w ((ISteamInput*)linux_side)->EnableActionEventCallbacks(pCallback ? &lin_SteamInputActionEventCallbackPointer : NULL); } +/***** convert and cache ISteamInput glyph paths *****/ +static std::unordered_map<int /*EInputActionOrigin*/, char *> cached_input_glyphs; +static std::unordered_map<int /*EInputActionOrigin*/, char *> cached_input_glyphs_svg; +static std::unordered_map<int /*EInputActionOrigin*/, char *> cached_input_glyphs_png[3 /* ESteamInputGlyphSize */]; + +static const char *steamclient_isteaminput_getglyph_png(int origin, int size, const char *lin_path) +{ + if(!lin_path) + return NULL; + + if(cached_input_glyphs_png[size].find(origin) == cached_input_glyphs_png[size].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_png[size][origin] = dos_path; + } + + return cached_input_glyphs_png[size][origin]; +} + +static const char *steamclient_isteaminput_getglyph_svg(int origin, const char *lin_path) +{ + if(!lin_path) + return NULL; + + if(cached_input_glyphs_svg.find(origin) == cached_input_glyphs_svg.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_svg[origin] = dos_path; + } + + return cached_input_glyphs_svg[origin]; +} + +const char *steamclient_isteaminput_getglyph(int origin, const char *lin_path) +{ + if(!lin_path) + return NULL; + + if(cached_input_glyphs.find(origin) == cached_input_glyphs.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[origin] = dos_path; + } + + return cached_input_glyphs[origin]; +} + +const char * cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphPNGForActionOrigin((EInputActionOrigin)eOrigin, eSize, unFlags); + return steamclient_isteaminput_getglyph_png(eOrigin, eSize, path_result); +} + +const char * cppISteamInput_SteamInput005_GetGlyphSVGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, uint32 unFlags) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphSVGForActionOrigin((EInputActionOrigin)eOrigin, unFlags); + return steamclient_isteaminput_getglyph_svg(eOrigin, path_result); +} + +const char * cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(void *linux_side, EInputActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamInput*)linux_side)->GetGlyphForActionOrigin_Legacy((EInputActionOrigin)eOrigin); + return steamclient_isteaminput_getglyph(eOrigin, path_result); +} + +/***** convert and cache ISteamController glyph paths *****/ +static std::unordered_map<int /*EControllerActionOrigin*/, char *> cached_controller_glyphs; + +const char *steamclient_isteamcontroller_getglyph(int origin, const char *lin_path) +{ + if(!lin_path) + return NULL; + + if(cached_controller_glyphs.find(origin) == cached_controller_glyphs.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_controller_glyphs[origin] = dos_path; + } + + return cached_controller_glyphs[origin]; +} + +const char * cppISteamController_SteamController008_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin) +{ + const char *path_result; + path_result = ((ISteamController*)linux_side)->GetGlyphForActionOrigin((EControllerActionOrigin)eOrigin); + return steamclient_isteamcontroller_getglyph(eOrigin, path_result); +} + } diff --git a/lsteamclient/steamclient_private.h b/lsteamclient/steamclient_private.h index f82ec723..a2c245ca 100644 --- a/lsteamclient/steamclient_private.h +++ b/lsteamclient/steamclient_private.h @@ -43,6 +43,7 @@ bool steamclient_dos_path_to_unix_path(const char *src, char *dst, int is_url); 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); uint32 manual_convert_nNativeKeyCode(uint32 win_vk); void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version); diff --git a/lsteamclient/winISteamController.c b/lsteamclient/winISteamController.c index 39967d67..dc5caff4 100644 --- a/lsteamclient/winISteamController.c +++ b/lsteamclient/winISteamController.c @@ -146,11 +146,8 @@ int __thiscall winISteamController_SteamController008_GetAnalogActionOrigins(win DEFINE_THISCALL_WRAPPER(winISteamController_SteamController008_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamController_SteamController008_GetGlyphForActionOrigin(winISteamController_SteamController008 *_this, EControllerActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamController_SteamController008_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamController_SteamController008_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamController_SteamController008_GetStringForActionOrigin, 8) @@ -451,11 +448,8 @@ int __thiscall winISteamController_SteamController007_GetAnalogActionOrigins(win DEFINE_THISCALL_WRAPPER(winISteamController_SteamController007_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamController_SteamController007_GetGlyphForActionOrigin(winISteamController_SteamController007 *_this, EControllerActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamController_SteamController007_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamController_SteamController007_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamController_SteamController007_GetStringForActionOrigin, 8) @@ -841,11 +835,8 @@ const char * __thiscall winISteamController_SteamController006_GetStringForActio DEFINE_THISCALL_WRAPPER(winISteamController_SteamController006_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamController_SteamController006_GetGlyphForActionOrigin(winISteamController_SteamController006 *_this, EControllerActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamController_SteamController006_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamController_SteamController006_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamController_SteamController006_GetInputTypeForHandle, 12) @@ -1094,11 +1085,8 @@ const char * __thiscall winISteamController_SteamController005_GetStringForActio DEFINE_THISCALL_WRAPPER(winISteamController_SteamController005_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamController_SteamController005_GetGlyphForActionOrigin(winISteamController_SteamController005 *_this, EControllerActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamController_SteamController005_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamController_SteamController005_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } extern vtable_ptr winISteamController_SteamController005_vtable; diff --git a/lsteamclient/winISteamInput.c b/lsteamclient/winISteamInput.c index 441560b3..761fa0c3 100644 --- a/lsteamclient/winISteamInput.c +++ b/lsteamclient/winISteamInput.c @@ -204,11 +204,8 @@ const char * __thiscall winISteamInput_SteamInput005_GetGlyphSVGForActionOrigin( DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy, 8) const char * __thiscall winISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(winISteamInput_SteamInput005 *_this, EInputActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput005_GetStringForActionOrigin, 8) @@ -557,11 +554,8 @@ int __thiscall winISteamInput_SteamInput002_GetAnalogActionOrigins(winISteamInpu DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput002_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamInput_SteamInput002_GetGlyphForActionOrigin(winISteamInput_SteamInput002 *_this, EInputActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamInput_SteamInput002_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamInput_SteamInput002_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput002_GetStringForActionOrigin, 8) @@ -870,11 +864,8 @@ int __thiscall winISteamInput_SteamInput001_GetAnalogActionOrigins(winISteamInpu DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput001_GetGlyphForActionOrigin, 8) const char * __thiscall winISteamInput_SteamInput001_GetGlyphForActionOrigin(winISteamInput_SteamInput001 *_this, EInputActionOrigin eOrigin) { - const char *path_result; TRACE("%p\n", _this); - path_result = cppISteamInput_SteamInput001_GetGlyphForActionOrigin(_this->linux_side, eOrigin); - path_result = steamclient_isteamcontroller_getglyph(eOrigin, path_result); - return path_result; + return cppISteamInput_SteamInput001_GetGlyphForActionOrigin(_this->linux_side, eOrigin); } DEFINE_THISCALL_WRAPPER(winISteamInput_SteamInput001_GetStringForActionOrigin, 8) |