Replace usage of Utils.ExtractArrayFromList with Span

This commit is contained in:
2022-12-22 18:57:40 +02:00
parent 6a41ab0b6d
commit e03a819176
6 changed files with 17 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace FlaxEngine
{
@@ -15,7 +16,7 @@ namespace FlaxEngine
/// <param name="customActors">The custom set of actors to render. If empty, the loaded scenes will be rendered.</param>
public static void DrawSceneDepth(GPUContext context, SceneRenderTask task, GPUTexture output, List<Actor> customActors)
{
var temp = Utils.ExtractArrayFromList(customActors);
var temp = CollectionsMarshal.AsSpan(customActors).ToArray(); // FIXME
var tempCount = temp.Length;
Internal_DrawSceneDepth(FlaxEngine.Object.GetUnmanagedPtr(context), FlaxEngine.Object.GetUnmanagedPtr(task), FlaxEngine.Object.GetUnmanagedPtr(output), ref temp, ref tempCount);
}