From 4a58a07dcd2ec876e88fbedc7007d4fff0cde6a3 Mon Sep 17 00:00:00 2001 From: ChrisDill Date: Sun, 29 Oct 2023 09:45:02 +0000 Subject: [PATCH] Simplify LoadModelAnimations util --- Raylib-cs/types/Raylib.Utils.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Raylib-cs/types/Raylib.Utils.cs b/Raylib-cs/types/Raylib.Utils.cs index 6bb24f9..0cb16a2 100644 --- a/Raylib-cs/types/Raylib.Utils.cs +++ b/Raylib-cs/types/Raylib.Utils.cs @@ -916,19 +916,12 @@ public static unsafe partial class Raylib } /// Load model animations from file - public static ReadOnlySpan LoadModelAnimations(string fileName, ref uint animCount) + public static ModelAnimation* LoadModelAnimations(string fileName, ref uint animCount) { using var str1 = fileName.ToAnsiBuffer(); fixed (uint* p = &animCount) { - ModelAnimation* modelAnimations = LoadModelAnimations(str1.AsPointer(), p); - - if ((IntPtr)modelAnimations == IntPtr.Zero) - { - throw new ApplicationException("Failed to load animation"); - } - - return new ReadOnlySpan(modelAnimations, (int)animCount); + return LoadModelAnimations(str1.AsPointer(), p); } }