From 222d0f538e4ef46dd2a54708a19d2f31f5075510 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Sat, 6 Nov 2021 22:48:28 +0000 Subject: [PATCH] Replace old version of GetDroppedUtils --- Raylib-cs/Raylib.cs | 2 +- Raylib-cs/RaylibUtils.cs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Raylib-cs/Raylib.cs b/Raylib-cs/Raylib.cs index 3039341..16b8ad3 100644 --- a/Raylib-cs/Raylib.cs +++ b/Raylib-cs/Raylib.cs @@ -542,7 +542,7 @@ namespace Raylib_cs /// Get dropped files names (memory should be freed) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr GetDroppedFiles(ref int count); + public static unsafe extern byte** GetDroppedFiles(int* count); /// Clear dropped files paths buffer (free memory) [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] diff --git a/Raylib-cs/RaylibUtils.cs b/Raylib-cs/RaylibUtils.cs index 22efcb8..57e5780 100644 --- a/Raylib-cs/RaylibUtils.cs +++ b/Raylib-cs/RaylibUtils.cs @@ -14,13 +14,10 @@ namespace Raylib_cs return input.Substring(position, Math.Min(length, input.Length)); } - [DllImport(Raylib.nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static unsafe extern byte** GetDroppedFiles(int* count); - public static unsafe string[] GetDroppedFiles() { int count; - var buffer = GetDroppedFiles(&count); + var buffer = Raylib.GetDroppedFiles(&count); var files = new string[count]; for (int i = 0; i < count; i++)