summaryrefslogtreecommitdiff
path: root/src/components.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components.hpp')
-rw-r--r--src/components.hpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/components.hpp b/src/components.hpp
index 44aaa30..968cd23 100644
--- a/src/components.hpp
+++ b/src/components.hpp
@@ -25,10 +25,22 @@ constexpr InstanceHandle InstanceHandle_MAX = InstanceHandle{ pk_handle_MAX_cons
constexpr SceneHandle SceneHandle_MAX = SceneHandle{ pk_handle_MAX_constexpr };
constexpr LevelHandle LevelHandle_MAX = LevelHandle{ pk_handle_MAX_constexpr };
+TypeSafeInt_constexpr(ENTITY_FLAGS, uint64_t, 0xFFFFFFFFFFFFFFFF);
+TypeSafeInt_constexpr(COMPONENT_INSTANCE_FLAGS, uint64_t, 0xFFFFFFFFFFFFFFFF);
+
+constexpr ENTITY_FLAGS ENTITY_FLAG_NONE = ENTITY_FLAGS(0x00);
+constexpr ENTITY_FLAGS ENTITY_FLAG_DO_NOT_SERIALIZE = ENTITY_FLAGS(0x01);
+
+constexpr COMPONENT_INSTANCE_FLAGS COMPONENT_INSTANCE_FLAG_NONE
+ = COMPONENT_INSTANCE_FLAGS(0x00);
+constexpr COMPONENT_INSTANCE_FLAGS COMPONENT_INSTANCE_FLAG_DO_NOT_SERIALIZE
+ = COMPONENT_INSTANCE_FLAGS(0x01);
+
struct Entity_Base {
EntityHandle handle = EntityHandle_MAX;
EntityHandle parentHandle = EntityHandle_MAX;
pk_uuid uuid = pk_uuid_max;
+ ENTITY_FLAGS entity_flags = ENTITY_FLAG_NONE;
bool isMarkedForRemoval = false;
};
@@ -53,10 +65,6 @@ struct CompGrBinds {
PkeCallback collisionCallback{};
};
-enum COMPONENT_INSTANCE_FLAGS : unsigned long long {
- COMPONENT_INSTANCE_FLAG_NONE = 0x00,
- COMPONENT_INSTANCE_FLAG_DO_NOT_SERIALIZE = 0x01,
-};
struct InstPos {
btTransform posRot;
btVector3 scale;
@@ -67,7 +75,7 @@ struct InstBt {
btRigidBody *rigidBody = nullptr;
};
struct CompInstance {
- unsigned long long flags = COMPONENT_INSTANCE_FLAG_NONE;
+ COMPONENT_INSTANCE_FLAGS comp_instance_flags = COMPONENT_INSTANCE_FLAG_NONE;
EntityHandle entHandle = EntityHandle_MAX;
GrBindsHandle grBindsHandle = GrBindsHandle_MAX;
InstanceHandle instanceHandle = InstanceHandle_MAX;