From 44664650a1b0660be769946cd132ef53573bbc32 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Tue, 16 Jan 2024 16:53:44 -0500 Subject: checkpoint - fix camera saving and allow camera attachment but not saved --- editor/editor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'editor') diff --git a/editor/editor.cpp b/editor/editor.cpp index f676e0c..882b5f5 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -1092,6 +1092,12 @@ void RecordImGui_CompInstPos(bool readonly, CompInstance *component) { ImGui::InputScalar("Phys - Rigid Body", ImGuiDataType_U64, &component->bt.rigidBody, nullptr, nullptr, "0x%016lX", ImGuiInputTextFlags_ReadOnly); ImGui::InputScalar("Phys - Motion State", ImGuiDataType_U64, &component->bt.motionState, nullptr, nullptr, "0x%016lX", ImGuiInputTextFlags_ReadOnly); + ImGui::BeginDisabled(ActiveCamera->handle == component->entHandle || ActiveCamera->phys.inst == nullptr || ActiveCamera->phys.inst == CAFE_BABE(CompInstance)); + if (ImGui::Button("Attach Active Camera")) { + PkeCamera_AttachToInstance(ActiveCamera->camHandle, component); + } + ImGui::EndDisabled(); + if (changed) { instPos.posRot.setOrigin(pos); eul = glm::radians(eul); @@ -1152,12 +1158,12 @@ void BuildDirRecursive(const std::filesystem::directory_entry &de, fsEntry *dirF auto &entry = dirFsEntry == nullptr ? fsEntries.Push() : dirFsEntry->children.Push(); auto fullPath = std::filesystem::absolute(de.path()); auto len = strlen(fullPath.c_str()); - // leaky + // TODO leaky entry.path = Pke_New(len + 1); memset(entry.path, '\0', len + 1); memcpy(entry.path, fullPath.c_str(), len); len = strlen(fullPath.filename().c_str()); - // leaky + // TODO leaky entry.name = Pke_New(len + 1); memset(entry.name, '\0', len + 1); memcpy(entry.name, fullPath.filename().c_str(), len); -- cgit v1.2.3