[fix] 修复ReversePInvokeWrapper生成的bug
parent
e3095ccc01
commit
4a00e944a6
|
@ -5,15 +5,16 @@ namespace hybridclr
|
||||||
{
|
{
|
||||||
namespace metadata
|
namespace metadata
|
||||||
{
|
{
|
||||||
//!!!{{REVERSE_PINVOKE_METHOD_STUB
|
|
||||||
|
|
||||||
void CallLuaFunction(void* xState, int32_t wrapperIndex)
|
void CallLuaFunction(void* xState, int32_t wrapperIndex)
|
||||||
{
|
{
|
||||||
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex);
|
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex);
|
||||||
typedef void (*Callback)(void* xState, const MethodInfo* method);
|
typedef void (*Callback)(void* xState, const MethodInfo* method);
|
||||||
((Callback)GetInterpreterDirectlyCallMethodPointer(method))(xState, method);
|
((Callback)(method->methodPointerCallByInterp))(xState, method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//!!!{{REVERSE_PINVOKE_METHOD_STUB
|
||||||
|
|
||||||
void __ReversePInvokeMethod_0(void* xState)
|
void __ReversePInvokeMethod_0(void* xState)
|
||||||
{
|
{
|
||||||
CallLuaFunction(xState, 0);
|
CallLuaFunction(xState, 0);
|
||||||
|
|
|
@ -15,15 +15,6 @@ namespace HybridCLR.Editor.ReversePInvokeWrap
|
||||||
var frr = new FileRegionReplace(template);
|
var frr = new FileRegionReplace(template);
|
||||||
var codes = new List<string>();
|
var codes = new List<string>();
|
||||||
|
|
||||||
codes.Add(@"
|
|
||||||
void CallLuaFunction(void* xState, int32_t wrapperIndex)
|
|
||||||
{
|
|
||||||
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex(wrapperIndex);
|
|
||||||
typedef void (*Callback)(void* xState, const MethodInfo* method);
|
|
||||||
((Callback)GetInterpreterDirectlyCallMethodPointer(method))(xState, method);
|
|
||||||
}
|
|
||||||
");
|
|
||||||
|
|
||||||
for(int i = 0; i < wrapperCount; i++)
|
for(int i = 0; i < wrapperCount; i++)
|
||||||
{
|
{
|
||||||
codes.Add($@"
|
codes.Add($@"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "com.focus-creative-games.hybridclr_unity",
|
"name": "com.focus-creative-games.hybridclr_unity",
|
||||||
"version": "0.4.1",
|
"version": "0.4.2",
|
||||||
"displayName": "HybridCLR",
|
"displayName": "HybridCLR",
|
||||||
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
|
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
|
||||||
"category": "Runtime",
|
"category": "Runtime",
|
||||||
|
|
Loading…
Reference in New Issue