diff options
Diffstat (limited to 'src/entities.cpp')
| -rw-r--r-- | src/entities.cpp | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index b4d0f4b..db3d0a3 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -16,37 +16,6 @@ struct ImplementedPipelines { } vkPipelines; void EntityType_Init() { - GlobalEntityTypes.Push( - EntityType { - .modelsDir = "assets/models", - .modelFile = "cube.gltf", - .entityTypeCode = "EntTypeCube", - .entityHandle = ECS_CreateEntity(), - .startingInstanceCount = 16, - .Importer_GLTF = { - .AccessorIndexVertex = 0, - .AccessorIndexNormal = 1, - .AccessorIndexUV = 2, - .AccessorIndexIndex = 3, - } - } - ); - GlobalEntityTypes.Push( - EntityType { - .modelsDir = "assets/models", - .modelFile = "plane.gltf", - .entityTypeCode = "EntTypePlane", - .entityHandle = ECS_CreateEntity(), - .startingInstanceCount = 16, - .Importer_GLTF = { - .AccessorIndexVertex = 0, - .AccessorIndexNormal = 1, - .AccessorIndexUV = 2, - .AccessorIndexIndex = 3, - } - } - ); - VkDescriptorSetLayoutBinding vkDescriptorSetLayoutBindings[2]; for (long i = 0; i < 2; ++i) { vkDescriptorSetLayoutBindings[i].pImmutableSamplers = nullptr; @@ -360,6 +329,15 @@ void EntityType_Init() { } } +int64_t EntityType_FindByTypeCode(const char *typeCode) { + for (int64_t i = 0; i < GlobalEntityTypes.Count(); ++i) { + if (strcmp(typeCode, GlobalEntityTypes[i].entityTypeCode) == 0) { + return i; + } + } + return -1; +} + void EntityType_Load(EntityType &et) { assert(et.startingInstanceCount > 0); if (et.modelFile != nullptr && et.modelFile != CAFE_BABE(char)) { |
