Fixing lvalue errors on linux build

nfd is not yet linking on Linux
This commit is contained in:
Nigel Barink 2023-05-13 21:32:55 +02:00
parent f7e087ee8d
commit 95f77209cf
6 changed files with 26 additions and 13 deletions

View File

@ -7,7 +7,7 @@ links{
"YoggieEngine", "YoggieEngine",
"ImGuizmo", "ImGuizmo",
"yaml-cpp", "yaml-cpp",
"nfd.lib" "nfd"
} }
includedirs{ includedirs{

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "../../YoggieEngine/src/YoggieEngine.h" #include "../../YoggieEngine/src/YoggieEngine.h"
#include "EditorWindow.h" #include "../EditorWindow.h"
#include "AssetManagement/AssetRegistry.h" #include "AssetRegistry.h"
const char* hidden_extensions [] { const char* hidden_extensions [] {
".exe", ".exe",
@ -39,7 +39,9 @@ public:
continue; continue;
Asset asset(filepath.filename().string().c_str()); Asset asset(filepath.filename().string().c_str());
asset.setFilPath(filepath.string());
auto filepathStr = filepath.string();
asset.setFilPath(filepathStr);
spdlog::info("Created asset: {0}", asset.GetName()); spdlog::info("Created asset: {0}", asset.GetName());
files.push_back(asset); files.push_back(asset);

View File

@ -7,7 +7,6 @@
#include <nfd.h> #include <nfd.h>
#include "AssetManagement/SceneSerializer.h" #include "AssetManagement/SceneSerializer.h"
#include "AssetManagement/AssetRegistry.h"
#include "AssetManagement/AssetFinder.h" #include "AssetManagement/AssetFinder.h"
#include "PropertyPanels/Inspector.h" #include "PropertyPanels/Inspector.h"
#include "AssetManagement/uuid.h" #include "AssetManagement/uuid.h"
@ -52,7 +51,11 @@ public:
project.setProjectDirectory(path); project.setProjectDirectory(path);
assetsView = AssetFinder(project.GetProjectDirectory()); assetsView = AssetFinder(project.GetProjectDirectory());
LoadLastOrEmptyProject(); LoadLastOrEmptyProject();
cube = (ModelLoader()).LoadAsset(std::filesystem::path("build/debug/Models/cube.obj"));
auto cubePath = std::filesystem::path("build/debug/Models/cube.obj");
cube = (ModelLoader()).LoadAsset(cubePath);
//Settings settings = Settings(); //Settings settings = Settings();
//Console console = Console(); //Console console = Console();
@ -389,14 +392,16 @@ public:
ImGuizmo::SetRect(ImGui::GetWindowPos().x, ImGui::GetWindowPos().y, ImGui::GetWindowWidth(), ImGui::GetWindowHeight()); ImGuizmo::SetRect(ImGui::GetWindowPos().x, ImGui::GetWindowPos().y, ImGui::GetWindowWidth(), ImGui::GetWindowHeight());
const auto& ProjMatrix = camera->projection; const auto& ProjMatrix = camera->projection;
glm::mat4& cameraView = glm::inverse(((EditorCamera*)camera)->view);
const glm::mat4& viewMatrix = ((EditorCamera*)camera)->view;
glm::mat4 cameraView = glm::inverse(viewMatrix);
glm::mat4 cameraDelta = glm::mat4(1.0f); glm::mat4 cameraDelta = glm::mat4(1.0f);
auto& tc = Selected.GetComponent<YoggieEngine::TransformComponent>(); auto& tc = Selected.GetComponent<YoggieEngine::TransformComponent>();
glm::mat4& transform = tc.GetTransform(); auto transform = tc.GetTransform();
ImGuizmo::Manipulate(glm::value_ptr(cameraView), glm::value_ptr(ProjMatrix), activeOperation, ImGuizmo::WORLD, glm::value_ptr(transform), nullptr, nullptr); ImGuizmo::Manipulate(glm::value_ptr(cameraView), glm::value_ptr(ProjMatrix), activeOperation, ImGuizmo::WORLD, glm::value_ptr(transform), nullptr, nullptr);
if(ImGuizmo::IsUsing()) if(ImGuizmo::IsUsing())
tc.Decompose(transform); tc.Decompose(transform);

View File

@ -9,7 +9,8 @@ public:
void Update() void Update()
{ {
ImGui::Begin(name.c_str(), false, flags);
ImGui::Begin(name.c_str(), nullptr, flags);
Draw(); Draw();
ImGui::End(); ImGui::End();
} }

View File

@ -68,8 +68,13 @@ namespace YAML {
{ {
if (!node.IsMap()) if (!node.IsMap())
return false; return false;
rhs.setName(node["Project"].as<std::string>());
rhs.setProjectDirectory(node["Directory"].as<std::string>()); std::string projectName = node["Project"].as<std::string>();
rhs.setName(projectName);
std::string projectDirectory = node["Directory"].as<std::string>();
rhs.setProjectDirectory(projectDirectory);

View File

@ -20,11 +20,11 @@ workspace "Yoggie GameEngine"
} }
filter "configurations:Debug" filter "configurations:Debug"
defines {"DEBUG"} defines {"DEBUG", "_DEBUG"}
symbols "On" symbols "On"
filter "configurations:Release" filter "configurations:Release"
defines {"NDEBUG"} defines {"NDEBUG", "_DEBUG"}
optimize "On" optimize "On"