summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2024-01-16 16:53:44 -0500
committerJonathan Bradley <jcb@pikum.xyz>2024-01-16 16:53:44 -0500
commit44664650a1b0660be769946cd132ef53573bbc32 (patch)
tree673056ec131183d7d1b0fdca5e7bdec337c21d32 /editor
parent048ed03fd977331d87ed9db4bbada382a74015e4 (diff)
checkpoint - fix camera saving and allow camera attachment but not saved
Diffstat (limited to 'editor')
-rw-r--r--editor/editor.cpp10
1 files changed, 8 insertions, 2 deletions
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<char>(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<char>(len + 1);
memset(entry.name, '\0', len + 1);
memcpy(entry.name, fullPath.filename().c_str(), len);