]> code.bitgloo.com Git - clyne/entityx.git/commitdiff
Changes 64 bits family to fast 32 bits
authorIsraël Hallé <israel.halle@shopify.com>
Mon, 4 Aug 2014 20:03:09 +0000 (16:03 -0400)
committerIsraël Hallé <israel.halle@shopify.com>
Tue, 5 Aug 2014 03:43:48 +0000 (23:43 -0400)
entityx/Entity.h
entityx/Event.h
entityx/System.h
entityx/config.h.in

index e36d7612eef24924f7d10aa1cad4e3eb4a98f622..e4192dbedb2a60632998ea84ed71981cfb803814 100644 (file)
@@ -212,7 +212,7 @@ private:
  */
 struct BaseComponent {
  public:
-  typedef uint64_t Family;
+  typedef size_t Family;
 
   // NOTE: Component memory is *always* managed by the EntityManager.
   // Use Entity::destroy() instead.
@@ -519,8 +519,8 @@ class EntityManager : entityx::help::NonCopyable {
   template <typename C>
   void remove(Entity::Id id) {
     assert_valid(id);
-    const int family = C::family();
-    const int index = id.index();
+    const BaseComponent::Family family = C::family();
+    const uint32_t index = id.index();
     ComponentHandle<C> component(this, id);
     BasePool *pool = component_pools_[family];
     event_manager_.emit<ComponentRemovedEvent<C>>(Entity(this, id), component);
index f830be0414a751bab0f58ded30d4b1897a67ec5d..f23849791677df07bfba6f042cb96605c19911c6 100644 (file)
@@ -26,7 +26,7 @@ namespace entityx {
 /// Used internally by the EventManager.
 class BaseEvent {
  public:
-  typedef uint64_t Family;
+  typedef size_t Family;
 
   virtual ~BaseEvent() {}
 
index d94c91ab5ec8fa92a9a68cbd9c9b1b4a139c82e3..4854b8d6360a1edbaf7edc8ed04e6fad7be2c77b 100644 (file)
@@ -32,7 +32,7 @@ class SystemManager;
  */
 class BaseSystem : entityx::help::NonCopyable {
  public:
-  typedef uint64_t Family;
+  typedef size_t Family;
 
   virtual ~BaseSystem() {}
 
index 575b34f5f8c5cfe290f693a9ca840fb0323893d0..e76e4dfc07c0b5c43aae26c0f6488f147c9e0f18 100644 (file)
@@ -2,10 +2,11 @@
 
 #cmakedefine ENTITYX_MAX_COMPONENTS @ENTITYX_MAX_COMPONENTS@
 
-#include <stdint.h>
+#include <cstdint>
+#include <cstddef>
 
 namespace entityx {
 
-static const uint64_t MAX_COMPONENTS = ENTITYX_MAX_COMPONENTS;
+static const size_t MAX_COMPONENTS = ENTITYX_MAX_COMPONENTS;
 
 }  // namespace entityx