-support for system priority
-fixed callers system pointer update -fixed HashMap issue
This commit is contained in:
parent
0eaff0adad
commit
1aa1fbf36b
3 changed files with 35 additions and 3 deletions
|
|
@ -115,6 +115,7 @@ class EntityManager
|
|||
}
|
||||
|
||||
system.m_system_pointer = cast(void*) Mallocator.instance.make!Sys;
|
||||
system.m_priority = priority;
|
||||
|
||||
system.m_components = Mallocator.instance.makeArray!uint(types.length - 1);
|
||||
mixin(genCompList());
|
||||
|
|
@ -268,7 +269,7 @@ class EntityManager
|
|||
{
|
||||
foreach(entity;&entities_infos.byValue)
|
||||
{
|
||||
foreach(caller;entity.callers)
|
||||
foreach(ref caller;entity.callers)
|
||||
{
|
||||
caller.system = &systems[caller.system_id];
|
||||
}
|
||||
|
|
@ -302,7 +303,13 @@ class EntityManager
|
|||
{
|
||||
call_data.deltas = Mallocator.instance.makeArray(deltas); //Mallocator.instance.makeArray!ushort(system.m_components.length);
|
||||
|
||||
entity.callers.add(call_data);
|
||||
uint index = 0;
|
||||
for(;index<entity.callers.length;index++)
|
||||
{
|
||||
CallData* caller = &entity.callers[index];
|
||||
if(caller.system.priority >= call_data.system.priority)break;
|
||||
}
|
||||
entity.callers.add(call_data,index);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -148,7 +148,8 @@ public:
|
|||
extend(array.length * 2);
|
||||
}
|
||||
foreach_reverse (size_t i; pos .. used) {
|
||||
swap(array[i + 1], array[i]);
|
||||
//swap(array[i + 1], array[i]);
|
||||
array[i+1] = array[i];
|
||||
}
|
||||
emplace(&array[pos], t);
|
||||
used++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue