From 02e14aa8fa5dc31fdb76d5229f781093c6db97ad Mon Sep 17 00:00:00 2001 From: Nigel Barink Date: Sat, 5 Nov 2022 17:17:08 +0100 Subject: [PATCH] Solving a few warnings --- Editor/premake5.lua | 4 ++-- Editor/src/Project.cpp | 1 + Editor/src/UI/widgets.cpp | 10 +++++----- YoggieEngine/premake5.lua | 5 +++++ YoggieEngine/src/BarinkEngine.h | 3 --- YoggieEngine/src/Graphics/RenderSurface.cpp | 2 +- premake5.lua | 5 +++++ 7 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Editor/premake5.lua b/Editor/premake5.lua index 0dd7b56..af8c88f 100644 --- a/Editor/premake5.lua +++ b/Editor/premake5.lua @@ -38,6 +38,6 @@ libdirs { } files { - "./src/*.h", - "./src/*.cpp" + "./src/**.h", + "./src/**.cpp" } diff --git a/Editor/src/Project.cpp b/Editor/src/Project.cpp index b42d850..05751cf 100644 --- a/Editor/src/Project.cpp +++ b/Editor/src/Project.cpp @@ -57,6 +57,7 @@ namespace YAML { return false; rhs.setName(node["Project"].as()); rhs.setProjectDirectory(node["Directory"].as()); + return true; } diff --git a/Editor/src/UI/widgets.cpp b/Editor/src/UI/widgets.cpp index b38a19c..12ce3bb 100644 --- a/Editor/src/UI/widgets.cpp +++ b/Editor/src/UI/widgets.cpp @@ -47,17 +47,17 @@ void Inspector(entt::entity ent , Scene& scene) { ImGui::NewLine(); auto component = entity.GetComponent(); - 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()) { auto& transform = entity.GetComponent(); 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); } } diff --git a/YoggieEngine/premake5.lua b/YoggieEngine/premake5.lua index 0fb435d..0959756 100644 --- a/YoggieEngine/premake5.lua +++ b/YoggieEngine/premake5.lua @@ -2,6 +2,11 @@ project "YoggieEngine" kind "StaticLib" buildmessage "Building Yoggie Engine" + disablewarnings{ + "4099" -- Ignore the missing debug signals for GLFW warning + + } + includedirs { "../libs/spdlog/include", diff --git a/YoggieEngine/src/BarinkEngine.h b/YoggieEngine/src/BarinkEngine.h index e1b5488..929c82e 100644 --- a/YoggieEngine/src/BarinkEngine.h +++ b/YoggieEngine/src/BarinkEngine.h @@ -7,9 +7,6 @@ #include "graphics/Renderable.h" #include "Graphics/Renderer.h" #include "Graphics/Primitives/Material.h" - -#include "spdlog/spdlog.h" - #include "Input/InputManager.h" #include "Graphics/Renderer.h" #include "GUI/GUIManager.h" diff --git a/YoggieEngine/src/Graphics/RenderSurface.cpp b/YoggieEngine/src/Graphics/RenderSurface.cpp index 805c65b..7448e78 100644 --- a/YoggieEngine/src/Graphics/RenderSurface.cpp +++ b/YoggieEngine/src/Graphics/RenderSurface.cpp @@ -1,4 +1,4 @@ -#include "RenderSurface.h"; +#include "RenderSurface.h" namespace YoggieEngine { RenderSurface::RenderSurface() { shader = new Shader("build/SandboxAppliction/Debug/renderSuface.vs", "build/SandboxApplication/Debug/renderSurface.fs"); diff --git a/premake5.lua b/premake5.lua index 310ceeb..bcd4a0b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -13,6 +13,11 @@ workspace "Yoggie GameEngine" startproject("Editor") + + defines{ + " _CRT_SECURE_NO_WARNINGS", + } + filter "configurations:Debug" defines {"DEBUG"} symbols "On"