Skip to content

Commit 846df9f

Browse files
authored
Merge branch 'skypjack:master' into polymorphic
2 parents a0e9a1c + ebc0c18 commit 846df9f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+15173
-9760
lines changed

AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ceeac
1111
ColinH
1212
corystegel
1313
Croydon
14+
cschreib
1415
cugone
1516
dbacchet
1617
dBagrat
@@ -31,6 +32,7 @@ Lawrencemm
3132
markand
3233
mhammerc
3334
Milerius
35+
Minimonium
3436
morbo84
3537
m-waka
3638
netpoetica

CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ if(ENTT_INCLUDE_HEADERS)
149149
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/entity/snapshot.hpp>
150150
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/entity/sparse_set.hpp>
151151
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/entity/storage.hpp>
152-
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/entity/utility.hpp>
153152
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/entity/view.hpp>
154153
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/locator/locator.hpp>
155154
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/meta/adl_pointer.hpp>
@@ -173,8 +172,8 @@ if(ENTT_INCLUDE_HEADERS)
173172
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/process/scheduler.hpp>
174173
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/resource/cache.hpp>
175174
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/resource/fwd.hpp>
176-
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/resource/handle.hpp>
177175
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/resource/loader.hpp>
176+
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/resource/resource.hpp>
178177
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/signal/delegate.hpp>
179178
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/signal/dispatcher.hpp>
180179
$<BUILD_INTERFACE:${EnTT_SOURCE_DIR}/src/entt/signal/emitter.hpp>

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
[![Discord channel](https://img.shields.io/discord/707607951396962417?logo=discord)](https://discord.gg/5BjPWBd)
1212
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg)](https://www.paypal.me/skypjack)
1313

14+
> `EnTT` has been a dream so far, we haven't found a single bug to date and it's
15+
> super easy to work with
16+
1417
`EnTT` is a header-only, tiny and easy to use library for game programming and
1518
much more written in **modern C++**.<br/>
1619
[Among others](https://github.com/skypjack/entt/wiki/EnTT-in-Action), it's used

TODO

+18-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
* debugging tools (#60): the issue online already contains interesting tips on this, look at it
22
* work stealing job system (see #100) + mt scheduler based on const awareness for types
3-
* add examples (and credits) from @alanjfs :)
3+
4+
EXAMPLES
5+
* filter on runtime values/variables (not only types)
6+
* support to polymorphic types (see #859)
7+
8+
DOC:
9+
* storage<void>
10+
* custom storage/view
11+
* examples (and credits) from @alanjfs :)
412

513
WIP:
6-
* get rid of storage_traits class template
7-
* uses-allocator construction: any (with allocator support), cache, poly, ...
8-
* add an ENTT_NOEXCEPT with args and use it to make ie compressed_pair conditionally noexcept
14+
* remove storage::base_type, make views extract the sparse set directly
15+
* make non-const registry::get use const assure or the like
16+
* emitter: runtime handlers, allocator support (ready for both already)
17+
* view/group: no storage_traits dependency -> use storage instead of components for the definition
18+
* basic_storage::bind for cross-registry setups
19+
* uses-allocator construction: any (with allocator support), poly, ...
920
* process scheduler: reviews, use free lists internally
10-
* runtime events (emitter)
1121
* iterator based try_emplace vs try_insert for perf reasons
1222
* dedicated entity storage, in-place O(1) release/destroy for non-orphaned entities, out-of-sync model
1323
* entity-only and exclude-only views
14-
* custom allocators all over
15-
16-
WIP:
24+
* custom allocators all over (registry, ...)
25+
* consider removing ENTT_NOEXCEPT, use ENTT_NOEXCEPT_IF (or noexcept(...)) as appropriate in any case (ie make compressed_pair conditionally noexcept)
26+
* add test for maximum number of entities reached
1727
* add user data to type_info
18-
* write documentation for custom storages and views!!
1928
* make runtime views use opaque storage and therefore return also elements.
2029
* entity-aware observer, add observer functions aside observer class
2130
* deprecate non-owning groups in favor of owning views and view packs, introduce lazy owning views

docs/md/config.md

+23-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
* [Introduction](#introduction)
99
* [Definitions](#definitions)
10-
* [ENTT_NOEXCEPTION](#entt_noexcept)
10+
* [ENTT_NOEXCEPTION](#entt_noexception)
11+
* [ENTT_NOEXCEPT](#entt_noexcept)
1112
* [ENTT_USE_ATOMIC](#entt_use_atomic)
1213
* [ENTT_ID_TYPE](#entt_id_type)
1314
* [ENTT_SPARSE_PAGE](#entt_sparse_page)
@@ -40,18 +41,24 @@ will remain stable over time unlike the options below.
4041

4142
## ENTT_NOEXCEPTION
4243

43-
This parameter can be used to switch off exception handling in `EnTT`.<br/>
44-
To do this, simply define the variable without assigning any value to it. This
45-
is roughly equivalent to setting the compiler flag `-ff-noexceptions`.
44+
Define this variable without assigning any value to it to turn off exception
45+
handling in `EnTT`.<br/>
46+
This is roughly equivalent to setting the compiler flag `-fno-exceptions` but is
47+
also limited to this library only.
48+
49+
## ENTT_NOEXCEPT
50+
51+
The purpose of this parameter is to suppress the use of `noexcept` by this
52+
library.<br/>
53+
To do this, simply define the variable without assigning any value to it.
4654

4755
## ENTT_USE_ATOMIC
4856

4957
In general, `EnTT` doesn't offer primitives to support multi-threading. Many of
50-
the features can be split over multiple threads without any explicit control and
51-
the user is the only one who knows if and when a synchronization point is
52-
required.<br/>
53-
However, some features aren't easily accessible to users and can be made
54-
thread-safe by means of this definition.
58+
the feature can be split over multiple threads without any explicit control and
59+
the user is the one who knows if a synchronization point is required.<br/>
60+
However, some feature aren't easily accessible to users and are made thread-safe
61+
by means of this definition.
5562

5663
## ENTT_ID_TYPE
5764

@@ -70,9 +77,9 @@ power of 2.
7077

7178
## ENTT_PACKED_PAGE
7279

73-
Similar to sparse arrays, packed arrays of components are paginated as well. In
74-
However, int this case the aim isn't to reduce memory usage but to have pointer
75-
stability upon component creation.<br/>
80+
As it happens with sparse arrays, packed arrays are also paginated. However, in
81+
this case the aim isn't to reduce memory usage but to have pointer stability
82+
upon component creation.<br/>
7683
Default size of pages (that is, the number of elements they contain) is 1024 but
7784
users can adjust it if appropriate. In all case, the chosen value **must** be a
7885
power of 2.
@@ -83,8 +90,8 @@ For performance reasons, `EnTT` doesn't use exceptions or any other control
8390
structures. In fact, it offers many features that result in undefined behavior
8491
if not used correctly.<br/>
8592
To get around this, the library relies on a lot of asserts for the purpose of
86-
detecting errors in debug builds. By default, it uses `assert` internally, but
87-
users are allowed to overwrite its behavior by setting this variable.
93+
detecting errors in debug builds. By default, it uses `assert` internally. Users
94+
are allowed to overwrite its behavior by setting this variable.
8895

8996
### ENTT_DISABLE_ASSERT
9097

@@ -105,7 +112,7 @@ dedicated storage for them.
105112

106113
`EnTT` mixes non-standard language features with others that are perfectly
107114
compliant to offer some of its functionalities.<br/>
108-
This definition will prevent the library from using non-standard techniques,
109-
that is, functionalities that aren't fully compliant with the standard C++.<br/>
115+
This definition prevents the library from using non-standard techniques, that
116+
is, functionalities that aren't fully compliant with the standard C++.<br/>
110117
While there are no known portability issues at the time of this writing, this
111118
should make the library fully portable anyway if needed.

docs/md/core.md

+19-6
Original file line numberDiff line numberDiff line change
@@ -559,14 +559,27 @@ require to enable RTTI.<br/>
559559
Therefore, they can sometimes be even more reliable than those obtained
560560
otherwise.
561561
562-
A type info object is an opaque class that is also copy and move constructible.
563-
Objects of this class are returned by the `type_id` function template:
562+
Its type defines an opaque class that is also copyable and movable.<br/>
563+
Objects of this type are generally returned by the `type_id` functions:
564564
565565
```cpp
566+
// by type
566567
auto info = entt::type_id<a_type>();
568+
569+
// by value
570+
auto other = entt::type_id(42);
571+
```
572+
573+
All elements thus received are nothing more than const references to instances
574+
of `type_info` with static storage duration.<br/>
575+
This is convenient for saving the entire object aside for the cost of a pointer.
576+
However, nothing prevents from constructing `type_info` objects directly:
577+
578+
```cpp
579+
entt::type_info info{std::in_place_type<int>};
567580
```
568581
569-
These are the information made available by a `type_info` object:
582+
These are the information made available by `type_info`:
570583
571584
* The index associated with a given type:
572585
@@ -577,7 +590,7 @@ These are the information made available by a `type_info` object:
577590
This is also an alias for the following:
578591

579592
```cpp
580-
auto idx = entt::type_index<std::remove_const_t<std::remove_reference_t<a_type>>>::value();
593+
auto idx = entt::type_index<std::remove_cv_t<std::remove_reference_t<a_type>>>::value();
581594
```
582595

583596
* The hash value associated with a given type:
@@ -589,7 +602,7 @@ These are the information made available by a `type_info` object:
589602
This is also an alias for the following:
590603

591604
```cpp
592-
auto hash = entt::type_hash<std::remove_const_t<std::remove_reference_t<a_type>>>::value();
605+
auto hash = entt::type_hash<std::remove_cv_t<std::remove_reference_t<a_type>>>::value();
593606
```
594607

595608
* The name associated with a given type:
@@ -601,7 +614,7 @@ These are the information made available by a `type_info` object:
601614
This is also an alias for the following:
602615

603616
```cpp
604-
auto name = entt::type_name<std::remove_const_t<std::remove_reference_t<a_type>>>::value();
617+
auto name = entt::type_name<std::remove_cv_t<std::remove_reference_t<a_type>>>::value();
605618
```
606619

607620
Where all accessed features are available at compile-time, the `type_info` class

docs/md/entity.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1732,7 +1732,7 @@ auto group = registry.group<position, velocity>();
17321732
Filtering entities by components is also supported:
17331733

17341734
```cpp
1735-
auto group = registry.group<position, velocity>(entt::exclude<renderable>);
1735+
auto group = registry.group<position, velocity>({}, entt::exclude<renderable>);
17361736
```
17371737

17381738
Once created, the group gets the ownership of all the components specified in
@@ -1841,7 +1841,7 @@ nested groups, an excluded component type `T` is treated as being an observed
18411841
type `not_T`. Therefore, consider these two definitions:
18421842

18431843
* `registry.group<sprite, transform>()`.
1844-
* `registry.group<sprite, transform>(entt::exclude<rotation>)`.
1844+
* `registry.group<sprite, transform>({}, entt::exclude<rotation>)`.
18451845

18461846
They are treated as if users were defining the following groups:
18471847

docs/md/links.md

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ I hope this list can grow much more in the future:
2020
* [Minecraft Earth](https://www.minecraft.net/en-us/about-earth) by
2121
[Mojang](https://mojang.com/): an augmented reality game for mobile, that
2222
lets users bring Minecraft into the real world.
23+
* [Ember Sword](https://embersword.com/): a modern Free-to-Play MMORPG with a
24+
player-driven economy, a classless combat system, and scarce, tradable
25+
cosmetic collectibles.
2326
* Apparently [Diablo II: Resurrected](https://diablo2.blizzard.com/) by
2427
[Blizzard](https://www.blizzard.com/): monsters, heroes, items, spells, all
2528
resurrected. Thanks unknown insider.
@@ -153,6 +156,8 @@ I hope this list can grow much more in the future:
153156
of the Alan Wake Engine.
154157
* [Nazara Engine](https://github.com/DigitalPulseSoftware/NazaraEngine): fast,
155158
cross-platform, object-oriented API to help in daily developer life.
159+
* [Billy Engine](https://github.com/billy4479/BillyEngine): some kind of a 2D
160+
engine based on `SDL2` and `EnTT`.
156161

157162
* Articles, videos and blog posts:
158163
* [Some posts](https://skypjack.github.io/tags/#entt) on my personal

0 commit comments

Comments
 (0)