diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2024-11-14 14:46:23 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2024-11-14 14:46:23 -0500 |
| commit | b2548ba4ce295fcd94a50123fb543fac2ef2bc33 (patch) | |
| tree | 444a32abb4a094c4fa2f7bc9a95aa86963ad4110 /src/entities.hpp | |
| parent | b1d926361b9d613ad712ad161f9a8b7ccab4551d (diff) | |
add pk.h and major pkmem refactor
Completely replaces the memory module with pkmem
pkmem is a newer implementation of the same
bucket memory structure.
Also includes replacing pkstr.h with pk.h's pkstr
Diffstat (limited to 'src/entities.hpp')
| -rw-r--r-- | src/entities.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/entities.hpp b/src/entities.hpp index 9907ab6..d81b90b 100644 --- a/src/entities.hpp +++ b/src/entities.hpp @@ -1,14 +1,13 @@ #ifndef PKE_ENTITIES_HPP #define PKE_ENTITIES_HPP -#include "memory-type-defs.hpp" #include "vendor/cgltf-include.hpp" #include "vendor/stb_image_include.hpp" #include "ecs.hpp" #include "components.hpp" #include "asset-manager.hpp" -#include "memory.hpp" #include "window.hpp" +#include "vendor/pk.h" #include <BulletCollision/CollisionShapes/btCollisionShape.h> #include <vulkan/vulkan_core.h> @@ -30,7 +29,7 @@ struct EntityTypeDetails { }; struct EntityType : public Entity_Base { AssetKey modelAssetKey; - const char *entityTypeCode = nullptr; + pk_str entityTypeCode; VkDeviceMemory deviceMemoryVert = VK_NULL_HANDLE; VkDeviceMemory deviceMemoryInst = VK_NULL_HANDLE; VkDeviceMemory deviceMemoryPhysVert = VK_NULL_HANDLE; @@ -41,8 +40,8 @@ struct EntityType : public Entity_Base { // PkeCallback serializeInstanceCallback; // TODO // PkeCallback parseInstanceCallback; // TODO }; -struct EntityTypeHandle : PkeHandle {}; -constexpr EntityTypeHandle EntityTypeHandle_MAX = EntityTypeHandle{}; +struct EntityTypeHandle : pk_handle {}; +constexpr EntityTypeHandle EntityTypeHandle_MAX = EntityTypeHandle{ pk_handle_MAX_constexpr }; void EntityType_Init(); EntityType *EntityType_FindByTypeCode(const char *typeCode); @@ -53,8 +52,8 @@ void EntityType_Load(EntityType &et); void EntityType_Tick(double delta); void EntityType_Tick_Late(double delta); void EntityType_RolloverInstances(EntityType &et, CompGrBinds &grBinds); -PkeHandleBucketIndex_T EntityType_GetBucketCount(); -EntityType *EntityType_GetEntityTypes(PkeHandleBucketIndex_T bucketIndex, PkeHandleItemIndex_T &itemCount); +pk_handle_bucket_index_T EntityType_GetBucketCount(); +EntityType *EntityType_GetEntityTypes(pk_handle_bucket_index_T bucketIndex, pk_handle_item_index_T &itemCount); void EntityType_Teardown(); #endif /* PKE_ENTITIES_HPP */ |
