diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-20 15:30:13 -0400 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-03-21 11:06:05 -0400 |
| commit | e6e7f56c9bba3b2191583c4c1d0599370d1f00c7 (patch) | |
| tree | 27476da693d9e75d920a698d57b74699f9f81c7a /src/ecs.cpp | |
| parent | 9b39b4c8eab360e087423f06ecffb694a3b98b23 (diff) | |
pke: replace PkeArray with pk_arr_t
Diffstat (limited to 'src/ecs.cpp')
| -rw-r--r-- | src/ecs.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ecs.cpp b/src/ecs.cpp index ecdb1ee..3ab8a80 100644 --- a/src/ecs.cpp +++ b/src/ecs.cpp @@ -1,7 +1,6 @@ #include "ecs.hpp" -#include "array.hpp" #include "bucketed-array.hpp" #include "game-settings.hpp" #include "math-helpers.hpp" @@ -408,14 +407,14 @@ CompGrBinds *ECS_GetGrBinds(GrBindsHandle grBindsHandle) { return &ecs.bc.grBinds.buckets[grBindsHandle.bucketIndex][grBindsHandle.itemIndex]; } -void ECS_GetGrBinds(Entity_Base *entity, PkeArray<CompGrBinds *> &arr) { +void ECS_GetGrBinds(Entity_Base *entity, pk_arr_t<CompGrBinds *> &arr) { for (pk_handle_bucket_index_T b = 0; b <= ecs.bc.grBinds.pkeHandle.bucketIndex; ++b) { auto &bkt = ecs.bc.grBinds.buckets[b]; long itemCount = ecs.bc.grBinds.pkeHandle.bucketIndex == b ? ecs.bc.grBinds.pkeHandle.itemIndex : ecs.bc.grBinds.limits.itemIndex; for (pk_handle_item_index_T i = 0; i < itemCount; ++i) { - auto &grBinds = bkt[i]; - if (grBinds.entHandle == entity->handle) { - PkeArray_Add(&arr, &grBinds); + CompGrBinds *grBinds = &bkt[i]; + if (grBinds->entHandle == entity->handle) { + pk_arr_append(&arr, &grBinds); } } } @@ -466,14 +465,14 @@ CompInstance *ECS_GetInstance(InstanceHandle instanceHandle ) { return inst; } -void ECS_GetInstances(Entity_Base *entity, PkeArray<CompInstance *> &arr) { +void ECS_GetInstances(Entity_Base *entity, pk_arr_t<CompInstance *> &arr) { for (pk_handle_bucket_index_T b = 0; b <= ecs.bc.instances.pkeHandle.bucketIndex; ++b) { auto &bkt = ecs.bc.instances.buckets[b]; long itemCount = ecs.bc.instances.pkeHandle.bucketIndex == b ? ecs.bc.instances.pkeHandle.itemIndex : ecs.bc.instances.limits.itemIndex; for (pk_handle_item_index_T i = 0; i < itemCount; ++i) { - auto &inst = bkt[i]; - if (inst.entHandle == entity->handle) { - PkeArray_Add(&arr, &inst); + CompInstance *inst = &bkt[i]; + if (inst->entHandle == entity->handle) { + pk_arr_append(&arr, &inst); } } } |
