summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2023-12-27 22:04:12 -0500
committerJonathan Bradley <jcb@pikum.xyz>2023-12-27 22:04:12 -0500
commit3187a32f7f0253ded7a41c4c21612253e525a8fe (patch)
tree76d3f6de872927dcd579feccc3c9d874b95e83df /editor
parentc9db77a8f789858b9e1ceb60edb5c463b30451ed (diff)
assets are global and stored in the project file
Diffstat (limited to 'editor')
-rw-r--r--editor/editor.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index bb19b70..e66f14c 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -721,12 +721,12 @@ bool RecordImGui_CallbackSelectModal(long &selectedIndex) {
void RecordImGuiModalCreateEntityType() {
if (ImGui::BeginPopupModal("CreateEntityType", nullptr, ImGuiWindowFlags_AlwaysAutoResize)) {
- static char modelsDir[64];
- static char modelFile[64];
+ static char modelKey[AssetKeyLength + 1];
+ static char textureKey[AssetKeyLength + 1];
static char entityTypeCode[32];
- ImGui::InputText("Models Dir", modelsDir, 63);
- ImGui::InputText("Model File", modelFile, 63);
+ ImGui::InputText("Model Key", modelKey, AssetKeyLength);
+ ImGui::InputText("Texture Key", textureKey, AssetKeyLength);
ImGui::InputText("Entity Type Code", entityTypeCode, 31);
ImGui::InputScalar("Starting Instance Count", ImGuiDataType_U32, &entityTypeToCreate.startingInstanceCount);
ImGui::InputScalar("GLTF Import Index - Vertex", ImGuiDataType_S16, &entityTypeToCreate.Importer_GLTF.AccessorIndexVertex);
@@ -741,19 +741,15 @@ void RecordImGuiModalCreateEntityType() {
if (ImGui::Button("Create")) {
// TODO some type of validation
- memset(modelsDir, '\0', 64);
- memset(modelFile, '\0', 64);
- memset(entityTypeCode, '\0', 32);
- // assert(entityTypeToCreate == nullptr || entityTypeToCreate == CAFE_BABE(EntityType));
- // entityTypeToCreate = Pke_New<EntityType>();
-
- char *sModelsDir = Pke_New<char>(strlen(modelsDir) + 1);
- strncpy(sModelsDir, modelsDir, 63);
- entityTypeToCreate.modelsDir = sModelsDir;
-
- char *sModelFile = Pke_New<char>(strlen(modelFile) + 1);
- strncpy(sModelFile, modelFile, 63);
- entityTypeToCreate.modelFile = sModelFile;
+ modelKey[0] = '\0';
+ textureKey[0] = '\0';
+ entityTypeCode[0] = '\0';
+ modelKey[AssetKeyLength] = '\0';
+ textureKey[AssetKeyLength] = '\0';
+ entityTypeCode[31] = '\0';
+
+ strncpy(entityTypeToCreate.modelAssetKey, modelKey, AssetKeyLength);
+ strncpy(entityTypeToCreate.textureAssetKey, textureKey, AssetKeyLength);
char *sEntityTypeCode = Pke_New<char>(strlen(entityTypeCode) + 1);
strncpy(sEntityTypeCode, entityTypeCode, 31);