Small fixes

This commit is contained in:
Dawid Masiukiewicz 2022-07-09 20:27:01 +00:00
parent 014e9cee8d
commit 24a07a05e5
13 changed files with 46 additions and 29 deletions

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.events;
import bubel.ecs.block_allocator;

View file

@ -1,4 +1,8 @@
module bubel.ecs.hash_map;
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.hash_map;
import std.traits;
@ -332,36 +336,36 @@ nothrow:
return result;
}
export int byKey(scope int delegate(Key k) nothrow dg)
export int byKey(scope int delegate(ref Key k) dg)
{
int result;
foreach (ref Key k; this)
{
result = dg(k);
result = (cast(int delegate(ref Key k) nothrow)dg)(k);
if (result)
break;
}
return result;
}
export int byValue(scope int delegate(ref Value k) nothrow dg)
export int byValue(scope int delegate(ref Value v) dg)
{
int result;
foreach (ref Value v; this)
{
result = dg(v);
result = (cast(int delegate(ref Value v) nothrow)dg)(v);
if (result)
break;
}
return result;
}
export int byKeyValue(scope int delegate(ref Key k, ref Value v) nothrow dg)
export int byKeyValue(scope int delegate(ref Key k, ref Value v) dg)
{
int result;
foreach (ref Key k, ref Value v; this)
{
result = dg(k, v);
result = (cast(int delegate(ref Key k, ref Value v) nothrow)dg)(k, v);
if (result)
break;
}

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.id_manager;
import bubel.ecs.entity;

View file

@ -80,8 +80,6 @@ export struct EntityManager
{
UpdatePass* pass = Mallocator.make!UpdatePass;
pass.name = Mallocator.makeArray(cast(char[]) "update");
//pass.name = Mallocator.makeArray!char("update".length);
//pass.name[0..$] = "update";
passes.add(pass);
passes_map.add(cast(string) pass.name, cast(ushort)(passes.length - 1));
}
@ -297,7 +295,6 @@ export struct EntityManager
if (threads_count == 0)
threads_count = 1;
threads = Mallocator.makeArray!ThreadData(threads_count);
//foreach(ref thread;threads)thread = ThreadData().init;
m_page_size = page_size;
m_pages_in_block = block_pages_count;
@ -1253,8 +1250,6 @@ export struct EntityManager
{
UpdatePass* pass = Mallocator.make!UpdatePass;
pass.name = Mallocator.makeArray(cast(char[]) name);
/*pass.name = Mallocator.makeArray!char(name.length);
pass.name[0..$] = name[0..$];*/
passes.add(pass);
passes_map.add(name, cast(ushort)(passes.length - 1));
return cast(ushort)(passes.length - 1);
@ -1849,8 +1844,6 @@ export struct EntityManager
info = Mallocator.make!EntityInfo;
info.components = Mallocator.makeArray(ids);
/*info.components = Mallocator.makeArray!ushort(ids.length);
info.components[0 .. $] = ids[0 .. $];*/
info.deltas = Mallocator.makeArray!ushort(ids[$ - 1] + 1);
info.size = EntityID.sizeof;
@ -3226,8 +3219,6 @@ export struct EntityManager
if (index > 0)
{
caller.exclusion = Mallocator.makeArray(exclusion[0 .. index]);
/*caller.exclusion = Mallocator.makeArray!(SystemCaller*)(index);
caller.exclusion[0..$] = exclusion[0 .. index];*/
}
else
caller.exclusion = null;
@ -3275,8 +3266,6 @@ export struct EntityManager
if (index > 0)
{
caller.dependencies = Mallocator.makeArray(exclusion[0 .. index]);
/*caller.dependencies = Mallocator.makeArray!(SystemCaller*)(index);
caller.dependencies[0..$] = exclusion[0 .. index];*/
caller.job_group.dependencies = Mallocator.makeArray!(JobGroup*)(index);
foreach (j, dep; caller.dependencies)

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs;
public import bubel.ecs.core;

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.simple_vector;
import bubel.ecs.std;

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.traits;
import std.traits;

View file

@ -1,3 +1,7 @@
/************************************************************************************************************************
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module bubel.ecs.vector;
import core.bitop;