Commit graph

26 commits

Author SHA1 Message Date
Stephen Gutekanst
7602bb5357 ecs: fix tests
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
026639da6d ecs: revamp module state API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
8ff02361da ecs: rename World.remove -> World.removeEntity; provide guidance on event names
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
de398b0fde ecs: avoid @tagName failure on empty union field
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
0bae4b00bd ecs: add type-safe module wrapper/helper
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
5c1414efb5 ecs: remove Module.update in favor of "one method per message" handler pattern
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
fcf9943d0f ecs: rename module globals -> state
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
6f499aa418 ecs: improve comptime error messages with empty sets
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
4575080ca9 ecs: simplify how modules are written
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
f153133c30 {mach,ecs}: pass World to ECS event handlers
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Stephen Gutekanst
2879ad58b0 ecs: replace world.tick() with generic world.send(.tick) message passing
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-03-27 09:29:47 -07:00
Aksel Hjerpbakk
2b6f3fb1d9
all: fix issue with glfw vulkan createWindowSurface; update to new for loop syntax (#713) 2023-03-01 18:33:17 -07:00
Stephen Gutekanst
2532436170 ecs: cleanup documentation
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-28 14:00:21 -07:00
Ali Chraghi
168a84805a ecs: saturated add
Fixes #409
2023-01-15 08:31:26 -07:00
Aaron Winter
f5d9b1ee57
ecs: store column values as independent arrays (#642)
* get column values from separate functions
* split ArchetypeStorage.block into blocks per component type
* ecs: remove allocator field from ArchetypeStorage
* ecs: remove whitespace
* ecs: correct suspicious index operation in setRow
* add back zero-size ColumnType check; bring back reliance on component names
* ecs: validate setRaw length matches
* ecs: fix failing test & move values slice into Column type

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
2023-01-02 00:54:10 -07:00
Benjaaaa
052d3a7da8
mach: fix compiler error regarding zig changes (#645) 2022-12-25 13:19:48 -07:00
Aaron Winter
8aa2c97079
ecs: improve formatting (#643) 2022-12-18 03:21:11 -07:00
Aaron Winter
72ef60c8c2
ecs: fix segfault in Entities.deinit (#629)
Co-authored-by: Aaron Winter <wintera@Aarons-MacBook-Pro.local>
2022-11-26 20:53:44 -07:00
Aaron Winter
a06ac6356d
ecs: rename sort function to be camelCase (#628)
Co-authored-by: Aaron Winter <wintera@Aarons-MacBook-Pro.local>
2022-11-26 20:42:15 -07:00
Stephen Gutekanst
dad8757d3a ecs: remove stage1 compiler bug workaround
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-10-15 07:55:15 -07:00
locriacyber
b8c48d6321
all: remove ineffective _ = variable assignments (#530)
Lastest Zig complains about this, so they must removed to build.
2022-09-14 09:42:29 -07:00
Stephen Gutekanst
8113ca370d all: remove support for stage1
With almost all tests/examples working on all platforms now with the new compiler,
https://github.com/hexops/mach/issues/180, it's time to remove stage1 support.

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-10 00:09:30 -07:00
Stephen Gutekanst
f1ae31ae86 ecs: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-09 21:23:51 -07:00
Stephen Gutekanst
0a1ff43ce5 ecs: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-08 10:22:11 -07:00
Stephen Gutekanst
54719c2de8 ecs: improve compatibility with self-hosted compiler
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-09-08 07:26:15 -07:00
Stephen Gutekanst
0645429df9 all: move standalone libraries to libs/ subdirectory
The root dir of our repository has grown quite a lot the past few months.

I'd like to make it more clear where the bulk of the engine lives (`src/`) and
also make it more clear which Mach libraries are consumable as standalone projects.

As for the name of this directory, `libs` was my first choice but there's a bit of
a convention of that being external libraries in Zig projects _today_, while these
are libraries maintained as part of Mach in this repository - not external ones.

We will name this directory `libs`, and if we have a need for external libraries
we will use `external` or `deps` for that directory name. I considered other names
such as `components`, `systems`, `modules` (which are bad as they overlap with
major ECS / engine concepts), and it seems likely the official Zig package manager
will break the convention of using a `libs` dir anyway.

Performed via:

```sh
mkdir libs/
git mv freetype libs/
git mv basisu libs/
git mv gamemode libs/
git mv glfw libs/
git mv gpu libs/
git mv gpu-dawn libs/
git mv sysaudio libs/
git mv sysjs libs/
git mv ecs libs/
```

git-subtree-dir: glfw
git-subtree-mainline: 0d5b853443
git-subtree-split: 572d1144f11b353abdb64fff828b25a4f0fbb7ca

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>

git mv ecs libs/

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
2022-08-26 15:12:04 -07:00