mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-14 23:58:17 +03:00
lsteamclient: wrap FSteamNetworkingSocketsDebugOutput
This commit is contained in:
parent
aa4c6fcc22
commit
197f25db04
@ -71,6 +71,7 @@ SteamNetworkingMicroseconds cppISteamNetworkingUtils_SteamNetworkingUtils001_Get
|
|||||||
|
|
||||||
void cppISteamNetworkingUtils_SteamNetworkingUtils001_SetDebugOutputFunction(void *linux_side, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc)
|
void cppISteamNetworkingUtils_SteamNetworkingUtils001_SetDebugOutputFunction(void *linux_side, ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc)
|
||||||
{
|
{
|
||||||
|
pfnFunc = (FSteamNetworkingSocketsDebugOutput)manual_convert_FSteamNetworkingSocketsDebugOutput((void*)pfnFunc);
|
||||||
((ISteamNetworkingUtils*)linux_side)->SetDebugOutputFunction((ESteamNetworkingSocketsDebugOutputType)eDetailLevel, (FSteamNetworkingSocketsDebugOutput)pfnFunc);
|
((ISteamNetworkingUtils*)linux_side)->SetDebugOutputFunction((ESteamNetworkingSocketsDebugOutputType)eDetailLevel, (FSteamNetworkingSocketsDebugOutput)pfnFunc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,6 +169,11 @@ manually_handled_structs = [
|
|||||||
"SteamNetworkingMessage_t"
|
"SteamNetworkingMessage_t"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# manual converters for simple types (function pointers)
|
||||||
|
manual_type_converters = [
|
||||||
|
"FSteamNetworkingSocketsDebugOutput"
|
||||||
|
]
|
||||||
|
|
||||||
#struct_conversion_cache = {
|
#struct_conversion_cache = {
|
||||||
# '142': {
|
# '142': {
|
||||||
# 'SteamUGCDetails_t': True,
|
# 'SteamUGCDetails_t': True,
|
||||||
@ -467,6 +472,7 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
|
|||||||
cfile.write(", %s *_r" % method.result_type.spelling)
|
cfile.write(", %s *_r" % method.result_type.spelling)
|
||||||
unnamed = 'a'
|
unnamed = 'a'
|
||||||
need_convert = []
|
need_convert = []
|
||||||
|
manual_convert = []
|
||||||
for param in list(method.get_children()):
|
for param in list(method.get_children()):
|
||||||
if param.kind == clang.cindex.CursorKind.PARM_DECL:
|
if param.kind == clang.cindex.CursorKind.PARM_DECL:
|
||||||
if param.type.kind == clang.cindex.TypeKind.POINTER and \
|
if param.type.kind == clang.cindex.TypeKind.POINTER and \
|
||||||
@ -486,6 +492,8 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
|
|||||||
need_convert.append(param)
|
need_convert.append(param)
|
||||||
#preserve pointers
|
#preserve pointers
|
||||||
win_name = typename.replace(real_type.spelling, "win%s_%s" % (real_type.spelling, sdkver))
|
win_name = typename.replace(real_type.spelling, "win%s_%s" % (real_type.spelling, sdkver))
|
||||||
|
elif real_type.spelling in manual_type_converters:
|
||||||
|
manual_convert.append(param)
|
||||||
|
|
||||||
if param.spelling == "":
|
if param.spelling == "":
|
||||||
cfile.write(", %s _%s" % (win_name, unnamed))
|
cfile.write(", %s _%s" % (win_name, unnamed))
|
||||||
@ -532,6 +540,8 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
|
|||||||
#raw structs
|
#raw structs
|
||||||
cpp.write(" %s lin_%s;\n" % (param.type.spelling, param.spelling))
|
cpp.write(" %s lin_%s;\n" % (param.type.spelling, param.spelling))
|
||||||
cpp.write(" win_to_lin_struct_%s_%s(&%s, &lin_%s);\n" % (param.type.spelling, sdkver, param.spelling, param.spelling))
|
cpp.write(" win_to_lin_struct_%s_%s(&%s, &lin_%s);\n" % (param.type.spelling, sdkver, param.spelling, param.spelling))
|
||||||
|
for param in manual_convert:
|
||||||
|
cpp.write(" %s = (%s)manual_convert_%s((void*)%s);\n" % (param.spelling, param.type.spelling, param.type.spelling, param.spelling))
|
||||||
|
|
||||||
cfile.write(" TRACE(\"%p\\n\", _this);\n")
|
cfile.write(" TRACE(\"%p\\n\", _this);\n")
|
||||||
|
|
||||||
|
@ -209,7 +209,8 @@ typedef struct SteamDatagramHostedAddress SteamDatagramHostedAddress;
|
|||||||
typedef void *SteamAPI_CheckCallbackRegistered_t;
|
typedef void *SteamAPI_CheckCallbackRegistered_t;
|
||||||
typedef void *SteamAPIWarningMessageHook_t;
|
typedef void *SteamAPIWarningMessageHook_t;
|
||||||
typedef void *SteamAPI_PostAPIResultInProcess_t;
|
typedef void *SteamAPI_PostAPIResultInProcess_t;
|
||||||
typedef void *FSteamNetworkingSocketsDebugOutput; /* XXX */
|
|
||||||
|
typedef void (*FSteamNetworkingSocketsDebugOutput)(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg);
|
||||||
|
|
||||||
typedef uint8 Salt_t[8];
|
typedef uint8 Salt_t[8];
|
||||||
typedef uint64 GID_t;
|
typedef uint64 GID_t;
|
||||||
|
@ -46,6 +46,7 @@ void *create_LinuxISteamMatchmakingServerListResponse(void *win, const char *ver
|
|||||||
void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version);
|
void *create_LinuxISteamMatchmakingPingResponse(void *win, const char *version);
|
||||||
void *create_LinuxISteamMatchmakingPlayersResponse(void *win, const char *version);
|
void *create_LinuxISteamMatchmakingPlayersResponse(void *win, const char *version);
|
||||||
void *create_LinuxISteamMatchmakingRulesResponse(void *win, const char *version);
|
void *create_LinuxISteamMatchmakingRulesResponse(void *win, const char *version);
|
||||||
|
void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func);
|
||||||
|
|
||||||
extern char g_tmppath[PATH_MAX];
|
extern char g_tmppath[PATH_MAX];
|
||||||
|
|
||||||
|
@ -280,3 +280,18 @@ void *create_LinuxISteamMatchmakingRulesResponse(void *win, const char *version)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***** FSteamNetworkingSocketsDebugOutput *****/
|
||||||
|
static void (CDECL *stored_FSteamNetworkingSocketsDebugOutput)(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg);
|
||||||
|
|
||||||
|
static void lin_FSteamNetworkingSocketsDebugOutput(ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg)
|
||||||
|
{
|
||||||
|
stored_FSteamNetworkingSocketsDebugOutput(nType, pszMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void *manual_convert_FSteamNetworkingSocketsDebugOutput(void *win_func)
|
||||||
|
{
|
||||||
|
stored_FSteamNetworkingSocketsDebugOutput = (void*)win_func;
|
||||||
|
return &lin_FSteamNetworkingSocketsDebugOutput;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user