diff --git a/source/graphics/Camera.cpp b/source/graphics/Camera.cpp index 5a87001eb2..fbf946d999 100644 --- a/source/graphics/Camera.cpp +++ b/source/graphics/Camera.cpp @@ -21,6 +21,9 @@ #include "graphics/HFTracer.h" #include "graphics/Terrain.h" +#include "lib/code_generation.h" +#include "lib/debug.h" +#include "lib/posix/posix_types.h" #include "maths/MathUtil.h" #include "maths/Vector2D.h" #include "maths/Vector4D.h" @@ -30,6 +33,9 @@ #include "renderer/SceneRenderer.h" #include "renderer/WaterManager.h" +#include +#include + CCamera::CCamera() { // Set viewport to something anything should handle, but should be initialised diff --git a/source/graphics/CameraController.cpp b/source/graphics/CameraController.cpp index 45bb20b439..01f2edc367 100644 --- a/source/graphics/CameraController.cpp +++ b/source/graphics/CameraController.cpp @@ -19,21 +19,19 @@ #include "CameraController.h" -#include "graphics/HFTracer.h" +#include "graphics/Camera.h" #include "graphics/Terrain.h" -#include "i18n/L10n.h" +#include "lib/external_libraries/libsdl.h" #include "lib/input.h" -#include "lib/timer.h" #include "maths/MathUtil.h" #include "maths/Matrix3D.h" #include "maths/Quaternion.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/ConfigDB.h" #include "ps/Game.h" #include "ps/Globals.h" #include "ps/Hotkey.h" -#include "ps/Pyrogenesis.h" -#include "ps/TouchInput.h" #include "ps/World.h" #include "renderer/Renderer.h" #include "renderer/SceneRenderer.h" @@ -41,7 +39,12 @@ #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpPosition.h" #include "simulation2/components/ICmpRangeManager.h" -#include "simulation2/helpers/Los.h" +#include "simulation2/system/CmpPtr.h" + +#include +#include +#include +#include extern int g_xres, g_yres; diff --git a/source/graphics/Canvas2D.cpp b/source/graphics/Canvas2D.cpp index f55f2e3369..cd76bb15f4 100644 --- a/source/graphics/Canvas2D.cpp +++ b/source/graphics/Canvas2D.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 @@ -20,16 +20,30 @@ #include "Canvas2D.h" #include "graphics/Color.h" +#include "graphics/ShaderDefines.h" #include "graphics/ShaderManager.h" +#include "graphics/ShaderTechnique.h" +#include "graphics/ShaderTechniquePtr.h" #include "graphics/TextRenderer.h" #include "graphics/TextureManager.h" +#include "lib/debug.h" +#include "lib/types.h" +#include "maths/Matrix3D.h" #include "maths/Rect.h" #include "maths/Vector2D.h" -#include "ps/containers/StaticVector.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include "ps/containers/Span.h" +#include "ps/containers/StaticVector.h" #include "renderer/Renderer.h" +#include "renderer/backend/Format.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/IShaderProgram.h" +#include #include +#include +#include namespace { diff --git a/source/graphics/CinemaManager.cpp b/source/graphics/CinemaManager.cpp index 3127e48f3e..c70e03d482 100644 --- a/source/graphics/CinemaManager.cpp +++ b/source/graphics/CinemaManager.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 @@ -17,33 +17,28 @@ #include "precompiled.h" -#include "graphics/CinemaManager.h" +#include "CinemaManager.h" -#include "graphics/Camera.h" #include "graphics/Color.h" #include "graphics/GameView.h" -#include "maths/MathUtil.h" -#include "maths/Quaternion.h" +#include "graphics/Terrain.h" +#include "maths/FixedVector3D.h" +#include "maths/NUSpline.h" #include "maths/Vector3D.h" -#include "maths/Vector4D.h" -#include "ps/CLogger.h" -#include "ps/ConfigDB.h" #include "ps/CStr.h" #include "ps/Game.h" -#include "ps/GameSetup/Config.h" -#include "ps/Hotkey.h" #include "ps/World.h" #include "renderer/DebugRenderer.h" #include "renderer/Renderer.h" -#include "simulation2/components/ICmpCinemaManager.h" -#include "simulation2/components/ICmpOverlayRenderer.h" -#include "simulation2/components/ICmpRangeManager.h" -#include "simulation2/components/ICmpSelectable.h" -#include "simulation2/components/ICmpTerritoryManager.h" -#include "simulation2/helpers/CinemaPath.h" -#include "simulation2/MessageTypes.h" -#include "simulation2/system/ComponentManager.h" #include "simulation2/Simulation2.h" +#include "simulation2/components/ICmpCinemaManager.h" +#include "simulation2/helpers/CinemaPath.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/SimContext.h" + +#include +#include +#include CCinemaManager::CCinemaManager() : m_DrawPaths(false) diff --git a/source/graphics/ColladaManager.cpp b/source/graphics/ColladaManager.cpp index 7684cbe719..e4788dd07b 100644 --- a/source/graphics/ColladaManager.cpp +++ b/source/graphics/ColladaManager.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 @@ -19,15 +19,26 @@ #include "ColladaManager.h" -#include "graphics/ModelDef.h" +#include "lib/debug.h" +#include "lib/file/file_system.h" +#include "lib/file/io/write_buffer.h" +#include "lib/file/vfs/vfs_util.h" +#include "lib/path.h" +#include "lib/status.h" +#include "lib/types.h" #include "maths/MD5.h" -#include "ps/CacheLoader.h" #include "ps/CLogger.h" #include "ps/CStr.h" +#include "ps/CacheLoader.h" #include "ps/DllLoader.h" +#include "ps/Errors.h" #include "ps/Filesystem.h" +#include #include +#include +#include +#include namespace Collada { diff --git a/source/graphics/Color.cpp b/source/graphics/Color.cpp index 49e6adad8f..d8754e80af 100644 --- a/source/graphics/Color.cpp +++ b/source/graphics/Color.cpp @@ -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 @@ -17,14 +17,17 @@ #include "precompiled.h" -#include "graphics/Color.h" +#include "Color.h" #include "graphics/SColor.h" #include "lib/sysdep/arch/x86_x64/simd.h" +#include "lib/sysdep/compiler.h" #include "maths/MathUtil.h" #include "ps/CLogger.h" #include "ps/CStr.h" +#include + #if COMPILER_HAS_SSE #include #endif diff --git a/source/graphics/Decal.cpp b/source/graphics/Decal.cpp index e2a914f02b..63dba96cf8 100644 --- a/source/graphics/Decal.cpp +++ b/source/graphics/Decal.cpp @@ -19,10 +19,19 @@ #include "Decal.h" +#include "graphics/RenderableObject.h" #include "graphics/Terrain.h" +#include "maths/BoundingBoxAligned.h" #include "maths/MathUtil.h" +#include "maths/Matrix3D.h" +#include "maths/Vector3D.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include +#include +#include + std::unique_ptr CModelDecal::Clone() const { return std::make_unique(m_Terrain, m_Decal); diff --git a/source/graphics/Entity.h b/source/graphics/Entity.h index dcbe034f0f..beb8957679 100644 --- a/source/graphics/Entity.h +++ b/source/graphics/Entity.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 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,8 +18,11 @@ #ifndef INCLUDED_RMS_ENTITY #define INCLUDED_RMS_ENTITY +#include "lib/code_annotation.h" #include "maths/FixedVector3D.h" +#include + // Struct for parsing random map data struct Entity { diff --git a/source/graphics/Font.cpp b/source/graphics/Font.cpp index 4438279224..a739dcd4d2 100644 --- a/source/graphics/Font.cpp +++ b/source/graphics/Font.cpp @@ -26,9 +26,7 @@ #include "ps/Profiler2.h" #include "ps/containers/Span.h" #include "renderer/Renderer.h" -#include "renderer/backend/Backend.h" #include "renderer/backend/IDevice.h" -#include "renderer/backend/vulkan/Device.h" #include "renderer/backend/IDeviceCommandContext.h" #include "renderer/backend/ITexture.h" #include "renderer/backend/Sampler.h" diff --git a/source/graphics/FontManager.cpp b/source/graphics/FontManager.cpp index 6f7112d7a3..c1a5321460 100644 --- a/source/graphics/FontManager.cpp +++ b/source/graphics/FontManager.cpp @@ -20,16 +20,28 @@ #include "FontManager.h" #include "graphics/Font.h" -#include "graphics/TextureManager.h" #include "i18n/L10n.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/posix/posix.h" #include "ps/CLogger.h" -#include "ps/ConfigDB.h" +#include "ps/CStr.h" #include "ps/CStrInternStatic.h" +#include "ps/ConfigDB.h" #include "ps/Filesystem.h" -#include "renderer/Renderer.h" -#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include namespace { struct FontSpec { diff --git a/source/graphics/FontManager.h b/source/graphics/FontManager.h index 8f7910553d..852c8ba2de 100644 --- a/source/graphics/FontManager.h +++ b/source/graphics/FontManager.h @@ -18,11 +18,13 @@ #ifndef INCLUDED_FONTMANAGER #define INCLUDED_FONTMANAGER +#include "lib/code_annotation.h" #include "ps/CStrIntern.h" #include #include FT_FREETYPE_H +#include #include class CFont; diff --git a/source/graphics/FontMetrics.cpp b/source/graphics/FontMetrics.cpp index 3b8e1690e7..d6739a1f62 100644 --- a/source/graphics/FontMetrics.cpp +++ b/source/graphics/FontMetrics.cpp @@ -16,12 +16,12 @@ */ #include "precompiled.h" + #include "FontMetrics.h" #include "graphics/Font.h" #include "graphics/FontManager.h" -#include "ps/Filesystem.h" -#include "ps/CLogger.h" +#include "ps/CStrIntern.h" #include "renderer/Renderer.h" CFontMetrics::CFontMetrics(CStrIntern font) diff --git a/source/graphics/FontMetrics.h b/source/graphics/FontMetrics.h index fe4206468b..f992202cf7 100644 --- a/source/graphics/FontMetrics.h +++ b/source/graphics/FontMetrics.h @@ -18,6 +18,8 @@ #ifndef INCLUDED_FONTMETRICS #define INCLUDED_FONTMETRICS +#include + class CFont; class CStrIntern; diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index 0085cc911c..c076f94aa3 100644 --- a/source/graphics/GameView.cpp +++ b/source/graphics/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 @@ -19,48 +19,45 @@ #include "GameView.h" +#include "graphics/Camera.h" #include "graphics/CameraController.h" #include "graphics/CinemaManager.h" #include "graphics/ColladaManager.h" -#include "graphics/HFTracer.h" +#include "graphics/ICameraController.h" #include "graphics/LOSTexture.h" -#include "graphics/LightEnv.h" +#include "graphics/MeshManager.h" #include "graphics/MiniMapTexture.h" -#include "graphics/Model.h" #include "graphics/ObjectManager.h" #include "graphics/Patch.h" #include "graphics/SkeletonAnimManager.h" -#include "graphics/SmoothedValue.h" #include "graphics/Terrain.h" #include "graphics/TerrainTextureManager.h" #include "graphics/TerritoryTexture.h" -#include "graphics/Unit.h" -#include "graphics/UnitManager.h" +#include "lib/external_libraries/libsdl.h" #include "lib/input.h" -#include "lib/timer.h" +#include "lib/posix/posix_types.h" #include "lobby/IXmppClient.h" #include "maths/BoundingBoxAligned.h" -#include "maths/MathUtil.h" -#include "maths/Matrix3D.h" -#include "maths/Quaternion.h" -#include "ps/ConfigDB.h" +#include "maths/Frustum.h" +#include "maths/Vector3D.h" #include "ps/Filesystem.h" #include "ps/Game.h" #include "ps/Globals.h" #include "ps/Hotkey.h" #include "ps/Loader.h" #include "ps/Profile.h" -#include "ps/Pyrogenesis.h" #include "ps/TouchInput.h" #include "ps/World.h" #include "renderer/Renderer.h" #include "renderer/SceneRenderer.h" #include "renderer/WaterManager.h" #include "simulation2/Simulation2.h" -#include "simulation2/components/ICmpPosition.h" -#include "simulation2/components/ICmpRangeManager.h" #include +#include + +namespace Renderer::Backend { class IDevice; } +namespace Renderer::Backend { class IDeviceCommandContext; } class CGameViewImpl { diff --git a/source/graphics/GameView.h b/source/graphics/GameView.h index fd92c88731..6cee791ec5 100644 --- a/source/graphics/GameView.h +++ b/source/graphics/GameView.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,11 +18,11 @@ #ifndef INCLUDED_GAMEVIEW #define INCLUDED_GAMEVIEW -#include "renderer/backend/IDeviceCommandContext.h" -#include "renderer/Scene.h" -#include "simulation2/system/Entity.h" - +#include "lib/code_annotation.h" #include "lib/input.h" // InReaction - can't forward-declare enum +#include "renderer/Scene.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "simulation2/system/Entity.h" class CCamera; class CCinemaManager; diff --git a/source/graphics/HFTracer.cpp b/source/graphics/HFTracer.cpp index 250d287640..601f543c9a 100644 --- a/source/graphics/HFTracer.cpp +++ b/source/graphics/HFTracer.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 @@ -25,11 +25,13 @@ #include "graphics/Patch.h" #include "graphics/Terrain.h" +#include "lib/debug.h" #include "maths/BoundingBoxAligned.h" #include "maths/MathUtil.h" #include "maths/Vector3D.h" #include +#include // To cope well with points that are slightly off the edge of the map, // we act as if there's an N-tile margin around the edges of the heightfield. diff --git a/source/graphics/HFTracer.h b/source/graphics/HFTracer.h index adcf049db7..10ce73103c 100644 --- a/source/graphics/HFTracer.h +++ b/source/graphics/HFTracer.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,6 +22,10 @@ #ifndef INCLUDED_HFTRACER #define INCLUDED_HFTRACER +#include "lib/types.h" + +#include + class CPatch; class CVector3D; class CTerrain; diff --git a/source/graphics/HeightMipmap.cpp b/source/graphics/HeightMipmap.cpp index f8690ad5fd..9e4e87f1fd 100644 --- a/source/graphics/HeightMipmap.cpp +++ b/source/graphics/HeightMipmap.cpp @@ -19,15 +19,23 @@ #include "HeightMipmap.h" -#include "lib/bits.h" -#include "lib/timer.h" +#include "lib/alignment.h" +#include "lib/allocators/dynarray.h" #include "lib/allocators/shared_ptr.h" +#include "lib/bits.h" +#include "lib/debug.h" +#include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_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 CHeightMipmap::CHeightMipmap() { diff --git a/source/graphics/HeightMipmap.h b/source/graphics/HeightMipmap.h index 2b60df70e0..a32ecbabf7 100644 --- a/source/graphics/HeightMipmap.h +++ b/source/graphics/HeightMipmap.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 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,9 @@ #ifndef INCLUDED_HEIGHTMIPMAP #define INCLUDED_HEIGHTMIPMAP +#include "lib/code_annotation.h" +#include "lib/types.h" + #include class Path; diff --git a/source/graphics/ICameraController.cpp b/source/graphics/ICameraController.cpp index daab55986e..9598a1675e 100644 --- a/source/graphics/ICameraController.cpp +++ b/source/graphics/ICameraController.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 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,6 +19,8 @@ #include "ICameraController.h" +class CCamera; + ICameraController::ICameraController(CCamera& camera) : m_Camera(camera) { diff --git a/source/graphics/ICameraController.h b/source/graphics/ICameraController.h index 5715fe565a..bd7f8274ed 100644 --- a/source/graphics/ICameraController.h +++ b/source/graphics/ICameraController.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 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,9 +19,9 @@ #define INCLUDED_ICAMERACONTROLLER #include "graphics/Camera.h" -#include "simulation2/system/Entity.h" - +#include "lib/code_annotation.h" #include "lib/input.h" // InReaction - can't forward-declare enum +#include "simulation2/system/Entity.h" /** * @interface ICameraController defines a camera controller interface. The camera object diff --git a/source/graphics/LOSTexture.cpp b/source/graphics/LOSTexture.cpp index a644dcfa30..a375cda833 100644 --- a/source/graphics/LOSTexture.cpp +++ b/source/graphics/LOSTexture.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 @@ -19,25 +19,38 @@ #include "LOSTexture.h" +#include "graphics/Color.h" #include "graphics/ShaderManager.h" +#include "graphics/ShaderTechnique.h" #include "lib/bits.h" -#include "lib/config2.h" +#include "lib/debug.h" #include "lib/timer.h" #include "maths/MathUtil.h" #include "ps/CLogger.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" -#include "ps/Game.h" #include "ps/Profile.h" -#include "renderer/backend/Backend.h" -#include "renderer/backend/IDevice.h" -#include "renderer/backend/PipelineState.h" -#include "renderer/backend/Sampler.h" +#include "ps/containers/Span.h" #include "renderer/Renderer.h" #include "renderer/RenderingOptions.h" #include "renderer/TimeManager.h" +#include "renderer/backend/Backend.h" +#include "renderer/backend/IDevice.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/IFramebuffer.h" +#include "renderer/backend/IShaderProgram.h" +#include "renderer/backend/ITexture.h" +#include "renderer/backend/Sampler.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpRangeManager.h" #include "simulation2/helpers/Los.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Entity.h" +#include "simulation2/system/SimContext.h" + +#include +#include +#include /* diff --git a/source/graphics/LightEnv.cpp b/source/graphics/LightEnv.cpp index 8cba470130..b7fb76e216 100644 --- a/source/graphics/LightEnv.cpp +++ b/source/graphics/LightEnv.cpp @@ -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 @@ -17,10 +17,11 @@ #include "precompiled.h" -#include "graphics/LightEnv.h" +#include "LightEnv.h" #include "maths/MathUtil.h" +#include CLightEnv::CLightEnv() : m_Elevation(DEGTORAD(45)), diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index 37b36539e8..cb4360a04b 100644 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -17,21 +17,29 @@ #include "precompiled.h" -#include "Camera.h" -#include "CinemaManager.h" -#include "GameView.h" -#include "LightEnv.h" -#include "MapReader.h" #include "MapWriter.h" -#include "Patch.h" -#include "Terrain.h" -#include "TerrainTextureEntry.h" -#include "TerrainTextureManager.h" +#include "graphics/Camera.h" +#include "graphics/Color.h" +#include "graphics/HeightMipmap.h" +#include "graphics/LightEnv.h" +#include "graphics/MapIO.h" +#include "graphics/MiniPatch.h" +#include "graphics/Patch.h" +#include "graphics/Terrain.h" +#include "graphics/TerrainTextureEntry.h" +#include "lib/debug.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/types.h" +#include "maths/Fixed.h" +#include "maths/FixedVector3D.h" #include "maths/MathUtil.h" +#include "maths/Matrix3D.h" #include "maths/NUSpline.h" +#include "maths/Vector3D.h" #include "ps/CLogger.h" -#include "ps/Loader.h" +#include "ps/FileIo.h" #include "ps/Filesystem.h" #include "ps/XML/XMLWriter.h" #include "renderer/PostprocManager.h" @@ -47,6 +55,17 @@ #include "simulation2/components/ICmpTurretHolder.h" #include "simulation2/components/ICmpVisual.h" #include "simulation2/components/ICmpWaterManager.h" +#include "simulation2/helpers/CinemaPath.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Components.h" +#include "simulation2/system/Entity.h" + +#include +#include +#include +#include +#include +#include /////////////////////////////////////////////////////////////////////////////////////////////////// // CMapWriter constructor: nothing to do at the minute diff --git a/source/graphics/Material.cpp b/source/graphics/Material.cpp index 73648848a6..1cfbdf2936 100644 --- a/source/graphics/Material.cpp +++ b/source/graphics/Material.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 @@ -18,8 +18,11 @@ #include "precompiled.h" #include "Material.h" + #include "ps/CStrInternStatic.h" +class CVector4D; + CMaterial::CMaterial() : m_AlphaBlending(false) { diff --git a/source/graphics/MaterialManager.cpp b/source/graphics/MaterialManager.cpp index 8a2a80327a..571c1532c5 100644 --- a/source/graphics/MaterialManager.cpp +++ b/source/graphics/MaterialManager.cpp @@ -19,17 +19,25 @@ #include "MaterialManager.h" +#include "graphics/Material.h" #include "graphics/PreprocessorWrapper.h" +#include "lib/path.h" #include "maths/MathUtil.h" #include "maths/Vector4D.h" #include "ps/CLogger.h" -#include "ps/ConfigDB.h" +#include "ps/CStr.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include "ps/ConfigDB.h" +#include "ps/Errors.h" #include "ps/Filesystem.h" +#include "ps/XMB/XMBData.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" -#include "renderer/RenderingOptions.h" #include +#include +#include CMaterialManager::CMaterialManager() : qualityLevel{Clamp(g_ConfigDB.Get("materialmgr.quality", 5.0f), 0.0f, 10.0f)} diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp index 103c401e30..4e063283eb 100644 --- a/source/graphics/MeshManager.cpp +++ b/source/graphics/MeshManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 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 @@ -25,6 +25,9 @@ #include "ps/FileIo.h" // to get access to its CError #include "ps/Profile.h" +#include +#include + // TODO: should this cache models while they're not actively in the game? // (Currently they'll probably be deleted when the reference count drops to 0, // even if it's quite possible that they'll get reloaded very soon.) diff --git a/source/graphics/MiniMapTexture.cpp b/source/graphics/MiniMapTexture.cpp index a18e059dc8..d46607520b 100644 --- a/source/graphics/MiniMapTexture.cpp +++ b/source/graphics/MiniMapTexture.cpp @@ -19,44 +19,64 @@ #include "MiniMapTexture.h" -#include "graphics/GameView.h" #include "graphics/LOSTexture.h" #include "graphics/MiniPatch.h" +#include "graphics/ShaderDefines.h" #include "graphics/ShaderManager.h" -#include "graphics/ShaderProgramPtr.h" +#include "graphics/ShaderTechnique.h" #include "graphics/Terrain.h" #include "graphics/TerrainTextureEntry.h" -#include "graphics/TerrainTextureManager.h" #include "graphics/TerritoryTexture.h" #include "graphics/TextureManager.h" #include "lib/bits.h" #include "lib/code_generation.h" +#include "lib/debug.h" #include "lib/hash.h" +#include "lib/path.h" #include "lib/timer.h" #include "maths/MathUtil.h" +#include "maths/Matrix3D.h" #include "maths/Vector2D.h" -#include "ps/ConfigDB.h" +#include "maths/Vector3D.h" +#include "ps/CLogger.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Game.h" #include "ps/Profile.h" -#include "ps/VideoMode.h" #include "ps/World.h" #include "ps/XML/Xeromyces.h" -#include "renderer/backend/IDevice.h" +#include "ps/containers/Span.h" #include "renderer/Renderer.h" -#include "renderer/RenderingOptions.h" #include "renderer/SceneRenderer.h" #include "renderer/WaterManager.h" -#include "scriptinterface/Object.h" +#include "renderer/backend/Backend.h" +#include "renderer/backend/Format.h" +#include "renderer/backend/IBuffer.h" +#include "renderer/backend/IDevice.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/IFramebuffer.h" +#include "renderer/backend/IShaderProgram.h" +#include "renderer/backend/ITexture.h" +#include "renderer/backend/PipelineState.h" +#include "renderer/backend/Sampler.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpMinimap.h" #include "simulation2/components/ICmpRangeManager.h" +#include "simulation2/helpers/Position.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Components.h" +#include "simulation2/system/Entity.h" #include "simulation2/system/ParamNode.h" +#include "simulation2/system/SimContext.h" #include #include #include +#include +#include +#include namespace { diff --git a/source/graphics/MiniPatch.cpp b/source/graphics/MiniPatch.cpp index a574c35332..e7d0f6078b 100644 --- a/source/graphics/MiniPatch.cpp +++ b/source/graphics/MiniPatch.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 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 @@ -26,6 +26,6 @@ /////////////////////////////////////////////////////////////////////////////// // Constructor CMiniPatch::CMiniPatch() : - Tex(NULL), Priority(0) + Tex(nullptr), Priority(0) { } diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index 5d84cba445..986213b56b 100644 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -22,20 +22,26 @@ #include "graphics/Decal.h" #include "graphics/MeshManager.h" #include "graphics/ModelDef.h" -#include "graphics/ObjectEntry.h" +#include "graphics/RenderableObject.h" #include "graphics/SkeletonAnim.h" #include "graphics/SkeletonAnimDef.h" -#include "maths/BoundingBoxAligned.h" -#include "maths/Quaternion.h" #include "lib/sysdep/rtl.h" +#include "maths/BoundingBoxAligned.h" +#include "maths/Matrix3D.h" +#include "maths/Vector3D.h" #include "ps/CLogger.h" +#include "ps/CStr.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" -#include "ps/Profile.h" +#include "ps/Profiler2.h" #include "renderer/RenderingOptions.h" #include "simulation2/components/ICmpTerrain.h" #include "simulation2/components/ICmpWaterManager.h" -#include "simulation2/Simulation2.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Entity.h" +#include +#include CModel::CModel(const CSimulation2& simulation, const CMaterial& material, const CModelDefPtr& modeldef) : m_Simulation{simulation}, m_Material{material}, m_pModelDef{modeldef} diff --git a/source/graphics/ModelAbstract.cpp b/source/graphics/ModelAbstract.cpp index 31389741c4..e451906618 100644 --- a/source/graphics/ModelAbstract.cpp +++ b/source/graphics/ModelAbstract.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 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,12 @@ #include "ModelAbstract.h" +#include "lib/debug.h" +#include "maths/Vector3D.h" #include "ps/CLogger.h" +#include + const CBoundingBoxOriented& CModelAbstract::GetSelectionBox() { if (!m_SelectionBoxValid) diff --git a/source/graphics/ModelDef.cpp b/source/graphics/ModelDef.cpp index 657e908574..e822d4769f 100644 --- a/source/graphics/ModelDef.cpp +++ b/source/graphics/ModelDef.cpp @@ -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 @@ -20,9 +20,18 @@ #include "ModelDef.h" #include "graphics/SkeletonAnimDef.h" +#include "lib/debug.h" #include "lib/sysdep/arch/x86_x64/simd.h" -#include "maths/Vector4D.h" +#include "lib/sysdep/compiler.h" +#include "maths/Vector2D.h" #include "ps/FileIo.h" +#include "ps/containers/Span.h" +#include "renderer/VertexArray.h" + +#include +#include +#include +#include #if COMPILER_HAS_SSE # include diff --git a/source/graphics/ObjectManager.cpp b/source/graphics/ObjectManager.cpp index 99101d4853..2d8d96fa8f 100644 --- a/source/graphics/ObjectManager.cpp +++ b/source/graphics/ObjectManager.cpp @@ -21,15 +21,25 @@ #include "graphics/ObjectBase.h" #include "graphics/ObjectEntry.h" +#include "lib/debug.h" +#include "lib/path.h" +#include "lib/utf8.h" #include "ps/CLogger.h" #include "ps/ConfigDB.h" -#include "ps/Game.h" -#include "ps/Profile.h" #include "ps/Filesystem.h" +#include "ps/Profiler2.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpTerrain.h" #include "simulation2/components/ICmpVisual.h" +#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Components.h" +#include "simulation2/system/Entity.h" + +#include +#include +#include bool CObjectManager::ObjectKey::operator< (const CObjectManager::ObjectKey& a) const { diff --git a/source/graphics/Overlay.cpp b/source/graphics/Overlay.cpp index f7a74d7bcb..98aac94ab0 100644 --- a/source/graphics/Overlay.cpp +++ b/source/graphics/Overlay.cpp @@ -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 @@ -20,9 +20,10 @@ #include "Overlay.h" #include "graphics/TextureManager.h" -#include "ps/CStr.h" +#include "lib/debug.h" #include "renderer/Renderer.h" #include "renderer/TexturedLineRData.h" +#include "renderer/backend/Sampler.h" SOverlayTexturedLine::LineCapType SOverlayTexturedLine::StrToLineCapType(const std::wstring& str) { diff --git a/source/graphics/ParticleEmitter.cpp b/source/graphics/ParticleEmitter.cpp index d0b7682fb0..edccc50edc 100644 --- a/source/graphics/ParticleEmitter.cpp +++ b/source/graphics/ParticleEmitter.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,15 +19,29 @@ #include "ParticleEmitter.h" -#include "graphics/LightEnv.h" #include "graphics/LOSTexture.h" +#include "graphics/LightEnv.h" #include "graphics/ParticleEmitterType.h" #include "graphics/ParticleManager.h" -#include "graphics/ShaderProgram.h" +#include "graphics/RenderableObject.h" #include "graphics/TextureManager.h" +#include "lib/debug.h" +#include "lib/types.h" +#include "maths/Matrix3D.h" +#include "ps/CStrIntern.h" #include "ps/CStrInternStatic.h" +#include "ps/containers/Span.h" #include "renderer/Renderer.h" +#include "renderer/Scene.h" #include "renderer/SceneRenderer.h" +#include "renderer/backend/Format.h" +#include "renderer/backend/IBuffer.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/IShaderProgram.h" + +#include +#include +#include CParticleEmitter::CParticleEmitter(const CParticleEmitterTypePtr& type) : m_Type(type), m_Active(true), m_NextParticleIdx(0), m_EmissionRoundingError(0.f), diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp index d14b81105c..d7768997f1 100644 --- a/source/graphics/ParticleEmitterType.cpp +++ b/source/graphics/ParticleEmitterType.cpp @@ -22,14 +22,28 @@ #include "graphics/Color.h" #include "graphics/ParticleEmitter.h" #include "graphics/ParticleManager.h" +#include "graphics/SColor.h" #include "graphics/TextureManager.h" +#include "lib/debug.h" #include "maths/MathUtil.h" +#include "maths/Matrix3D.h" +#include "maths/Quaternion.h" +#include "maths/Vector3D.h" #include "ps/CLogger.h" +#include "ps/CStr.h" +#include "ps/Errors.h" #include "ps/Filesystem.h" +#include "ps/XMB/XMBData.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" #include "renderer/Renderer.h" +#include "renderer/backend/Sampler.h" +#include #include +#include +#include +#include /** diff --git a/source/graphics/ParticleManager.cpp b/source/graphics/ParticleManager.cpp index 16a143913b..5e81ddf303 100644 --- a/source/graphics/ParticleManager.cpp +++ b/source/graphics/ParticleManager.cpp @@ -23,7 +23,13 @@ #include "ps/Profile.h" #include "renderer/Scene.h" +#include +#include #include +#include +#include + +class CFrustum; static Status ReloadChangedFileCB(void* param, const VfsPath& path) { diff --git a/source/graphics/Patch.cpp b/source/graphics/Patch.cpp index 8c1deea98a..86ea2318ae 100644 --- a/source/graphics/Patch.cpp +++ b/source/graphics/Patch.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 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,8 +22,13 @@ #include "precompiled.h" #include "Patch.h" -#include "Terrain.h" +#include "graphics/RenderableObject.h" +#include "graphics/Terrain.h" +#include "maths/BoundingBoxAligned.h" +#include "maths/Vector3D.h" + +#include /////////////////////////////////////////////////////////////////////////////// // CPatch constructor diff --git a/source/graphics/ShaderDefines.cpp b/source/graphics/ShaderDefines.cpp index f05117d9cd..7fb54d2ce2 100644 --- a/source/graphics/ShaderDefines.cpp +++ b/source/graphics/ShaderDefines.cpp @@ -19,13 +19,19 @@ #include "ShaderDefines.h" -#include "graphics/ShaderProgram.h" +#include "lib/debug.h" #include "lib/hash.h" #include "maths/Vector4D.h" +#include "ps/CStr.h" #include "ps/ThreadUtil.h" +#include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/IShaderProgram.h" #include +#include #include +#include +#include namespace std { diff --git a/source/graphics/ShaderProgram.cpp b/source/graphics/ShaderProgram.cpp index 7946c9db60..0169a81357 100644 --- a/source/graphics/ShaderProgram.cpp +++ b/source/graphics/ShaderProgram.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 @@ -21,6 +21,8 @@ #include "renderer/backend/IDevice.h" +#include + CShaderProgram::CShaderProgram( Renderer::Backend::IDevice* device, const CStr& name, const CShaderDefines& defines) : m_Device(device), m_Name(name), m_Defines(defines) diff --git a/source/graphics/ShaderProgramPtr.h b/source/graphics/ShaderProgramPtr.h index 7eaf2575e1..8f859cef23 100644 --- a/source/graphics/ShaderProgramPtr.h +++ b/source/graphics/ShaderProgramPtr.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 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,6 +18,8 @@ #ifndef INCLUDED_SHADERPROGRAMPTR #define INCLUDED_SHADERPROGRAMPTR +#include + /* * Forward declaration, to reduce the number of header files that have to pull * in the whole of ShaderProgram.h diff --git a/source/graphics/ShaderTechnique.cpp b/source/graphics/ShaderTechnique.cpp index e977138581..e787c96c99 100644 --- a/source/graphics/ShaderTechnique.cpp +++ b/source/graphics/ShaderTechnique.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 @@ -20,10 +20,12 @@ #include "ShaderTechnique.h" #include "graphics/ShaderProgram.h" -#include "renderer/backend/IDevice.h" +#include "lib/debug.h" #include +namespace Renderer::Backend { class IShaderProgram; } + CShaderPass::CShaderPass( std::unique_ptr pipelineState, const CShaderProgramPtr& shader) diff --git a/source/graphics/SkeletonAnim.h b/source/graphics/SkeletonAnim.h index c3b1d32de2..47896e5240 100644 --- a/source/graphics/SkeletonAnim.h +++ b/source/graphics/SkeletonAnim.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 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 @@ -23,6 +23,7 @@ #define INCLUDED_SKELETONANIM #include "maths/BoundingBoxAligned.h" +#include "ps/CStr.h" class CSkeletonAnimDef; diff --git a/source/graphics/TerritoryBoundary.h b/source/graphics/TerritoryBoundary.h index a1c23846ca..2280ad048d 100644 --- a/source/graphics/TerritoryBoundary.h +++ b/source/graphics/TerritoryBoundary.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 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,13 @@ #ifndef INCLUDED_TERRITORYBOUNDARY #define INCLUDED_TERRITORYBOUNDARY -#include - +#include "lib/types.h" #include "maths/Vector2D.h" #include "simulation2/helpers/Player.h" -template -class Grid; +#include + +template class Grid; /** * Describes an outline of a territory, where the latter are understood to mean the largest sets of mutually connected tiles diff --git a/source/graphics/TerritoryTexture.h b/source/graphics/TerritoryTexture.h index 1e84d0f2f9..248f0ba3b4 100644 --- a/source/graphics/TerritoryTexture.h +++ b/source/graphics/TerritoryTexture.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 @@ -15,13 +15,15 @@ * along with 0 A.D. If not, see . */ +#include "lib/code_annotation.h" #include "maths/Matrix3D.h" -#include "renderer/backend/ITexture.h" #include "renderer/backend/IDeviceCommandContext.h" +#include "renderer/backend/ITexture.h" + +#include class CSimulation2; -template -class Grid; +template class Grid; /** * Maintains the territory boundary texture, used for diff --git a/source/graphics/Unit.h b/source/graphics/Unit.h index f0c05496b8..98c83cf7fb 100644 --- a/source/graphics/Unit.h +++ b/source/graphics/Unit.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,6 +18,7 @@ #ifndef INCLUDED_UNIT #define INCLUDED_UNIT +#include "lib/code_annotation.h" #include "ps/CStr.h" #include "simulation2/system/Entity.h" // entity_id_t diff --git a/source/graphics/UnitAnimation.h b/source/graphics/UnitAnimation.h index d6383af7ad..111db762d9 100644 --- a/source/graphics/UnitAnimation.h +++ b/source/graphics/UnitAnimation.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,6 +18,7 @@ #ifndef INCLUDED_UNITANIMATION #define INCLUDED_UNITANIMATION +#include "lib/code_annotation.h" #include "ps/CStr.h" #include "simulation2/system/Entity.h" diff --git a/source/graphics/tests/test_MeshManager.h b/source/graphics/tests/test_MeshManager.h index 6dace98273..f92add675d 100644 --- a/source/graphics/tests/test_MeshManager.h +++ b/source/graphics/tests/test_MeshManager.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 @@ -17,15 +17,14 @@ #include "lib/self_test.h" -#include "lib/file/file_system.h" -#include "lib/file/vfs/vfs.h" -#include "lib/file/io/io.h" -#include "lib/allocators/shared_ptr.h" - #include "graphics/ColladaManager.h" #include "graphics/MeshManager.h" #include "graphics/ModelDef.h" - +#include "lib/allocators/shared_ptr.h" +#include "lib/file/file_system.h" +#include "lib/file/io/io.h" +#include "lib/file/vfs/vfs.h" +#include "lib/secure_crt.h" #include "ps/CLogger.h" #include "ps/XML/RelaxNG.h"