From d2a76bd8cfd883070259bf572a9f723a37c0d96e Mon Sep 17 00:00:00 2001 From: HampusM Date: Tue, 28 Jun 2022 19:22:06 +0200 Subject: refactor: improve includes with iwyu --- src/engine/graphics/component_renderer.cpp | 15 +++++++++++---- src/engine/graphics/component_renderer.hpp | 9 ++++++--- src/engine/graphics/scene.cpp | 14 ++++++++------ src/engine/graphics/scene.hpp | 18 ++++++++++-------- 4 files changed, 35 insertions(+), 21 deletions(-) (limited to 'src/engine/graphics') diff --git a/src/engine/graphics/component_renderer.cpp b/src/engine/graphics/component_renderer.cpp index effe153..0584028 100644 --- a/src/engine/graphics/component_renderer.cpp +++ b/src/engine/graphics/component_renderer.cpp @@ -1,13 +1,20 @@ #include "component_renderer.hpp" -#include "engine/escape.hpp" -#include "util/color.hpp" - #include - #include +#include #include +#include "engine/data/style.hpp" +#include "engine/data/vector2.hpp" +#include "engine/escape.hpp" +#include "engine/graphics/matrix_iterator.hpp" +#include "engine/graphics/matrix_iterator_impl.hpp" +#include "interfaces/component.hpp" +#include "interfaces/cursor.hpp" +#include "interfaces/matrix.hpp" +#include "util/color.hpp" + ComponentRenderer::ComponentRenderer( std::shared_ptr cursor_controller) noexcept : _cursor_controller(std::move(cursor_controller)) diff --git a/src/engine/graphics/component_renderer.hpp b/src/engine/graphics/component_renderer.hpp index ff1bc47..4d21623 100644 --- a/src/engine/graphics/component_renderer.hpp +++ b/src/engine/graphics/component_renderer.hpp @@ -1,12 +1,15 @@ #pragma once +#include + +#include "engine/data/vector2.hpp" #include "interfaces/component.hpp" #include "interfaces/component_renderer.hpp" #include "interfaces/cursor.hpp" -#include "engine/data/vector2.hpp" - -#include +class IComponent; +class ICursorController; +class Vector2; constexpr auto SET_BOLD_MODE = "{esc}[1m"; diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index ff64edd..7c23c7d 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -1,13 +1,15 @@ #include "scene.hpp" -#include "engine/escape.hpp" -#include "util/color.hpp" - -#include #include - -#include #include +#include +#include +#include +#include + +#include "engine/escape.hpp" + +class IComponent; Scene::Scene(const IMatrixFactory &matrix_factory) noexcept : _matrix(matrix_factory(size())), _is_shown(false) diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index 4df5f56..5b52027 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -1,19 +1,21 @@ #pragma once -#include "interfaces/component.hpp" -#include "interfaces/matrix.hpp" -#include "interfaces/scene.hpp" - -#include "engine/data/vector2.hpp" - #include -#include - #include #include #include #include #include +#include + +#include "engine/data/bounds.hpp" +#include "engine/data/vector2.hpp" +#include "interfaces/component.hpp" +#include "interfaces/matrix.hpp" +#include "interfaces/scene.hpp" + +class IComponent; +struct termios; constexpr fmt::string_view ENABLE_ALT_BUFFER = "{esc}[?1049h"; constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; -- cgit v1.2.3-18-g5258