From ede0f961491f170bb937ab62870d1740df466441 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Tue, 17 Sep 2019 14:31:48 -0500 Subject: [PATCH] vrclient: Convert structure members --- vrclient_x64/gen_wrapper.py | 7 ++++++- vrclient_x64/vrclient_x64/struct_converters_090.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_091.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_0910.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_092.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_093.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_094.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_096.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_097.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_098.cpp | 4 ++-- vrclient_x64/vrclient_x64/struct_converters_099.cpp | 4 ++-- 11 files changed, 26 insertions(+), 21 deletions(-) diff --git a/vrclient_x64/gen_wrapper.py b/vrclient_x64/gen_wrapper.py index f54e2e75..c637e920 100755 --- a/vrclient_x64/gen_wrapper.py +++ b/vrclient_x64/gen_wrapper.py @@ -376,7 +376,6 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e while real_type.kind == clang.cindex.TypeKind.POINTER: real_type = real_type.get_pointee() if param.type.kind == clang.cindex.TypeKind.POINTER: - print("checking param %s" % real_type.spelling) if strip_ns(param.type.get_pointee().get_canonical().spelling) in user_structs: do_lin_to_win = (strip_ns(param.type.get_pointee().get_canonical().spelling), param.spelling) typename = "win" + do_lin_to_win[0] + "_" + display_sdkver(sdkver) + " *" @@ -888,6 +887,9 @@ def handle_struct(sdkver, struct): #TODO: if this is a struct, or packed differently, we'll have to # copy each element in a for-loop cppfile.write(" memcpy(win->%s, lin->%s, sizeof(win->%s));\n" % (m.displayname, m.displayname, m.displayname)) + elif m.type.kind == clang.cindex.TypeKind.RECORD and \ + struct_needs_conversion(m.type): + cppfile.write(" lin_to_win_struct_%s_%s(&lin->%s, &win->%s);\n" % (strip_ns(m.type.spelling), display_sdkver(sdkver), m.displayname, m.displayname)) else: cppfile.write(" win->%s = lin->%s;\n" % (m.displayname, m.displayname)) @@ -906,6 +908,9 @@ def handle_struct(sdkver, struct): #TODO: if this is a struct, or packed differently, we'll have to # copy each element in a for-loop cppfile.write(" memcpy(lin->%s, win->%s, sizeof(lin->%s));\n" % (m.displayname, m.displayname, m.displayname)) + elif m.type.kind == clang.cindex.TypeKind.RECORD and \ + struct_needs_conversion(m.type): + cppfile.write(" win_to_lin_struct_%s_%s(&win->%s, &lin->%s);\n" % (m.type.spelling, display_sdkver(sdkver), m.displayname, m.displayname)) else: cppfile.write(" lin->%s = win->%s;\n" % (m.displayname, m.displayname)) diff --git a/vrclient_x64/vrclient_x64/struct_converters_090.cpp b/vrclient_x64/vrclient_x64/struct_converters_090.cpp index 069f445e..72f8fb7e 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_090.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_090.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_090_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_090(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_090_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_090_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_090(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_090 *struct_RenderModel_t_090_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_091.cpp b/vrclient_x64/vrclient_x64/struct_converters_091.cpp index 157d3cb5..9b1b8f64 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_091.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_091.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_091_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_091(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_091_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_091_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_091(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_091 *struct_RenderModel_t_091_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_0910.cpp b/vrclient_x64/vrclient_x64/struct_converters_0910.cpp index b75679a5..92400260 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_0910.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_0910.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_0910_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_0910(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_0910_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_0910_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_0910(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_0910 *struct_RenderModel_t_0910_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_092.cpp b/vrclient_x64/vrclient_x64/struct_converters_092.cpp index 7faab9be..96d3f4f6 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_092.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_092.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_092_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_092(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_092_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_092_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_092(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_092 *struct_RenderModel_t_092_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_093.cpp b/vrclient_x64/vrclient_x64/struct_converters_093.cpp index 8d193978..b9592b54 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_093.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_093.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_093_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_093(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_093_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_093_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_093(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_093 *struct_RenderModel_t_093_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_094.cpp b/vrclient_x64/vrclient_x64/struct_converters_094.cpp index 3b74fea4..52adbd88 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_094.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_094.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_094_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_094(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_094_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_094_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_094(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_094 *struct_RenderModel_t_094_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_096.cpp b/vrclient_x64/vrclient_x64/struct_converters_096.cpp index 5764b08c..8107a66e 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_096.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_096.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_096_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_096(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_096_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_096_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_096(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_096 *struct_RenderModel_t_096_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_097.cpp b/vrclient_x64/vrclient_x64/struct_converters_097.cpp index db2c0029..49651c5a 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_097.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_097.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_097_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_097(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_097_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_097_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_097(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_097 *struct_RenderModel_t_097_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_098.cpp b/vrclient_x64/vrclient_x64/struct_converters_098.cpp index bfdba392..c42296f9 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_098.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_098.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_098_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_098(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_098_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_098_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_098(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_098 *struct_RenderModel_t_098_wrap(void *l) diff --git a/vrclient_x64/vrclient_x64/struct_converters_099.cpp b/vrclient_x64/vrclient_x64/struct_converters_099.cpp index 69d9770e..09cfdfa3 100644 --- a/vrclient_x64/vrclient_x64/struct_converters_099.cpp +++ b/vrclient_x64/vrclient_x64/struct_converters_099.cpp @@ -74,7 +74,7 @@ void struct_RenderModel_t_099_lin_to_win(void *l, void *w) win->unVertexCount = lin->unVertexCount; win->rIndexData = lin->rIndexData; win->unTriangleCount = lin->unTriangleCount; - win->diffuseTexture = lin->diffuseTexture; + lin_to_win_struct_RenderModel_TextureMap_t_099(&lin->diffuseTexture, &win->diffuseTexture); } void struct_RenderModel_t_099_win_to_lin(void *w, void *l) @@ -86,7 +86,7 @@ void struct_RenderModel_t_099_win_to_lin(void *w, void *l) lin->unVertexCount = win->unVertexCount; lin->rIndexData = win->rIndexData; lin->unTriangleCount = win->unTriangleCount; - lin->diffuseTexture = win->diffuseTexture; + win_to_lin_struct_vr::RenderModel_TextureMap_t_099(&win->diffuseTexture, &lin->diffuseTexture); } struct winRenderModel_t_099 *struct_RenderModel_t_099_wrap(void *l)