Cleanup headers in irr/include/ (#15181)

This commit is contained in:
DS 2024-10-18 10:58:32 +02:00 committed by GitHub
parent f2ab887644
commit e5d321d286
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 76 additions and 180 deletions

@ -4,8 +4,6 @@
#pragma once
#include "irrTypes.h"
namespace irr
{
namespace video

@ -4,7 +4,6 @@
#pragma once
#include "aabbox3d.h"
#include "IMesh.h"
namespace irr

@ -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

@ -10,10 +10,8 @@
#include "IEventReceiver.h"
#include "EGUIElementTypes.h"
#include "EGUIAlignment.h"
#include "IAttributes.h"
#include "IGUIEnvironment.h"
#include <cassert>
#include <algorithm>
#include <list>
#include <vector>

@ -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"

@ -3,7 +3,7 @@
#pragma once
#include "IGUIElement.h"
#include "IReferenceCounted.h"
#include "rect.h"
#include "irrTypes.h"

@ -6,7 +6,6 @@
#include "IGUIElement.h"
#include "SColor.h"
#include "IGUISkin.h"
namespace irr
{

@ -6,9 +6,7 @@
#include "IReferenceCounted.h"
#include "IImage.h"
#include "ITexture.h"
#include "path.h"
#include "irrArray.h"
namespace irr
{

@ -5,8 +5,7 @@
#pragma once
#include "IReferenceCounted.h"
#include "irrString.h"
#include "coreutil.h"
#include "path.h"
namespace irr
{

@ -5,7 +5,6 @@
#pragma once
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "EHardwareBufferFlags.h"
#include "EPrimitiveTypes.h"
#include "SVertexIndex.h"

@ -5,7 +5,6 @@
#pragma once
#include "SMaterial.h"
#include "S3DVertex.h"
namespace irr
{

@ -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"

@ -5,8 +5,8 @@
#pragma once
#include "IReferenceCounted.h"
#include "coreutil.h"
#include "EReadFileType.h"
#include "path.h"
namespace irr
{

@ -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

@ -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 <list>
#include <optional>
#include <string>
namespace irr
{

@ -5,11 +5,12 @@
#pragma once
#include "irrArray.h"
#include "IBoneSceneNode.h"
#include "IAnimatedMesh.h"
#include "SSkinMeshBuffer.h"
#include "quaternion.h"
#include <optional>
#include <string>
namespace irr
{

@ -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
{

@ -5,7 +5,6 @@
#pragma once
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "EHardwareBufferFlags.h"
#include "S3DVertex.h"

@ -6,6 +6,7 @@
#include "rect.h"
#include "SColor.h"
#include "IImage.h"
#include "ITexture.h"
#include "irrArray.h"
#include "matrix4.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

@ -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

@ -8,7 +8,6 @@
#include "CVertexBuffer.h"
#include "CIndexBuffer.h"
#include "S3DVertex.h"
#include "irrArray.h"
namespace irr
{

@ -4,8 +4,6 @@
#pragma once
#include "irrTypes.h"
namespace irr
{
namespace video

@ -4,9 +4,7 @@
#pragma once
#include "matrix4.h"
#include "S3DVertex.h"
#include "SColor.h"
#include "vector3d.h"
namespace irr
{

@ -4,7 +4,6 @@
#pragma once
#include "irrString.h"
#include "path.h"
namespace irr

@ -4,8 +4,10 @@
#pragma once
#include "irrMath.h"
#include "irrString.h"
#include "irrTypes.h"
#include <cfloat>
#include <climits>
#include <cmath>
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;

@ -155,7 +155,7 @@ public:
}
//! Assignment operator
const array<T> &operator=(const array<T> &other)
array<T> &operator=(const array<T> &other)
{
if (this == &other)
return *this;

@ -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 <irrlicht.h>
* // 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.
*/

@ -6,7 +6,6 @@
#include <string>
#include <unordered_set>
#include "IrrCompileConfig.h" // for IRRLICHT_API
#include "irrTypes.h"
#include "IContextManager.h"
#include <KHR/khrplatform.h>

@ -277,7 +277,8 @@ inline quaternion &quaternion::operator=(const matrix4 &m)
}
}
return normalize();
normalize();
return *this;
}
#endif

@ -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 <string>
#include <unordered_set>
#include "IrrCompileConfig.h" // for IRRLICHT_API
#include "irrTypes.h"
#include "IContextManager.h"
#include <KHR/khrplatform.h>
@ -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.

@ -10,6 +10,7 @@
#include "IVideoDriver.h"
#include "IFileSystem.h"
#include "coreutil.h"
#include "os.h"
#include <algorithm>

@ -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 <list>
#if defined(__STRICT_ANSI__)

@ -8,8 +8,8 @@
#include "SColor.h"
#include "CColorConverter.h"
#include "CImage.h"
#include "coreutil.h"
#include "os.h"
#include "irrString.h"
namespace irr
{

@ -6,8 +6,10 @@
#include "IReadFile.h"
#include "CImage.h"
#include "coreutil.h"
#include "os.h"
#include "irrString.h"
#include <csetjmp>
namespace irr
{

@ -6,9 +6,8 @@
#include "IImageLoader.h"
#include <cstdio> // required for jpeglib.h
#include <cstdio> // IWYU pragma: keep (required for jpeglib.h)
#include <jpeglib.h> // use system lib
#include <setjmp.h>
namespace irr
{

@ -7,7 +7,8 @@
#include <png.h> // use system lib png
#include "CImage.h"
#include "CReadFile.h"
#include "IReadFile.h"
#include "coreutil.h"
#include "os.h"
namespace irr

@ -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))

@ -6,15 +6,12 @@
#include "CColorConverter.h"
#include "IWriteFile.h"
#include "CImage.h"
#include "irrString.h"
#include "coreutil.h"
#include "os.h"
#include <cstdio> // required for jpeglib.h
extern "C" {
#include <cstdio> // IWYU pragma: keep (required for jpeglib.h)
#include <jpeglib.h>
#include <jerror.h>
}
namespace irr
{

@ -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 <png.h> // use system lib png

@ -12,6 +12,7 @@
#include "CIrrDeviceOSX.h"
#include "IEventReceiver.h"
#include "IVideoDriver.h"
#include "os.h"
#include "CTimer.h"
#include "irrString.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
{

@ -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

@ -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 <IGUISpriteBank.h>
#include <ICameraSceneNode.h>

@ -19,8 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "game.h"
#include <iomanip>
#include <cmath>
#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<GenericCAO*>(runData.selected_object);
if (gcao != nullptr && gcao->getProperties().rotate_selectionbox)

@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <optional>
#include <irrlicht.h>
#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"

@ -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

@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <SViewFrustum.h>
#include <IAnimatedMeshSceneNode.h>
#include <IVideoDriver.h>
#include "IAttributes.h"
#include "porting.h"
GUIScene::GUIScene(gui::IGUIEnvironment *env, scene::ISceneManager *smgr,

@ -30,9 +30,15 @@
john@suckerfreegames.com
*/
#include <irrlicht.h>
#include <iostream>
#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
{

@ -32,10 +32,14 @@
#pragma once
#include <irrlicht.h>
#include <ft2build.h>
#include <vector>
#include <map>
#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),

@ -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 <irrlicht.h>
#include "irrlicht.h"
#include "catch.h"