From 837b2c91076b52d10438a7c6a564e613436ced48 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Wed, 6 Dec 2023 10:52:44 -0500 Subject: use NullCamera for fallback --- editor/editor.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/editor/editor.cpp b/editor/editor.cpp index 4a7cdde..a896cfd 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -30,14 +30,6 @@ const char *dbgCtrl_ClearSelection = "debug-clear-selection"; ThreadPoolHandle threadPoolHandle = ThreadPoolHandle_MAX; -PkeCamera cameraDefault { - .pos = glm::vec3(-40.f, -40.f, -40.f), - .rot = glm::quat(1.f, 0.f, 0.f, 0.f), - .target = glm::vec3(0.f), - .type = PKE_CAMERA_TYPE_PERSPECTIVE, - .orientation = PKE_CAMERA_ORIENTATION_TARGET, - .stale = PKE_CAMERA_STALE_ALL, -}; PkeCamera cameraDbg { .pos = glm::vec3(4.f, 4.f, 4.f), .rot = glm::quat(1.f, 0.f, 0.f, 0.f), @@ -240,8 +232,8 @@ void PkeEditor_Tick(double delta) { if (shouldLockCamera) { shouldLockCamera = false; glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); - cameraDefault.stale = PKE_CAMERA_STALE_ALL; - ActiveCamera = &cameraDefault; + NullCamera.stale = PKE_CAMERA_STALE_ALL; + ActiveCamera = &NullCamera; } if (pkeSettings.editorSettings.isUsingDebugCamera) { @@ -749,7 +741,12 @@ void PkeEditor_Init() { debugControlsHandle = PkeInput_RegisterSet(debugControlsSet); - ActiveCamera = &cameraDefault; + NullCamera.pos = glm::vec3(-40.f, -40.f, -40.f), + NullCamera.rot = glm::quat(1.f, 0.f, 0.f, 0.f), + NullCamera.target = glm::vec3(0.f), + NullCamera.type = PKE_CAMERA_TYPE_PERSPECTIVE, + NullCamera.orientation = PKE_CAMERA_ORIENTATION_TARGET, + NullCamera.stale = PKE_CAMERA_STALE_ALL, threadPoolHandle = PkeThreads_Init(1, 1); } -- cgit v1.2.3