Solving a few warnings

This commit is contained in:
2022-11-05 17:17:08 +01:00
parent 7343300dcb
commit 02e14aa8fa
7 changed files with 19 additions and 11 deletions

View File

@ -38,6 +38,6 @@ libdirs {
}
files {
"./src/*.h",
"./src/*.cpp"
"./src/**.h",
"./src/**.cpp"
}

View File

@ -57,6 +57,7 @@ namespace YAML {
return false;
rhs.setName(node["Project"].as<std::string>());
rhs.setProjectDirectory(node["Directory"].as<std::string>());
return true;
}

View File

@ -47,17 +47,17 @@ void Inspector(entt::entity ent , Scene& scene) {
ImGui::NewLine();
auto component = entity.GetComponent<IdentifierComponent>();
char* buf = new char(component.name.length());
char* buf = new char(component.name.size());
strcpy(buf, component.name.c_str());
ImGui::InputText("Name:",buf , IM_ARRAYSIZE(buf), ImGuiInputTextFlags_ReadOnly);
ImGui::InputText("Name:",buf , sizeof(buf), ImGuiInputTextFlags_ReadOnly);
if (entity.HasComponent<TransformComponent>()) {
auto& transform = entity.GetComponent<TransformComponent>();
if (ImGui::CollapsingHeader("Transform", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::DragFloat3("Position", glm::value_ptr(transform.Position), 0.01);
ImGui::DragFloat3("Rotation", glm::value_ptr(transform.Rotation), 0.01);
ImGui::DragFloat3("Scale", glm::value_ptr(transform.Scale), 0.01, 0);
ImGui::DragFloat3("Position", glm::value_ptr(transform.Position), 0.01f);
ImGui::DragFloat3("Rotation", glm::value_ptr(transform.Rotation), 0.01f);
ImGui::DragFloat3("Scale", glm::value_ptr(transform.Scale), 0.01f, 0.0f);
}
}