Merge branch 'improve_component_init' into 'master'
Syntax '*ptr = Structure.init' requires opAssign operator, get rid of this... See merge request Mergul/bubel-ecs!23
This commit is contained in:
commit
6c4109d86c
1 changed files with 2 additions and 1 deletions
|
|
@ -1307,7 +1307,8 @@ export struct EntityManager
|
||||||
info.size = Comp.sizeof;
|
info.size = Comp.sizeof;
|
||||||
info.alignment = Comp.alignof; //8;
|
info.alignment = Comp.alignof; //8;
|
||||||
info.init_data = Mallocator.makeArray!ubyte(Comp.sizeof);
|
info.init_data = Mallocator.makeArray!ubyte(Comp.sizeof);
|
||||||
*cast(Comp*) info.init_data.ptr = Comp.init; // = Comp();
|
__gshared Comp init_memory;
|
||||||
|
memcpy(info.init_data.ptr, &init_memory, Comp.sizeof);
|
||||||
|
|
||||||
ushort comp_id = components_map.get(cast(char[]) ComponentName, ushort.max);
|
ushort comp_id = components_map.get(cast(char[]) ComponentName, ushort.max);
|
||||||
if (comp_id < components.length)
|
if (comp_id < components.length)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue