diff --git a/lsteamclient/Makefile.in b/lsteamclient/Makefile.in index 9c464460..c5d42a85 100644 --- a/lsteamclient/Makefile.in +++ b/lsteamclient/Makefile.in @@ -71,10 +71,6 @@ SOURCES = \ cppISteamClient_SteamClient020.cpp \ cppISteamController_SteamController003.cpp \ cppISteamController_SteamController004.cpp \ - cppISteamController_SteamController005.cpp \ - cppISteamController_SteamController006.cpp \ - cppISteamController_SteamController007.cpp \ - cppISteamController_SteamController008.cpp \ cppISteamController_STEAMCONTROLLER_INTERFACE_VERSION.cpp \ cppISteamFriends_SteamFriends001.cpp \ cppISteamFriends_SteamFriends002.cpp \ @@ -116,10 +112,6 @@ SOURCES = \ cppISteamHTTP_STEAMHTTP_INTERFACE_VERSION001.cpp \ cppISteamHTTP_STEAMHTTP_INTERFACE_VERSION002.cpp \ cppISteamHTTP_STEAMHTTP_INTERFACE_VERSION003.cpp \ - cppISteamInput_SteamInput001.cpp \ - cppISteamInput_SteamInput002.cpp \ - cppISteamInput_SteamInput005.cpp \ - cppISteamInput_SteamInput006.cpp \ cppISteamInventory_STEAMINVENTORY_INTERFACE_V001.cpp \ cppISteamInventory_STEAMINVENTORY_INTERFACE_V002.cpp \ cppISteamInventory_STEAMINVENTORY_INTERFACE_V003.cpp \ @@ -143,20 +135,10 @@ SOURCES = \ cppISteamNetworking_SteamNetworking004.cpp \ cppISteamNetworking_SteamNetworking005.cpp \ cppISteamNetworking_SteamNetworking006.cpp \ - cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.cpp \ - cppISteamNetworkingMessages_SteamNetworkingMessages002.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets002.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets004.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets006.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets008.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets009.cpp \ - cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp \ cppISteamNetworkingSocketsSerialized_SteamNetworkingSocketsSerialized002.cpp \ cppISteamNetworkingSocketsSerialized_SteamNetworkingSocketsSerialized003.cpp \ cppISteamNetworkingUtils_SteamNetworkingUtils001.cpp \ cppISteamNetworkingUtils_SteamNetworkingUtils002.cpp \ - cppISteamNetworkingUtils_SteamNetworkingUtils003.cpp \ - cppISteamNetworkingUtils_SteamNetworkingUtils004.cpp \ cppISteamParentalSettings_STEAMPARENTALSETTINGS_INTERFACE_VERSION001.cpp \ cppISteamParties_SteamParties002.cpp \ cppISteamRemotePlay_STEAMREMOTEPLAY_INTERFACE_VERSION001.cpp \ diff --git a/lsteamclient/cppISteamController_SteamController005.cpp b/lsteamclient/cppISteamController_SteamController005.hpp similarity index 100% rename from lsteamclient/cppISteamController_SteamController005.cpp rename to lsteamclient/cppISteamController_SteamController005.hpp diff --git a/lsteamclient/cppISteamController_SteamController006.cpp b/lsteamclient/cppISteamController_SteamController006.hpp similarity index 100% rename from lsteamclient/cppISteamController_SteamController006.cpp rename to lsteamclient/cppISteamController_SteamController006.hpp diff --git a/lsteamclient/cppISteamController_SteamController007.cpp b/lsteamclient/cppISteamController_SteamController007.hpp similarity index 100% rename from lsteamclient/cppISteamController_SteamController007.cpp rename to lsteamclient/cppISteamController_SteamController007.hpp diff --git a/lsteamclient/cppISteamController_SteamController008.cpp b/lsteamclient/cppISteamController_SteamController008.hpp similarity index 100% rename from lsteamclient/cppISteamController_SteamController008.cpp rename to lsteamclient/cppISteamController_SteamController008.hpp diff --git a/lsteamclient/cppISteamInput_SteamInput001.cpp b/lsteamclient/cppISteamInput_SteamInput001.hpp similarity index 100% rename from lsteamclient/cppISteamInput_SteamInput001.cpp rename to lsteamclient/cppISteamInput_SteamInput001.hpp diff --git a/lsteamclient/cppISteamInput_SteamInput002.cpp b/lsteamclient/cppISteamInput_SteamInput002.hpp similarity index 100% rename from lsteamclient/cppISteamInput_SteamInput002.cpp rename to lsteamclient/cppISteamInput_SteamInput002.hpp diff --git a/lsteamclient/cppISteamInput_SteamInput005.cpp b/lsteamclient/cppISteamInput_SteamInput005.hpp similarity index 100% rename from lsteamclient/cppISteamInput_SteamInput005.cpp rename to lsteamclient/cppISteamInput_SteamInput005.hpp diff --git a/lsteamclient/cppISteamInput_SteamInput006.cpp b/lsteamclient/cppISteamInput_SteamInput006.hpp similarity index 100% rename from lsteamclient/cppISteamInput_SteamInput006.cpp rename to lsteamclient/cppISteamInput_SteamInput006.hpp diff --git a/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.cpp b/lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.cpp rename to lsteamclient/cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp diff --git a/lsteamclient/cppISteamNetworkingMessages_SteamNetworkingMessages002.cpp b/lsteamclient/cppISteamNetworkingMessages_SteamNetworkingMessages002.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingMessages_SteamNetworkingMessages002.cpp rename to lsteamclient/cppISteamNetworkingMessages_SteamNetworkingMessages002.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets002.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets002.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets004.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets004.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets006.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets006.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets006.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets006.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets008.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets008.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets008.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets008.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets009.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets009.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets009.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets009.hpp diff --git a/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp b/lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.cpp rename to lsteamclient/cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp diff --git a/lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils003.cpp b/lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils003.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils003.cpp rename to lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils003.hpp diff --git a/lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils004.cpp b/lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils004.hpp similarity index 100% rename from lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils004.cpp rename to lsteamclient/cppISteamNetworkingUtils_SteamNetworkingUtils004.hpp diff --git a/lsteamclient/gen_wrapper.py b/lsteamclient/gen_wrapper.py index 0096ca2c..24e7ccdb 100755 --- a/lsteamclient/gen_wrapper.py +++ b/lsteamclient/gen_wrapper.py @@ -851,6 +851,13 @@ def handle_method_c(method, winclassname, cppname, out): def handle_class(klass): cppname = f"cpp{klass.full_name}" + ext = "cpp" + for method in klass.methods: + if type(method) is Destructor: + continue + if method_needs_manual_handling(cppname, method.name): + ext = "hpp" + with open(f"{cppname}.h", "w") as file: out = file.write @@ -861,7 +868,7 @@ def handle_class(klass): continue handle_method_hpp(method, cppname, out) - with open(f"{cppname}.cpp", "w") as file: + with open(f"{cppname}.{ext}", "w") as file: out = file.write out(u'#include "steam_defs.h"\n') @@ -1293,14 +1300,24 @@ for _, klass in sorted(all_classes.items()): handle_class(klass) +with open('struct_converters.h', 'w') as file: + out = file.write + + out(u'#ifndef __STRUCT_CONVERTERS_H\n') + out(u'#define __STRUCT_CONVERTERS_H\n') + for sdkver in SDK_VERSIONS: generate(sdkver, all_records[sdkver]) - for f in cpp_files_need_close_brace: m = open(f, "a") m.write("\n}\n") +with open('struct_converters.h', 'a') as file: + out = file.write + + out(u'#endif /* __STRUCT_CONVERTERS_H */\n') + getapifile = open("cb_getapi_table.dat", "w") cbsizefile = open("cb_getapi_sizes.dat", "w") diff --git a/lsteamclient/steamclient_manual_141.cpp b/lsteamclient/steamclient_manual_141.cpp index dc323570..e53a327e 100644 --- a/lsteamclient/steamclient_manual_141.cpp +++ b/lsteamclient/steamclient_manual_141.cpp @@ -1,24 +1,22 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1410 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_141/steam_api.h" +#include "cppISteamController_SteamController005.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -#define SDK_VERSION 1410 -#include "steamclient_manual_common.h" - -extern "C" { -#include "cppISteamController_SteamController005.h" -} - void cppISteamController_SteamController005_GetGlyphForActionOrigin( struct cppISteamController_SteamController005_GetGlyphForActionOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EControllerActionOrigin)params->eOrigin ); + struct cppISteamController_SteamController005 *iface = (struct cppISteamController_SteamController005 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteamcontroller_getglyph( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/steamclient_manual_142.cpp b/lsteamclient/steamclient_manual_142.cpp index 1916b992..e422c97a 100644 --- a/lsteamclient/steamclient_manual_142.cpp +++ b/lsteamclient/steamclient_manual_142.cpp @@ -1,24 +1,22 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1420 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_142/steam_api.h" +#include "cppISteamController_SteamController006.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -#define SDK_VERSION 1420 -#include "steamclient_manual_common.h" - -extern "C" { -#include "cppISteamController_SteamController006.h" -} - void cppISteamController_SteamController006_GetGlyphForActionOrigin( struct cppISteamController_SteamController006_GetGlyphForActionOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EControllerActionOrigin)params->eOrigin ); + struct cppISteamController_SteamController006 *iface = (struct cppISteamController_SteamController006 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteamcontroller_getglyph( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/steamclient_manual_144.cpp b/lsteamclient/steamclient_manual_144.cpp index 04ed8252..9016eb0e 100644 --- a/lsteamclient/steamclient_manual_144.cpp +++ b/lsteamclient/steamclient_manual_144.cpp @@ -1,29 +1,22 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1440 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_144/steam_api.h" -#include "steamworks_sdk_144/isteamnetworkingsockets.h" -#include "steamworks_sdk_144/steamnetworkingtypes.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets002.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -extern "C" { -#define SDKVER_144 -#include "struct_converters.h" - -#define SDK_VERSION 1440 -#include "steamclient_manual_common.h" - -#include "cppISteamNetworkingSockets_SteamNetworkingSockets002.h" -} - void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -32,7 +25,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets002_ReceiveMessagesOnListenSocket_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets002 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets002 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, diff --git a/lsteamclient/steamclient_manual_146.cpp b/lsteamclient/steamclient_manual_146.cpp index 915a6192..2b60d3a7 100644 --- a/lsteamclient/steamclient_manual_146.cpp +++ b/lsteamclient/steamclient_manual_146.cpp @@ -1,30 +1,22 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1460 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_146/steam_api.h" -#include "steamworks_sdk_146/isteamnetworkingsockets.h" -#include "steamworks_sdk_146/isteamnetworkingutils.h" -#include "steamworks_sdk_146/steamnetworkingtypes.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets004.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -extern "C" { -#define SDKVER_146 -#include "struct_converters.h" - -#define SDK_VERSION 1460 -#include "steamclient_manual_common.h" - -#include "cppISteamNetworkingSockets_SteamNetworkingSockets004.h" -} - void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -33,7 +25,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets004_ReceiveMessagesOnListenSocket_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets004 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets004 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, diff --git a/lsteamclient/steamclient_manual_147.cpp b/lsteamclient/steamclient_manual_147.cpp index 22259e93..564c82c2 100644 --- a/lsteamclient/steamclient_manual_147.cpp +++ b/lsteamclient/steamclient_manual_147.cpp @@ -1,32 +1,24 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1470 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_147/steam_api.h" -#include "steamworks_sdk_147/isteamnetworkingsockets.h" -#include "steamworks_sdk_147/isteamnetworkingutils.h" -#include "steamworks_sdk_147/steamnetworkingtypes.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets006.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -extern "C" { -#define SDKVER_147 -#include "struct_converters.h" - -#define SDK_VERSION 1470 -#include "steamclient_manual_common.h" - -#include "cppISteamNetworkingSockets_SteamNetworkingSockets006.h" -} - WINE_DEFAULT_DEBUG_CHANNEL(steamclient); void cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -35,7 +27,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnListenSocket( struct cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnListenSocket_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnListenSocket( params->hSocket, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -45,7 +37,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets006_ReceiveMessagesOnListe void cppISteamNetworkingSockets_SteamNetworkingSockets006_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets006_SendMessages_params *params ) { #define MAX_SEND_MESSAGES 64 - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets006 *)params->linux_side; /* use the stack to avoid heap allocation */ struct SteamNetworkingMessage_t *lin_msgs[MAX_SEND_MESSAGES]; int i; @@ -62,7 +54,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets006_SendMessages( struct c for (i = 0; i < params->nMessages && i < MAX_SEND_MESSAGES; ++i) lin_msgs[i] = (SteamNetworkingMessage_t *)network_message_win_to_lin( params->pMessages[i] ); - iface->SendMessages( i, lin_msgs, (int64 *)params->pOutMessageNumberOrResult ); + iface->SendMessages( i, lin_msgs, params->pOutMessageNumberOrResult ); params->nMessages -= i; params->pMessages += i; diff --git a/lsteamclient/steamclient_manual_148a.cpp b/lsteamclient/steamclient_manual_148a.cpp index c646e9b4..f3aa4444 100644 --- a/lsteamclient/steamclient_manual_148a.cpp +++ b/lsteamclient/steamclient_manual_148a.cpp @@ -1,35 +1,24 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1481 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_148a/steam_api.h" -#include "steamworks_sdk_148a/isteamnetworkingsockets.h" -#include "steamworks_sdk_148a/isteamnetworkingutils.h" -#include "steamworks_sdk_148a/steamnetworkingtypes.h" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets008.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -extern "C" { -#define SDKVER_148a -#include "struct_converters.h" - -#define SDK_VERSION 1481 -#include "steamclient_manual_common.h" - -typedef winSteamNetworkingMessage_t_148a winSteamNetworkingMessage_t_149; -typedef winSteamNetworkingMessage_t_148a winSteamNetworkingMessage_t_152; -#include "cppISteamNetworkingSockets_SteamNetworkingSockets008.h" -#include "cppISteamNetworkingUtils_SteamNetworkingUtils003.h" -} - WINE_DEFAULT_DEBUG_CHANNEL(steamclient); void cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -38,7 +27,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnPollGroup( struct cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnPollGroup_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnPollGroup( params->hPollGroup, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -48,7 +37,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets008_ReceiveMessagesOnPollG void cppISteamNetworkingSockets_SteamNetworkingSockets008_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets008_SendMessages_params *params ) { #define MAX_SEND_MESSAGES 64 - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets008 *)params->linux_side; /* use the stack to avoid heap allocation */ struct SteamNetworkingMessage_t *lin_msgs[MAX_SEND_MESSAGES]; int i; @@ -65,17 +54,10 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets008_SendMessages( struct c for (i = 0; i < params->nMessages && i < MAX_SEND_MESSAGES; ++i) lin_msgs[i] = (SteamNetworkingMessage_t *)network_message_win_to_lin( params->pMessages[i] ); - iface->SendMessages( i, lin_msgs, (int64 *)params->pOutMessageNumberOrResult ); + iface->SendMessages( i, lin_msgs, params->pOutMessageNumberOrResult ); params->nMessages -= i; params->pMessages += i; if (params->pOutMessageNumberOrResult) params->pOutMessageNumberOrResult += i; } } - -void cppISteamNetworkingUtils_SteamNetworkingUtils003_AllocateMessage( struct cppISteamNetworkingUtils_SteamNetworkingUtils003_AllocateMessage_params *params ) -{ - ISteamNetworkingUtils *iface = (ISteamNetworkingUtils *)params->linux_side; - params->_ret = (winSteamNetworkingMessage_t_148a *)iface->AllocateMessage( params->cbAllocateBuffer ); - params->_ret = (winSteamNetworkingMessage_t_148a *)network_message_lin_to_win( params->_ret ); -} diff --git a/lsteamclient/steamclient_manual_150.cpp b/lsteamclient/steamclient_manual_150.cpp index 41c87cad..527cb63c 100644 --- a/lsteamclient/steamclient_manual_150.cpp +++ b/lsteamclient/steamclient_manual_150.cpp @@ -1,40 +1,32 @@ #include "steamclient_private.h" -#include "steam_defs.h" -#pragma push_macro("__cdecl") -#undef __cdecl -#pragma push_macro("strncpy") -#undef strncpy -#include "steamworks_sdk_150/steam_api.h" -#include "steamworks_sdk_150/isteamnetworkingsockets.h" -#include "steamworks_sdk_150/isteamnetworkingutils.h" -#include "steamworks_sdk_150/steamnetworkingtypes.h" -#pragma pop_macro("__cdecl") -#pragma pop_macro("strncpy") - extern "C" { -#define SDKVER_150 -#include "struct_converters.h" #include "cb_converters.h" +#define SDKVER_157 #define SDK_VERSION 1500 #include "steamclient_manual_common.h" - -typedef winSteamNetworkingMessage_t_150 winSteamNetworkingMessage_t_152; -typedef winSteamNetworkingMessage_t_150 winSteamNetworkingMessage_t_158; -typedef struct SteamNetConnectionRealTimeStatus_t SteamNetConnectionRealTimeStatus_t; -#include "cppISteamNetworkingSockets_SteamNetworkingSockets009.h" -#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.h" -#include "cppISteamNetworkingUtils_SteamNetworkingUtils003.h" -#include "cppISteamInput_SteamInput001.h" -#include "cppISteamController_SteamController007.h" } +#pragma push_macro( "__cdecl" ) +#undef __cdecl +#pragma push_macro( "strncpy" ) +#undef strncpy +typedef struct SteamNetConnectionRealTimeStatus_t SteamNetConnectionRealTimeStatus_t; +typedef struct winSteamNetworkingMessage_t winSteamNetworkingMessage_t_158; +#include "cppISteamNetworkingSockets_SteamNetworkingSockets009.hpp" +#include "cppISteamNetworkingMessages_SteamNetworkingMessages002.hpp" +#include "cppISteamNetworkingUtils_SteamNetworkingUtils003.hpp" +#include "cppISteamInput_SteamInput001.hpp" +#include "cppISteamController_SteamController007.hpp" +#pragma pop_macro( "__cdecl" ) +#pragma pop_macro( "strncpy" ) + WINE_DEFAULT_DEBUG_CHANNEL(steamclient); void cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -43,7 +35,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnPollGroup( struct cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnPollGroup_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnPollGroup( params->hPollGroup, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -53,7 +45,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets009_ReceiveMessagesOnPollG void cppISteamNetworkingSockets_SteamNetworkingSockets009_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets009_SendMessages_params *params ) { #define MAX_SEND_MESSAGES 64 - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets009 *)params->linux_side; /* use the stack to avoid heap allocation */ struct SteamNetworkingMessage_t *lin_msgs[MAX_SEND_MESSAGES]; int i; @@ -70,7 +62,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets009_SendMessages( struct c for (i = 0; i < params->nMessages && i < MAX_SEND_MESSAGES; ++i) lin_msgs[i] = (SteamNetworkingMessage_t *)network_message_win_to_lin( params->pMessages[i] ); - iface->SendMessages( i, lin_msgs, (int64 *)params->pOutMessageNumberOrResult ); + iface->SendMessages( i, lin_msgs, params->pOutMessageNumberOrResult ); params->nMessages -= i; params->pMessages += i; @@ -80,7 +72,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets009_SendMessages( struct c void cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel( struct cppISteamNetworkingMessages_SteamNetworkingMessages002_ReceiveMessagesOnChannel_params *params ) { - ISteamNetworkingMessages *iface = (ISteamNetworkingMessages *)params->linux_side; + struct cppISteamNetworkingMessages_SteamNetworkingMessages002 *iface = (struct cppISteamNetworkingMessages_SteamNetworkingMessages002 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnChannel( params->nLocalChannel, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -148,32 +140,35 @@ void lin_SteamNetworkingMessagesSessionFailed(SteamNetworkingMessagesSessionFail fn(dat); } +void cppISteamNetworkingUtils_SteamNetworkingUtils003_AllocateMessage( struct cppISteamNetworkingUtils_SteamNetworkingUtils003_AllocateMessage_params *params ) +{ + struct cppISteamNetworkingUtils_SteamNetworkingUtils003 *iface = (struct cppISteamNetworkingUtils_SteamNetworkingUtils003 *)params->linux_side; + params->_ret = (winSteamNetworkingMessage_t_152 *)iface->AllocateMessage( params->cbAllocateBuffer ); + params->_ret = (winSteamNetworkingMessage_t_152 *)network_message_lin_to_win( params->_ret ); +} + void cppISteamNetworkingUtils_SteamNetworkingUtils003_SetConfigValue( struct cppISteamNetworkingUtils_SteamNetworkingUtils003_SetConfigValue_params *params ) { - ISteamNetworkingUtils *iface = (ISteamNetworkingUtils *)params->linux_side; + struct cppISteamNetworkingUtils_SteamNetworkingUtils003 *iface = (struct cppISteamNetworkingUtils_SteamNetworkingUtils003 *)params->linux_side; void *lin_fn; /* api requires passing pointer-to-pointer */ switch (params->eValue) { -#define CASE( x, y ) \ - case k_ESteamNetworkingConfig_Callback_##x: \ - if (!params->pArg) \ - { \ - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, \ - (ESteamNetworkingConfigScope)params->eScopeType, \ - params->scopeObj, \ - (ESteamNetworkingConfigDataType)params->eDataType, NULL ); \ - } \ - else \ - { \ - if (*(void **)params->pArg == NULL) lin_fn = NULL; \ - else lin_fn = (void *)&lin_##y; \ - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, \ - (ESteamNetworkingConfigScope)params->eScopeType, \ - params->scopeObj, \ - (ESteamNetworkingConfigDataType)params->eDataType, &lin_fn ); \ - if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ +#define CASE( x, y ) \ + case k_ESteamNetworkingConfig_Callback_##x: \ + if (!params->pArg) \ + { \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, NULL ); \ + } \ + else \ + { \ + if (*(void **)params->pArg == NULL) lin_fn = NULL; \ + else lin_fn = (void *)&lin_##y; \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, &lin_fn ); \ + if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ } CASE( ConnectionStatusChanged, SteamNetConnectionStatusChanged ) @@ -185,37 +180,35 @@ void cppISteamNetworkingUtils_SteamNetworkingUtils003_SetConfigValue( struct cpp #undef CASE default: - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, - (ESteamNetworkingConfigScope)params->eScopeType, params->scopeObj, - (ESteamNetworkingConfigDataType)params->eDataType, - params->pArg ); + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, params->scopeObj, + params->eDataType, params->pArg ); } } void cppISteamInput_SteamInput001_GetGlyphForActionOrigin( struct cppISteamInput_SteamInput001_GetGlyphForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EInputActionOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput001 *iface = (struct cppISteamInput_SteamInput001 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph( params->eOrigin, params->_ret ); } void cppISteamInput_SteamInput001_GetGlyphForXboxOrigin( struct cppISteamInput_SteamInput001_GetGlyphForXboxOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput001 *iface = (struct cppISteamInput_SteamInput001 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } void cppISteamController_SteamController007_GetGlyphForActionOrigin( struct cppISteamController_SteamController007_GetGlyphForActionOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EControllerActionOrigin)params->eOrigin ); + struct cppISteamController_SteamController007 *iface = (struct cppISteamController_SteamController007 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteamcontroller_getglyph( params->eOrigin, params->_ret ); } void cppISteamController_SteamController007_GetGlyphForXboxOrigin( struct cppISteamController_SteamController007_GetGlyphForXboxOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamController_SteamController007 *iface = (struct cppISteamController_SteamController007 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/steamclient_manual_151.cpp b/lsteamclient/steamclient_manual_151.cpp index 112d59d8..c9f7011f 100644 --- a/lsteamclient/steamclient_manual_151.cpp +++ b/lsteamclient/steamclient_manual_151.cpp @@ -1,35 +1,29 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1510 +#include "steamclient_manual_common.h" +} + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_151/steam_api.h" +#include "cppISteamInput_SteamInput002.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -extern "C" { -#define SDKVER_151 -#include "struct_converters.h" -#include "cb_converters.h" - -#define SDK_VERSION 1510 -#include "steamclient_manual_common.h" - -#include "cppISteamInput_SteamInput002.h" -} - void cppISteamInput_SteamInput002_GetGlyphForActionOrigin( struct cppISteamInput_SteamInput002_GetGlyphForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EInputActionOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput002 *iface = (struct cppISteamInput_SteamInput002 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph( params->eOrigin, params->_ret ); } void cppISteamInput_SteamInput002_GetGlyphForXboxOrigin( struct cppISteamInput_SteamInput002_GetGlyphForXboxOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput002 *iface = (struct cppISteamInput_SteamInput002 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/steamclient_manual_152.cpp b/lsteamclient/steamclient_manual_152.cpp index b8ba3345..eb82f863 100644 --- a/lsteamclient/steamclient_manual_152.cpp +++ b/lsteamclient/steamclient_manual_152.cpp @@ -1,29 +1,22 @@ #include "steamclient_private.h" -#include "steam_defs.h" +extern "C" +{ +#define SDK_VERSION 1520 +#include "steamclient_manual_common.h" +} + +#include + #pragma push_macro("__cdecl") #undef __cdecl #pragma push_macro("strncpy") #undef strncpy -#include "steamworks_sdk_152/steam_api.h" -#include "steamworks_sdk_152/isteaminput.h" +#include "cppISteamInput_SteamInput005.hpp" +#include "cppISteamController_SteamController008.hpp" #pragma pop_macro("__cdecl") #pragma pop_macro("strncpy") -#include - -extern "C" { -#define SDKVER_152 -#include "struct_converters.h" -#include "cb_converters.h" - -#define SDK_VERSION 1520 -#include "steamclient_manual_common.h" - -#include "cppISteamInput_SteamInput005.h" -#include "cppISteamController_SteamController008.h" -} - WINE_DEFAULT_DEBUG_CHANNEL(steamclient); /***** manual fn wrapper for ISteamInput::EnableActionEventCallbacks *****/ @@ -38,7 +31,7 @@ void lin_SteamInputActionEventCallbackPointer(SteamInputActionEvent_t *dat) void cppISteamInput_SteamInput005_EnableActionEventCallbacks( struct cppISteamInput_SteamInput005_EnableActionEventCallbacks_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; + struct cppISteamInput_SteamInput005 *iface = (struct cppISteamInput_SteamInput005 *)params->linux_side; win_EnableActionEventCallbacks = (win_SteamInputActionEventCallbackPointer)params->pCallback; iface->EnableActionEventCallbacks( params->pCallback ? &lin_SteamInputActionEventCallbackPointer : NULL ); } @@ -121,31 +114,30 @@ const char *steamclient_isteaminput_getglyph_xbox(int origin, const char *lin_pa void cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin( struct cppISteamInput_SteamInput005_GetGlyphPNGForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphPNGForActionOrigin( (EInputActionOrigin)params->eOrigin, - (ESteamInputGlyphSize)params->eSize, params->unFlags ); + struct cppISteamInput_SteamInput005 *iface = (struct cppISteamInput_SteamInput005 *)params->linux_side; + params->_ret = iface->GetGlyphPNGForActionOrigin( params->eOrigin, params->eSize, params->unFlags ); params->_ret = steamclient_isteaminput_getglyph_png( params->eOrigin, params->eSize, params->unFlags, params->_ret ); } void cppISteamInput_SteamInput005_GetGlyphSVGForActionOrigin( struct cppISteamInput_SteamInput005_GetGlyphSVGForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphSVGForActionOrigin( (EInputActionOrigin)params->eOrigin, params->unFlags ); + struct cppISteamInput_SteamInput005 *iface = (struct cppISteamInput_SteamInput005 *)params->linux_side; + params->_ret = iface->GetGlyphSVGForActionOrigin( params->eOrigin, params->unFlags ); params->_ret = steamclient_isteaminput_getglyph_svg( params->eOrigin, params->unFlags, params->_ret ); } void cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy( struct cppISteamInput_SteamInput005_GetGlyphForActionOrigin_Legacy_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin_Legacy( (EInputActionOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput005 *iface = (struct cppISteamInput_SteamInput005 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin_Legacy( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph( params->eOrigin, params->_ret ); } void cppISteamInput_SteamInput005_GetGlyphForXboxOrigin( struct cppISteamInput_SteamInput005_GetGlyphForXboxOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput005 *iface = (struct cppISteamInput_SteamInput005 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } @@ -170,14 +162,14 @@ const char *steamclient_isteamcontroller_getglyph(int origin, const char *lin_pa void cppISteamController_SteamController008_GetGlyphForActionOrigin( struct cppISteamController_SteamController008_GetGlyphForActionOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin( (EControllerActionOrigin)params->eOrigin ); + struct cppISteamController_SteamController008 *iface = (struct cppISteamController_SteamController008 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin( params->eOrigin ); params->_ret = steamclient_isteamcontroller_getglyph( params->eOrigin, params->_ret ); } void cppISteamController_SteamController008_GetGlyphForXboxOrigin( struct cppISteamController_SteamController008_GetGlyphForXboxOrigin_params *params ) { - ISteamController *iface = (ISteamController *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamController_SteamController008 *iface = (struct cppISteamController_SteamController008 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/steamclient_manual_153a.cpp b/lsteamclient/steamclient_manual_153a.cpp index 006b34f6..adb1cb66 100644 --- a/lsteamclient/steamclient_manual_153a.cpp +++ b/lsteamclient/steamclient_manual_153a.cpp @@ -1,35 +1,25 @@ #include "steamclient_private.h" -#include "steam_defs.h" -#pragma push_macro("__cdecl") -#undef __cdecl -#pragma push_macro("strncpy") -#undef strncpy -#include "steamworks_sdk_153a/steam_api.h" -#include "steamworks_sdk_153a/isteamnetworkingsockets.h" -#include "steamworks_sdk_153a/isteamnetworkingutils.h" -#include "steamworks_sdk_153a/steamnetworkingtypes.h" -#include "steamworks_sdk_153a/steamnetworkingfakeip.h" -#pragma pop_macro("__cdecl") -#pragma pop_macro("strncpy") - extern "C" { -#define SDKVER_153a -#include "struct_converters.h" -#include "cb_converters.h" #include "win_constructors.h" +#include "cb_converters.h" #define SDK_VERSION 1531 #include "steamclient_manual_common.h" - -typedef winSteamNetworkingMessage_t_153a winSteamNetworkingMessage_t_158; -#include "cppISteamNetworkingUtils_SteamNetworkingUtils004.h" -#include "cppISteamNetworkingSockets_SteamNetworkingSockets012.h" -#include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.h" -typedef struct ScePadTriggerEffectParam { uint8 m_data[120]; } ScePadTriggerEffectParam; -#include "cppISteamInput_SteamInput006.h" } +#pragma push_macro( "__cdecl" ) +#undef __cdecl +#pragma push_macro( "strncpy" ) +#undef strncpy +#include "cppISteamNetworkingUtils_SteamNetworkingUtils004.hpp" +#include "cppISteamNetworkingSockets_SteamNetworkingSockets012.hpp" +#include "cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001.hpp" +typedef struct ScePadTriggerEffectParam { uint8 m_data[120]; } ScePadTriggerEffectParam; +#include "cppISteamInput_SteamInput006.hpp" +#pragma pop_macro( "__cdecl" ) +#pragma pop_macro( "strncpy" ) + WINE_DEFAULT_DEBUG_CHANNEL(steamclient); /***** manual fn wrapper for ISteamInput::EnableActionEventCallbacks *****/ @@ -37,14 +27,14 @@ extern win_SteamInputActionEventCallbackPointer win_EnableActionEventCallbacks; void cppISteamInput_SteamInput006_EnableActionEventCallbacks( struct cppISteamInput_SteamInput006_EnableActionEventCallbacks_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; + struct cppISteamInput_SteamInput006 *iface = (struct cppISteamInput_SteamInput006 *)params->linux_side; win_EnableActionEventCallbacks = (win_SteamInputActionEventCallbackPointer)params->pCallback; iface->EnableActionEventCallbacks( params->pCallback ? &lin_SteamInputActionEventCallbackPointer : NULL ); } void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConnection_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnConnection( params->hConn, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -53,7 +43,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnConne void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollGroup_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessagesOnPollGroup( params->hPollGroup, lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -63,7 +53,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets012_ReceiveMessagesOnPollG void cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages_params *params ) { #define MAX_SEND_MESSAGES 64 - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; + struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; /* use the stack to avoid heap allocation */ struct SteamNetworkingMessage_t *lin_msgs[MAX_SEND_MESSAGES]; int i; @@ -80,7 +70,7 @@ void cppISteamNetworkingSockets_SteamNetworkingSockets012_SendMessages( struct c for (i = 0; i < params->nMessages && i < MAX_SEND_MESSAGES; ++i) lin_msgs[i] = (SteamNetworkingMessage_t *)network_message_win_to_lin( params->pMessages[i] ); - iface->SendMessages( i, lin_msgs, (int64 *)params->pOutMessageNumberOrResult ); + iface->SendMessages( i, lin_msgs, params->pOutMessageNumberOrResult ); params->nMessages -= i; params->pMessages += i; @@ -96,15 +86,15 @@ typedef struct __winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 { void cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort( struct cppISteamNetworkingSockets_SteamNetworkingSockets012_CreateFakeUDPPort_params *params ) { - ISteamNetworkingSockets *iface = (ISteamNetworkingSockets *)params->linux_side; - ISteamNetworkingFakeUDPPort *lin_iface = iface->CreateFakeUDPPort( params->idxFakeServerPort ); + struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *iface = (struct cppISteamNetworkingSockets_SteamNetworkingSockets012 *)params->linux_side; + void *lin_iface = iface->CreateFakeUDPPort( params->idxFakeServerPort ); if (!lin_iface) params->_ret = NULL; else params->_ret = create_winISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001( lin_iface ); } void cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages( struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001_ReceiveMessages_params *params ) { - ISteamNetworkingFakeUDPPort *iface = (ISteamNetworkingFakeUDPPort *)params->linux_side; + struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *iface = (struct cppISteamNetworkingFakeUDPPort_SteamNetworkingFakeUDPPort001 *)params->linux_side; SteamNetworkingMessage_t *lin_ppOutMessages[params->nMaxMessages]; params->_ret = iface->ReceiveMessages( lin_ppOutMessages, params->nMaxMessages ); lin_to_win_struct_SteamNetworkingMessage_t( params->_ret, lin_ppOutMessages, @@ -161,31 +151,27 @@ extern void lin_SteamNetAuthenticationStatusChanged(SteamNetAuthenticationStatus void cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue_params *params ) { - ISteamNetworkingUtils *iface = (ISteamNetworkingUtils *)params->linux_side; + struct cppISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct cppISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; bool ret; void *lin_fn; /* api requires passing pointer-to-pointer */ switch (params->eValue) { -#define CASE( x, y ) \ - case k_ESteamNetworkingConfig_Callback_##x: \ - if (!params->pArg) \ - { \ - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, \ - (ESteamNetworkingConfigScope)params->eScopeType, \ - params->scopeObj, \ - (ESteamNetworkingConfigDataType)params->eDataType, NULL ); \ - } \ - else \ - { \ - if (*(void **)params->pArg == NULL) lin_fn = NULL; \ - else lin_fn = (void *)&lin_##y; \ - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, \ - (ESteamNetworkingConfigScope)params->eScopeType, \ - params->scopeObj, \ - (ESteamNetworkingConfigDataType)params->eDataType, &lin_fn ); \ - if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ +#define CASE( x, y ) \ + case k_ESteamNetworkingConfig_Callback_##x: \ + if (!params->pArg) \ + { \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, NULL ); \ + } \ + else \ + { \ + if (*(void **)params->pArg == NULL) lin_fn = NULL; \ + else lin_fn = (void *)&lin_##y; \ + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, \ + params->scopeObj, params->eDataType, &lin_fn ); \ + if (params->_ret) win_##y = *(win_Fn##y *)params->pArg; \ } CASE( ConnectionStatusChanged, SteamNetConnectionStatusChanged ) @@ -197,46 +183,43 @@ void cppISteamNetworkingUtils_SteamNetworkingUtils004_SetConfigValue( struct cpp #undef CASE default: - params->_ret = iface->SetConfigValue( (ESteamNetworkingConfigValue)params->eValue, - (ESteamNetworkingConfigScope)params->eScopeType, params->scopeObj, - (ESteamNetworkingConfigDataType)params->eDataType, - params->pArg ); + params->_ret = iface->SetConfigValue( params->eValue, params->eScopeType, params->scopeObj, + params->eDataType, params->pArg ); } } void cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage( struct cppISteamNetworkingUtils_SteamNetworkingUtils004_AllocateMessage_params *params ) { - ISteamNetworkingUtils *iface = (ISteamNetworkingUtils *)params->linux_side; - params->_ret = (winSteamNetworkingMessage_t_153a *)iface->AllocateMessage( params->cbAllocateBuffer ); - params->_ret = (winSteamNetworkingMessage_t_153a *)network_message_lin_to_win( params->_ret ); + struct cppISteamNetworkingUtils_SteamNetworkingUtils004 *iface = (struct cppISteamNetworkingUtils_SteamNetworkingUtils004 *)params->linux_side; + params->_ret = (winSteamNetworkingMessage_t_158 *)iface->AllocateMessage( params->cbAllocateBuffer ); + params->_ret = (winSteamNetworkingMessage_t_158 *)network_message_lin_to_win( params->_ret ); } void cppISteamInput_SteamInput006_GetGlyphPNGForActionOrigin( struct cppISteamInput_SteamInput006_GetGlyphPNGForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphPNGForActionOrigin( (EInputActionOrigin)params->eOrigin, - (ESteamInputGlyphSize)params->eSize, params->unFlags ); + struct cppISteamInput_SteamInput006 *iface = (struct cppISteamInput_SteamInput006 *)params->linux_side; + params->_ret = iface->GetGlyphPNGForActionOrigin( params->eOrigin, params->eSize, params->unFlags ); params->_ret = steamclient_isteaminput_getglyph_png( params->eOrigin, params->eSize, params->unFlags, params->_ret ); } void cppISteamInput_SteamInput006_GetGlyphSVGForActionOrigin( struct cppISteamInput_SteamInput006_GetGlyphSVGForActionOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphSVGForActionOrigin( (EInputActionOrigin)params->eOrigin, params->unFlags ); + struct cppISteamInput_SteamInput006 *iface = (struct cppISteamInput_SteamInput006 *)params->linux_side; + params->_ret = iface->GetGlyphSVGForActionOrigin( params->eOrigin, params->unFlags ); params->_ret = steamclient_isteaminput_getglyph_svg( params->eOrigin, params->unFlags, params->_ret ); } void cppISteamInput_SteamInput006_GetGlyphForActionOrigin_Legacy( struct cppISteamInput_SteamInput006_GetGlyphForActionOrigin_Legacy_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForActionOrigin_Legacy( (EInputActionOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput006 *iface = (struct cppISteamInput_SteamInput006 *)params->linux_side; + params->_ret = iface->GetGlyphForActionOrigin_Legacy( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph( params->eOrigin, params->_ret ); } void cppISteamInput_SteamInput006_GetGlyphForXboxOrigin( struct cppISteamInput_SteamInput006_GetGlyphForXboxOrigin_params *params ) { - ISteamInput *iface = (ISteamInput *)params->linux_side; - params->_ret = iface->GetGlyphForXboxOrigin( (EXboxOrigin)params->eOrigin ); + struct cppISteamInput_SteamInput006 *iface = (struct cppISteamInput_SteamInput006 *)params->linux_side; + params->_ret = iface->GetGlyphForXboxOrigin( params->eOrigin ); params->_ret = steamclient_isteaminput_getglyph_xbox( params->eOrigin, params->_ret ); } diff --git a/lsteamclient/struct_converters.h b/lsteamclient/struct_converters.h index b3abbc56..a06c7c59 100644 --- a/lsteamclient/struct_converters.h +++ b/lsteamclient/struct_converters.h @@ -1,3 +1,5 @@ +#ifndef __STRUCT_CONVERTERS_H +#define __STRUCT_CONVERTERS_H #if defined(SDKVER_158) || !defined(__cplusplus) #pragma pack( push, 8 ) struct winSteamPartyBeaconLocation_t_158 { @@ -3256,3 +3258,4 @@ extern void win_to_lin_struct_LeaderboardEntry_t_111x(const struct winLeaderboar extern void lin_to_win_struct_LeaderboardEntry_t_111x(const struct LeaderboardEntry_t *l, struct winLeaderboardEntry_t_111x *w); #endif +#endif /* __STRUCT_CONVERTERS_H */