Просмотр исходного кода

work around for a bug of msvc (close #212)

Michele Caini 7 лет назад
Родитель
Сommit
4f6cab9a45
2 измененных файлов с 7 добавлено и 8 удалено
  1. 2 1
      TODO
  2. 5 7
      src/entt/entity/registry.hpp

+ 2 - 1
TODO

@@ -22,7 +22,8 @@
 * review sparse set to allow customization (mix pack in the spec, base is position only)
   - non-owning groups can iterate pages and skip empty ones, this should mitigate the lack of the packed array
 * review 64 bit id: user defined area + dedicated member on the registry to set it
-* events on replace, so that one can track updated components? indagate impact
+* events on replace, so that one can track updated components
+  - introduce ENTT_REPLACE_ONLY mode
   - define basic reactive systems (track entities to which component is attached, track entities from which component is removed, and so on)
   - define systems as composable mixins (initializazion, reactive, update, whatever) with flexible auto-detected arguments (registry, views, etc)
   - from Tommaso on discord view<Health, Transform>().where<Health>([](h) {h > 5}).where<Transform>([](t) {t.inside(aabb)});

+ 5 - 7
src/entt/entity/registry.hpp

@@ -162,19 +162,17 @@ class basic_registry {
     };
 
     struct owning_group_data {
-        using match_fn_type = bool(ENTT_ID_TYPE);
         std::unique_ptr<boxed_owned> data;
-        match_fn_type *exclude;
-        match_fn_type *get;
-        match_fn_type *owned;
+        bool(* exclude)(ENTT_ID_TYPE);
+        bool(* get)(ENTT_ID_TYPE);
+        bool(* owned)(ENTT_ID_TYPE);
         std::size_t extent;
     };
 
     struct non_owning_group_data {
-        using match_fn_type = bool(ENTT_ID_TYPE);
         std::unique_ptr<sparse_set<Entity>> data;
-        match_fn_type *exclude;
-        match_fn_type *get;
+        bool(* exclude)(ENTT_ID_TYPE);
+        bool(* get)(ENTT_ID_TYPE);
         std::size_t extent;
     };