minor changes
This commit is contained in:
@@ -176,7 +176,8 @@ class basic_observer {
|
||||
template<std::size_t Index>
|
||||
static void maybe_valid_if(basic_observer *obs, const basic_registry<Entity> ®, const Entity entt) {
|
||||
if(reg.template has<Require...>(entt) && !(reg.template has<Reject>(entt) || ...)) {
|
||||
(obs->view.has(entt) ? obs->view.get(entt) : obs->view.construct(entt)) |= (1 << Index);
|
||||
auto *comp = obs->view.try_get(entt);
|
||||
(comp ? *comp : obs->view.construct(entt)) |= (1 << Index);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,7 +211,8 @@ class basic_observer {
|
||||
if(reg.template has<AllOf...>(entt) && !(reg.template has<NoneOf>(entt) || ...)
|
||||
&& reg.template has<Require...>(entt) && !(reg.template has<Reject>(entt) || ...))
|
||||
{
|
||||
(obs->view.has(entt) ? obs->view.get(entt) : obs->view.construct(entt)) |= (1 << Index);
|
||||
auto *comp = obs->view.try_get(entt);
|
||||
(comp ? *comp : obs->view.construct(entt)) |= (1 << Index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class sparse_set {
|
||||
using traits_type = entt_traits<Entity>;
|
||||
|
||||
static_assert(ENTT_PAGE_SIZE && ((ENTT_PAGE_SIZE & (ENTT_PAGE_SIZE - 1)) == 0));
|
||||
static constexpr auto entt_per_page = ENTT_PAGE_SIZE / sizeof(typename entt_traits<Entity>::entity_type);
|
||||
static constexpr auto entt_per_page = ENTT_PAGE_SIZE / sizeof(typename traits_type::entity_type);
|
||||
|
||||
class iterator {
|
||||
friend class sparse_set<Entity>;
|
||||
|
||||
Reference in New Issue
Block a user