From: Israël Hallé Date: Mon, 4 Aug 2014 20:03:32 +0000 (-0400) Subject: Uses bitmask function to set bit X-Git-Url: https://code.bitgloo.com/?a=commitdiff_plain;h=84a899775b86a1e44b2327cb35ef45a393f161d6;p=clyne%2Fentityx.git Uses bitmask function to set bit --- diff --git a/entityx/Entity.h b/entityx/Entity.h index e4192db..7312e25 100644 --- a/entityx/Entity.h +++ b/entityx/Entity.h @@ -506,7 +506,7 @@ class EntityManager : entityx::help::NonCopyable { Pool *pool = accomodate_component(); new(pool->get(id.index())) C(std::forward(args) ...); ComponentHandle component(this, id); - entity_component_mask_[id.index()] |= uint64_t(1) << family; + entity_component_mask_[id.index()].set(family); event_manager_.emit>(Entity(this, id), component); return component; } @@ -524,7 +524,7 @@ class EntityManager : entityx::help::NonCopyable { ComponentHandle component(this, id); BasePool *pool = component_pools_[family]; event_manager_.emit>(Entity(this, id), component); - entity_component_mask_[id.index()] &= ~(uint64_t(1) << family); + entity_component_mask_[id.index()].reset(family); pool->destroy(index); }