Skip to content

Commit

Permalink
Fixed the build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tippesi committed Jul 2, 2024
1 parent f29aa51 commit 339e358
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/editor/ui/panels/components/LuaScriptComponentPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/engine/scene/components/LuaScriptComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ namespace Atlas::Scene::Components {
continue;
scriptProperty.booleanValue = value.get<bool>();
break;
case PropertyType::Undefined:
break;
}

foundProperties[scriptProperty.name] = scriptProperty;
Expand Down Expand Up @@ -301,6 +303,8 @@ namespace Atlas::Scene::Components {
case PropertyType::Boolean:
state["ScriptProperties"][propertyName]["value"] = property.booleanValue;
break;
case PropertyType::Undefined:
break;
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/engine/scene/components/LuaScriptComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ namespace Atlas::Scene {

template<class T>
void LuaScriptComponent::ScriptProperty::SetValue(const T value) {

static_assert(std::is_same_v<T, std::string> || std::is_same_v<T, double> ||
std::is_same_v<T, int32_t> || std::is_same_v<T, bool>, "Unsupported type");

if constexpr (std::is_same_v<T, std::string>) {
stringValue = value;
type = PropertyType::String;
Expand All @@ -109,9 +113,6 @@ namespace Atlas::Scene {
booleanValue = value;
type = PropertyType::Boolean;
}
else {
static_assert("Unsupported type" && false);
}

wasChanged = true;
}
Expand All @@ -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<T, std::string> || std::is_same_v<T, double> ||
std::is_same_v<T, int32_t> || std::is_same_v<T, bool>, "Unsupported type");

if constexpr (std::is_same_v<T, std::string>) {
return stringValue;
}
Expand All @@ -134,7 +138,7 @@ namespace Atlas::Scene {
return booleanValue;
}
else {
static_assert("Unsupported type" && false);

}
}

Expand Down
2 changes: 1 addition & 1 deletion src/tests/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ TEST_P(EngineEndToEndTest, DemoTest) {
engineInstance->Update(deltaTime);
engineInstance->Render(deltaTime);

graphicsDevice->CompleteFrame();
graphicsDevice->SubmitFrame();

}

Expand Down

0 comments on commit 339e358

Please sign in to comment.