From 339e358645b2c608a4914578067440bbb4da4ea4 Mon Sep 17 00:00:00 2001 From: Simon Tippe Date: Tue, 2 Jul 2024 23:10:01 +0200 Subject: [PATCH] Fixed the build issues --- .../ui/panels/components/LuaScriptComponentPanel.cpp | 2 ++ src/engine/scene/components/LuaScriptComponent.cpp | 4 ++++ src/engine/scene/components/LuaScriptComponent.h | 12 ++++++++---- src/tests/Main.cpp | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/src/editor/ui/panels/components/LuaScriptComponentPanel.cpp b/src/editor/ui/panels/components/LuaScriptComponentPanel.cpp index 503e47131..bb599303f 100644 --- a/src/editor/ui/panels/components/LuaScriptComponentPanel.cpp +++ b/src/editor/ui/panels/components/LuaScriptComponentPanel.cpp @@ -54,6 +54,8 @@ namespace Atlas::Editor::UI case LuaScriptComponent::PropertyType::String: ImGui::InputText(property.name.c_str(), &property.stringValue); break; + case LuaScriptComponent::PropertyType::Undefined: + break; } } diff --git a/src/engine/scene/components/LuaScriptComponent.cpp b/src/engine/scene/components/LuaScriptComponent.cpp index f6de02a0c..bc035d291 100644 --- a/src/engine/scene/components/LuaScriptComponent.cpp +++ b/src/engine/scene/components/LuaScriptComponent.cpp @@ -253,6 +253,8 @@ namespace Atlas::Scene::Components { continue; scriptProperty.booleanValue = value.get(); break; + case PropertyType::Undefined: + break; } foundProperties[scriptProperty.name] = scriptProperty; @@ -301,6 +303,8 @@ namespace Atlas::Scene::Components { case PropertyType::Boolean: state["ScriptProperties"][propertyName]["value"] = property.booleanValue; break; + case PropertyType::Undefined: + break; } } } diff --git a/src/engine/scene/components/LuaScriptComponent.h b/src/engine/scene/components/LuaScriptComponent.h index db2f98922..a1bb64e42 100644 --- a/src/engine/scene/components/LuaScriptComponent.h +++ b/src/engine/scene/components/LuaScriptComponent.h @@ -93,6 +93,10 @@ namespace Atlas::Scene { template void LuaScriptComponent::ScriptProperty::SetValue(const T value) { + + static_assert(std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v, "Unsupported type"); + if constexpr (std::is_same_v) { stringValue = value; type = PropertyType::String; @@ -109,9 +113,6 @@ namespace Atlas::Scene { booleanValue = value; type = PropertyType::Boolean; } - else { - static_assert("Unsupported type" && false); - } wasChanged = true; } @@ -121,6 +122,9 @@ namespace Atlas::Scene { AE_ASSERT(type != PropertyType::Undefined && "This property was most likely not defined properly"); + static_assert(std::is_same_v || std::is_same_v || + std::is_same_v || std::is_same_v, "Unsupported type"); + if constexpr (std::is_same_v) { return stringValue; } @@ -134,7 +138,7 @@ namespace Atlas::Scene { return booleanValue; } else { - static_assert("Unsupported type" && false); + } } diff --git a/src/tests/Main.cpp b/src/tests/Main.cpp index 9bbc42d77..8f383dfd4 100644 --- a/src/tests/Main.cpp +++ b/src/tests/Main.cpp @@ -80,7 +80,7 @@ TEST_P(EngineEndToEndTest, DemoTest) { engineInstance->Update(deltaTime); engineInstance->Render(deltaTime); - graphicsDevice->CompleteFrame(); + graphicsDevice->SubmitFrame(); }