mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 21:01:52 +00:00
ScriptCore: Made trivial pointer stuff complicated to fix some warnings
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Diagnostics;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using GlitchyEngine.Core;
|
using GlitchyEngine.Core;
|
||||||
using GlitchyEngine.Extensions;
|
using GlitchyEngine.Extensions;
|
||||||
@@ -492,7 +493,7 @@ internal class EntityEditor
|
|||||||
{
|
{
|
||||||
if (payloadPtr.NativePtr != null)
|
if (payloadPtr.NativePtr != null)
|
||||||
{
|
{
|
||||||
ListPayload payload = *(ListPayload*)(payloadPtr.Data);
|
ref ListPayload payload = ref Unsafe.AsRef<ListPayload>((void*)payloadPtr.Data);
|
||||||
|
|
||||||
// Make sure the index is still correct
|
// Make sure the index is still correct
|
||||||
if (payload.Element < myList.Count)
|
if (payload.Element < myList.Count)
|
||||||
@@ -539,7 +540,7 @@ internal class EntityEditor
|
|||||||
{
|
{
|
||||||
ListPayload payload = new() { List = myList, Element = i };
|
ListPayload payload = new() { List = myList, Element = i };
|
||||||
|
|
||||||
ImGui.SetDragDropPayload("SCRIPT_EDITOR_LIST_ELEMENT", (IntPtr)(&payload), (uint)sizeof(ListPayload));
|
ImGui.SetDragDropPayload("SCRIPT_EDITOR_LIST_ELEMENT", (IntPtr)Unsafe.AsPointer(ref payload), (uint)Unsafe.SizeOf<ListPayload>());
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui.SetTooltip($"Move Element {i}");
|
ImGui.SetTooltip($"Move Element {i}");
|
||||||
|
|||||||
Reference in New Issue
Block a user