From 165525f18cb3afaf3da97039566a5f2802e015b0 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 13 May 2024 03:20:09 +0300 Subject: [PATCH] includes refactor --- src/frontend/locale.hpp | 4 ++-- src/frontend/screens/LevelScreen.cpp | 1 + src/graphics/core/Batch2D.cpp | 1 + src/graphics/core/Batch2D.hpp | 2 +- src/graphics/core/DrawContext.cpp | 1 + src/graphics/core/DrawContext.hpp | 1 - src/graphics/core/PostProcessing.cpp | 2 ++ src/graphics/core/PostProcessing.hpp | 5 ++--- src/graphics/core/Texture.cpp | 1 - src/graphics/core/Texture.hpp | 5 +++-- src/graphics/ui/GUI.cpp | 1 + src/graphics/ui/elements/TextBox.cpp | 1 + src/typedefs.hpp | 2 -- 13 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/frontend/locale.hpp b/src/frontend/locale.hpp index a7d357d5..e2209788 100644 --- a/src/frontend/locale.hpp +++ b/src/frontend/locale.hpp @@ -1,14 +1,14 @@ #ifndef FRONTEND_LOCALES_HPP_ #define FRONTEND_LOCALES_HPP_ -#include "../content/ContentPack.hpp" - #include #include #include #include #include +struct ContentPack; + namespace langs { const char LANG_FILE_EXT[] = ".txt"; const char TEXTS_FOLDER[] = "texts"; diff --git a/src/frontend/screens/LevelScreen.cpp b/src/frontend/screens/LevelScreen.cpp index 22cbaed3..7f805e27 100644 --- a/src/frontend/screens/LevelScreen.cpp +++ b/src/frontend/screens/LevelScreen.cpp @@ -20,6 +20,7 @@ #include "../../world/World.hpp" #include "../../window/Camera.hpp" #include "../../window/Events.hpp" +#include "../../window/Window.hpp" #include "../../engine.hpp" static debug::Logger logger("level-screen"); diff --git a/src/graphics/core/Batch2D.cpp b/src/graphics/core/Batch2D.cpp index ded51861..c07c6632 100644 --- a/src/graphics/core/Batch2D.cpp +++ b/src/graphics/core/Batch2D.cpp @@ -2,6 +2,7 @@ #include "Mesh.hpp" #include "Texture.hpp" #include "gl_util.hpp" +#include "../../maths/UVRegion.hpp" #include diff --git a/src/graphics/core/Batch2D.hpp b/src/graphics/core/Batch2D.hpp index ff93157d..cbd56908 100644 --- a/src/graphics/core/Batch2D.hpp +++ b/src/graphics/core/Batch2D.hpp @@ -6,10 +6,10 @@ #include #include "commons.hpp" -#include "../../maths/UVRegion.hpp" class Mesh; class Texture; +struct UVRegion; class Batch2D { float* buffer; diff --git a/src/graphics/core/DrawContext.cpp b/src/graphics/core/DrawContext.cpp index 669af3f1..f05754c0 100644 --- a/src/graphics/core/DrawContext.cpp +++ b/src/graphics/core/DrawContext.cpp @@ -4,6 +4,7 @@ #include "Batch2D.hpp" #include "Framebuffer.hpp" +#include "../../window/Window.hpp" static void set_blend_mode(BlendMode mode) { switch (mode) { diff --git a/src/graphics/core/DrawContext.hpp b/src/graphics/core/DrawContext.hpp index ada2f516..2f656df3 100644 --- a/src/graphics/core/DrawContext.hpp +++ b/src/graphics/core/DrawContext.hpp @@ -3,7 +3,6 @@ #include "commons.hpp" #include "Viewport.hpp" -#include "../../window/Window.hpp" #include "../../typedefs.hpp" class Batch2D; diff --git a/src/graphics/core/PostProcessing.cpp b/src/graphics/core/PostProcessing.cpp index 67110faa..0498c5e7 100644 --- a/src/graphics/core/PostProcessing.cpp +++ b/src/graphics/core/PostProcessing.cpp @@ -3,6 +3,8 @@ #include "Shader.hpp" #include "Texture.hpp" #include "Framebuffer.hpp" +#include "Viewport.hpp" +#include "DrawContext.hpp" #include diff --git a/src/graphics/core/PostProcessing.hpp b/src/graphics/core/PostProcessing.hpp index 7e2cb0d1..408839c9 100644 --- a/src/graphics/core/PostProcessing.hpp +++ b/src/graphics/core/PostProcessing.hpp @@ -1,14 +1,13 @@ #ifndef GRAPHICS_CORE_POST_PROCESSING_HPP_ #define GRAPHICS_CORE_POST_PROCESSING_HPP_ -#include "Viewport.hpp" -#include "DrawContext.hpp" - #include class Mesh; class Shader; class Framebuffer; +class DrawContext; +class ImageData; /// @brief Framebuffer with blitting with shaders. /// @attention Current implementation does not support multiple render passes diff --git a/src/graphics/core/Texture.cpp b/src/graphics/core/Texture.cpp index eb91d206..f2c7348f 100644 --- a/src/graphics/core/Texture.cpp +++ b/src/graphics/core/Texture.cpp @@ -1,5 +1,4 @@ #include "Texture.hpp" -#include "ImageData.hpp" #include "gl_util.hpp" #include diff --git a/src/graphics/core/Texture.hpp b/src/graphics/core/Texture.hpp index effb50ee..b5d28617 100644 --- a/src/graphics/core/Texture.hpp +++ b/src/graphics/core/Texture.hpp @@ -1,11 +1,12 @@ #ifndef GRAPHICS_CORE_TEXTURE_HPP_ #define GRAPHICS_CORE_TEXTURE_HPP_ -#include -#include #include "../../typedefs.hpp" #include "ImageData.hpp" +#include +#include + class Texture { protected: uint id; diff --git a/src/graphics/ui/GUI.cpp b/src/graphics/ui/GUI.cpp index 403d940f..3b8d8a1b 100644 --- a/src/graphics/ui/GUI.cpp +++ b/src/graphics/ui/GUI.cpp @@ -8,6 +8,7 @@ #include "../../graphics/core/Shader.hpp" #include "../../graphics/core/DrawContext.hpp" #include "../../window/Events.hpp" +#include "../../window/Window.hpp" #include "../../window/input.hpp" #include "../../window/Camera.hpp" diff --git a/src/graphics/ui/elements/TextBox.cpp b/src/graphics/ui/elements/TextBox.cpp index e8f4cf48..7d6690de 100644 --- a/src/graphics/ui/elements/TextBox.cpp +++ b/src/graphics/ui/elements/TextBox.cpp @@ -7,6 +7,7 @@ #include "../../../assets/Assets.hpp" #include "../../../util/stringutil.hpp" #include "../../../window/Events.hpp" +#include "../../../window/Window.hpp" using namespace gui; diff --git a/src/typedefs.hpp b/src/typedefs.hpp index 655661fb..7b065aa3 100644 --- a/src/typedefs.hpp +++ b/src/typedefs.hpp @@ -2,9 +2,7 @@ #define TYPEDEFS_HPP_ #include -#include #include -#include using scriptenv = std::shared_ptr; using observer_handler = std::shared_ptr;