From 288ad4c6cd81d26c17e3f0439637984d8c67b441 Mon Sep 17 00:00:00 2001 From: Mergul Date: Mon, 1 Oct 2018 17:29:43 +0200 Subject: [PATCH] -removed unused CallData.deltas member --- source/ecs/manager.d | 38 +++----------------------------------- 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/source/ecs/manager.d b/source/ecs/manager.d index ffa53f6..1d17aa6 100644 --- a/source/ecs/manager.d +++ b/source/ecs/manager.d @@ -618,10 +618,7 @@ class EntityManager export void addEntityCaller(ref EntityInfo entity, uint system_id) { System* system = &systems[system_id]; - CallData call_data = CallData(system_id, system, &entity, null); - uint num = cast(uint)(system.m_components.length + system.m_optional_components.length); - ushort[] deltas = (cast(ushort*) alloca(num * ushort.sizeof))[0 .. num]; - uint delta_id = 0; + CallData call_data = CallData(system_id, system, &entity); if(system.m_absen_components) { @@ -636,41 +633,14 @@ class EntityManager foreach (id; system.m_components) { - deltas[delta_id] = ushort.max; foreach (i2, id2; entity.components) { - if (id2 == id) - { - deltas[delta_id] = entity.deltas[id2]; - break; - } + if (id2 == id)goto is_; } - if (deltas[delta_id] == ushort.max) - { - deltas = null; - break; - } - delta_id++; - } - if (deltas is null) return; - - foreach (id; system.m_optional_components) - { - deltas[delta_id] = ushort.max; - foreach (i2, id2; entity.components) - { - if (id2 == id) - { - deltas[delta_id] = entity.deltas[id2]; - break; - } - } - delta_id++; + is_: } - call_data.deltas = Mallocator.instance.makeArray(deltas); //Mallocator.instance.makeArray!ushort(system.m_components.length); - uint index = 0; for (; index < entity.callers.length; index++) { @@ -1272,8 +1242,6 @@ class EntityManager System* system; ///poiner to Entity type info EntityManager.EntityInfo* info; - ///deltas for components - ushort[] deltas; //unused in linear-layout } alias SytemFuncType = void function(ref EntityManager.CallData data, void* entity);