From 24a07a05e5948aeada729de9782611734153e745 Mon Sep 17 00:00:00 2001 From: Dawid Masiukiewicz Date: Sat, 9 Jul 2022 20:27:01 +0000 Subject: [PATCH] Small fixes --- .gitlab-ci.yml | 6 +++--- demos/meson.build | 2 +- dub.json | 4 ++-- meson.build | 8 ++++---- source/bubel/ecs/events.d | 4 ++++ source/bubel/ecs/hash_map.d | 18 +++++++++++------- source/bubel/ecs/id_manager.d | 4 ++++ source/bubel/ecs/manager.d | 11 ----------- source/bubel/ecs/package.d | 4 ++++ source/bubel/ecs/simple_vector.d | 4 ++++ source/bubel/ecs/traits.d | 4 ++++ source/bubel/ecs/vector.d | 4 ++++ tests/meson.build | 2 +- 13 files changed, 46 insertions(+), 29 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8fa868a..555e6d5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ build_code: test_dmd_debug: stage: test - image: frolvlad/alpine-glibc + image: debian:buster-slim script: - binaries/dmd_debug_unittest artifacts: @@ -31,7 +31,7 @@ test_dmd_debug: junit: test_report.xml test_dmd: stage: test - image: frolvlad/alpine-glibc + image: debian:buster-slim script: - binaries/dmd_release_unittest artifacts: @@ -39,7 +39,7 @@ test_dmd: junit: test_report.xml test_dmd_betterC: stage: test - image: frolvlad/alpine-glibc + image: debian:buster-slim script: - binaries/dmd_debug_unittest_bc artifacts: diff --git a/demos/meson.build b/demos/meson.build index 20df64c..deee071 100644 --- a/demos/meson.build +++ b/demos/meson.build @@ -19,7 +19,7 @@ sdl2_image_dep = dependency('SDL2_image') subdir('utils') # Utils library -executable('decs-demos', [demos_src, external_src], +executable('BubelECSDemos', [demos_src, external_src], include_directories : [demos_inc, external_inc], d_module_versions : versions, link_with : [ecs_lib, ecs_utils_lib], diff --git a/dub.json b/dub.json index 8e2a1b3..b3bfa66 100755 --- a/dub.json +++ b/dub.json @@ -1,6 +1,6 @@ { - "name": "bubel_ecs", - "targetName" : "bubel_ecs", + "name": "bubel-ecs", + "targetName" : "BubelECS", "authors": [ "Michał Masiukiewicz", "Dawid Masiukiewicz" ], diff --git a/meson.build b/meson.build index b3770bf..8275cc9 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('decs', 'd', version : '0.5.0') +project('bubel-ecs', 'd', version : '0.5.0') # Options betterC_opt = get_option('betterC') @@ -55,18 +55,18 @@ add_project_link_arguments(link_args, language : 'd') # Dependencies threads_dep = dependency('threads') -ecs_lib = library('decs', +ecs_lib = library('BubelECS', src, include_directories : [inc], ) -decs_dep = declare_dependency( +bubel_ecs_dep = declare_dependency( include_directories : [inc], link_with : ecs_lib, dependencies : threads_dep, ) -meson.override_dependency('decs', decs_dep) +meson.override_dependency('bubel-ecs', bubel_ecs_dep) # Tests if BuildTests_opt diff --git a/source/bubel/ecs/events.d b/source/bubel/ecs/events.d index 7cb0d0c..f123e86 100644 --- a/source/bubel/ecs/events.d +++ b/source/bubel/ecs/events.d @@ -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; diff --git a/source/bubel/ecs/hash_map.d b/source/bubel/ecs/hash_map.d index 764374c..1af0fd8 100755 --- a/source/bubel/ecs/hash_map.d +++ b/source/bubel/ecs/hash_map.d @@ -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; } diff --git a/source/bubel/ecs/id_manager.d b/source/bubel/ecs/id_manager.d index 86a611e..ccb4fac 100644 --- a/source/bubel/ecs/id_manager.d +++ b/source/bubel/ecs/id_manager.d @@ -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; diff --git a/source/bubel/ecs/manager.d b/source/bubel/ecs/manager.d index 1ca7a86..32ba65d 100644 --- a/source/bubel/ecs/manager.d +++ b/source/bubel/ecs/manager.d @@ -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) diff --git a/source/bubel/ecs/package.d b/source/bubel/ecs/package.d index 51da325..2b3b7f4 100644 --- a/source/bubel/ecs/package.d +++ b/source/bubel/ecs/package.d @@ -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; diff --git a/source/bubel/ecs/simple_vector.d b/source/bubel/ecs/simple_vector.d index acf01ee..02f3f3d 100644 --- a/source/bubel/ecs/simple_vector.d +++ b/source/bubel/ecs/simple_vector.d @@ -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; diff --git a/source/bubel/ecs/traits.d b/source/bubel/ecs/traits.d index 849632a..15880fd 100644 --- a/source/bubel/ecs/traits.d +++ b/source/bubel/ecs/traits.d @@ -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; diff --git a/source/bubel/ecs/vector.d b/source/bubel/ecs/vector.d index 019673b..e9b061d 100644 --- a/source/bubel/ecs/vector.d +++ b/source/bubel/ecs/vector.d @@ -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; diff --git a/tests/meson.build b/tests/meson.build index cfccaa7..ff1a3a1 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -10,7 +10,7 @@ tests_src = files( 'vector.d' ) -exe = executable('decs-tests', +exe = executable('BubelECSTests', tests_src, include_directories : [inc, include_directories('..')], d_args : args,