-removed unused CallData.deltas member
This commit is contained in:
parent
e4573f1ec7
commit
288ad4c6cd
1 changed files with 3 additions and 35 deletions
|
|
@ -618,10 +618,7 @@ class EntityManager
|
||||||
export void addEntityCaller(ref EntityInfo entity, uint system_id)
|
export void addEntityCaller(ref EntityInfo entity, uint system_id)
|
||||||
{
|
{
|
||||||
System* system = &systems[system_id];
|
System* system = &systems[system_id];
|
||||||
CallData call_data = CallData(system_id, system, &entity, null);
|
CallData call_data = CallData(system_id, system, &entity);
|
||||||
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;
|
|
||||||
|
|
||||||
if(system.m_absen_components)
|
if(system.m_absen_components)
|
||||||
{
|
{
|
||||||
|
|
@ -636,40 +633,13 @@ class EntityManager
|
||||||
|
|
||||||
foreach (id; system.m_components)
|
foreach (id; system.m_components)
|
||||||
{
|
{
|
||||||
deltas[delta_id] = ushort.max;
|
|
||||||
foreach (i2, id2; entity.components)
|
foreach (i2, id2; entity.components)
|
||||||
{
|
{
|
||||||
if (id2 == id)
|
if (id2 == id)goto is_;
|
||||||
{
|
|
||||||
deltas[delta_id] = entity.deltas[id2];
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (deltas[delta_id] == ushort.max)
|
|
||||||
{
|
|
||||||
deltas = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
delta_id++;
|
|
||||||
}
|
|
||||||
if (deltas is null)
|
|
||||||
return;
|
return;
|
||||||
|
is_:
|
||||||
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++;
|
|
||||||
}
|
|
||||||
|
|
||||||
call_data.deltas = Mallocator.instance.makeArray(deltas); //Mallocator.instance.makeArray!ushort(system.m_components.length);
|
|
||||||
|
|
||||||
uint index = 0;
|
uint index = 0;
|
||||||
for (; index < entity.callers.length; index++)
|
for (; index < entity.callers.length; index++)
|
||||||
|
|
@ -1272,8 +1242,6 @@ class EntityManager
|
||||||
System* system;
|
System* system;
|
||||||
///poiner to Entity type info
|
///poiner to Entity type info
|
||||||
EntityManager.EntityInfo* info;
|
EntityManager.EntityInfo* info;
|
||||||
///deltas for components
|
|
||||||
ushort[] deltas; //unused in linear-layout
|
|
||||||
}
|
}
|
||||||
|
|
||||||
alias SytemFuncType = void function(ref EntityManager.CallData data, void* entity);
|
alias SytemFuncType = void function(ref EntityManager.CallData data, void* entity);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue