From 5e37d073bb86492e8c415964ffd554a2fa08920d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rold=C3=A1n=20Etcheverry?= Date: Sun, 12 Sep 2021 19:50:13 +0200 Subject: C#: Re-write GD and some other icalls as P/Invoke --- modules/mono/csharp_script.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'modules/mono/csharp_script.cpp') diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index 9520598f5c..4316f38bd2 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -109,7 +109,7 @@ Error CSharpLanguage::execute_file(const String &p_path) { return OK; } -extern void *godotsharp_pinvoke_funcs[138]; +extern void *godotsharp_pinvoke_funcs[164]; [[maybe_unused]] volatile void **do_not_strip_godotsharp_pinvoke_funcs; void CSharpLanguage::init() { @@ -705,19 +705,14 @@ void CSharpLanguage::pre_unsafe_unreference(Object *p_obj) { void CSharpLanguage::frame() { if (gdmono && gdmono->is_runtime_initialized() && gdmono->get_core_api_assembly() != nullptr) { - const Ref &task_scheduler_handle = GDMonoCache::cached_data.task_scheduler_handle; - - if (task_scheduler_handle.is_valid()) { - MonoObject *task_scheduler = task_scheduler_handle->get_target(); - - if (task_scheduler) { - MonoException *exc = nullptr; - CACHED_METHOD_THUNK(GodotTaskScheduler, Activate).invoke(task_scheduler, &exc); + MonoException *exc = nullptr; + gdmono->get_core_api_assembly() + ->get_class("Godot", "ScriptManager") + ->get_method("FrameCallback") + ->invoke(nullptr, &exc); - if (exc) { - GDMonoUtils::debug_unhandled_exception(exc); - } - } + if (exc) { + GDMonoUtils::debug_unhandled_exception(exc); } } } -- cgit v1.2.3