vrclient: Move json conversion to the unix side.

CW-Bug-Id: #22729
This commit is contained in:
Rémi Bernon 2023-10-02 22:19:36 +02:00 committed by Arkadiusz Hiler
parent 13fa4c9b13
commit 4e8556ae62
10 changed files with 53 additions and 54 deletions

View file

@ -144,6 +144,7 @@ SOURCES = \
vrclient_x64/cppIVRTrackedCamera_IVRTrackedCamera_006.cpp \
vrclient_x64/json_converter.cpp \
vrclient_x64/jsoncpp.cpp \
vrclient_x64/unix_vrclientcore_manual.cpp \
vrclient_x64/unix_vrcompositor_manual.cpp \
vrclient_x64/unix_vroverlay_manual.cpp \
vrclient_x64/unix_vrrendermodels_manual.cpp \

View file

@ -216,7 +216,7 @@ unique_structs = []
MANUAL_METHODS = {
"IVRClientCore_BIsHmdPresent": lambda ver, abi: abi == 'w',
"IVRClientCore_Init": lambda ver, abi: abi == 'w',
"IVRClientCore_Init": lambda ver, abi: True,
"IVRClientCore_GetGenericInterface": lambda ver, abi: abi == 'w',
"IVRClientCore_Cleanup": lambda ver, abi: abi == 'w',
"IVRSystem_GetDXGIOutputInfo": lambda ver, abi: abi == 'w',
@ -235,7 +235,7 @@ MANUAL_METHODS = {
"IVRRenderModels_LoadRenderModel": lambda ver, abi: ver > 1,
"IVRRenderModels_LoadRenderModel_Async": True,
"IVRRenderModels_FreeRenderModel": lambda ver, abi: ver > 1,
"IVRMailbox_undoc3": lambda ver, abi: abi == 'w',
"IVRMailbox_undoc3": lambda ver, abi: abi == 'u',
"IVROverlay_SetOverlayTexture": True,
"IVRInput_GetDigitalActionData": lambda ver, abi: abi == 'w' and ver > 3,
}

View file

@ -1,14 +1,6 @@
/* This file is auto-generated, do not edit. */
#include "unix_private.h"
NTSTATUS IVRClientCore_IVRClientCore_002_Init( void *args )
{
struct IVRClientCore_IVRClientCore_002_Init_params *params = (struct IVRClientCore_IVRClientCore_002_Init_params *)args;
struct u_IVRClientCore_IVRClientCore_002 *iface = (struct u_IVRClientCore_IVRClientCore_002 *)params->linux_side;
params->_ret = (uint32_t)iface->Init( params->eApplicationType );
return 0;
}
NTSTATUS IVRClientCore_IVRClientCore_002_Cleanup( void *args )
{
struct IVRClientCore_IVRClientCore_002_Cleanup_params *params = (struct IVRClientCore_IVRClientCore_002_Cleanup_params *)args;

View file

@ -1,14 +1,6 @@
/* This file is auto-generated, do not edit. */
#include "unix_private.h"
NTSTATUS IVRClientCore_IVRClientCore_003_Init( void *args )
{
struct IVRClientCore_IVRClientCore_003_Init_params *params = (struct IVRClientCore_IVRClientCore_003_Init_params *)args;
struct u_IVRClientCore_IVRClientCore_003 *iface = (struct u_IVRClientCore_IVRClientCore_003 *)params->linux_side;
params->_ret = (uint32_t)iface->Init( params->eApplicationType, params->pStartupInfo );
return 0;
}
NTSTATUS IVRClientCore_IVRClientCore_003_Cleanup( void *args )
{
struct IVRClientCore_IVRClientCore_003_Cleanup_params *params = (struct IVRClientCore_IVRClientCore_003_Cleanup_params *)args;

View file

@ -17,14 +17,6 @@ NTSTATUS IVRMailbox_IVRMailbox_001_undoc2( void *args )
return 0;
}
NTSTATUS IVRMailbox_IVRMailbox_001_undoc3( void *args )
{
struct IVRMailbox_IVRMailbox_001_undoc3_params *params = (struct IVRMailbox_IVRMailbox_001_undoc3_params *)args;
struct u_IVRMailbox_IVRMailbox_001 *iface = (struct u_IVRMailbox_IVRMailbox_001 *)params->linux_side;
params->_ret = (uint32_t)iface->undoc3( params->a, params->b, params->c );
return 0;
}
NTSTATUS IVRMailbox_IVRMailbox_001_undoc4( void *args )
{
struct IVRMailbox_IVRMailbox_001_undoc4_params *params = (struct IVRMailbox_IVRMailbox_001_undoc4_params *)args;

View file

@ -22,6 +22,9 @@ extern VkPhysicalDevice_T *(WINAPI *p_get_native_VkPhysicalDevice)( VkPhysicalDe
extern VkPhysicalDevice_T *(WINAPI *p_get_wrapped_VkPhysicalDevice)( VkInstance_T *, VkPhysicalDevice_T * );
extern VkQueue_T *(WINAPI *p_get_native_VkQueue)( VkQueue_T * );
extern char *json_convert_startup_info(const char *startup_info);
extern char *json_convert_paths(const char *input);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */

View file

@ -0,0 +1,34 @@
#include "unix_private.h"
#include <stdlib.h>
NTSTATUS IVRClientCore_IVRClientCore_002_Init( void *args )
{
struct IVRClientCore_IVRClientCore_002_Init_params *params = (struct IVRClientCore_IVRClientCore_002_Init_params *)args;
struct u_IVRClientCore_IVRClientCore_002 *iface = (struct u_IVRClientCore_IVRClientCore_002 *)params->linux_side;
params->_ret = (uint32_t)iface->Init( params->eApplicationType );
return 0;
}
NTSTATUS IVRClientCore_IVRClientCore_003_Init( void *args )
{
struct IVRClientCore_IVRClientCore_003_Init_params *params = (struct IVRClientCore_IVRClientCore_003_Init_params *)args;
struct u_IVRClientCore_IVRClientCore_003 *iface = (struct u_IVRClientCore_IVRClientCore_003 *)params->linux_side;
const char *startup_info = json_convert_startup_info( params->pStartupInfo );
if (!startup_info) startup_info = params->pStartupInfo;
params->_ret = (uint32_t)iface->Init( params->eApplicationType, startup_info );
if (startup_info != params->pStartupInfo) free( (char *)startup_info );
return 0;
}
NTSTATUS IVRMailbox_IVRMailbox_001_undoc3( void *args )
{
struct IVRMailbox_IVRMailbox_001_undoc3_params *params = (struct IVRMailbox_IVRMailbox_001_undoc3_params *)args;
struct u_IVRMailbox_IVRMailbox_001 *iface = (struct u_IVRMailbox_IVRMailbox_001 *)params->linux_side;
char *c = json_convert_paths( params->c );
params->_ret = (uint32_t)iface->undoc3( params->a, params->b, c );
free( c );
return 0;
}

View file

@ -533,18 +533,13 @@ uint32_t __thiscall winIVRClientCore_IVRClientCore_003_Init( struct w_steam_ifac
.eApplicationType = eApplicationType,
.pStartupInfo = pStartupInfo,
};
char *startup_info_converted;
TRACE( "%p\n", _this );
startup_info_converted = json_convert_startup_info( pStartupInfo );
if (startup_info_converted) params.pStartupInfo = startup_info_converted;
InitializeCriticalSection( &_this->user_data.critical_section );
VRCLIENT_CALL( IVRClientCore_IVRClientCore_003_Init, &params );
free( startup_info_converted );
if (params._ret) WARN( "error %#x\n", params._ret );
else compositor_data.client_core_linux_side = params.linux_side;
@ -608,22 +603,3 @@ bool __thiscall winIVRClientCore_IVRClientCore_003_BIsHmdPresent( struct w_steam
return TRUE;
}
uint32_t __thiscall winIVRMailbox_IVRMailbox_001_undoc3( struct w_steam_iface *_this, uint64_t a,
const char *b, const char *c )
{
struct IVRMailbox_IVRMailbox_001_undoc3_params params =
{
.linux_side = _this->u_iface,
.a = a,
.b = b,
.c = json_convert_paths(c),
};
TRACE( "%p\n", _this );
VRCLIENT_CALL( IVRMailbox_IVRMailbox_001_undoc3, &params );
free( (char *)params.c );
return params._ret;
}

View file

@ -16,9 +16,6 @@ typedef void (*vtable_ptr)(void);
extern "C" {
#endif
char *json_convert_paths(const char *input);
char *json_convert_startup_info(const char *startup_info);
char *vrclient_dos_to_unix_path( const char *src );
void vrclient_free_path( const char *path );

View file

@ -38,7 +38,19 @@ uint32_t __thiscall winIVRMailbox_IVRMailbox_001_undoc2(struct w_steam_iface *_t
return params._ret;
}
extern uint32_t __thiscall winIVRMailbox_IVRMailbox_001_undoc3(struct w_steam_iface *_this, uint64_t a, const char *b, const char *c);
uint32_t __thiscall winIVRMailbox_IVRMailbox_001_undoc3(struct w_steam_iface *_this, uint64_t a, const char *b, const char *c)
{
struct IVRMailbox_IVRMailbox_001_undoc3_params params =
{
.linux_side = _this->u_iface,
.a = a,
.b = b,
.c = c,
};
TRACE("%p\n", _this);
VRCLIENT_CALL( IVRMailbox_IVRMailbox_001_undoc3, &params );
return params._ret;
}
uint32_t __thiscall winIVRMailbox_IVRMailbox_001_undoc4(struct w_steam_iface *_this, uint64_t a, char *b, uint32_t c, uint32_t *d)
{