Commit graph

177 commits

Author SHA1 Message Date
cd1f81127a Workaround for issue with hasMember and opDispatch 2023-04-23 21:52:18 +02:00
3a3a9e0341 Add @nogc UDA, fix some small issues, xmake changes
-add @nogc to some functions where it was missing
-fix compilation issue in mallocator
-fix Meson build
-some work on xmake build
2023-03-23 22:31:20 +01:00
0702b007d1 Fix unregisterSystem function
and add function to get m_system_pointer from System
2023-03-09 11:04:12 +01:00
ed0603a675 Update copyright notice 2023-01-18 14:40:59 +01:00
c2ba4c632a Fixes
-Assert if callEntitiesFunction is called for system which is not alive
-cleanup and formatting
2022-11-12 12:10:09 +01:00
5f4ba90b3e Add unregisterSystem functionality 2022-11-10 10:54:23 +01:00
7a614686c8 Export id generated by becsID 2022-11-08 22:05:57 +01:00
c0246ce2af Syntax '*ptr = Structure.init' requires opAssign operator, get rid of this requirement by using malloc.
This is useful when component is defined in another shared library and we use '-fvisibility=hidden', in that case opAssign is hidden and we will get 'undefined symbol'
2022-10-27 23:29:50 +02:00
56ce8c3f9c Don't use ForeachType as it don't work if foreach type is not copyable.
This fixes compilation error:
include/d/std/traits.d:8024: Error: Generating an `inout` copy constructor for `struct game.graphic.manager.Graphic` failed, therefore instances of it are uncopyable
2022-10-04 22:18:45 +02:00
24a07a05e5 Small fixes 2022-07-09 20:27:01 +00:00
85e1f8a76e Fixed bug with addComponents template
-deprecated Comonent.ref_ function
-remover Comonent.ref_ usage from addComponents template
-updated dub.json
2021-11-17 15:03:25 +01:00
cc097dddf0 Minor fixes 2021-05-09 16:46:11 +00:00
fa0c196c60 -code cleanup
-some documentation improvements
-README update
2021-03-06 22:02:49 +01:00
3b954b732b -update README code example (to one that compile)
-remove Entity.instance and gEM, global manager is now gEntityManager
2021-03-02 19:44:18 +01:00
1acd0df0ef Merge branch 'master' of https://gitlab.com/Mergul/bubel-ecs.git into Demos 2021-02-27 17:43:05 +01:00
8b2793fc57 Merge branch 'master' of https://gitlab.com/Mergul/bubel-ecs.git into remove_structure_top_mixin
# Conflicts:
#	tests/basic.d
2021-02-27 17:30:31 +01:00
a6d92cb21b -change ecsID to becsID
-change component_id/system_id to becsID in demos
2021-02-27 17:25:13 +01:00
66b5807368 Improve meson build.
-Add all required packages as wrap dependencies
-Move source lsitnings to separate files
-Proper dependencies declarations
-Set global D compiler arguments
-Add few asserts
-Add test exe
-Other small improvements

Tested with dmd with betterC, demos executable has to be run from 'demos' directory to properly load assets.
2021-02-21 20:44:58 +01:00
3c1c67efd0 -added filterEntity callback (used to filter EntityInfos for system, better control than simply @optional)
-removed some redundant code (two times same code)
-added some common functions
2021-01-03 13:05:48 +01:00
a926b79223 -add ecsID template function (get Component/System/Event ID, passes tests)
-removed some ECS mixins code
2020-09-29 18:41:31 +02:00
13c82acad4 -removed some unused code 2020-09-25 10:50:11 +02:00
8960423935 ECS fixes
-fixed bug with addEntityCopy (on create was called for bad entity, and incorrect block was added to update)
-added function to retrieve Component pointer from Entity (not  template function)
-fixed thread_pool bug
2020-08-22 11:37:23 +02:00
96bbcb9956 Fixed issues and bugs
-moved system destroy functionality to System structure "destroy()" function
-now arrays are properly destroyed (with destructor calling (__xdtor))
-fixed bug which makes BlockAllocator crashing after freeing it's memory
-fixed many smaller memory leaks
2020-07-17 13:34:08 +02:00
a0efa4e67d Fixed unittests and betterC compilation (after adding fullyQualifiedName instead of simple stringof)
-added new trait to get full name of structure (witho module and package, not tested on more nested packages)
-some small improvements (like adding const to function which need it)
2020-07-08 22:04:13 +02:00
ef4faf2755 Changed Components/System/Events names to full name (with module) and fixed bug with flag 2020-07-01 19:26:47 +02:00
ffc19d4723 Better multithread jobs generation tests 2020-06-15 22:28:55 +02:00
3e7575c4b2 Bug fixes
-fix: UnittestRunner don't catch RangeError
-fix: sometimes onUpdate was called with empty array of entities
2020-06-15 17:21:29 +02:00
8cba2626be Added entity filering support and fixed minor bug 2020-06-10 15:35:42 +02:00
13e6ed8fd5 ECS core imprevement
-Adedd function to resize array to Mallocator
-significant speed up for first time ID allocation by using resizeArray instead of makeArray
-fix: onUpdate called with zero length arrays
-call updateBlocks before updateEvents (it's more accurate behaviour)
-some minore fixes
-fixed meson.build for GDC
2020-06-06 22:26:59 +02:00
66860b9042 Android update and small improvements
-fixed code do cross compiling to android
-fixed build with GCC (workaround)
-added little benchmark
-several small fixes
-updated meson build (demos building, working with GCC, LDC and DMD)
-added some meson options
-added ImGUI bind for OpenGL3
2020-06-01 11:24:50 +02:00
7a0ddf7494 Bugfix update
-fixed critical bug with adding entities
-fixed small bug with adding entity with replacement components which entity hasn't
-added multiple asserts to faster bug detection in future
2020-05-28 15:53:05 +02:00
3719cdaee0 Some small fixes 2020-05-28 09:39:17 +02:00
f964d7bf85 Added more tests
-added Vector test
-added HashMap test
-added EntityMeta test
-added default hashing function to hashmap
2020-05-27 19:46:11 +02:00
6929f5a748 Mostly bugfix update + empty components support and remove EntityID from Event structure
-empty components now take no memory, so flag components is now far better
-added test for critical bug
-fixed critical bug with adding/removing entities form inside events
-fixed small bug with TestRunner
-improve basic tests
-fixed betterC compilation on DMD
-remove EntityID form Event structure
-added "return" attribute to some functions
-moved some code from Tempalte side to actual implementation
-fixed bug with EntityTemplate copying
-commented out some possibliy unused code
-use code formatter
2020-05-27 17:03:44 +02:00
15cd57dbcb Basic update, multithreading emplate support, fixed
-Added possibility to add entity form template + components to replace template data
-basic tests for new functionality
-small performance improvement for events
-added ComponentRef structure which contain data pointer and component ID
-now events are called before entities removing
2020-05-24 21:57:48 +02:00
233f4abd47 Added job_id parameter to EntitiesData (index of currently executing job) 2020-05-23 10:53:36 +02:00
43f8755a39 Fixed ECS bug related to adding/removing entities inside onAdd/onRemove entity callback
Now whole committing process is called in specific order:
 - UpdateBlocks
 - ChangeEntities
 - RemoveEntities
 - HandleEvents
Whole process is repeated until there will be no more changes to commit
2020-05-22 15:44:31 +02:00
9589a5cb2d FIxed GDC compilation (basic betterC WIP) and some improvements
-fixed issue with adding/removing entities inside events handling
-fixed EntityMeta.getComponent() (added check if component_id is valid)
-added function hasComponent to entity to check if component exists
2020-05-14 22:18:57 +02:00
dd491302af Fixed system reregistration issue and added funtion to allocate EntityTEmplate as copy of different teamplte 2020-05-13 15:31:26 +02:00
1b925b7ab1 Change component name from "modified" to "writable" 2020-05-12 17:30:57 +02:00
5e884352ba Add support for external depencencies 2020-05-12 17:28:31 +02:00
f6e7af1014 Some preformance tests and added EntityMeta structure 2020-05-07 21:58:34 +02:00
4bd5a37b5d Demo update and start counting tests times
-Fixed performance issue with multithreading and rendering
-start making better shaders (by using many macros)
-speed up rendeing when maximum objects count was reached
-remove map rendering form Snake demo, and render entities by themself
-start adding depth and color rendering parameters
-added properly names to jobs (for debugging purpses)
-starts adding multithreaded rendering
-added some math to vectors
-changes execute() to willExecute(). Probably should have different name.
2020-05-07 14:07:07 +02:00
46aba822d0 Improved documentation and removed some old code 2020-05-06 10:55:40 +02:00
5411e97cb1 Move ECS to Bubel module 2020-05-05 16:56:51 +02:00
54a6d5dec2 CI and common update:
-added webpage deploymnet stage
-added separate build stage which build all binaries and generate documentation
-added Emscripten build stage for merge to master only
-added VBO batch rendering (current default, no render mode switch yet)
-fixed camera positioning calculation
-fixed buffer issue with WebGL
-added viewport scalling (at least 300 pixels height). Pixels are scalled if screen is bigger.
-center demos gameplay area
-added fullpage html template for Emscripten build
2020-05-01 19:26:21 +00:00
b434d851ed CIUpdate
- added build test
 - probably fixed some trash
- coverage test should only wait for test_dmd_debug
2020-04-25 11:09:35 +00:00
f7a1e9bd05 More test and fixes:
-added test for addEntityCopy
-test order of onAddEntity, onRemoveEntity, onChangeEntity callbacks calls
-testing onAddEntity, onRemoveEntity, onChangeEntity callback
-test callEntityFunction call
-fixed bug with crashing ECS (setting callers for entity change callbacks)
-commented debug asserts conering duplicated components ids (to further consideration)
2020-04-22 16:23:42 +02:00
cb9eaad123 More tests:
-removed some unused code
-fixed bug with struct destructors (Mallocator called __dtor instead of __xdtor)
-added unittests for events
-addded _d_eh_personality null implementation as LDC betterC bug workaround
2020-04-18 19:16:45 +02:00
d0b7138f9f More tests:
-fixed bug in EntityManger.addComponents
-added many new tests
2020-04-17 17:17:37 +02:00