-removed some unused code
This commit is contained in:
parent
8960423935
commit
13c82acad4
2 changed files with 2 additions and 38 deletions
1
demos/.gitignore
vendored
1
demos/.gitignore
vendored
|
|
@ -16,3 +16,4 @@
|
||||||
!emscripten_multi_shell.html
|
!emscripten_multi_shell.html
|
||||||
!compile_android.py
|
!compile_android.py
|
||||||
.dub
|
.dub
|
||||||
|
Android
|
||||||
|
|
@ -2542,43 +2542,6 @@ export struct EntityManager
|
||||||
*/
|
*/
|
||||||
export Entity* addEntity(EntityTemplate* tmpl)
|
export Entity* addEntity(EntityTemplate* tmpl)
|
||||||
{
|
{
|
||||||
/*EntityInfo* info = tmpl.info;
|
|
||||||
|
|
||||||
ushort index = 0;
|
|
||||||
EntitiesBlock* block;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
block = findBlockWithFreeSpaceMT(info);
|
|
||||||
index = block.added_count.atomicOp!"+="(1);
|
|
||||||
}
|
|
||||||
while (block.entities_count + index > info.max_entities);
|
|
||||||
|
|
||||||
uint id = (block.entities_count + index - 1); //block.added_count);
|
|
||||||
|
|
||||||
void* data_begin = block.dataBegin();
|
|
||||||
void* start = data_begin + EntityID.sizeof * id;
|
|
||||||
|
|
||||||
foreach (comp; info.components)
|
|
||||||
{
|
|
||||||
memcpy(cast(void*) block + info.deltas[comp] + components[comp].size * id,
|
|
||||||
tmpl.entity_data.ptr + info.tmpl_deltas[comp], components[comp].size);
|
|
||||||
|
|
||||||
if (components[comp].create_callback)
|
|
||||||
{
|
|
||||||
components[comp].create_callback(
|
|
||||||
cast(void*) block + info.deltas[comp] + id * components[comp].size);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index == 1)
|
|
||||||
threads[threadID].infosToUpdate.add(block);
|
|
||||||
|
|
||||||
Entity* entity = cast(Entity*) start;
|
|
||||||
entity.id = id_manager.getNewID();
|
|
||||||
id_manager.update(*entity); //entity.updateID();
|
|
||||||
|
|
||||||
return entity;*/
|
|
||||||
return addEntity(tmpl, null);
|
return addEntity(tmpl, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue