From e5d321d286ad6da066cee18e01b26a374603c54d Mon Sep 17 00:00:00 2001 From: DS Date: Fri, 18 Oct 2024 10:58:32 +0200 Subject: [PATCH] Cleanup headers in irr/include/ (#15181) --- irr/include/EDriverTypes.h | 2 - irr/include/IAnimatedMesh.h | 1 - irr/include/IAttributes.h | 3 - irr/include/IGUIElement.h | 2 - irr/include/IGUIEnvironment.h | 2 +- irr/include/IGUIImageList.h | 2 +- irr/include/IGUITabControl.h | 1 - irr/include/IImageLoader.h | 2 - irr/include/IImageWriter.h | 3 +- irr/include/IIndexBuffer.h | 1 - irr/include/IMaterialRendererServices.h | 1 - irr/include/IMeshManipulator.h | 1 - irr/include/IReadFile.h | 2 +- irr/include/ISceneManager.h | 4 +- irr/include/ISceneNode.h | 3 +- irr/include/ISkinnedMesh.h | 3 +- irr/include/ITexture.h | 3 +- irr/include/IVertexBuffer.h | 1 - irr/include/IVideoDriver.h | 1 + irr/include/SMaterial.h | 4 +- irr/include/SMeshBuffer.h | 2 +- irr/include/SSkinMeshBuffer.h | 1 - irr/include/SVertexIndex.h | 2 - irr/include/SVertexManipulator.h | 4 +- irr/include/coreutil.h | 1 - irr/include/fast_atof.h | 10 +- irr/include/irrArray.h | 2 +- irr/include/irrlicht.h | 106 ++------------------- irr/include/mt_opengl.h | 1 - irr/include/quaternion.h | 3 +- irr/scripts/BindingGenerator.lua | 7 +- irr/src/CB3DMeshFileLoader.cpp | 1 + irr/src/CFileSystem.cpp | 3 +- irr/src/CImageLoaderBMP.cpp | 2 +- irr/src/CImageLoaderJPG.cpp | 2 + irr/src/CImageLoaderJPG.h | 3 +- irr/src/CImageLoaderPNG.cpp | 3 +- irr/src/CImageLoaderTGA.cpp | 2 +- irr/src/CImageWriterJPG.cpp | 7 +- irr/src/CImageWriterPNG.cpp | 3 +- irr/src/CIrrDeviceOSX.mm | 1 + irr/src/CSkinnedMesh.h | 2 + irr/src/Irrlicht.cpp | 3 + src/client/clientlauncher.cpp | 3 +- src/client/game.cpp | 9 +- src/client/renderingengine.cpp | 3 +- src/config.h | 2 +- src/gui/guiScene.cpp | 1 + src/irrlicht_changes/CGUITTFont.cpp | 8 +- src/irrlicht_changes/CGUITTFont.h | 10 +- src/unittest/test_irr_gltf_mesh_loader.cpp | 7 +- 51 files changed, 76 insertions(+), 180 deletions(-) diff --git a/irr/include/EDriverTypes.h b/irr/include/EDriverTypes.h index f19e65ace..20c684d4c 100644 --- a/irr/include/EDriverTypes.h +++ b/irr/include/EDriverTypes.h @@ -4,8 +4,6 @@ #pragma once -#include "irrTypes.h" - namespace irr { namespace video diff --git a/irr/include/IAnimatedMesh.h b/irr/include/IAnimatedMesh.h index 2a1c1f4b1..62568bf6b 100644 --- a/irr/include/IAnimatedMesh.h +++ b/irr/include/IAnimatedMesh.h @@ -4,7 +4,6 @@ #pragma once -#include "aabbox3d.h" #include "IMesh.h" namespace irr diff --git a/irr/include/IAttributes.h b/irr/include/IAttributes.h index 4606c5710..1f35732f0 100644 --- a/irr/include/IAttributes.h +++ b/irr/include/IAttributes.h @@ -7,9 +7,6 @@ #include "IReferenceCounted.h" #include "EAttributes.h" -// not needed here but I can't be bothered to clean the transitive includes up. -#include "quaternion.h" - namespace irr { namespace video diff --git a/irr/include/IGUIElement.h b/irr/include/IGUIElement.h index 866ca282d..cffac10d1 100644 --- a/irr/include/IGUIElement.h +++ b/irr/include/IGUIElement.h @@ -10,10 +10,8 @@ #include "IEventReceiver.h" #include "EGUIElementTypes.h" #include "EGUIAlignment.h" -#include "IAttributes.h" #include "IGUIEnvironment.h" #include -#include #include #include diff --git a/irr/include/IGUIEnvironment.h b/irr/include/IGUIEnvironment.h index b9905252d..9a61abb39 100644 --- a/irr/include/IGUIEnvironment.h +++ b/irr/include/IGUIEnvironment.h @@ -7,7 +7,7 @@ #include "IReferenceCounted.h" #include "IGUISkin.h" #include "rect.h" -#include "EFocusFlags.h" +#include "EFocusFlags.h" // IWYU pragma: export #include "IEventReceiver.h" #include "path.h" diff --git a/irr/include/IGUIImageList.h b/irr/include/IGUIImageList.h index 6b23c5469..a13ec57a4 100644 --- a/irr/include/IGUIImageList.h +++ b/irr/include/IGUIImageList.h @@ -3,7 +3,7 @@ #pragma once -#include "IGUIElement.h" +#include "IReferenceCounted.h" #include "rect.h" #include "irrTypes.h" diff --git a/irr/include/IGUITabControl.h b/irr/include/IGUITabControl.h index f1d2183ae..274d12695 100644 --- a/irr/include/IGUITabControl.h +++ b/irr/include/IGUITabControl.h @@ -6,7 +6,6 @@ #include "IGUIElement.h" #include "SColor.h" -#include "IGUISkin.h" namespace irr { diff --git a/irr/include/IImageLoader.h b/irr/include/IImageLoader.h index a521be15f..207b648d5 100644 --- a/irr/include/IImageLoader.h +++ b/irr/include/IImageLoader.h @@ -6,9 +6,7 @@ #include "IReferenceCounted.h" #include "IImage.h" -#include "ITexture.h" #include "path.h" -#include "irrArray.h" namespace irr { diff --git a/irr/include/IImageWriter.h b/irr/include/IImageWriter.h index b8defc75f..872b50290 100644 --- a/irr/include/IImageWriter.h +++ b/irr/include/IImageWriter.h @@ -5,8 +5,7 @@ #pragma once #include "IReferenceCounted.h" -#include "irrString.h" -#include "coreutil.h" +#include "path.h" namespace irr { diff --git a/irr/include/IIndexBuffer.h b/irr/include/IIndexBuffer.h index 01282f0c8..917fc10b4 100644 --- a/irr/include/IIndexBuffer.h +++ b/irr/include/IIndexBuffer.h @@ -5,7 +5,6 @@ #pragma once #include "IReferenceCounted.h" -#include "irrArray.h" #include "EHardwareBufferFlags.h" #include "EPrimitiveTypes.h" #include "SVertexIndex.h" diff --git a/irr/include/IMaterialRendererServices.h b/irr/include/IMaterialRendererServices.h index 81a195d8c..8ed66061d 100644 --- a/irr/include/IMaterialRendererServices.h +++ b/irr/include/IMaterialRendererServices.h @@ -5,7 +5,6 @@ #pragma once #include "SMaterial.h" -#include "S3DVertex.h" namespace irr { diff --git a/irr/include/IMeshManipulator.h b/irr/include/IMeshManipulator.h index de3d84416..54770c6f7 100644 --- a/irr/include/IMeshManipulator.h +++ b/irr/include/IMeshManipulator.h @@ -7,7 +7,6 @@ #include "IReferenceCounted.h" #include "vector3d.h" #include "aabbox3d.h" -#include "matrix4.h" #include "IAnimatedMesh.h" #include "IMeshBuffer.h" #include "SVertexManipulator.h" diff --git a/irr/include/IReadFile.h b/irr/include/IReadFile.h index d3d973069..4431bdb32 100644 --- a/irr/include/IReadFile.h +++ b/irr/include/IReadFile.h @@ -5,8 +5,8 @@ #pragma once #include "IReferenceCounted.h" -#include "coreutil.h" #include "EReadFileType.h" +#include "path.h" namespace irr { diff --git a/irr/include/ISceneManager.h b/irr/include/ISceneManager.h index c247c4b99..18521dbe9 100644 --- a/irr/include/ISceneManager.h +++ b/irr/include/ISceneManager.h @@ -6,13 +6,11 @@ #include "IReferenceCounted.h" #include "irrArray.h" -#include "irrString.h" -#include "path.h" #include "vector3d.h" #include "dimension2d.h" #include "SColor.h" #include "ESceneNodeTypes.h" -#include "SceneParameters.h" +#include "SceneParameters.h" // IWYU pragma: export #include "ISkinnedMesh.h" namespace irr diff --git a/irr/include/ISceneNode.h b/irr/include/ISceneNode.h index 1eab3a3fd..0438d855f 100644 --- a/irr/include/ISceneNode.h +++ b/irr/include/ISceneNode.h @@ -9,14 +9,13 @@ #include "ECullingTypes.h" #include "EDebugSceneTypes.h" #include "SMaterial.h" -#include "irrString.h" #include "irrArray.h" #include "aabbox3d.h" #include "matrix4.h" -#include "IAttributes.h" #include #include +#include namespace irr { diff --git a/irr/include/ISkinnedMesh.h b/irr/include/ISkinnedMesh.h index 869327bcd..af241f55d 100644 --- a/irr/include/ISkinnedMesh.h +++ b/irr/include/ISkinnedMesh.h @@ -5,11 +5,12 @@ #pragma once #include "irrArray.h" -#include "IBoneSceneNode.h" #include "IAnimatedMesh.h" #include "SSkinMeshBuffer.h" +#include "quaternion.h" #include +#include namespace irr { diff --git a/irr/include/ITexture.h b/irr/include/ITexture.h index adca90e7b..533271b39 100644 --- a/irr/include/ITexture.h +++ b/irr/include/ITexture.h @@ -5,11 +5,10 @@ #pragma once #include "IReferenceCounted.h" -#include "IImage.h" +#include "SColor.h" #include "dimension2d.h" #include "EDriverTypes.h" #include "path.h" -#include "matrix4.h" namespace irr { diff --git a/irr/include/IVertexBuffer.h b/irr/include/IVertexBuffer.h index e5be83904..e6f8c633c 100644 --- a/irr/include/IVertexBuffer.h +++ b/irr/include/IVertexBuffer.h @@ -5,7 +5,6 @@ #pragma once #include "IReferenceCounted.h" -#include "irrArray.h" #include "EHardwareBufferFlags.h" #include "S3DVertex.h" diff --git a/irr/include/IVideoDriver.h b/irr/include/IVideoDriver.h index af8d97fef..035f5ad77 100644 --- a/irr/include/IVideoDriver.h +++ b/irr/include/IVideoDriver.h @@ -6,6 +6,7 @@ #include "rect.h" #include "SColor.h" +#include "IImage.h" #include "ITexture.h" #include "irrArray.h" #include "matrix4.h" diff --git a/irr/include/SMaterial.h b/irr/include/SMaterial.h index 8c0a51dfd..7a939317c 100644 --- a/irr/include/SMaterial.h +++ b/irr/include/SMaterial.h @@ -7,8 +7,8 @@ #include "SColor.h" #include "matrix4.h" #include "irrMath.h" -#include "EMaterialTypes.h" -#include "EMaterialProps.h" +#include "EMaterialTypes.h" // IWYU pragma: export +#include "EMaterialProps.h" // IWYU pragma: export #include "SMaterialLayer.h" #include "IrrCompileConfig.h" // for IRRLICHT_API diff --git a/irr/include/SMeshBuffer.h b/irr/include/SMeshBuffer.h index 2053db958..c92669724 100644 --- a/irr/include/SMeshBuffer.h +++ b/irr/include/SMeshBuffer.h @@ -3,4 +3,4 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h // replaced by template -#include "CMeshBuffer.h" +#include "CMeshBuffer.h" // IWYU pragma: export diff --git a/irr/include/SSkinMeshBuffer.h b/irr/include/SSkinMeshBuffer.h index 303207d93..b0b6658b3 100644 --- a/irr/include/SSkinMeshBuffer.h +++ b/irr/include/SSkinMeshBuffer.h @@ -8,7 +8,6 @@ #include "CVertexBuffer.h" #include "CIndexBuffer.h" #include "S3DVertex.h" -#include "irrArray.h" namespace irr { diff --git a/irr/include/SVertexIndex.h b/irr/include/SVertexIndex.h index 21cf42583..73db1d23f 100644 --- a/irr/include/SVertexIndex.h +++ b/irr/include/SVertexIndex.h @@ -4,8 +4,6 @@ #pragma once -#include "irrTypes.h" - namespace irr { namespace video diff --git a/irr/include/SVertexManipulator.h b/irr/include/SVertexManipulator.h index f302273c8..80111b8ed 100644 --- a/irr/include/SVertexManipulator.h +++ b/irr/include/SVertexManipulator.h @@ -4,9 +4,7 @@ #pragma once -#include "matrix4.h" -#include "S3DVertex.h" -#include "SColor.h" +#include "vector3d.h" namespace irr { diff --git a/irr/include/coreutil.h b/irr/include/coreutil.h index 73d1c4b43..ca19c00ca 100644 --- a/irr/include/coreutil.h +++ b/irr/include/coreutil.h @@ -4,7 +4,6 @@ #pragma once -#include "irrString.h" #include "path.h" namespace irr diff --git a/irr/include/fast_atof.h b/irr/include/fast_atof.h index 8bbd0e9f1..2b517d62d 100644 --- a/irr/include/fast_atof.h +++ b/irr/include/fast_atof.h @@ -4,8 +4,10 @@ #pragma once -#include "irrMath.h" -#include "irrString.h" +#include "irrTypes.h" +#include +#include +#include namespace irr { @@ -305,7 +307,7 @@ inline const char *fast_atof_move(const char *in, f32 &result) if (numDecimals < IRR_ATOF_TABLE_SIZE) { value += decimal * fast_atof_table[numDecimals]; } else { - value += decimal * (f32)pow(10.f, -(float)numDecimals); + value += decimal * std::pow(10.f, -(float)numDecimals); } in = afterDecimal; } @@ -316,7 +318,7 @@ inline const char *fast_atof_move(const char *in, f32 &result) // strtol10() will deal with both + and - signs, // but calculate as f32 to prevent overflow at FLT_MAX // Using pow with float cast instead of powf as otherwise accuracy decreases. - value *= (f32)pow(10.f, (f32)strtol10(in, &in)); + value *= std::pow(10.f, (f32)strtol10(in, &in)); } result = negative ? -value : value; diff --git a/irr/include/irrArray.h b/irr/include/irrArray.h index 9f390e79b..4a87382bc 100644 --- a/irr/include/irrArray.h +++ b/irr/include/irrArray.h @@ -155,7 +155,7 @@ public: } //! Assignment operator - const array &operator=(const array &other) + array &operator=(const array &other) { if (this == &other) return *this; diff --git a/irr/include/irrlicht.h b/irr/include/irrlicht.h index 5b7042fc6..14a190e53 100644 --- a/irr/include/irrlicht.h +++ b/irr/include/irrlicht.h @@ -28,106 +28,12 @@ #pragma once -#include "aabbox3d.h" -#include "CMeshBuffer.h" -#include "coreutil.h" -#include "dimension2d.h" -#include "ECullingTypes.h" -#include "EDebugSceneTypes.h" -#include "EDriverFeatures.h" -#include "EDriverTypes.h" -#include "EGUIAlignment.h" -#include "EGUIElementTypes.h" -#include "EHardwareBufferFlags.h" -#include "EMaterialProps.h" -#include "EMaterialTypes.h" -#include "ESceneNodeTypes.h" -#include "fast_atof.h" -#include "IAnimatedMesh.h" -#include "IAnimatedMeshSceneNode.h" -#include "IAttributes.h" -#include "IBillboardSceneNode.h" -#include "IBoneSceneNode.h" -#include "ICameraSceneNode.h" -#include "IContextManager.h" -#include "ICursorControl.h" -#include "IDummyTransformationSceneNode.h" -#include "IEventReceiver.h" -#include "IFileList.h" -#include "IFileSystem.h" -#include "IGPUProgrammingServices.h" -#include "IGUIButton.h" -#include "IGUICheckBox.h" -#include "IGUIComboBox.h" -#include "IGUIEditBox.h" -#include "IGUIElement.h" -#include "IGUIEnvironment.h" -#include "IGUIFileOpenDialog.h" -#include "IGUIFont.h" -#include "IGUIFontBitmap.h" -#include "IGUIImage.h" -#include "IGUIListBox.h" -#include "IGUIScrollBar.h" -#include "IGUISkin.h" -#include "IGUISpriteBank.h" -#include "IGUIStaticText.h" -#include "IGUITabControl.h" -#include "IGUIToolbar.h" -#include "IImage.h" -#include "IImageLoader.h" -#include "IImageWriter.h" -#include "IIndexBuffer.h" -#include "ILogger.h" -#include "IMaterialRenderer.h" -#include "IMaterialRendererServices.h" -#include "IMesh.h" -#include "IMeshBuffer.h" -#include "IMeshCache.h" -#include "IMeshLoader.h" -#include "IMeshManipulator.h" -#include "IMeshSceneNode.h" -#include "IOSOperator.h" -#include "IReadFile.h" -#include "IReferenceCounted.h" -#include "irrArray.h" -#include "IRenderTarget.h" #include "IrrlichtDevice.h" -#include "irrMath.h" -#include "irrString.h" +#include "dimension2d.h" +#include "EDriverTypes.h" +#include "IEventReceiver.h" #include "irrTypes.h" -#include "path.h" -#include "ISceneCollisionManager.h" -#include "ISceneManager.h" -#include "ISceneNode.h" -#include "IShaderConstantSetCallBack.h" -#include "ISkinnedMesh.h" -#include "ITexture.h" -#include "ITimer.h" -#include "IVertexBuffer.h" -#include "IVideoDriver.h" -#include "IWriteFile.h" -#include "Keycodes.h" -#include "line2d.h" -#include "line3d.h" -#include "matrix4.h" -#include "plane3d.h" -#include "position2d.h" -#include "quaternion.h" -#include "rect.h" -#include "S3DVertex.h" -#include "SAnimatedMesh.h" -#include "SceneParameters.h" -#include "SColor.h" -#include "SExposedVideoData.h" #include "SIrrCreationParameters.h" -#include "SMaterial.h" -#include "SMesh.h" -#include "SMeshBuffer.h" -#include "SSkinMeshBuffer.h" -#include "SVertexIndex.h" -#include "SViewFrustum.h" -#include "vector2d.h" -#include "vector3d.h" #include "IrrCompileConfig.h" // for IRRLICHT_API and IRRCALLCONV /*! \mainpage Irrlicht Engine 1.9 API documentation @@ -166,6 +72,8 @@ * * \code * #include + * // include a bunch of other stuff... + * * using namespace irr; * * int main() @@ -241,8 +149,6 @@ * a look into the examples directory of the SDK. */ -#include "SIrrCreationParameters.h" - //! Everything in the Irrlicht Engine can be found in this namespace. namespace irr { @@ -314,5 +220,5 @@ namespace video } /*! \file irrlicht.h - \brief Main header file of the irrlicht, the only file needed to include. + \brief Main header file of the irrlicht, needed to create a device. */ diff --git a/irr/include/mt_opengl.h b/irr/include/mt_opengl.h index 32d3f1c0a..f69ba8c69 100755 --- a/irr/include/mt_opengl.h +++ b/irr/include/mt_opengl.h @@ -6,7 +6,6 @@ #include #include #include "IrrCompileConfig.h" // for IRRLICHT_API -#include "irrTypes.h" #include "IContextManager.h" #include diff --git a/irr/include/quaternion.h b/irr/include/quaternion.h index 5a2e16367..4e90fa067 100644 --- a/irr/include/quaternion.h +++ b/irr/include/quaternion.h @@ -277,7 +277,8 @@ inline quaternion &quaternion::operator=(const matrix4 &m) } } - return normalize(); + normalize(); + return *this; } #endif diff --git a/irr/scripts/BindingGenerator.lua b/irr/scripts/BindingGenerator.lua index 0f9ffa764..d0be04293 100755 --- a/irr/scripts/BindingGenerator.lua +++ b/irr/scripts/BindingGenerator.lua @@ -198,7 +198,7 @@ local consts = List(); -- Parse a whole header, extracting the data. local function ParseHeader( path, into, apiRegex, defs, consts, nameSet, noNewNames ) defs:AddFormat( "\t// %s", path ); - local f = assert( io.open( path, "r" ), "Could not open " .. path ); + local f = assert( io.open( path, "r" ) ); for line in f:lines() do -- Do not parse PFN typedefs; they're easily reconstructible. local T, rawName, args = line:match( apiRegex ); @@ -340,7 +340,7 @@ end ------------ Write files ------------ -- Write loader header -local f = io.open( sourceTreePath .. "/include/mt_opengl.h", "wb" ); +local f = assert(io.open( sourceTreePath .. "/include/mt_opengl.h", "wb" )); f:write[[ // This code was generated by scripts/BindingGenerator.lua // Do not modify it, modify and run the generator instead. @@ -350,7 +350,6 @@ f:write[[ #include #include #include "IrrCompileConfig.h" // for IRRLICHT_API -#include "irrTypes.h" #include "IContextManager.h" #include @@ -408,7 +407,7 @@ f:write( "IRRLICHT_API extern OpenGLProcedures GL;\n" ); f:close(); -- Write loader implementation -f = io.open( sourceTreePath .. "/src/mt_opengl_loader.cpp", "wb" ); +f = assert(io.open( sourceTreePath .. "/src/mt_opengl_loader.cpp", "wb" )); f:write[[ // This code was generated by scripts/BindingGenerator.lua // Do not modify it, modify and run the generator instead. diff --git a/irr/src/CB3DMeshFileLoader.cpp b/irr/src/CB3DMeshFileLoader.cpp index cf6a980d8..6cb40cb95 100644 --- a/irr/src/CB3DMeshFileLoader.cpp +++ b/irr/src/CB3DMeshFileLoader.cpp @@ -10,6 +10,7 @@ #include "IVideoDriver.h" #include "IFileSystem.h" +#include "coreutil.h" #include "os.h" #include diff --git a/irr/src/CFileSystem.cpp b/irr/src/CFileSystem.cpp index 386bb389c..4b938c4c5 100644 --- a/irr/src/CFileSystem.cpp +++ b/irr/src/CFileSystem.cpp @@ -7,12 +7,11 @@ #include "IWriteFile.h" #include "CZipReader.h" #include "CFileList.h" -#include "stdio.h" -#include "os.h" #include "CReadFile.h" #include "CMemoryFile.h" #include "CLimitReadFile.h" #include "CWriteFile.h" +#include "coreutil.h" #include #if defined(__STRICT_ANSI__) diff --git a/irr/src/CImageLoaderBMP.cpp b/irr/src/CImageLoaderBMP.cpp index 301edb2fe..40989882e 100644 --- a/irr/src/CImageLoaderBMP.cpp +++ b/irr/src/CImageLoaderBMP.cpp @@ -8,8 +8,8 @@ #include "SColor.h" #include "CColorConverter.h" #include "CImage.h" +#include "coreutil.h" #include "os.h" -#include "irrString.h" namespace irr { diff --git a/irr/src/CImageLoaderJPG.cpp b/irr/src/CImageLoaderJPG.cpp index e64c458e7..5b7978a4b 100644 --- a/irr/src/CImageLoaderJPG.cpp +++ b/irr/src/CImageLoaderJPG.cpp @@ -6,8 +6,10 @@ #include "IReadFile.h" #include "CImage.h" +#include "coreutil.h" #include "os.h" #include "irrString.h" +#include namespace irr { diff --git a/irr/src/CImageLoaderJPG.h b/irr/src/CImageLoaderJPG.h index 921a46a25..ffdc6c95c 100644 --- a/irr/src/CImageLoaderJPG.h +++ b/irr/src/CImageLoaderJPG.h @@ -6,9 +6,8 @@ #include "IImageLoader.h" -#include // required for jpeglib.h +#include // IWYU pragma: keep (required for jpeglib.h) #include // use system lib -#include namespace irr { diff --git a/irr/src/CImageLoaderPNG.cpp b/irr/src/CImageLoaderPNG.cpp index 69a283890..f1951e71b 100644 --- a/irr/src/CImageLoaderPNG.cpp +++ b/irr/src/CImageLoaderPNG.cpp @@ -7,7 +7,8 @@ #include // use system lib png #include "CImage.h" -#include "CReadFile.h" +#include "IReadFile.h" +#include "coreutil.h" #include "os.h" namespace irr diff --git a/irr/src/CImageLoaderTGA.cpp b/irr/src/CImageLoaderTGA.cpp index 5b7cc6143..1fd5dddc8 100644 --- a/irr/src/CImageLoaderTGA.cpp +++ b/irr/src/CImageLoaderTGA.cpp @@ -5,10 +5,10 @@ #include "CImageLoaderTGA.h" #include "IReadFile.h" +#include "coreutil.h" #include "os.h" #include "CColorConverter.h" #include "CImage.h" -#include "irrString.h" #define MAX(x, y) (((x) > (y)) ? (x) : (y)) diff --git a/irr/src/CImageWriterJPG.cpp b/irr/src/CImageWriterJPG.cpp index 574e46041..fa8ad64bc 100644 --- a/irr/src/CImageWriterJPG.cpp +++ b/irr/src/CImageWriterJPG.cpp @@ -6,15 +6,12 @@ #include "CColorConverter.h" #include "IWriteFile.h" -#include "CImage.h" -#include "irrString.h" +#include "coreutil.h" #include "os.h" -#include // required for jpeglib.h -extern "C" { +#include // IWYU pragma: keep (required for jpeglib.h) #include #include -} namespace irr { diff --git a/irr/src/CImageWriterPNG.cpp b/irr/src/CImageWriterPNG.cpp index 7bd3065c6..14c9f2d9c 100644 --- a/irr/src/CImageWriterPNG.cpp +++ b/irr/src/CImageWriterPNG.cpp @@ -4,10 +4,9 @@ #include "CImageWriterPNG.h" -#include "CImageLoaderPNG.h" #include "CColorConverter.h" #include "IWriteFile.h" -#include "irrString.h" +#include "coreutil.h" #include "os.h" // for logging #include // use system lib png diff --git a/irr/src/CIrrDeviceOSX.mm b/irr/src/CIrrDeviceOSX.mm index e335085e4..43c1c81b6 100644 --- a/irr/src/CIrrDeviceOSX.mm +++ b/irr/src/CIrrDeviceOSX.mm @@ -12,6 +12,7 @@ #include "CIrrDeviceOSX.h" #include "IEventReceiver.h" +#include "IVideoDriver.h" #include "os.h" #include "CTimer.h" #include "irrString.h" diff --git a/irr/src/CSkinnedMesh.h b/irr/src/CSkinnedMesh.h index 1be6ee7bc..576ae1217 100644 --- a/irr/src/CSkinnedMesh.h +++ b/irr/src/CSkinnedMesh.h @@ -6,6 +6,7 @@ #pragma once +#include "ISceneManager.h" #include "ISkinnedMesh.h" #include "SMeshBuffer.h" #include "quaternion.h" @@ -17,6 +18,7 @@ namespace scene class IAnimatedMeshSceneNode; class IBoneSceneNode; +class ISceneManager; class CSkinnedMesh : public ISkinnedMesh { diff --git a/irr/src/Irrlicht.cpp b/irr/src/Irrlicht.cpp index eb94fa4eb..b1818eb55 100644 --- a/irr/src/Irrlicht.cpp +++ b/irr/src/Irrlicht.cpp @@ -5,6 +5,9 @@ static const char *const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Gebhardt"; // put string in binary #include "irrlicht.h" +#include "matrix4.h" +#include "SMaterial.h" + #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ #include "CIrrDeviceWin32.h" #endif diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index 60d4fb6c8..938378df8 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -17,10 +17,10 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "IAttributes.h" #include "gui/mainmenumanager.h" #include "clouds.h" #include "gui/touchcontrols.h" -#include "server.h" #include "filesys.h" #include "gui/guiMainMenu.h" #include "game.h" @@ -34,7 +34,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "clientlauncher.h" #include "version.h" #include "renderingengine.h" -#include "network/networkexceptions.h" #include "util/tracy_wrapper.h" #include #include diff --git a/src/client/game.cpp b/src/client/game.cpp index 8e01c40da..a4920a164 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "game.h" -#include #include +#include "IAttributes.h" #include "client/renderingengine.h" #include "camera.h" #include "client.h" @@ -44,7 +44,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "itemdef.h" #include "log.h" #include "log_internal.h" -#include "filesys.h" #include "gameparams.h" #include "gettext.h" #include "gui/guiChatConsole.h" @@ -55,7 +54,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "gui/guiVolumeChange.h" #include "gui/mainmenumanager.h" #include "gui/profilergraph.h" -#include "mapblock.h" #include "minimap.h" #include "nodedef.h" // Needed for determining pointing to nodes #include "nodemetadata.h" @@ -73,7 +71,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/directiontables.h" #include "util/pointedthing.h" #include "util/quicktune_shortcutter.h" -#include "irrlicht_changes/static_text.h" #include "irr_ptr.h" #include "version.h" #include "script/scripting_client.h" @@ -2815,7 +2812,7 @@ static void pauseNodeAnimation(PausedNodesList &paused, scene::ISceneNode *node) float speed = animated_node->getAnimationSpeed(); if (!speed) return; - paused.push_back({grab(animated_node), speed}); + paused.emplace_back(grab(animated_node), speed); animated_node->setAnimationSpeed(0.0f); } @@ -3507,7 +3504,7 @@ PointedThing Game::updatePointedThing( if (show_entity_selectionbox && runData.selected_object->doShowSelectionBox() && runData.selected_object->getSelectionBox(&selection_box)) { v3f pos = runData.selected_object->getPosition(); - selectionboxes->push_back(aabb3f(selection_box)); + selectionboxes->push_back(selection_box); hud->setSelectionPos(pos, camera_offset); GenericCAO* gcao = dynamic_cast(runData.selected_object); if (gcao != nullptr && gcao->getProperties().rotate_selectionbox) diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index 522383f22..828591149 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include "IMeshCache.h" #include "fontengine.h" #include "client.h" #include "clouds.h" @@ -34,8 +35,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "renderingengine.h" #include "render/core.h" #include "render/factory.h" -#include "inputhandler.h" -#include "gettext.h" #include "filesys.h" #include "irrlicht_changes/static_text.h" #include "irr_ptr.h" diff --git a/src/config.h b/src/config.h index d573a0fab..9839cedda 100644 --- a/src/config.h +++ b/src/config.h @@ -1,7 +1,7 @@ #pragma once #if defined USE_CMAKE_CONFIG_H - #include "cmake_config.h" + #include "cmake_config.h" // IWYU pragma: export #else #warning Missing configuration #endif diff --git a/src/gui/guiScene.cpp b/src/gui/guiScene.cpp index 06784cd6e..eba9918c3 100644 --- a/src/gui/guiScene.cpp +++ b/src/gui/guiScene.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include "IAttributes.h" #include "porting.h" GUIScene::GUIScene(gui::IGUIEnvironment *env, scene::ISceneManager *smgr, diff --git a/src/irrlicht_changes/CGUITTFont.cpp b/src/irrlicht_changes/CGUITTFont.cpp index bc920d5b3..ee5ec6b35 100644 --- a/src/irrlicht_changes/CGUITTFont.cpp +++ b/src/irrlicht_changes/CGUITTFont.cpp @@ -30,9 +30,15 @@ john@suckerfreegames.com */ -#include #include #include "CGUITTFont.h" +#include "CMeshBuffer.h" +#include "IFileSystem.h" +#include "IGUIEnvironment.h" +#include "IMeshManipulator.h" +#include "IMeshSceneNode.h" +#include "ISceneManager.h" +#include "ISceneNode.h" namespace irr { diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h index b67d518ae..f8e9d8896 100644 --- a/src/irrlicht_changes/CGUITTFont.h +++ b/src/irrlicht_changes/CGUITTFont.h @@ -32,10 +32,14 @@ #pragma once -#include #include -#include #include +#include "IGUIEnvironment.h" +#include "IGUIFont.h" +#include "ISceneManager.h" +#include "IVideoDriver.h" +#include "IrrlichtDevice.h" +#include "SMesh.h" #include "util/enriched_string.h" #include "util/basic_macros.h" #include FT_FREETYPE_H @@ -64,7 +68,7 @@ namespace gui DISABLE_CLASS_COPY(SGUITTGlyph); //! This class would be trivially copyable except for the reference count on `surface`. - SGUITTGlyph(SGUITTGlyph &&other) : + SGUITTGlyph(SGUITTGlyph &&other) noexcept : isLoaded(other.isLoaded), glyph_page(other.glyph_page), source_rect(other.source_rect), diff --git a/src/unittest/test_irr_gltf_mesh_loader.cpp b/src/unittest/test_irr_gltf_mesh_loader.cpp index 6125ab026..2d87db4e3 100644 --- a/src/unittest/test_irr_gltf_mesh_loader.cpp +++ b/src/unittest/test_irr_gltf_mesh_loader.cpp @@ -1,7 +1,6 @@ // Minetest // SPDX-License-Identifier: LGPL-2.1-or-later -#include "EDriverTypes.h" #include "content/subgames.h" #include "filesys.h" @@ -9,8 +8,12 @@ #include "irr_v2d.h" #include "irr_ptr.h" +#include "EDriverTypes.h" +#include "IFileSystem.h" +#include "IReadFile.h" +#include "ISceneManager.h" #include "ISkinnedMesh.h" -#include +#include "irrlicht.h" #include "catch.h"