Demos #10

Merged
Mergul merged 39 commits from Demos into master 2020-05-28 18:48:45 +02:00
46 changed files with 163 additions and 154 deletions
Showing only changes of commit 5411e97cb1 - Show all commits

View file

@ -1,3 +1,7 @@
default:
artifacts:
expire_in: 1 day
stages:
- build
- test

View file

@ -86,6 +86,11 @@ ninja
python compile_wasm.py -opt
```
##### Documentation
```shell
adrdox -i source/bubel/ecs/ -o docs/ -s skeleton.html
```
For more detailed build options please check documentation for used build system.
## Demos

View file

@ -1,6 +1,6 @@
module mmutils.thread_pool;
import ecs.atomic;
import bubel.ecs.atomic;
//import core.stdc.stdio;
//import core.stdc.stdlib : free, malloc, realloc;
@ -32,7 +32,7 @@ else
version (D_BetterC)
{
import ecs.std;
import bubel.ecs.std;
extern (C) __gshared int _d_eh_personality(int, int, size_t, void*, void*)
{
return 0;

View file

@ -6,9 +6,9 @@ import cimgui.cimgui;
import game_core.job_updater;
import ecs.manager;
import ecs.core;
import ecs.std;
import bubel.ecs.manager;
import bubel.ecs.core;
import bubel.ecs.std;
import ecs_utils.gfx.renderer;
import ecs_utils.imgui_bind;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,12 +6,12 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import ecs.vector;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import bubel.ecs.vector;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -6,11 +6,11 @@ import bindbc.sdl;
import cimgui.cimgui;
import ecs.attributes;
import ecs.core;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import ecs_utils.gfx.texture;
import ecs_utils.math.vector;

View file

@ -1,13 +1,13 @@
module game_core.job_updater;
import ecs.std;
import ecs.vector;
import ecs.atomic;
import bubel.ecs.std;
import bubel.ecs.vector;
import bubel.ecs.atomic;
import ecs_utils.utils;
//import core.time;
import ecs.manager;
import bubel.ecs.manager;
import mmutils.thread_pool;
version(LDC)

View file

@ -4,10 +4,10 @@ import app;
import cimgui.cimgui;
import ecs.std;
import ecs.system;
import ecs.vector;
import ecs.entity;
import bubel.ecs.std;
import bubel.ecs.system;
import bubel.ecs.vector;
import bubel.ecs.entity;
import gui.system;
import gui.template_;

View file

@ -1,6 +1,6 @@
module gui.system;
import ecs.system;
import bubel.ecs.system;
struct SystemGUI
{

View file

@ -1,6 +1,6 @@
module gui.template_;
import ecs.entity;
import bubel.ecs.entity;
struct TemplateGUI
{

View file

@ -1,6 +1,6 @@
module ecs_utils.gfx.buffer;
import ecs.std;
import bubel.ecs.std;
import glad.gl.gl;
import glad.gl.gles2;

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.config;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
import ecs_utils.gfx.material;
import ecs_utils.gfx.mesh;
@ -18,7 +18,7 @@ enum LayerType
sorted
}
import ecs.vector;
import bubel.ecs.vector;
static struct GfxConfig
{

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.material;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
import ecs_utils.gfx.shader;

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.mesh;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
import ecs_utils.gfx.buffer;

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.renderer;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
//import ecs_utils.core : Backend;
import ecs_utils.gfx.buffer;

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.shader;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
import glad.gl.gl;

View file

@ -2,7 +2,7 @@ module ecs_utils.gfx.texture;
import bindbc.sdl;
import ecs.std;
import bubel.ecs.std;
import ecs_utils.math.vector;

View file

@ -1,6 +1,6 @@
module ecs_utils.gfx.vertex;
import ecs.std;
import bubel.ecs.std;
struct Vertex
{

View file

@ -1,21 +1,21 @@
project('DECS', 'd')
src = [
'source/ecs/atomic.d',
'source/ecs/attributes.d',
'source/ecs/block_allocator.d',
'source/ecs/core.d',
'source/ecs/entity.d',
'source/ecs/events.d',
'source/ecs/hash_map.d',
'source/ecs/id_manager.d',
'source/ecs/manager.d',
'source/ecs/package.d',
'source/ecs/simple_vector.d',
'source/ecs/std.d',
'source/ecs/system.d',
'source/ecs/traits.d',
'source/ecs/vector.d'
'source/bubel/ecs/atomic.d',
'source/bubel/ecs/attributes.d',
'source/bubel/ecs/block_allocator.d',
'source/bubel/ecs/core.d',
'source/bubel/ecs/entity.d',
'source/bubel/ecs/events.d',
'source/bubel/ecs/hash_map.d',
'source/bubel/ecs/id_manager.d',
'source/bubel/ecs/manager.d',
'source/bubel/ecs/package.d',
'source/bubel/ecs/simple_vector.d',
'source/bubel/ecs/std.d',
'source/bubel/ecs/system.d',
'source/bubel/ecs/traits.d',
'source/bubel/ecs/vector.d'
]
tests_src = [

View file

@ -7,7 +7,7 @@ Emscripten functions are contained in API similar to druntime.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.atomic;
module bubel.ecs.atomic;
version(Emscripten)version = ECSEmscripten;

View file

@ -20,7 +20,7 @@ Struct EntitiesData
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.attributes;
module bubel.ecs.attributes;
///Used to mark optional components for system.
enum optional = "optional";

View file

@ -6,10 +6,10 @@ Module contain memory allocator.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.block_allocator;
module bubel.ecs.block_allocator;
import ecs.manager;
import ecs.std;
import bubel.ecs.manager;
import bubel.ecs.std;
/************************************************************************************************************************
Allocator allocate large blocks and return smaller blocks. When there is no more blocks then next large block is allocated.

View file

@ -49,10 +49,10 @@ Struct System1
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.core;
module bubel.ecs.core;
public import ecs.manager;
public import ecs.entity;
public import bubel.ecs.manager;
public import bubel.ecs.entity;
/************************************************************************************************************************
Main struct used as namespace for templates.

View file

@ -4,10 +4,10 @@ Entity module.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.entity;
module bubel.ecs.entity;
import ecs.system;
import ecs.manager;
import bubel.ecs.system;
import bubel.ecs.manager;
/************************************************************************************************************************
Entity ID structure. Used as reference to Entity. Pointer to entity should be ever used to store entity reference!

View file

@ -1,9 +1,9 @@
module ecs.events;
module bubel.ecs.events;
import ecs.block_allocator;
import ecs.entity;
import ecs.manager;
import ecs.std;
import bubel.ecs.block_allocator;
import bubel.ecs.entity;
import bubel.ecs.manager;
import bubel.ecs.std;
import std.algorithm.comparison : max;

View file

@ -1,9 +1,9 @@
module ecs.hash_map;
module bubel.ecs.hash_map;
import std.traits;
import ecs.vector;
import ecs.traits;
import bubel.ecs.vector;
import bubel.ecs.traits;
enum doNotInline = "version(DigitalMars)pragma(inline,false);version(LDC)pragma(LDC_never_inline);";

View file

@ -1,10 +1,10 @@
module ecs.id_manager;
module bubel.ecs.id_manager;
import ecs.entity;
import ecs.std;
import ecs.vector;
import bubel.ecs.entity;
import bubel.ecs.std;
import bubel.ecs.vector;
import ecs.atomic;
import bubel.ecs.atomic;
import core.stdc.string : memcpy;
/************************************************************************************************************************

View file

@ -4,7 +4,7 @@ Most important module. Almost every function is called from EntityManager.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.manager;
module bubel.ecs.manager;
import std.algorithm : max;
import std.conv : to;
@ -14,21 +14,21 @@ import std.traits;
//import core.stdc.stdlib : qsort;
//import core.stdc.string;
import ecs.system; //not ordered as forward reference bug workaround
import ecs.block_allocator;
import ecs.entity;
import ecs.events;
import ecs.hash_map;
import ecs.id_manager;
import ecs.simple_vector;
import ecs.std;
import ecs.traits;
import ecs.vector;
import ecs.atomic;
import bubel.ecs.system; //not ordered as forward reference bug workaround
import bubel.ecs.block_allocator;
import bubel.ecs.entity;
import bubel.ecs.events;
import bubel.ecs.hash_map;
import bubel.ecs.id_manager;
import bubel.ecs.simple_vector;
import bubel.ecs.std;
import bubel.ecs.traits;
import bubel.ecs.vector;
import bubel.ecs.atomic;
export alias gEM = EntityManager.instance;
export alias gEntityManager = EntityManager.instance;
alias SerializeVector = ecs.vector.Vector!ubyte;
alias SerializeVector = bubel.ecs.vector.Vector!ubyte;
/************************************************************************************************************************
Entity manager is responsible for everything.

View file

@ -0,0 +1,10 @@
module ecs;
public import bubel.ecs.core;
public import bubel.ecs.entity;
public import bubel.ecs.manager;
public import bubel.ecs.system;
import bubel.ecs.events;
import bubel.ecs.id_manager;
import bubel.ecs.std;

View file

@ -1,6 +1,6 @@
module ecs.simple_vector;
module bubel.ecs.simple_vector;
import ecs.std;
import bubel.ecs.std;
//import core.stdc.string;

View file

@ -5,7 +5,7 @@ This module contain implementation of standard functionality.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.std;
module bubel.ecs.std;
version(Emscripten)version = ECSEmscripten;

View file

@ -4,10 +4,10 @@ System module.
Copyright: Copyright © 2018-2019, Dawid Masiukiewicz, Michał Masiukiewicz
License: BSD 3-clause, see LICENSE file in project root folder.
*/
module ecs.system;
module bubel.ecs.system;
import ecs.entity;
import ecs.manager;
import bubel.ecs.entity;
import bubel.ecs.manager;
/************************************************************************************************************************
System contain data required to proper glue EntityManager with Systems.

View file

@ -1,4 +1,4 @@
module ecs.traits;
module bubel.ecs.traits;
import std.traits;

View file

@ -1,8 +1,8 @@
module ecs.vector;
module bubel.ecs.vector;
import core.bitop;
//import core.stdc.stdlib : free, malloc;
import ecs.std;
import bubel.ecs.std;
//import core.stdc.string : memcpy, memset;
//import std.algorithm : swap;
import std.conv : emplace;

View file

@ -1,10 +0,0 @@
module ecs;
public import ecs.core;
public import ecs.entity;
public import ecs.manager;
public import ecs.system;
import ecs.events;
import ecs.id_manager;
import ecs.std;

View file

@ -1,9 +1,9 @@
module tests.basic;
import ecs.core;
import ecs.manager;
import ecs.system;
import ecs.attributes;
import bubel.ecs.core;
import bubel.ecs.manager;
import bubel.ecs.system;
import bubel.ecs.attributes;
import std.array : staticArray;

View file

@ -1,7 +1,7 @@
module tests.id_manager;
import ecs.id_manager;
import ecs.entity;
import bubel.ecs.id_manager;
import bubel.ecs.entity;
unittest
{

View file

@ -5,9 +5,9 @@ import core.stdc.stdio;
import core.stdc.string;
import core.sys.posix.setjmp;
import ecs.vector;
import ecs.simple_vector;
import ecs.std;
import bubel.ecs.vector;
import bubel.ecs.simple_vector;
import bubel.ecs.std;
enum int ASSERTED = 123;
enum string OUT_FILE = "test_report.xml";

View file

@ -3,12 +3,12 @@ module tests.tests;
import std.experimental.allocator;
import std.experimental.allocator.mallocator;*/
import ecs.entity;
import ecs.events;
import ecs.manager;
import ecs.system;
import ecs.attributes;
import ecs.core;
import bubel.ecs.entity;
import bubel.ecs.events;
import bubel.ecs.manager;
import bubel.ecs.system;
import bubel.ecs.attributes;
import bubel.ecs.core;
version (WebAssembly)
{
@ -714,7 +714,7 @@ else:
//foreach(i; 0..1_000_000)gEM.removeEntity(gEM.addEntity(tmpl).id);
import ecs.std;
import bubel.ecs.std;
EntityID[] idss = Mallocator.makeArray!EntityID(5000); //[5000]
//scope(exit)Mallocator.dispose(idss);

View file

@ -1,7 +1,7 @@
module tests.vector;
import ecs.simple_vector;
//import ecs.vector;
import bubel.ecs.simple_vector;
//import bubel.ecs.vector;
@("simple-vector")
unittest