Fix compile errors due to changes in flecs-cs

main
copygirl 1 year ago
parent 063fb40c5c
commit 5600a6f0ee
  1. 8
      src/gaemstone.ECS/EntityBuilder.cs
  2. 2
      src/gaemstone.ECS/EntityPath.cs
  3. 2
      src/gaemstone.ECS/Filter.cs
  4. 2
      src/gaemstone.ECS/Term.cs

@ -109,11 +109,11 @@ public class EntityBuilder<TContext>
using var alloc = TempAllocator.Use(); using var alloc = TempAllocator.Use();
var desc = new ecs_entity_desc_t { var desc = new ecs_entity_desc_t {
id = Id, id = Id,
name = (Path != null) ? alloc.AllocateCString(Path.Name.AsSpan()) : default, _name = (Path != null) ? alloc.AllocateCString(Path.Name.AsSpan()) : default,
symbol = alloc.AllocateCString(_symbol), _symbol = alloc.AllocateCString(_symbol),
add_expr = alloc.AllocateCString(Expression), _add_expr = alloc.AllocateCString(Expression),
use_low_id = UseLowId, use_low_id = UseLowId,
sep = CStringExtensions.ETX, _sep = CStringExtensions.ETX,
}; };
var add = desc.add; var index = 0; var add = desc.add; var index = 0;

@ -197,7 +197,7 @@ public class EntityPath
foreach (var part in path) foreach (var part in path)
fixed (byte* ptr = part.AsSpan()) fixed (byte* ptr = part.AsSpan())
if (skipLookup || (parent = new(ecs_lookup_child(world, parent, ptr))).IsNone) { 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.ETX };
if (parent.IsSome) desc.add[0] = Id.Pair(FlecsBuiltIn.ChildOf, parent); if (parent.IsSome) desc.add[0] = Id.Pair(FlecsBuiltIn.ChildOf, parent);
parent = new(ecs_entity_init(world, &desc)); parent = new(ecs_entity_init(world, &desc));
skipLookup = true; skipLookup = true;

@ -77,7 +77,7 @@ public class FilterDesc
public unsafe ecs_filter_desc_t ToFlecs(IAllocator allocator) public unsafe ecs_filter_desc_t ToFlecs(IAllocator allocator)
{ {
var desc = new ecs_filter_desc_t { var desc = new ecs_filter_desc_t {
expr = allocator.AllocateCString(Expression), _expr = allocator.AllocateCString(Expression),
instanced = Instanced, instanced = Instanced,
entity = Entity, entity = Entity,
}; };

@ -80,7 +80,7 @@ public class TermId
public ecs_term_id_t ToFlecs(IAllocator allocator) => new() { public ecs_term_id_t ToFlecs(IAllocator allocator) => new() {
id = Id, id = Id,
name = allocator.AllocateCString(Name), _name = allocator.AllocateCString(Name),
trav = Traverse, trav = Traverse,
flags = (ecs_flags32_t)(uint)Flags flags = (ecs_flags32_t)(uint)Flags
}; };

Loading…
Cancel
Save