From b2548ba4ce295fcd94a50123fb543fac2ef2bc33 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 14 Nov 2024 14:46:23 -0500 Subject: 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 --- src/entities.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/entities.hpp') 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 #include @@ -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 */ -- cgit v1.2.3