From 621a9c422f435ddc07f6ccb2334ea4faeb2c50fd Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Mon, 28 Jul 2025 20:13:46 +0200 Subject: [PATCH] Fix includes in source/graphics Make include-what-you-use happy with files in source/graphics and fix what needs to be fixed. Ref: #8086 Signed-off-by: Ralph Sennhauser --- source/graphics/FontManager.h | 2 +- source/graphics/ICameraController.h | 1 + source/graphics/MapGenerator.cpp | 24 +++++++++++++-- source/graphics/MapGenerator.h | 9 ++++-- source/graphics/MapIO.cpp | 8 ++++- source/graphics/MapReader.cpp | 30 +++++++++++++++++-- source/graphics/MapReader.h | 29 +++++++++++------- source/graphics/Material.h | 1 - source/graphics/ObjectBase.h | 15 ++++++---- source/graphics/ObjectEntry.h | 8 +++-- source/graphics/ObjectManager.h | 11 +++++-- source/graphics/ParticleEmitter.h | 17 +++++++++-- source/graphics/ParticleEmitterType.cpp | 1 + source/graphics/ParticleEmitterType.h | 9 ++++-- source/graphics/ParticleManager.h | 4 +++ source/graphics/Patch.h | 3 +- source/graphics/ShaderDefines.h | 12 ++++---- source/graphics/ShaderManager.cpp | 22 +++++++------- source/graphics/ShaderManager.h | 19 ++++++++---- source/graphics/ShaderProgram.h | 6 +++- source/graphics/ShaderTechnique.h | 7 +++-- source/graphics/SkeletonAnimDef.h | 10 +++++-- source/graphics/SkeletonAnimManager.h | 4 ++- source/graphics/Terrain.h | 11 +++---- source/graphics/TerrainProperties.h | 13 ++++---- source/graphics/TerrainTextureEntry.h | 3 ++ source/graphics/TerrainTextureManager.h | 17 ++++++----- source/graphics/TerritoryTexture.h | 7 +++-- source/graphics/TextRenderer.h | 10 ++++--- source/graphics/TextureConverter.h | 7 +++-- source/graphics/TextureManager.h | 18 +++++++---- source/graphics/Unit.h | 3 +- source/graphics/UnitAnimation.h | 3 +- source/graphics/UnitManager.h | 9 +++--- .../scripting/JSInterface_GameView.cpp | 13 ++++++-- source/graphics/tests/test_MapGenerator.h | 15 +++++++++- source/ps/VideoMode.cpp | 1 + 37 files changed, 273 insertions(+), 109 deletions(-) diff --git a/source/graphics/FontManager.h b/source/graphics/FontManager.h index 12245e5f37..6248dc863f 100644 --- a/source/graphics/FontManager.h +++ b/source/graphics/FontManager.h @@ -21,11 +21,11 @@ #include "lib/code_annotation.h" #include "ps/CStrIntern.h" +#include #include #include FT_FREETYPE_H #include #include -#include class CFont; struct FT_LibraryRec_; diff --git a/source/graphics/ICameraController.h b/source/graphics/ICameraController.h index 3d3ce3cffc..b80cc43f73 100644 --- a/source/graphics/ICameraController.h +++ b/source/graphics/ICameraController.h @@ -23,6 +23,7 @@ #include "simulation2/system/Entity.h" class CCamera; +class CVector3D; struct SDL_Event_; struct SViewPort; diff --git a/source/graphics/MapGenerator.cpp b/source/graphics/MapGenerator.cpp index df95ed8ff4..dc89cc0c87 100644 --- a/source/graphics/MapGenerator.cpp +++ b/source/graphics/MapGenerator.cpp @@ -22,15 +22,21 @@ #include "graphics/MapIO.h" #include "graphics/Patch.h" #include "graphics/Terrain.h" -#include "lib/status.h" -#include "lib/timer.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/file/vfs/vfs_util.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/status.h" +#include "lib/utf8.h" #include "maths/MathUtil.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/FileIo.h" +#include "ps/Filesystem.h" #include "ps/Future.h" -#include "ps/scripting/JSInterface_VFS.h" #include "ps/TemplateLoader.h" +#include "ps/scripting/JSInterface_VFS.h" #include "scriptinterface/FunctionWrapper.h" #include "scriptinterface/JSON.h" #include "scriptinterface/ModuleLoader.h" @@ -38,14 +44,26 @@ #include "scriptinterface/ScriptContext.h" #include "scriptinterface/ScriptConversions.h" #include "scriptinterface/ScriptInterface.h" +#include "scriptinterface/ScriptRequest.h" #include "simulation2/helpers/MapEdgeTiles.h" +#include "simulation2/system/ParamNode.h" #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include #include +struct JSContext; + namespace { constexpr const char* GENERATOR_NAME{"generateMap"}; diff --git a/source/graphics/MapGenerator.h b/source/graphics/MapGenerator.h index 5901c38350..03f16fc331 100644 --- a/source/graphics/MapGenerator.h +++ b/source/graphics/MapGenerator.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,12 +19,17 @@ #define INCLUDED_MAPGENERATOR #include "lib/file/vfs/vfs_path.h" -#include "ps/Future.h" +#include "lib/types.h" #include "scriptinterface/ScriptTypes.h" #include "scriptinterface/StructuredClone.h" #include +#include #include +#include + +class ScriptInterface; +class StopToken; constexpr std::wstring_view RANDOM_MAP_PREFIX{L"maps/random/"}; diff --git a/source/graphics/MapIO.cpp b/source/graphics/MapIO.cpp index 66aaea128b..d050f1ccbe 100644 --- a/source/graphics/MapIO.cpp +++ b/source/graphics/MapIO.cpp @@ -20,17 +20,23 @@ #include "MapIO.h" #include "graphics/Patch.h" +#include "lib/alignment.h" #include "lib/allocators/shared_ptr.h" #include "lib/file/file.h" +#include "lib/file/vfs/vfs.h" #include "lib/file/vfs/vfs_path.h" #include "lib/os_path.h" +#include "lib/posix/posix_types.h" #include "lib/status.h" #include "lib/tex/tex.h" #include "maths/MathUtil.h" #include "ps/Filesystem.h" -#include #include +#include +#include +#include +#include #include Status ParseHeightmapImage(const std::shared_ptr& fileData, size_t fileSize, std::vector& heightmap); diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index 40fb8f8d68..919cbb556f 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -20,30 +20,46 @@ #include "MapReader.h" #include "graphics/Camera.h" -#include "graphics/CinemaManager.h" +#include "graphics/Color.h" #include "graphics/Entity.h" #include "graphics/GameView.h" #include "graphics/MapGenerator.h" +#include "graphics/MapIO.h" +#include "graphics/MiniPatch.h" #include "graphics/Patch.h" #include "graphics/Terrain.h" #include "graphics/TerrainTextureEntry.h" #include "graphics/TerrainTextureManager.h" +#include "lib/alignment.h" +#include "lib/code_annotation.h" +#include "lib/code_generation.h" +#include "lib/debug.h" +#include "lib/path.h" #include "lib/timer.h" +#include "lib/utf8.h" +#include "maths/Fixed.h" +#include "maths/FixedVector3D.h" #include "maths/MathUtil.h" +#include "maths/Matrix3D.h" +#include "maths/NUSpline.h" #include "ps/CLogger.h" +#include "ps/Filesystem.h" +#include "ps/Future.h" #include "ps/Loader.h" #include "ps/Profiler2.h" #include "ps/TaskManager.h" #include "ps/World.h" +#include "ps/XMB/XMBData.h" #include "ps/XML/Xeromyces.h" #include "renderer/PostprocManager.h" #include "renderer/SkyManager.h" #include "renderer/WaterManager.h" +#include "scriptinterface/JSON.h" #include "scriptinterface/Object.h" #include "scriptinterface/ScriptContext.h" #include "scriptinterface/ScriptInterface.h" #include "scriptinterface/ScriptRequest.h" -#include "scriptinterface/JSON.h" +#include "scriptinterface/StructuredClone.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpCinemaManager.h" #include "simulation2/components/ICmpGarrisonHolder.h" @@ -56,8 +72,18 @@ #include "simulation2/components/ICmpTurretHolder.h" #include "simulation2/components/ICmpVisual.h" #include "simulation2/components/ICmpWaterManager.h" +#include "simulation2/helpers/CinemaPath.h" +#include "simulation2/helpers/Position.h" +#include "simulation2/system/CmpPtr.h" +#include +#include #include +#include +#include +#include +#include +#include extern bool IsQuitRequested(); diff --git a/source/graphics/MapReader.h b/source/graphics/MapReader.h index 64ec43a52e..82482ff50a 100644 --- a/source/graphics/MapReader.h +++ b/source/graphics/MapReader.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,27 +21,36 @@ #include "MapIO.h" #include "graphics/LightEnv.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/posix/posix_types.h" +#include "lib/types.h" +#include "maths/Vector3D.h" #include "ps/CStr.h" +#include "ps/Errors.h" #include "ps/FileIo.h" #include "scriptinterface/ScriptTypes.h" #include "simulation2/system/Entity.h" +#include +#include +#include +#include #include +#include -class CTerrain; -class WaterManager; -class SkyManager; -class CLightEnv; class CCinemaManager; -class CPostprocManager; -class CTriggerManager; -class CSimulation2; -class CSimContext; -class CTerrainTextureEntry; class CGameView; +class CPostprocManager; +class CSimContext; +class CSimulation2; +class CTerrain; +class CTerrainTextureEntry; +class CTriggerManager; class CXMLReader; class ScriptContext; class ScriptInterface; +class SkyManager; +class WaterManager; class CMapReader : public CMapIO { diff --git a/source/graphics/Material.h b/source/graphics/Material.h index 30cc671717..7058f4ad64 100644 --- a/source/graphics/Material.h +++ b/source/graphics/Material.h @@ -18,7 +18,6 @@ #ifndef INCLUDED_MATERIAL #define INCLUDED_MATERIAL -#include "graphics/Color.h" #include "graphics/ShaderDefines.h" #include "graphics/Texture.h" #include "ps/CStr.h" diff --git a/source/graphics/ObjectBase.h b/source/graphics/ObjectBase.h index 8cabb4a0da..15f5da7d2a 100644 --- a/source/graphics/ObjectBase.h +++ b/source/graphics/ObjectBase.h @@ -18,16 +18,14 @@ #ifndef INCLUDED_OBJECTBASE #define INCLUDED_OBJECTBASE +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/path.h" +#include "lib/types.h" #include "ps/CStr.h" #include "ps/CStrIntern.h" -class CActorDef; -class CObjectEntry; -class CObjectManager; -class CXeromyces; -class XMBElement; - +#include #include #include #include @@ -35,6 +33,11 @@ class XMBElement; #include #include +class CActorDef; +class CObjectManager; +class CXeromyces; +class XMBElement; + /** * Maintains the tree of possible objects from a specific actor definition at a given quality level. * An Object Base is made of: diff --git a/source/graphics/ObjectEntry.h b/source/graphics/ObjectEntry.h index a6529863ab..0feed1d47c 100644 --- a/source/graphics/ObjectEntry.h +++ b/source/graphics/ObjectEntry.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,19 +20,21 @@ #include "graphics/Color.h" #include "graphics/ObjectBase.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "ps/CStr.h" #include #include #include +#include #include class CModelAbstract; -class CSkeletonAnim; -class CObjectBase; class CObjectManager; class CSimulation2; +class CSkeletonAnim; class CObjectEntry { diff --git a/source/graphics/ObjectManager.h b/source/graphics/ObjectManager.h index eb0b1f92ba..ccf7bd78c9 100644 --- a/source/graphics/ObjectManager.h +++ b/source/graphics/ObjectManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,13 +18,18 @@ #ifndef INCLUDED_OBJECTMANAGER #define INCLUDED_OBJECTMANAGER -#include "ps/CStr.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/status.h" +#include "lib/types.h" +#include "ps/CStr.h" -#include +#include #include #include +#include #include +#include #include class CActorDef; diff --git a/source/graphics/ParticleEmitter.h b/source/graphics/ParticleEmitter.h index 332b71045a..8bc07c4c6c 100644 --- a/source/graphics/ParticleEmitter.h +++ b/source/graphics/ParticleEmitter.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,12 +20,23 @@ #include "graphics/ModelAbstract.h" #include "graphics/ParticleEmitterType.h" +#include "graphics/SColor.h" +#include "lib/posix/posix_types.h" +#include "maths/BoundingBoxAligned.h" #include "maths/Quaternion.h" -#include "renderer/backend/IDeviceCommandContext.h" -#include "renderer/backend/IShaderProgram.h" +#include "maths/Vector3D.h" #include "renderer/VertexArray.h" +#include #include +#include +#include +#include + +class CParticleEmitter; +namespace Renderer::Backend { class IDeviceCommandContext; } +namespace Renderer::Backend { class IShaderProgram; } +namespace Renderer::Backend { class IVertexInputLayout; } /** * Simulation state for a single particle. diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp index b1f0ec870f..c8e2078da6 100644 --- a/source/graphics/ParticleEmitterType.cpp +++ b/source/graphics/ParticleEmitterType.cpp @@ -43,6 +43,7 @@ #include #include #include +#include /** * Interface for particle state variables, which get evaluated for each newly diff --git a/source/graphics/ParticleEmitterType.h b/source/graphics/ParticleEmitterType.h index 5861be05ed..714b1ead24 100644 --- a/source/graphics/ParticleEmitterType.h +++ b/source/graphics/ParticleEmitterType.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,17 +19,20 @@ #define INCLUDED_PARTICLEEMITTERTYPE #include "graphics/Texture.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "maths/BoundingBoxAligned.h" #include #include +#include -class CVector3D; class CParticleEmitter; class CParticleManager; -class IParticleVar; +class CVector3D; class IParticleEffector; +class IParticleVar; /** * Particle emitter type - stores the common state data for all emitters of that diff --git a/source/graphics/ParticleManager.h b/source/graphics/ParticleManager.h index 417c192594..b5af592ef7 100644 --- a/source/graphics/ParticleManager.h +++ b/source/graphics/ParticleManager.h @@ -20,11 +20,15 @@ #include "graphics/ParticleEmitter.h" #include "graphics/ParticleEmitterType.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/path.h" +#include "lib/status.h" #include #include #include +class CFrustum; class SceneCollector; class CParticleManager diff --git a/source/graphics/Patch.h b/source/graphics/Patch.h index d4cdd98ef2..edc1d915d6 100644 --- a/source/graphics/Patch.h +++ b/source/graphics/Patch.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2009 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include "MiniPatch.h" #include "RenderableObject.h" +#include "lib/posix/posix_types.h" class CTerrain; diff --git a/source/graphics/ShaderDefines.h b/source/graphics/ShaderDefines.h index 8bcc0d8ec9..72b10e4573 100644 --- a/source/graphics/ShaderDefines.h +++ b/source/graphics/ShaderDefines.h @@ -18,17 +18,19 @@ #ifndef INCLUDED_SHADERDEFINES #define INCLUDED_SHADERDEFINES -#include "ps/containers/StaticVector.h" -#include "ps/CStr.h" +#include "maths/Vector4D.h" #include "ps/CStrIntern.h" -#include "renderer/backend/IDeviceCommandContext.h" -#include "renderer/backend/IShaderProgram.h" +#include "ps/containers/StaticVector.h" +#include #include +#include #include +#include #include -class CVector4D; +namespace Renderer::Backend { class IDeviceCommandContext; } +namespace Renderer::Backend { class IShaderProgram; } /** * Represents a mapping of name strings to value, for use with diff --git a/source/graphics/ShaderManager.cpp b/source/graphics/ShaderManager.cpp index 197d46b5c2..2cf672e173 100644 --- a/source/graphics/ShaderManager.cpp +++ b/source/graphics/ShaderManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,32 +19,34 @@ #include "ShaderManager.h" +#include "graphics/Color.h" #include "graphics/PreprocessorWrapper.h" +#include "graphics/ShaderProgram.h" #include "graphics/ShaderTechnique.h" -#include "lib/config2.h" +#include "lib/debug.h" #include "lib/hash.h" #include "lib/timer.h" #include "lib/utf8.h" #include "ps/CLogger.h" #include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include "ps/Errors.h" #include "ps/Filesystem.h" -#include "ps/Profile.h" +#include "ps/Profiler2.h" +#include "ps/XMB/XMBData.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" #include "renderer/backend/Backend.h" #include "renderer/backend/CompareOp.h" #include "renderer/backend/IDevice.h" - -#define USE_SHADER_XML_VALIDATION 1 - -#if USE_SHADER_XML_VALIDATION -#include "ps/XML/RelaxNG.h" -#include "ps/XML/XMLWriter.h" -#endif +#include "renderer/backend/PipelineState.h" #include +#include #include +#define USE_SHADER_XML_VALIDATION 1 + TIMER_ADD_CLIENT(tc_ShaderValidation); CShaderManager::CShaderManager(Renderer::Backend::IDevice* device) diff --git a/source/graphics/ShaderManager.h b/source/graphics/ShaderManager.h index ba1f0913e9..9f52e51eac 100644 --- a/source/graphics/ShaderManager.h +++ b/source/graphics/ShaderManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,16 +19,25 @@ #define INCLUDED_SHADERMANAGER #include "graphics/ShaderDefines.h" -#include "graphics/ShaderProgram.h" +#include "graphics/ShaderProgramPtr.h" #include "graphics/ShaderTechnique.h" -#include "renderer/backend/IDevice.h" -#include "renderer/backend/PipelineState.h" +#include "graphics/ShaderTechniquePtr.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/path.h" +#include "lib/status.h" +#include "ps/CStr.h" +#include "ps/CStrIntern.h" -#include +#include +#include #include #include +#include #include +class CShaderProgram; +namespace Renderer::Backend { class IDevice; } + /** * Shader manager: loads and caches shader programs. * diff --git a/source/graphics/ShaderProgram.h b/source/graphics/ShaderProgram.h index 40e5a9ff34..e7b85cdf6a 100644 --- a/source/graphics/ShaderProgram.h +++ b/source/graphics/ShaderProgram.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -20,12 +20,16 @@ #include "graphics/ShaderDefines.h" #include "graphics/ShaderProgramPtr.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" #include "ps/CStr.h" #include "renderer/backend/IShaderProgram.h" +#include #include +namespace Renderer::Backend { class IDevice; } + /** * A wrapper for backend shader program to handle high-level operations like * file reloading and handling errors on reload. diff --git a/source/graphics/ShaderTechnique.h b/source/graphics/ShaderTechnique.h index b4374bfe4d..a683ba3ba8 100644 --- a/source/graphics/ShaderTechnique.h +++ b/source/graphics/ShaderTechnique.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,8 +19,7 @@ #define INCLUDED_SHADERTECHNIQUE #include "graphics/ShaderDefines.h" -#include "graphics/ShaderProgram.h" -#include "graphics/ShaderTechniquePtr.h" +#include "graphics/ShaderProgramPtr.h" #include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" #include "renderer/backend/PipelineState.h" @@ -29,6 +28,8 @@ #include #include +namespace Renderer::Backend { class IShaderProgram; } + /** * Implements a render pass consisting of a pipeline state and a shader, * used by CShaderTechnique. diff --git a/source/graphics/SkeletonAnimDef.h b/source/graphics/SkeletonAnimDef.h index 0b04259e48..7178321970 100644 --- a/source/graphics/SkeletonAnimDef.h +++ b/source/graphics/SkeletonAnimDef.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,13 +22,17 @@ #ifndef INCLUDED_SKELETONANIMDEF #define INCLUDED_SKELETONANIMDEF -#include "maths/Vector3D.h" -#include "maths/Quaternion.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" +#include "maths/Quaternion.h" +#include "maths/Vector3D.h" +#include #include #include +class CMatrix3D; + //////////////////////////////////////////////////////////////////////////////////////// // CBoneState: structure describing state of a bone at some point class CBoneState diff --git a/source/graphics/SkeletonAnimManager.h b/source/graphics/SkeletonAnimManager.h index 08b11712f5..3a19c648c7 100644 --- a/source/graphics/SkeletonAnimManager.h +++ b/source/graphics/SkeletonAnimManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,7 +22,9 @@ #ifndef INCLUDED_SKELETONANIMMANAGER #define INCLUDED_SKELETONANIMMANAGER +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/path.h" #include #include diff --git a/source/graphics/Terrain.h b/source/graphics/Terrain.h index 5585aca733..866dbd097c 100644 --- a/source/graphics/Terrain.h +++ b/source/graphics/Terrain.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -24,14 +24,15 @@ #include "graphics/HeightMipmap.h" #include "graphics/SColor.h" +#include "lib/posix/posix_types.h" +#include "lib/types.h" #include "maths/Fixed.h" #include "maths/Vector3D.h" -#include "ps/CStr.h" -class CPatch; -class CMiniPatch; -class CFixedVector3D; class CBoundingBoxAligned; +class CFixedVector3D; +class CMiniPatch; +class CPatch; /////////////////////////////////////////////////////////////////////////////// // Terrain Constants: diff --git a/source/graphics/TerrainProperties.h b/source/graphics/TerrainProperties.h index a35389e21a..7f7d5f9ed6 100644 --- a/source/graphics/TerrainProperties.h +++ b/source/graphics/TerrainProperties.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -27,15 +27,16 @@ #ifndef INCLUDED_TERRAINPROPERTIES #define INCLUDED_TERRAINPROPERTIES -#include - -#include "ps/CStr.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" + +#include +#include class CTerrainGroup; -class XMBElement; -class CXeromyces; class CTerrainProperties; +class CXeromyces; +class XMBElement; typedef std::shared_ptr CTerrainPropertiesPtr; diff --git a/source/graphics/TerrainTextureEntry.h b/source/graphics/TerrainTextureEntry.h index 08fcfc0da3..1086c36cf2 100644 --- a/source/graphics/TerrainTextureEntry.h +++ b/source/graphics/TerrainTextureEntry.h @@ -22,11 +22,14 @@ #include "graphics/TerrainTextureManager.h" #include "graphics/Texture.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "maths/Matrix3D.h" #include "ps/CStr.h" #include +class CTerrainProperties; + // CTerrainTextureEntry: class wrapping a terrain texture object; contains various other required // elements - color of minimap, terrain "group" it belongs to, etc class CTerrainTextureEntry diff --git a/source/graphics/TerrainTextureManager.h b/source/graphics/TerrainTextureManager.h index 7ed6e3bf6f..22f6e47c26 100644 --- a/source/graphics/TerrainTextureManager.h +++ b/source/graphics/TerrainTextureManager.h @@ -19,25 +19,25 @@ #define INCLUDED_TERRAINTEXTUREMANAGER #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "ps/CStr.h" #include "ps/Singleton.h" -#include "renderer/backend/IDeviceCommandContext.h" #include "renderer/backend/ITexture.h" +#include #include #include #include -// access to sole CTerrainTextureManager object -#define g_TexMan CTerrainTextureManager::GetSingleton() - -#define NUM_ALPHA_MAPS 14 - -class CTerrainTextureEntry; class CTerrainProperties; +class CTerrainTextureEntry; +namespace Renderer::Backend { class IDevice; } +namespace Renderer::Backend { class IDeviceCommandContext; } typedef std::shared_ptr CTerrainPropertiesPtr; +#define NUM_ALPHA_MAPS 14 + class CTerrainGroup { // name of this terrain group (as specified by the terrain XML) @@ -141,4 +141,7 @@ private: std::vector m_AlphaMapsToUpload; }; +// access to sole CTerrainTextureManager object +#define g_TexMan CTerrainTextureManager::GetSingleton() + #endif // INCLUDED_TERRAINTEXTUREMANAGER diff --git a/source/graphics/TerritoryTexture.h b/source/graphics/TerritoryTexture.h index 248f0ba3b4..2efa76fc61 100644 --- a/source/graphics/TerritoryTexture.h +++ b/source/graphics/TerritoryTexture.h @@ -16,13 +16,16 @@ */ #include "lib/code_annotation.h" +#include "lib/posix/posix_types.h" +#include "lib/types.h" #include "maths/Matrix3D.h" -#include "renderer/backend/IDeviceCommandContext.h" -#include "renderer/backend/ITexture.h" +#include #include class CSimulation2; +namespace Renderer::Backend { class IDeviceCommandContext; } +namespace Renderer::Backend { class ITexture; } template class Grid; /** diff --git a/source/graphics/TextRenderer.h b/source/graphics/TextRenderer.h index c6fb581d94..c43e1dd639 100644 --- a/source/graphics/TextRenderer.h +++ b/source/graphics/TextRenderer.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,16 +19,18 @@ #define INCLUDED_TEXTRENDERER #include "graphics/Color.h" -#include "graphics/ShaderProgram.h" #include "maths/Rect.h" #include "maths/Vector2D.h" #include "ps/CStrIntern.h" -#include "renderer/backend/IDeviceCommandContext.h" +#include #include +#include +#include class CFont; -class CMatrix3D; +namespace Renderer::Backend { class IDeviceCommandContext; } +namespace Renderer::Backend { class IShaderProgram; } class CTextRenderer { diff --git a/source/graphics/TextureConverter.h b/source/graphics/TextureConverter.h index d5cbbb9431..fa053ec9c9 100644 --- a/source/graphics/TextureConverter.h +++ b/source/graphics/TextureConverter.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -18,10 +18,13 @@ #ifndef INCLUDED_TEXTURECONVERTER #define INCLUDED_TEXTURECONVERTER +#include "graphics/Texture.h" #include "lib/config2.h" #include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_path.h" -#include "TextureManager.h" +#include +#include #if CONFIG2_NVTT #include "ps/Future.h" diff --git a/source/graphics/TextureManager.h b/source/graphics/TextureManager.h index 20b40c2fe2..16289a3e0f 100644 --- a/source/graphics/TextureManager.h +++ b/source/graphics/TextureManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -19,17 +19,23 @@ #define INCLUDED_TEXTUREMANAGER #include "graphics/Texture.h" +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs.h" -#include "lib/tex/tex.h" -#include "renderer/backend/IDevice.h" -#include "renderer/backend/IDeviceCommandContext.h" -#include "renderer/backend/ITexture.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" +#include "renderer/backend/Format.h" #include "renderer/backend/Sampler.h" +#include +#include #include -class CTextureProperties; class CTextureManagerImpl; +class CTextureProperties; +class Tex; +namespace Renderer::Backend { class IDevice; } +namespace Renderer::Backend { class IDeviceCommandContext; } +namespace Renderer::Backend { class ITexture; } /** * Texture manager with asynchronous loading and automatic DDS conversion/compression. diff --git a/source/graphics/Unit.h b/source/graphics/Unit.h index 98c83cf7fb..660a34609b 100644 --- a/source/graphics/Unit.h +++ b/source/graphics/Unit.h @@ -20,8 +20,9 @@ #include "lib/code_annotation.h" #include "ps/CStr.h" -#include "simulation2/system/Entity.h" // entity_id_t +#include "simulation2/system/Entity.h" +#include #include #include #include diff --git a/source/graphics/UnitAnimation.h b/source/graphics/UnitAnimation.h index 111db762d9..55b235b459 100644 --- a/source/graphics/UnitAnimation.h +++ b/source/graphics/UnitAnimation.h @@ -24,10 +24,9 @@ #include -class CUnit; class CModel; -class CSkeletonAnim; class CObjectEntry; +class CSkeletonAnim; /** * Deals with synchronisation issues between raw animation data (CModel, CSkeletonAnim) diff --git a/source/graphics/UnitManager.h b/source/graphics/UnitManager.h index a8f4eaf40a..10c5caeaf3 100644 --- a/source/graphics/UnitManager.h +++ b/source/graphics/UnitManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,15 +22,16 @@ #ifndef INCLUDED_UNITMANAGER #define INCLUDED_UNITMANAGER -#include "ps/CStrForward.h" +#include "lib/posix/posix_types.h" #include "simulation2/system/Entity.h" +#include #include -#include #include -class CUnit; class CObjectManager; +class CStrW; +class CUnit; /////////////////////////////////////////////////////////////////////////////// // CUnitManager: simple container class holding all units within the world diff --git a/source/graphics/scripting/JSInterface_GameView.cpp b/source/graphics/scripting/JSInterface_GameView.cpp index c96f904f76..86998ffd5c 100644 --- a/source/graphics/scripting/JSInterface_GameView.cpp +++ b/source/graphics/scripting/JSInterface_GameView.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -22,13 +22,22 @@ #include "graphics/Camera.h" #include "graphics/GameView.h" #include "graphics/Terrain.h" +#include "maths/Fixed.h" #include "maths/FixedVector3D.h" +#include "maths/Vector3D.h" +#include "ps/CLogger.h" #include "ps/Game.h" #include "ps/World.h" -#include "ps/CLogger.h" #include "scriptinterface/FunctionWrapper.h" #include "scriptinterface/Object.h" +#include "scriptinterface/ScriptRequest.h" #include "simulation2/helpers/Position.h" +#include "simulation2/system/Entity.h" + +#include +#include +#include +#include namespace JSI_GameView { diff --git a/source/graphics/tests/test_MapGenerator.h b/source/graphics/tests/test_MapGenerator.h index f50f822942..05bf270f51 100644 --- a/source/graphics/tests/test_MapGenerator.h +++ b/source/graphics/tests/test_MapGenerator.h @@ -15,13 +15,26 @@ * along with 0 A.D. If not, see . */ +#include "lib/self_test.h" + #include "graphics/MapGenerator.h" +#include "lib/debug.h" +#include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/file/vfs/vfs_util.h" +#include "lib/path.h" #include "ps/CLogger.h" #include "ps/Filesystem.h" #include "ps/Future.h" -#include "simulation2/system/ComponentTest.h" +#include "ps/XML/Xeromyces.h" +#include "scriptinterface/ScriptInterface.h" +#include "scriptinterface/StructuredClone.h" #include +#include +#include +#include +#include class TestMapGenerator : public CxxTest::TestSuite { diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 70aaac57fb..2b0ad11b80 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -21,6 +21,7 @@ #include "graphics/GameView.h" #include "graphics/ShaderDefines.h" +#include "graphics/ShaderProgram.h" #include "gui/GUIManager.h" #include "lib/config2.h" #include "lib/external_libraries/libsdl.h"