Format files with dfmt
This commit is contained in:
parent
2069e7b420
commit
86e4e57f74
4 changed files with 50 additions and 46 deletions
|
|
@ -32,7 +32,8 @@ class EntityManager
|
|||
string ret = "s.update(";
|
||||
foreach (i, param; Parameters!(Sys.update))
|
||||
{
|
||||
ret ~= "*cast(types["~i.to!string~"]*)(data_pointer + data.deltas["~i.to!string~"]),";
|
||||
ret ~= "*cast(types[" ~ i.to!string
|
||||
~ "]*)(data_pointer + data.deltas[" ~ i.to!string ~ "]),";
|
||||
}
|
||||
ret ~= ");";
|
||||
return ret;
|
||||
|
|
@ -43,7 +44,8 @@ class EntityManager
|
|||
string ret;
|
||||
foreach (i, param; Parameters!(Sys.update))
|
||||
{
|
||||
ret ~= "system.components["~i.to!string~"] = components_map.get(types["~i.to!string~"].stringof);\n";
|
||||
ret ~= "system.components[" ~ i.to!string
|
||||
~ "] = components_map.get(types[" ~ i.to!string ~ "].stringof);\n";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -58,7 +60,8 @@ class EntityManager
|
|||
while (block !is null)
|
||||
{
|
||||
void* data_pointer = block.dataBegin();
|
||||
foreach(i; 0..block.entities_count){
|
||||
foreach (i; 0 .. block.entities_count)
|
||||
{
|
||||
mixin(genCall());
|
||||
data_pointer += data.info.size;
|
||||
}
|
||||
|
|
@ -151,7 +154,8 @@ class EntityManager
|
|||
|
||||
foreach (ref system; systems)
|
||||
{
|
||||
if(system.update is null)continue;
|
||||
if (system.update is null)
|
||||
continue;
|
||||
CallData call_data = CallData(&system, info, null);
|
||||
call_data.deltas = Mallocator.instance.makeArray!ushort(system.components.length);
|
||||
foreach (i, id; system.components)
|
||||
|
|
@ -218,7 +222,6 @@ class EntityManager
|
|||
break; // block exists and bounds check passed
|
||||
}
|
||||
|
||||
|
||||
void* start = block.dataBegin() + block.entities_count * tmpl.info.size;
|
||||
memcpy(start, tmpl.entity_data.ptr, tmpl.info.size);
|
||||
block.entities_count++;
|
||||
|
|
@ -256,6 +259,7 @@ class EntityManager
|
|||
alignNum(dif, type_data.alignment);
|
||||
return dif;
|
||||
}
|
||||
|
||||
void* dataBegin()
|
||||
{
|
||||
ushort dif = EntitiesBlock.sizeof;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue