From 6edb163126fa8965151fb5b0acd796ee3f5a5488 Mon Sep 17 00:00:00 2001 From: Joe Morton Date: Mon, 29 Jul 2024 08:19:45 +0100 Subject: [PATCH] build fix --- Lumos/External/imgui/Plugins/ImFileBrowser.h | 1 + Lumos/Source/Lumos/Core/DataStructures/Map.h | 1 + Lumos/Source/Lumos/Core/JobSystem.cpp | 2 +- Lumos/Source/Lumos/Core/Reference.h | 1 + .../Lumos/Graphics/RHI/RHIDefinitions.h | 1 + .../Graphics/Renderers/SceneRenderer.cpp | 34 +++++++------------ Lumos/Source/Lumos/ImGui/ImGuiManager.cpp | 1 - Lumos/Source/Lumos/Maths/Vector2.h | 1 + 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Lumos/External/imgui/Plugins/ImFileBrowser.h b/Lumos/External/imgui/Plugins/ImFileBrowser.h index 7de4a6e9..56d76d2c 100644 --- a/Lumos/External/imgui/Plugins/ImFileBrowser.h +++ b/Lumos/External/imgui/Plugins/ImFileBrowser.h @@ -10,6 +10,7 @@ #include #include #include +#include #ifndef IMGUI_VERSION # error "include imgui.h before this header" diff --git a/Lumos/Source/Lumos/Core/DataStructures/Map.h b/Lumos/Source/Lumos/Core/DataStructures/Map.h index a3c89442..2b25d0f6 100644 --- a/Lumos/Source/Lumos/Core/DataStructures/Map.h +++ b/Lumos/Source/Lumos/Core/DataStructures/Map.h @@ -1,6 +1,7 @@ #pragma once #include "Core/OS/Memory.h" #include "Utilities/Hash.h" +#include namespace Lumos { diff --git a/Lumos/Source/Lumos/Core/JobSystem.cpp b/Lumos/Source/Lumos/Core/JobSystem.cpp index 369a8bba..229228b3 100644 --- a/Lumos/Source/Lumos/Core/JobSystem.cpp +++ b/Lumos/Source/Lumos/Core/JobSystem.cpp @@ -8,7 +8,7 @@ #include #include #include - +#include #ifdef LUMOS_PLATFORM_WINDOWS #define NOMINMAX #include diff --git a/Lumos/Source/Lumos/Core/Reference.h b/Lumos/Source/Lumos/Core/Reference.h index 938c6ff7..86662f0a 100644 --- a/Lumos/Source/Lumos/Core/Reference.h +++ b/Lumos/Source/Lumos/Core/Reference.h @@ -3,6 +3,7 @@ #include "ReferenceCounter.h" #include "OS/Memory.h" #include "Core/LMLog.h" +#include namespace Lumos { diff --git a/Lumos/Source/Lumos/Graphics/RHI/RHIDefinitions.h b/Lumos/Source/Lumos/Graphics/RHI/RHIDefinitions.h index 727c7f3f..974420a4 100644 --- a/Lumos/Source/Lumos/Graphics/RHI/RHIDefinitions.h +++ b/Lumos/Source/Lumos/Graphics/RHI/RHIDefinitions.h @@ -1,6 +1,7 @@ #pragma once #include "Core/LMLog.h" #include "Core/DataStructures/TDArray.h" +#include namespace Lumos { diff --git a/Lumos/Source/Lumos/Graphics/Renderers/SceneRenderer.cpp b/Lumos/Source/Lumos/Graphics/Renderers/SceneRenderer.cpp index 13cd3333..947a65f5 100644 --- a/Lumos/Source/Lumos/Graphics/Renderers/SceneRenderer.cpp +++ b/Lumos/Source/Lumos/Graphics/Renderers/SceneRenderer.cpp @@ -2053,10 +2053,6 @@ namespace Lumos::Graphics } m_CurrentUIText = false; - /* opengl_2d_renderer_push_quad(widget->position + size * 0.5f, - size, - 0.0f, - border_color);*/ { m_Stats.NumRenderedObjects++; @@ -2137,12 +2133,6 @@ namespace Lumos::Graphics } m_CurrentUIText = false; - /* opengl_2d_renderer_push_quad(p + size * 0.5f, - size, - 0.0f, - background_color, - widget->texture);*/ - { m_Stats.NumRenderedObjects++; @@ -2210,12 +2200,18 @@ namespace Lumos::Graphics Vec2 p = widget->position /* - size * 0.5f*/ + debugUIOffset; // size *= 4.0f; - p.y = m_MainTexture->GetHeight() - p.y; - p.y -= size.y - padding.y * 0.5f; - p.x += padding.x * 0.5f; - - // LINFO("Text {0} - Pos {1}, {2} - Size {3}, {4}", (char*)widget->text.str, p.x,p.y,size.x, size.y); - + if(widget->TextAlignment & UI_Text_Alignment_Center_X) + { + p.y = m_MainTexture->GetHeight() - p.y; + p.y -= size.y - padding.y * 0.5f; + p.x += size.x * 0.5f + padding.x * 0.5f; + } + else + { + p.y = m_MainTexture->GetHeight() - p.y; + p.y -= size.y - padding.y * 0.5f; + p.x += padding.x * 0.5f; + } if(!m_CurrentUIText) { if(m_Renderer2DData.m_IndexCount >= 0) @@ -2227,12 +2223,6 @@ namespace Lumos::Graphics m_CurrentUIText = true; - /* opengl_2d_renderer_push_string(font, - widget->text, - text_size, - p + size * 0.5f, - text_color);*/ - Vec2 pos = p; // - size * 0.5f; { Mat4 transform = Mat4::Translation(Vec3(pos.x, pos.y, 0.0f)) * Mat4::Scale(Vec3(fontSize, fontSize, fontSize)); diff --git a/Lumos/Source/Lumos/ImGui/ImGuiManager.cpp b/Lumos/Source/Lumos/ImGui/ImGuiManager.cpp index 67b9e460..d5068cec 100644 --- a/Lumos/Source/Lumos/ImGui/ImGuiManager.cpp +++ b/Lumos/Source/Lumos/ImGui/ImGuiManager.cpp @@ -15,7 +15,6 @@ #include #include #include -#include #if defined(LUMOS_PLATFORM_MACOS) || defined(LUMOS_PLATFORM_WINDOWS) || defined(LUMOS_PLATFORM_LINUX) #define USING_GLFW diff --git a/Lumos/Source/Lumos/Maths/Vector2.h b/Lumos/Source/Lumos/Maths/Vector2.h index 341097a8..f689d1c4 100644 --- a/Lumos/Source/Lumos/Maths/Vector2.h +++ b/Lumos/Source/Lumos/Maths/Vector2.h @@ -2,6 +2,7 @@ #ifdef LUMOS_SSE_VEC2 #include #endif +#include namespace Lumos {