From 0a1e22451ba51970d6bad369f0f7ac6fdacea82c Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 16 Nov 2022 10:54:38 +0800 Subject: [PATCH] Remove irrlicht.h in graphics code --- src/graphics/abstract_renderer.hpp | 17 ++++++++++++++++- src/graphics/cpu_particle_manager.cpp | 3 +++ src/graphics/draw_calls.hpp | 13 ++++++++++++- src/graphics/irr_driver.cpp | 2 -- src/graphics/lighting_passes.hpp | 14 +++++++++++++- src/graphics/material_manager.hpp | 2 +- src/graphics/mesh_tools.cpp | 1 - src/graphics/render_target.cpp | 1 + src/graphics/render_target.hpp | 15 ++++++++++++++- src/graphics/shader_based_renderer.hpp | 8 ++++++++ src/graphics/shadow.cpp | 1 + src/graphics/skid_marks.cpp | 1 + src/graphics/slip_stream.cpp | 5 +++++ src/graphics/sp/sp_texture.cpp | 3 +++ src/graphics/spherical_harmonics.cpp | 1 - src/graphics/stk_particle.cpp | 1 + src/graphics/stk_text_billboard.cpp | 6 +++++- src/guiengine/screen_keyboard.cpp | 1 + src/guiengine/widgets/spinner_widget.cpp | 1 + src/items/item.cpp | 1 + src/items/rubber_band.cpp | 1 + src/modes/capture_the_flag.cpp | 2 ++ src/modes/ctf_flag.cpp | 2 ++ .../options/options_screen_language.cpp | 1 + 24 files changed, 93 insertions(+), 10 deletions(-) diff --git a/src/graphics/abstract_renderer.hpp b/src/graphics/abstract_renderer.hpp index 53f4365fa..923bd0be1 100644 --- a/src/graphics/abstract_renderer.hpp +++ b/src/graphics/abstract_renderer.hpp @@ -19,11 +19,26 @@ #define HEADER_ABSTRACT_RENDERER_HPP #include "graphics/gl_headers.hpp" -#include #include #include #include +#include +#include +#include + +namespace irr +{ + namespace scene + { + class ISceneNode; class ISkinnedMesh; class ICameraSceneNode; + } + namespace video + { + class SColorf; + } +} + class RenderTarget; enum TypeRTT : unsigned int; diff --git a/src/graphics/cpu_particle_manager.cpp b/src/graphics/cpu_particle_manager.cpp index b1d33b3e4..29aec134d 100644 --- a/src/graphics/cpu_particle_manager.cpp +++ b/src/graphics/cpu_particle_manager.cpp @@ -27,6 +27,9 @@ #include #ifndef SERVER_ONLY +#include +#include + #include "graphics/texture_shader.hpp" // ============================================================================ diff --git a/src/graphics/draw_calls.hpp b/src/graphics/draw_calls.hpp index 78ed23b32..6fd7f7e79 100644 --- a/src/graphics/draw_calls.hpp +++ b/src/graphics/draw_calls.hpp @@ -20,11 +20,22 @@ #ifndef SERVER_ONLY #include "graphics/gl_headers.hpp" -#include #include +#include +#include +#include + using namespace irr; +namespace irr +{ + namespace scene + { + class ISceneNode; class ICameraSceneNode; + } +} + class ShadowMatrices; class DrawCalls diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index a9fab1881..08a058457 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -88,8 +88,6 @@ #include "utils/translation.hpp" #include "utils/vs.hpp" -#include - #if !defined(SERVER_ONLY) && defined(ANDROID) #include #if SDL_VERSION_ATLEAST(2, 0, 9) diff --git a/src/graphics/lighting_passes.hpp b/src/graphics/lighting_passes.hpp index 441706471..2655a4f50 100644 --- a/src/graphics/lighting_passes.hpp +++ b/src/graphics/lighting_passes.hpp @@ -19,7 +19,19 @@ #define HEADER_LIGHTING_PASSES_HPP #include "graphics/gl_headers.hpp" -#include +#include + +namespace irr +{ + namespace scene + { + class ICameraSceneNode; + } + namespace video + { + class SColorf; + } +} class FrameBuffer; class PostProcessing; diff --git a/src/graphics/material_manager.hpp b/src/graphics/material_manager.hpp index 8ca39fd65..4b896950f 100644 --- a/src/graphics/material_manager.hpp +++ b/src/graphics/material_manager.hpp @@ -29,10 +29,10 @@ namespace irr } using namespace irr; -#include #include #include #include +#include class Material; class XMLReader; diff --git a/src/graphics/mesh_tools.cpp b/src/graphics/mesh_tools.cpp index 7f29e36b9..2a00cb6d8 100644 --- a/src/graphics/mesh_tools.cpp +++ b/src/graphics/mesh_tools.cpp @@ -19,7 +19,6 @@ #include "utils/log.hpp" #include "utils/vec3.hpp" -#include #include #include #include diff --git a/src/graphics/render_target.cpp b/src/graphics/render_target.cpp index 38d298fed..6767bb871 100644 --- a/src/graphics/render_target.cpp +++ b/src/graphics/render_target.cpp @@ -24,6 +24,7 @@ #include "graphics/rtts.hpp" #include "graphics/shader_based_renderer.hpp" +#include //----------------------------------------------------------------------------- GL1RenderTarget::GL1RenderTarget(const irr::core::dimension2du &dimension, diff --git a/src/graphics/render_target.hpp b/src/graphics/render_target.hpp index 52291918c..a502bdeb3 100644 --- a/src/graphics/render_target.hpp +++ b/src/graphics/render_target.hpp @@ -18,13 +18,26 @@ #ifndef HEADER_RENDER_TARGET_HPP #define HEADER_RENDER_TARGET_HPP -#include +#include +#include #include class FrameBuffer; class RTT; class ShaderBasedRenderer; +namespace irr +{ + namespace scene + { + class ICameraSceneNode; class ISceneNode; + } + namespace video + { + class ITexture; class SColor; + } +} + class RenderTarget { public: diff --git a/src/graphics/shader_based_renderer.hpp b/src/graphics/shader_based_renderer.hpp index 8029e32f5..cee34e690 100644 --- a/src/graphics/shader_based_renderer.hpp +++ b/src/graphics/shader_based_renderer.hpp @@ -37,6 +37,14 @@ class Skybox; class SphericalHarmonics; class PostProcessing; +namespace irr +{ + namespace video + { + class IImage; + } +} + class ShaderBasedRenderer: public AbstractRenderer { private: diff --git a/src/graphics/shadow.cpp b/src/graphics/shadow.cpp index 5ca793cb2..e309ee5d9 100644 --- a/src/graphics/shadow.cpp +++ b/src/graphics/shadow.cpp @@ -31,6 +31,7 @@ #ifndef SERVER_ONLY #include +#include #include #include diff --git a/src/graphics/skid_marks.cpp b/src/graphics/skid_marks.cpp index c78d5f0c9..a63573dff 100644 --- a/src/graphics/skid_marks.cpp +++ b/src/graphics/skid_marks.cpp @@ -38,6 +38,7 @@ #ifndef SERVER_ONLY +#include #include #include #include diff --git a/src/graphics/slip_stream.cpp b/src/graphics/slip_stream.cpp index 50ae981ec..55c91d19e 100644 --- a/src/graphics/slip_stream.cpp +++ b/src/graphics/slip_stream.cpp @@ -39,6 +39,11 @@ #include "utils/constants.hpp" #include "mini_glm.hpp" +#include +#include +#include +#include + #ifndef SERVER_ONLY #include #include diff --git a/src/graphics/sp/sp_texture.cpp b/src/graphics/sp/sp_texture.cpp index 6d9f86f66..2298ddcb2 100644 --- a/src/graphics/sp/sp_texture.cpp +++ b/src/graphics/sp/sp_texture.cpp @@ -29,6 +29,9 @@ #include "utils/log.hpp" #include "utils/string_utils.hpp" +#include +#include + #if !(defined(SERVER_ONLY) || defined(MOBILE_STK)) #include static_assert(squish::kColourClusterFit == (1 << 5), "Wrong header"); diff --git a/src/graphics/spherical_harmonics.cpp b/src/graphics/spherical_harmonics.cpp index 76b994516..09b238b7a 100644 --- a/src/graphics/spherical_harmonics.cpp +++ b/src/graphics/spherical_harmonics.cpp @@ -26,7 +26,6 @@ #include #include -#include #if __SSE2__ || _M_X64 || _M_IX86_FP >= 2 #include diff --git a/src/graphics/stk_particle.cpp b/src/graphics/stk_particle.cpp index c2c944831..5b14c79e2 100644 --- a/src/graphics/stk_particle.cpp +++ b/src/graphics/stk_particle.cpp @@ -25,6 +25,7 @@ #include #include "../../lib/irrlicht/source/Irrlicht/os.h" +#include // ---------------------------------------------------------------------------- std::vector STKParticle::m_flips_data; diff --git a/src/graphics/stk_text_billboard.cpp b/src/graphics/stk_text_billboard.cpp index 7ae423933..7f515fcf1 100644 --- a/src/graphics/stk_text_billboard.cpp +++ b/src/graphics/stk_text_billboard.cpp @@ -26,8 +26,12 @@ #include #include #include -#include +#include +#include +#include +#include #include +#include // ---------------------------------------------------------------------------- STKTextBillboard::STKTextBillboard(const video::SColor& color_top, diff --git a/src/guiengine/screen_keyboard.cpp b/src/guiengine/screen_keyboard.cpp index 5e39e2c32..895c6f416 100644 --- a/src/guiengine/screen_keyboard.cpp +++ b/src/guiengine/screen_keyboard.cpp @@ -31,6 +31,7 @@ #include #include +#include using namespace GUIEngine; // ============================================================================ diff --git a/src/guiengine/widgets/spinner_widget.cpp b/src/guiengine/widgets/spinner_widget.cpp index e2d878876..2991f551e 100644 --- a/src/guiengine/widgets/spinner_widget.cpp +++ b/src/guiengine/widgets/spinner_widget.cpp @@ -31,6 +31,7 @@ #include #include "../../../lib/irrlicht/source/Irrlicht/CGUIButton.h" +#include using namespace GUIEngine; using namespace irr::core; diff --git a/src/items/item.cpp b/src/items/item.cpp index fad2c96d9..3b7caff17 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -36,6 +36,7 @@ #include "utils/constants.hpp" #include "utils/string_utils.hpp" +#include #include #include diff --git a/src/items/rubber_band.cpp b/src/items/rubber_band.cpp index ab16e7c39..00c502bf1 100644 --- a/src/items/rubber_band.cpp +++ b/src/items/rubber_band.cpp @@ -36,6 +36,7 @@ #include "utils/string_utils.hpp" #include +#include #include #include diff --git a/src/modes/capture_the_flag.cpp b/src/modes/capture_the_flag.cpp index 298a6e65b..65365f872 100644 --- a/src/modes/capture_the_flag.cpp +++ b/src/modes/capture_the_flag.cpp @@ -38,6 +38,8 @@ #include "utils/translation.hpp" #include +#include +#include const float g_capture_length = 2.0f; const int g_captured_score = 10; diff --git a/src/modes/ctf_flag.cpp b/src/modes/ctf_flag.cpp index 614b8da08..22291a492 100644 --- a/src/modes/ctf_flag.cpp +++ b/src/modes/ctf_flag.cpp @@ -25,6 +25,8 @@ #include "LinearMath/btQuaternion.h" #include +#include +#include // ============================================================================ // Position offset to attach in kart model diff --git a/src/states_screens/options/options_screen_language.cpp b/src/states_screens/options/options_screen_language.cpp index 7abc4cefc..073f7dda7 100644 --- a/src/states_screens/options/options_screen_language.cpp +++ b/src/states_screens/options/options_screen_language.cpp @@ -54,6 +54,7 @@ #include #include #include +#include using namespace GUIEngine; using namespace Online;