From 1607506e323b0c1513733d93dea619c22edd5cc7 Mon Sep 17 00:00:00 2001 From: copygirl Date: Tue, 16 May 2023 13:10:21 +0200 Subject: [PATCH] Remove ETX as Flecs now supports Empty --- src/gaemstone.ECS/EntityBuilder.cs | 2 +- src/gaemstone.ECS/EntityPath.cs | 2 +- src/gaemstone.ECS/Utility/CStringExtensions.cs | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gaemstone.ECS/EntityBuilder.cs b/src/gaemstone.ECS/EntityBuilder.cs index cbc98d2..8b073fb 100644 --- a/src/gaemstone.ECS/EntityBuilder.cs +++ b/src/gaemstone.ECS/EntityBuilder.cs @@ -113,7 +113,7 @@ public class EntityBuilder _symbol = alloc.AllocateCString(_symbol), _add_expr = alloc.AllocateCString(Expression), use_low_id = UseLowId, - _sep = CStringExtensions.ETX, + _sep = CStringExtensions.Empty, }; var add = desc.add; var index = 0; diff --git a/src/gaemstone.ECS/EntityPath.cs b/src/gaemstone.ECS/EntityPath.cs index e4f44bf..960bb46 100644 --- a/src/gaemstone.ECS/EntityPath.cs +++ b/src/gaemstone.ECS/EntityPath.cs @@ -197,7 +197,7 @@ public class EntityPath foreach (var part in path) fixed (byte* ptr = part.AsSpan()) if (skipLookup || (parent = new(ecs_lookup_child(world, parent, ptr))).IsNone) { - var desc = new ecs_entity_desc_t { _name = ptr, _sep = CStringExtensions.ETX }; + var desc = new ecs_entity_desc_t { _name = ptr, _sep = CStringExtensions.Empty }; if (parent.IsSome) desc.add[0] = Id.Pair(FlecsBuiltIn.ChildOf, parent); parent = new(ecs_entity_init(world, &desc)); skipLookup = true; diff --git a/src/gaemstone.ECS/Utility/CStringExtensions.cs b/src/gaemstone.ECS/Utility/CStringExtensions.cs index 406d552..4c932b4 100644 --- a/src/gaemstone.ECS/Utility/CStringExtensions.cs +++ b/src/gaemstone.ECS/Utility/CStringExtensions.cs @@ -8,7 +8,6 @@ namespace gaemstone.ECS.Utility; public unsafe static class CStringExtensions { public static CString Empty { get; } = (CString)""; - public static CString ETX { get; } = (CString)"\x3"; // TODO: Temporary, until flecs supports Empty. public static unsafe byte[]? FlecsToBytes(this CString str) {