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(";
|
string ret = "s.update(";
|
||||||
foreach (i, param; Parameters!(Sys.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 ~= ");";
|
ret ~= ");";
|
||||||
return ret;
|
return ret;
|
||||||
|
|
@ -43,7 +44,8 @@ class EntityManager
|
||||||
string ret;
|
string ret;
|
||||||
foreach (i, param; Parameters!(Sys.update))
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
@ -58,7 +60,8 @@ class EntityManager
|
||||||
while (block !is null)
|
while (block !is null)
|
||||||
{
|
{
|
||||||
void* data_pointer = block.dataBegin();
|
void* data_pointer = block.dataBegin();
|
||||||
foreach(i; 0..block.entities_count){
|
foreach (i; 0 .. block.entities_count)
|
||||||
|
{
|
||||||
mixin(genCall());
|
mixin(genCall());
|
||||||
data_pointer += data.info.size;
|
data_pointer += data.info.size;
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +154,8 @@ class EntityManager
|
||||||
|
|
||||||
foreach (ref system; systems)
|
foreach (ref system; systems)
|
||||||
{
|
{
|
||||||
if(system.update is null)continue;
|
if (system.update is null)
|
||||||
|
continue;
|
||||||
CallData call_data = CallData(&system, info, null);
|
CallData call_data = CallData(&system, info, null);
|
||||||
call_data.deltas = Mallocator.instance.makeArray!ushort(system.components.length);
|
call_data.deltas = Mallocator.instance.makeArray!ushort(system.components.length);
|
||||||
foreach (i, id; system.components)
|
foreach (i, id; system.components)
|
||||||
|
|
@ -218,7 +222,6 @@ class EntityManager
|
||||||
break; // block exists and bounds check passed
|
break; // block exists and bounds check passed
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void* start = block.dataBegin() + block.entities_count * tmpl.info.size;
|
void* start = block.dataBegin() + block.entities_count * tmpl.info.size;
|
||||||
memcpy(start, tmpl.entity_data.ptr, tmpl.info.size);
|
memcpy(start, tmpl.entity_data.ptr, tmpl.info.size);
|
||||||
block.entities_count++;
|
block.entities_count++;
|
||||||
|
|
@ -256,6 +259,7 @@ class EntityManager
|
||||||
alignNum(dif, type_data.alignment);
|
alignNum(dif, type_data.alignment);
|
||||||
return dif;
|
return dif;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* dataBegin()
|
void* dataBegin()
|
||||||
{
|
{
|
||||||
ushort dif = EntitiesBlock.sizeof;
|
ushort dif = EntitiesBlock.sizeof;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue