lsteamclient: Also convert paths from GetGlyphForXboxOrigin

CW-Bug-Id: #19517
This commit is contained in:
Andrew Eikum 2021-10-08 12:58:43 -05:00
parent f9eef72c88
commit 0b1db713ac
10 changed files with 63 additions and 30 deletions

View file

@ -156,11 +156,6 @@ const char * cppISteamController_SteamController007_GetStringForXboxOrigin(void
return ((ISteamController*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); 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) EControllerActionOrigin cppISteamController_SteamController007_GetActionOriginFromXboxOrigin(void *linux_side, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin)
{ {
return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin); return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin);

View file

@ -156,11 +156,6 @@ const char * cppISteamController_SteamController008_GetStringForXboxOrigin(void
return ((ISteamController*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); 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) EControllerActionOrigin cppISteamController_SteamController008_GetActionOriginFromXboxOrigin(void *linux_side, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin)
{ {
return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin); return ((ISteamController*)linux_side)->GetActionOriginFromXboxOrigin((ControllerHandle_t)controllerHandle, (EXboxOrigin)eOrigin);

View file

@ -156,11 +156,6 @@ const char * cppISteamInput_SteamInput001_GetStringForXboxOrigin(void *linux_sid
return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); 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) EInputActionOrigin cppISteamInput_SteamInput001_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin)
{ {
return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin);

View file

@ -156,11 +156,6 @@ const char * cppISteamInput_SteamInput002_GetStringForXboxOrigin(void *linux_sid
return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); 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) EInputActionOrigin cppISteamInput_SteamInput002_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin)
{ {
return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin);

View file

@ -196,11 +196,6 @@ const char * cppISteamInput_SteamInput005_GetStringForXboxOrigin(void *linux_sid
return ((ISteamInput*)linux_side)->GetStringForXboxOrigin((EXboxOrigin)eOrigin); 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) EInputActionOrigin cppISteamInput_SteamInput005_GetActionOriginFromXboxOrigin(void *linux_side, InputHandle_t inputHandle, EXboxOrigin eOrigin)
{ {
return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin); return ((ISteamInput*)linux_side)->GetActionOriginFromXboxOrigin((InputHandle_t)inputHandle, (EXboxOrigin)eOrigin);

View file

@ -220,16 +220,19 @@ manually_handled_methods = {
"ReceiveMessagesOnChannel" "ReceiveMessagesOnChannel"
], ],
"cppISteamInput_SteamInput001": [ "cppISteamInput_SteamInput001": [
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin",
"GetGlyphForXboxOrigin"
], ],
"cppISteamInput_SteamInput002": [ "cppISteamInput_SteamInput002": [
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin",
"GetGlyphForXboxOrigin"
], ],
"cppISteamInput_SteamInput005": [ "cppISteamInput_SteamInput005": [
"EnableActionEventCallbacks", "EnableActionEventCallbacks",
"GetGlyphPNGForActionOrigin", "GetGlyphPNGForActionOrigin",
"GetGlyphSVGForActionOrigin", "GetGlyphSVGForActionOrigin",
"GetGlyphForActionOrigin_Legacy" "GetGlyphForActionOrigin_Legacy",
"GetGlyphForXboxOrigin"
], ],
"cppISteamController_SteamController005": [ "cppISteamController_SteamController005": [
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin"
@ -238,10 +241,12 @@ manually_handled_methods = {
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin"
], ],
"cppISteamController_SteamController007": [ "cppISteamController_SteamController007": [
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin",
"GetGlyphForXboxOrigin"
], ],
"cppISteamController_SteamController008": [ "cppISteamController_SteamController008": [
"GetGlyphForActionOrigin" "GetGlyphForActionOrigin",
"GetGlyphForXboxOrigin"
], ],
} }

View file

@ -369,6 +369,13 @@ const char * cppISteamInput_SteamInput001_GetGlyphForActionOrigin(void *linux_si
return steamclient_isteaminput_getglyph(eOrigin, path_result); 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 * cppISteamController_SteamController007_GetGlyphForActionOrigin(void *linux_side, EControllerActionOrigin eOrigin)
{ {
const char *path_result; const char *path_result;
@ -376,4 +383,11 @@ const char * cppISteamController_SteamController007_GetGlyphForActionOrigin(void
return steamclient_isteamcontroller_getglyph(eOrigin, path_result); 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);
}
} }

View file

@ -27,4 +27,11 @@ const char * cppISteamInput_SteamInput002_GetGlyphForActionOrigin(void *linux_si
return steamclient_isteaminput_getglyph(eOrigin, path_result); 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);
}
} }

View file

@ -42,6 +42,7 @@ void cppISteamInput_SteamInput005_EnableActionEventCallbacks(void *linux_side, w
/***** convert and cache ISteamInput glyph paths *****/ /***** 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;
static std::unordered_map<int /*EInputActionOrigin*/, char *> cached_input_glyphs_xbox;
static std::unordered_map<int /*EInputActionOrigin*/, char *> cached_input_glyphs_svg; 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 std::unordered_map<int /*EInputActionOrigin*/, char *> 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]; 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 * cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin(void *linux_side, EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags)
{ {
const char *path_result; const char *path_result;
@ -114,6 +131,13 @@ const char * cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy(void *l
return steamclient_isteaminput_getglyph(eOrigin, path_result); 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 *****/ /***** convert and cache ISteamController glyph paths *****/
static std::unordered_map<int /*EControllerActionOrigin*/, char *> cached_controller_glyphs; static std::unordered_map<int /*EControllerActionOrigin*/, char *> cached_controller_glyphs;
@ -140,4 +164,11 @@ const char * cppISteamController_SteamController008_GetGlyphForActionOrigin(void
return steamclient_isteamcontroller_getglyph(eOrigin, path_result); 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);
}
} }

View file

@ -44,6 +44,7 @@ const char **steamclient_dos_to_unix_stringlist(const char **src);
void steamclient_free_stringlist(const char **out); void steamclient_free_stringlist(const char **out);
const char *steamclient_isteamcontroller_getglyph(int origin, const char *lin_path); 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(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); uint32 manual_convert_nNativeKeyCode(uint32 win_vk);
void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *version);
void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version); void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version);