lsteamclient: Use the generated interfaces in the manual converters.

CW-Bug-Id: #22729
This commit is contained in:
Rémi Bernon 2023-09-24 11:11:25 +02:00 committed by Arkadiusz Hiler
parent 09846111bd
commit cc69121738
31 changed files with 215 additions and 296 deletions

View file

@ -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;