diff --git a/source/dapinterface/DapInterface.cpp b/source/dapinterface/DapInterface.cpp index d1652e746e..ba64390241 100644 --- a/source/dapinterface/DapInterface.cpp +++ b/source/dapinterface/DapInterface.cpp @@ -17,21 +17,31 @@ #include "lib/precompiled.h" -#include "dapinterface/DapInterface.h" +#include "DapInterface.h" -#include "fmt/format.h" -#include "js/Debug.h" +#include "lib/debug.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/sysdep/os.h" #include "ps/CLogger.h" #include "ps/Filesystem.h" #include "scriptinterface/FunctionWrapper.h" #include "scriptinterface/JSON.h" #include "scriptinterface/ModuleLoader.h" #include "scriptinterface/Object.h" +#include "scriptinterface/ScriptContext.h" +#include "scriptinterface/ScriptExceptions.h" #include "scriptinterface/ScriptExtraHeaders.h" +#include "scriptinterface/ScriptInterface.h" #include "scriptinterface/ScriptRequest.h" +#include +#include +#include +#include #include - +#include +#include #if OS_WIN #include @@ -40,10 +50,7 @@ #include #include #include -#include #endif -#include -#include namespace DAP { diff --git a/source/dapinterface/DapInterface.h b/source/dapinterface/DapInterface.h index 0e2929782b..b973eb6b64 100644 --- a/source/dapinterface/DapInterface.h +++ b/source/dapinterface/DapInterface.h @@ -18,16 +18,19 @@ #ifndef INCLUDED_DAPINTERFACE #define INCLUDED_DAPINTERFACE -#include "scriptinterface/ScriptContext.h" -#include "scriptinterface/ScriptInterface.h" -#include "ps/GameSetup/Paths.h" +#include "lib/code_annotation.h" #include -#include -#include +#include +#include +#include +#include #include -#include #include +#include + +class ScriptContext; +class ScriptInterface; namespace DAP { diff --git a/source/dapinterface/tests/test_DapInterface.h b/source/dapinterface/tests/test_DapInterface.h index 90dc74f51a..3e92c182d8 100644 --- a/source/dapinterface/tests/test_DapInterface.h +++ b/source/dapinterface/tests/test_DapInterface.h @@ -18,10 +18,15 @@ #include "lib/self_test.h" #include "dapinterface/DapInterface.h" +#include "lib/file/vfs/vfs.h" +#include "lib/path.h" #include "ps/CLogger.h" #include "ps/Filesystem.h" +#include "scriptinterface/ScriptInterface.h" #include +#include +#include class TestDapInterface : public CxxTest::TestSuite { diff --git a/source/graphics/CinemaManager.cpp b/source/graphics/CinemaManager.cpp index c70e03d482..4d2a8f75ea 100644 --- a/source/graphics/CinemaManager.cpp +++ b/source/graphics/CinemaManager.cpp @@ -33,8 +33,7 @@ #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 "simulation2/system/Component.h" #include #include diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp index 8df7849ce8..2032459a6d 100644 --- a/source/i18n/L10n.cpp +++ b/source/i18n/L10n.cpp @@ -36,6 +36,7 @@ #include "ps/Errors.h" #include "ps/Filesystem.h" #include "ps/GameSetup/GameSetup.h" +#include "scriptinterface/ScriptInterface.h" #include #include diff --git a/source/lib/precompiled.h b/source/lib/precompiled.h index b13ab433c1..19fcee4b0e 100644 --- a/source/lib/precompiled.h +++ b/source/lib/precompiled.h @@ -102,6 +102,7 @@ #include "ps/CLogger.h" #include "ps/Profile.h" +#endif // #if CONFIG_ENABLE_PCH + // IWYU pragma: end_keep -#endif // #if CONFIG_ENABLE_PCH diff --git a/source/lobby/IXmppClient.h b/source/lobby/IXmppClient.h index 4aced9ee6d..dcc0317b25 100644 --- a/source/lobby/IXmppClient.h +++ b/source/lobby/IXmppClient.h @@ -18,6 +18,7 @@ #ifndef IXMPPCLIENT_H #define IXMPPCLIENT_H +#include "lib/types.h" #include "scriptinterface/ScriptTypes.h" class ScriptRequest; diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 7071b0d5aa..d3606f3152 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -39,7 +39,6 @@ #include "scriptinterface/StructuredClone.h" #include -#include #include #include #include diff --git a/source/lobby/scripting/JSInterface_Lobby.cpp b/source/lobby/scripting/JSInterface_Lobby.cpp index 61063a75f6..1d7916423c 100644 --- a/source/lobby/scripting/JSInterface_Lobby.cpp +++ b/source/lobby/scripting/JSInterface_Lobby.cpp @@ -32,15 +32,12 @@ #include "ps/Util.h" #include "scriptinterface/FunctionWrapper.h" #include "scriptinterface/ScriptExceptions.h" -#include "scriptinterface/ScriptRequest.h" #include "third_party/encryption/pkcs5_pbkdf2.h" -#include #include #include #include -#include -#include +#include #include #include diff --git a/source/main.cpp b/source/main.cpp index 777f778a08..bf05a603fa 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -31,20 +31,40 @@ that of Atlas depending on commandline parameters. #define MINIMAL_PCH 2 #include "lib/precompiled.h" +#include "dapinterface/DapInterface.h" +#include "graphics/GameView.h" +#include "graphics/TextureManager.h" +#include "gui/GUIManager.h" +#include "lib/code_annotation.h" +#include "lib/config2.h" #include "lib/debug.h" -#include "lib/status.h" -#include "lib/secure_crt.h" +#include "lib/external_libraries/libsdl.h" +#include "lib/file/file_system.h" +#include "lib/file/vfs/vfs.h" #include "lib/frequency_filter.h" #include "lib/input.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/secure_crt.h" +#include "lib/status.h" +#include "lib/sysdep/compiler.h" +#include "lib/sysdep/os.h" #include "lib/timer.h" -#include "lib/external_libraries/libsdl.h" - +#include "lib/types.h" +#include "lobby/IXmppClient.h" +#include "network/NetClient.h" #include "ps/ArchiveBuilder.h" #include "ps/CConsole.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Game.h" +#include "ps/GameSetup/Atlas.h" +#include "ps/GameSetup/CmdLineArgs.h" +#include "ps/GameSetup/Config.h" +#include "ps/GameSetup/GameSetup.h" +#include "ps/GameSetup/Paths.h" #include "ps/Globals.h" #include "ps/Hotkey.h" #include "ps/Loader.h" @@ -54,37 +74,39 @@ that of Atlas depending on commandline parameters. #include "ps/Profiler2.h" #include "ps/Pyrogenesis.h" #include "ps/Replay.h" +#include "ps/TaskManager.h" #include "ps/TouchInput.h" #include "ps/UserReport.h" -#include "ps/Util.h" #include "ps/VideoMode.h" -#include "ps/TaskManager.h" -#include "ps/World.h" -#include "ps/GameSetup/GameSetup.h" -#include "ps/GameSetup/Atlas.h" -#include "ps/GameSetup/Config.h" -#include "ps/GameSetup/CmdLineArgs.h" -#include "ps/GameSetup/Paths.h" #include "ps/XML/Xeromyces.h" -#include "network/NetClient.h" -#include "network/NetServer.h" -#include "network/NetSession.h" -#include "lobby/IXmppClient.h" -#include "graphics/Camera.h" -#include "graphics/GameView.h" -#include "graphics/TextureManager.h" -#include "gui/GUIManager.h" -#include "renderer/backend/IDevice.h" +#include "ps/containers/Span.h" #include "renderer/Renderer.h" #include "rlinterface/RLInterface.h" +#include "scriptinterface/JSON.h" #include "scriptinterface/ScriptContext.h" +#include "scriptinterface/ScriptConversions.h" #include "scriptinterface/ScriptEngine.h" #include "scriptinterface/ScriptInterface.h" -#include "scriptinterface/JSON.h" -#include "simulation2/Simulation2.h" +#include "scriptinterface/ScriptRequest.h" #include "simulation2/system/TurnManager.h" #include "soundmanager/ISoundManager.h" -#include "dapinterface/DapInterface.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #if OS_UNIX #include @@ -125,9 +147,6 @@ extern "C" } #endif -#include -#include - extern CStrW g_UniqueLogPostfix; // Determines the lifetime of the mainloop diff --git a/source/mocks/mocks_real.cpp b/source/mocks/mocks_real.cpp index 1bdd8c9c2c..39b0e51327 100644 --- a/source/mocks/mocks_real.cpp +++ b/source/mocks/mocks_real.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,8 @@ #endif #include "lib/precompiled.h" +#include "lib/sysdep/os.h" + #if OS_LINUX || OS_BSD #include "mocks/dlfcn.h" #include "mocks/unistd.h" diff --git a/source/mocks/mocks_test.cpp b/source/mocks/mocks_test.cpp index 11299fb03b..c330b193a1 100644 --- a/source/mocks/mocks_test.cpp +++ b/source/mocks/mocks_test.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,8 @@ #endif #include "lib/precompiled.h" +#include "lib/sysdep/os.h" + // Cause calls to be redirected to the real function by default #define DEFAULT(name) static T::Real_##name real_##name diff --git a/source/network/NetClient.cpp b/source/network/NetClient.cpp index 97453126bd..0b4929d934 100644 --- a/source/network/NetClient.cpp +++ b/source/network/NetClient.cpp @@ -49,12 +49,11 @@ #include #include #include -#include #include #include #include #include -#include +#include /** * Once ping goes above turn length * command delay, diff --git a/source/network/NetFileTransfer.cpp b/source/network/NetFileTransfer.cpp index 31da554dc1..3d45672999 100644 --- a/source/network/NetFileTransfer.cpp +++ b/source/network/NetFileTransfer.cpp @@ -28,8 +28,7 @@ #include "ps/CStr.h" #include -#include -#include +#include Status CNetFileTransferer::HandleMessageReceive(const CNetMessage& message) { diff --git a/source/network/NetFileTransfer.h b/source/network/NetFileTransfer.h index ce644d3860..69ec32dac7 100644 --- a/source/network/NetFileTransfer.h +++ b/source/network/NetFileTransfer.h @@ -27,7 +27,6 @@ #include #include #include -#include class CFileTransferAckMessage; class CFileTransferDataMessage; diff --git a/source/network/NetProtocol.cpp b/source/network/NetProtocol.cpp index 540fb96195..75f0025a3f 100644 --- a/source/network/NetProtocol.cpp +++ b/source/network/NetProtocol.cpp @@ -23,7 +23,6 @@ #include #include -#include namespace { diff --git a/source/network/NetServer.cpp b/source/network/NetServer.cpp index a9efa7d6d6..1c94b4855e 100644 --- a/source/network/NetServer.cpp +++ b/source/network/NetServer.cpp @@ -55,8 +55,12 @@ #include #include #include -#include #include +#include +#include +#include +#include + #if CONFIG2_MINIUPNPC #include #include @@ -64,12 +68,6 @@ #include #include #endif -#include -#include -#include -#include -#include -#include /** * Number of peers to allocate for the enet host. diff --git a/source/network/NetServerTurnManager.cpp b/source/network/NetServerTurnManager.cpp index 395ffd7484..28f6e0d2f1 100644 --- a/source/network/NetServerTurnManager.cpp +++ b/source/network/NetServerTurnManager.cpp @@ -30,8 +30,7 @@ #include "simulation2/system/TurnManager.h" #include -#include -#include +#include #if 0 #include "ps/Util.h" diff --git a/source/network/NetServerTurnManager.h b/source/network/NetServerTurnManager.h index e9eb1389df..73e5034bd4 100644 --- a/source/network/NetServerTurnManager.h +++ b/source/network/NetServerTurnManager.h @@ -25,7 +25,6 @@ #include #include #include -#include #include class CNetServerSession; diff --git a/source/network/NetSession.h b/source/network/NetSession.h index d8bff6ee66..b01dee737e 100644 --- a/source/network/NetSession.h +++ b/source/network/NetSession.h @@ -28,7 +28,6 @@ #include #include -#include class CNetClient; class CNetMessage; diff --git a/source/pch/lobby/precompiled.h b/source/pch/lobby/precompiled.h index 8d3653b99f..5ba69ad0d1 100644 --- a/source/pch/lobby/precompiled.h +++ b/source/pch/lobby/precompiled.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 @@ -15,4 +15,8 @@ * along with 0 A.D. If not, see . */ +// IWYU pragma: begin_keep + #include "lib/precompiled.h" // common precompiled header + +// IWYU pragma: end_keep diff --git a/source/pch/network/precompiled.h b/source/pch/network/precompiled.h index 3bb3e1f509..3f5f18121b 100644 --- a/source/pch/network/precompiled.h +++ b/source/pch/network/precompiled.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 @@ -15,6 +15,8 @@ * along with 0 A.D. If not, see . */ +// IWYU pragma: begin_keep + #define MINIMAL_PCH 2 #include "lib/precompiled.h" // common precompiled header @@ -25,3 +27,5 @@ #include "ps/ThreadUtil.h" #include "network/NetMessage.h" #endif // CONFIG_ENABLE_PCH + +// IWYU pragma: end_keep diff --git a/source/pch/simulation2/precompiled.h b/source/pch/simulation2/precompiled.h index 09a09baa31..59c43b3560 100644 --- a/source/pch/simulation2/precompiled.h +++ b/source/pch/simulation2/precompiled.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 @@ -15,6 +15,8 @@ * along with 0 A.D. If not, see . */ +// IWYU pragma: begin_keep + #define MINIMAL_PCH 2 #include "lib/precompiled.h" // common precompiled header @@ -28,3 +30,5 @@ #include "maths/FixedVector3D.h" #endif // CONFIG_ENABLE_PCH + +// IWYU pragma: end_keep diff --git a/source/ps/Game.cpp b/source/ps/Game.cpp index 2d9a98696e..e612effa19 100644 --- a/source/ps/Game.cpp +++ b/source/ps/Game.cpp @@ -58,7 +58,6 @@ #include #include -#include #include #include #include diff --git a/source/ps/GameSetup/CmdLineArgs.cpp b/source/ps/GameSetup/CmdLineArgs.cpp index 5a33e0accd..bbaff6c804 100644 --- a/source/ps/GameSetup/CmdLineArgs.cpp +++ b/source/ps/GameSetup/CmdLineArgs.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index c72f74135c..97668af3e5 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -109,13 +109,9 @@ #include #include #include -#include -#include -#include #include #include #include -#include #include #include #include diff --git a/source/ps/Hotkey.h b/source/ps/Hotkey.h index b407e9c5a4..de0be44ac1 100644 --- a/source/ps/Hotkey.h +++ b/source/ps/Hotkey.h @@ -32,7 +32,7 @@ */ #include "lib/input.h" -#include "lib/types.h" +#include "lib/posix/posix_types.h" #include "ps/CStr.h" #include "ps/containers/StaticVector.h" diff --git a/source/ps/Mod.cpp b/source/ps/Mod.cpp index 5aa65d1e3f..5f4ad3c1ae 100644 --- a/source/ps/Mod.cpp +++ b/source/ps/Mod.cpp @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp index 4fa86f8a7c..b9236143f9 100644 --- a/source/ps/ProfileViewer.cpp +++ b/source/ps/ProfileViewer.cpp @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/source/ps/Replay.cpp b/source/ps/Replay.cpp index 58ec6a6b09..0229552124 100644 --- a/source/ps/Replay.cpp +++ b/source/ps/Replay.cpp @@ -55,7 +55,6 @@ #include #include -#include #include #include diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp index 316acfff5a..7148fb21f6 100644 --- a/source/ps/SavedGame.cpp +++ b/source/ps/SavedGame.cpp @@ -51,7 +51,6 @@ #include #include -#include #include #include #include diff --git a/source/ps/XMB/XMBStorage.cpp b/source/ps/XMB/XMBStorage.cpp index 996921e3de..af9a780626 100644 --- a/source/ps/XMB/XMBStorage.cpp +++ b/source/ps/XMB/XMBStorage.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_ConfigDB.cpp b/source/ps/scripting/JSInterface_ConfigDB.cpp index cad83c5b47..a35deb3d73 100644 --- a/source/ps/scripting/JSInterface_ConfigDB.cpp +++ b/source/ps/scripting/JSInterface_ConfigDB.cpp @@ -25,7 +25,6 @@ #include "ps/VideoMode.h" #include "scriptinterface/FunctionWrapper.h" -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_Console.cpp b/source/ps/scripting/JSInterface_Console.cpp index f8969f50ad..0900cc19e1 100644 --- a/source/ps/scripting/JSInterface_Console.cpp +++ b/source/ps/scripting/JSInterface_Console.cpp @@ -23,8 +23,6 @@ #include "ps/CLogger.h" #include "scriptinterface/FunctionWrapper.h" -#include - namespace JS { class CallArgs; } namespace JSI_Console diff --git a/source/ps/scripting/JSInterface_Debug.cpp b/source/ps/scripting/JSInterface_Debug.cpp index bbc87d2843..09df66b0cd 100644 --- a/source/ps/scripting/JSInterface_Debug.cpp +++ b/source/ps/scripting/JSInterface_Debug.cpp @@ -26,7 +26,6 @@ #include "scriptinterface/FunctionWrapper.h" #include -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_Game.cpp b/source/ps/scripting/JSInterface_Game.cpp index 513b3c41f1..17cf167c51 100644 --- a/source/ps/scripting/JSInterface_Game.cpp +++ b/source/ps/scripting/JSInterface_Game.cpp @@ -41,7 +41,6 @@ #include "simulation2/system/TurnManager.h" #include "soundmanager/ISoundManager.h" -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_Main.cpp b/source/ps/scripting/JSInterface_Main.cpp index 45a7f1bf99..e6d6500370 100644 --- a/source/ps/scripting/JSInterface_Main.cpp +++ b/source/ps/scripting/JSInterface_Main.cpp @@ -40,7 +40,6 @@ #include "scriptinterface/ScriptRequest.h" #include "tools/atlas/GameInterface/GameLoop.h" -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_Mod.cpp b/source/ps/scripting/JSInterface_Mod.cpp index 91c53a0684..f42b8b2752 100644 --- a/source/ps/scripting/JSInterface_Mod.cpp +++ b/source/ps/scripting/JSInterface_Mod.cpp @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_ModIo.cpp b/source/ps/scripting/JSInterface_ModIo.cpp index 0c5854a141..e4e8381a7f 100644 --- a/source/ps/scripting/JSInterface_ModIo.cpp +++ b/source/ps/scripting/JSInterface_ModIo.cpp @@ -27,7 +27,6 @@ #include "scriptinterface/Object.h" #include "scriptinterface/ScriptRequest.h" -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_SavedGame.cpp b/source/ps/scripting/JSInterface_SavedGame.cpp index ac3b1bc53c..ba60cefadf 100644 --- a/source/ps/scripting/JSInterface_SavedGame.cpp +++ b/source/ps/scripting/JSInterface_SavedGame.cpp @@ -33,7 +33,6 @@ #include "simulation2/Simulation2.h" #include "simulation2/system/TurnManager.h" -#include #include #include #include diff --git a/source/ps/scripting/JSInterface_UserReport.cpp b/source/ps/scripting/JSInterface_UserReport.cpp index 59877157df..37438647e4 100644 --- a/source/ps/scripting/JSInterface_UserReport.cpp +++ b/source/ps/scripting/JSInterface_UserReport.cpp @@ -27,7 +27,6 @@ #include "ps/UserReport.h" #include "scriptinterface/FunctionWrapper.h" -#include #include namespace JSI_UserReport diff --git a/source/ps/scripting/JSInterface_VisualReplay.cpp b/source/ps/scripting/JSInterface_VisualReplay.cpp index f4e642f0c5..c938d8ead4 100644 --- a/source/ps/scripting/JSInterface_VisualReplay.cpp +++ b/source/ps/scripting/JSInterface_VisualReplay.cpp @@ -25,7 +25,6 @@ #include "ps/VisualReplay.h" #include "scriptinterface/FunctionWrapper.h" -#include #include namespace JSI_VisualReplay diff --git a/source/rlinterface/RLInterface.cpp b/source/rlinterface/RLInterface.cpp index a088b5177a..a4328e164e 100644 --- a/source/rlinterface/RLInterface.cpp +++ b/source/rlinterface/RLInterface.cpp @@ -22,22 +22,31 @@ #include "rlinterface/RLInterface.h" #include "gui/GUIManager.h" +#include "lib/debug.h" +#include "lib/types.h" #include "ps/CLogger.h" +#include "ps/CStr.h" +#include "ps/Errors.h" #include "ps/Game.h" #include "ps/GameSetup/GameSetup.h" #include "ps/Loader.h" +#include "scriptinterface/JSON.h" #include "scriptinterface/Object.h" #include "scriptinterface/ScriptInterface.h" -#include "scriptinterface/JSON.h" +#include "scriptinterface/ScriptRequest.h" #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpAIInterface.h" #include "simulation2/components/ICmpTemplateManager.h" #include "simulation2/system/Component.h" #include "simulation2/system/LocalTurnManager.h" +#include "simulation2/system/TurnManager.h" -#include +#include +#include +#include +#include #include -#include +#include namespace RL { diff --git a/source/rlinterface/RLInterface.h b/source/rlinterface/RLInterface.h index c1cc41fd52..106a55ce7e 100644 --- a/source/rlinterface/RLInterface.h +++ b/source/rlinterface/RLInterface.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 @@ -18,14 +18,18 @@ #ifndef INCLUDED_RLINTERFACE #define INCLUDED_RLINTERFACE +#include "lib/code_annotation.h" #include "simulation2/helpers/Player.h" #include "third_party/mongoose/mongoose.h" #include #include #include +#include #include +struct mg_context; + namespace RL { struct ScenarioConfig diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index 90a4a75874..b4d34fc388 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -21,6 +21,7 @@ #include "graphics/TextureManager.h" #include "lib/debug.h" +#include "lib/path.h" #include "maths/Fixed.h" #include "maths/FixedVector3D.h" #include "ps/CLogger.h" diff --git a/source/simulation2/components/CCmpUnitMotion.h b/source/simulation2/components/CCmpUnitMotion.h index fab143b744..de3b19175d 100644 --- a/source/simulation2/components/CCmpUnitMotion.h +++ b/source/simulation2/components/CCmpUnitMotion.h @@ -39,7 +39,6 @@ #include "simulation2/components/ICmpUnitMotionManager.h" #include "simulation2/components/ICmpValueModificationManager.h" #include "simulation2/components/ICmpVisual.h" -#include "simulation2/helpers/Geometry.h" #include "simulation2/helpers/PathGoal.h" #include "simulation2/helpers/Pathfinding.h" #include "simulation2/helpers/Position.h" diff --git a/source/simulation2/components/ICmpPlayer.cpp b/source/simulation2/components/ICmpPlayer.cpp index 63eaae143e..4e66deb998 100644 --- a/source/simulation2/components/ICmpPlayer.cpp +++ b/source/simulation2/components/ICmpPlayer.cpp @@ -21,9 +21,10 @@ #include "graphics/Color.h" #include "maths/FixedVector3D.h" +#include "simulation2/scripting/ScriptComponent.h" #include "simulation2/system/Component.h" #include "simulation2/system/InterfaceScripted.h" -#include "simulation2/scripting/ScriptComponent.h" +#include "simulation2/system/Message.h" BEGIN_INTERFACE_WRAPPER(Player) END_INTERFACE_WRAPPER(Player) diff --git a/source/simulation2/components/ICmpRallyPoint.cpp b/source/simulation2/components/ICmpRallyPoint.cpp index 746e43e824..91eebfb1d0 100644 --- a/source/simulation2/components/ICmpRallyPoint.cpp +++ b/source/simulation2/components/ICmpRallyPoint.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,8 +20,10 @@ #include "ICmpRallyPoint.h" #include "maths/FixedVector2D.h" -#include "simulation2/system/InterfaceScripted.h" #include "simulation2/scripting/ScriptComponent.h" +#include "simulation2/system/InterfaceScripted.h" + +#include BEGIN_INTERFACE_WRAPPER(RallyPoint) END_INTERFACE_WRAPPER(RallyPoint) diff --git a/source/simulation2/components/ICmpSettlement.cpp b/source/simulation2/components/ICmpSettlement.cpp index 62098926f3..107e96a878 100644 --- a/source/simulation2/components/ICmpSettlement.cpp +++ b/source/simulation2/components/ICmpSettlement.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 @@ -22,6 +22,7 @@ #include "simulation2/system/InterfaceScripted.h" #include "simulation2/scripting/ScriptComponent.h" +#include BEGIN_INTERFACE_WRAPPER(Settlement) END_INTERFACE_WRAPPER(Settlement) diff --git a/source/simulation2/components/ICmpTerritoryDecayManager.cpp b/source/simulation2/components/ICmpTerritoryDecayManager.cpp index 4e50d29e53..9420c3b48d 100644 --- a/source/simulation2/components/ICmpTerritoryDecayManager.cpp +++ b/source/simulation2/components/ICmpTerritoryDecayManager.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 @@ -22,6 +22,8 @@ #include "simulation2/system/InterfaceScripted.h" #include "simulation2/scripting/ScriptComponent.h" +#include + BEGIN_INTERFACE_WRAPPER(TerritoryDecayManager) END_INTERFACE_WRAPPER(TerritoryDecayManager) diff --git a/source/simulation2/components/ICmpVisual.h b/source/simulation2/components/ICmpVisual.h index 17db3cd582..6eb00d4181 100644 --- a/source/simulation2/components/ICmpVisual.h +++ b/source/simulation2/components/ICmpVisual.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 @@ -20,12 +20,18 @@ #include "simulation2/system/Interface.h" -#include "ps/CStr.h" -#include "maths/BoundingBoxOriented.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "maths/BoundingBoxAligned.h" +#include "maths/BoundingBoxOriented.h" #include "maths/Fixed.h" #include "maths/FixedVector3D.h" -#include "lib/file/vfs/vfs_path.h" +#include "maths/Vector3D.h" +#include "ps/CStr.h" +#include "simulation2/system/Component.h" + +#include +#include class CUnit; diff --git a/source/simulation2/helpers/LongPathfinder.h b/source/simulation2/helpers/LongPathfinder.h index b1a8d53945..5eab374ec4 100644 --- a/source/simulation2/helpers/LongPathfinder.h +++ b/source/simulation2/helpers/LongPathfinder.h @@ -31,7 +31,6 @@ #include #include #include -#include #include /** diff --git a/source/simulation2/helpers/Spatial.h b/source/simulation2/helpers/Spatial.h index b81b02f635..2c1088b7c1 100644 --- a/source/simulation2/helpers/Spatial.h +++ b/source/simulation2/helpers/Spatial.h @@ -18,12 +18,20 @@ #ifndef INCLUDED_SPATIAL #define INCLUDED_SPATIAL +#include "lib/debug.h" +#include "lib/types.h" +#include "maths/Fixed.h" #include "maths/FixedVector2D.h" #include "maths/MathUtil.h" #include "simulation2/helpers/Position.h" #include "simulation2/serialization/SerializeTemplates.h" +#include "simulation2/system/Component.h" #include "simulation2/system/Entity.h" +#include +#include +#include +#include #include /** diff --git a/source/soundmanager/ISoundManager.h b/source/soundmanager/ISoundManager.h index e77f53a2d7..3c6339a9b9 100644 --- a/source/soundmanager/ISoundManager.h +++ b/source/soundmanager/ISoundManager.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 @@ -20,9 +20,9 @@ #include "lib/config2.h" #include "lib/file/vfs/vfs_path.h" -#include "ps/CStr.h" #include "simulation2/system/Entity.h" +class CStr8; class CVector3D; class ISoundManager diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index 98d776a24f..622d8fc367 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -17,23 +17,34 @@ #include "precompiled.h" -#include "ISoundManager.h" #include "SoundManager.h" -#include "data/SoundData.h" + #include "items/CBufferItem.h" #include "items/CSoundItem.h" #include "items/CStreamItem.h" - -#include "lib/external_libraries/libsdl.h" +#include "lib/code_generation.h" +#include "lib/debug.h" +#include "lib/path.h" +#include "lib/sysdep/os.h" +#include "lib/timer.h" #include "ps/CLogger.h" #include "ps/CStr.h" #include "ps/ConfigDB.h" #include "ps/Filesystem.h" #include "ps/Profiler2.h" #include "ps/Threading.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" +#include "soundmanager/ISoundManager.h" +#include "soundmanager/data/SoundData.h" +#include "soundmanager/items/ISoundItem.h" +#include "soundmanager/scripting/SoundGroup.h" +#include +#include +#include #include +#include ISoundManager* g_SoundManager = NULL; diff --git a/source/soundmanager/SoundManager.h b/source/soundmanager/SoundManager.h index f69825ec1e..e652815809 100644 --- a/source/soundmanager/SoundManager.h +++ b/source/soundmanager/SoundManager.h @@ -23,22 +23,22 @@ #if CONFIG2_AUDIO #include "ISoundManager.h" -#include "data/SoundData.h" #include "items/ISoundItem.h" -#include "scripting/SoundGroup.h" - +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/status.h" #include "ps/CStr.h" -#include "ps/Profiler2.h" +#include "scripting/SoundGroup.h" #include "simulation2/system/Entity.h" #include #include #include #include +#include #include -#define AL_CHECK CSoundManager::al_check(__func__, __LINE__) +class CSoundData; struct ALSourceHolder { @@ -171,6 +171,8 @@ private: CSoundManager(CSoundManager* /*other*/){}; }; +#define AL_CHECK CSoundManager::al_check(__func__, __LINE__) + #else // !CONFIG2_AUDIO #define AL_CHECK diff --git a/source/soundmanager/data/OggData.cpp b/source/soundmanager/data/OggData.cpp index 1aab1f25af..eacd43df27 100644 --- a/source/soundmanager/data/OggData.cpp +++ b/source/soundmanager/data/OggData.cpp @@ -21,12 +21,16 @@ #if CONFIG2_AUDIO +#include "lib/status.h" +#include "lib/types.h" #include "ps/CLogger.h" -#include "ps/containers/Span.h" #include "ps/Filesystem.h" +#include "ps/containers/Span.h" #include "soundmanager/SoundManager.h" +#include "soundmanager/data/ogg.h" #include +#include #include /* diff --git a/source/soundmanager/data/OggData.h b/source/soundmanager/data/OggData.h index e251a37122..23e0eef13f 100644 --- a/source/soundmanager/data/OggData.h +++ b/source/soundmanager/data/OggData.h @@ -28,7 +28,6 @@ #include "lib/file/vfs/vfs_path.h" #include -#include #include /* diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp index c4adf6ba3a..3997ef2298 100644 --- a/source/soundmanager/data/SoundData.cpp +++ b/source/soundmanager/data/SoundData.cpp @@ -22,8 +22,13 @@ #if CONFIG2_AUDIO -#include "OggData.h" #include "ps/CLogger.h" +#include "soundmanager/data/OggData.h" +#include "soundmanager/data/SoundData.h" + +#include +#include +#include DataMap CSoundData::sSoundData; diff --git a/source/soundmanager/data/SoundData.h b/source/soundmanager/data/SoundData.h index a0b1521a47..87d0592a1b 100644 --- a/source/soundmanager/data/SoundData.h +++ b/source/soundmanager/data/SoundData.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 @@ -23,9 +23,10 @@ #if CONFIG2_AUDIO #include "lib/file/vfs/vfs_path.h" -#include "ps/CStr.h" +#include "lib/path.h" #include +#include class CSoundData; typedef std::map DataMap; diff --git a/source/soundmanager/data/ogg.cpp b/source/soundmanager/data/ogg.cpp index f142e38e5d..d653e76a86 100644 --- a/source/soundmanager/data/ogg.cpp +++ b/source/soundmanager/data/ogg.cpp @@ -21,19 +21,22 @@ #if CONFIG2_AUDIO #include "lib/byte_order.h" -#include "lib/external_libraries/vorbis.h" -#include "lib/file/file_system.h" +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/file/io/io.h" -#include "lib/file/vfs/vfs_util.h" +#include "lib/posix/posix_types.h" #include "maths/MathUtil.h" #include "ps/CLogger.h" #include "ps/containers/Span.h" -#include "ps/Filesystem.h" #include -#include #include +#include +#include +#include #include +#include +#include static Status LibErrorFromVorbis(int err) { diff --git a/source/soundmanager/data/ogg.h b/source/soundmanager/data/ogg.h index 8860735f03..0fd3b1563f 100644 --- a/source/soundmanager/data/ogg.h +++ b/source/soundmanager/data/ogg.h @@ -22,11 +22,15 @@ #if CONFIG2_AUDIO #include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/status.h" #include "lib/types.h" -#include "ps/containers/Span.h" #include -#include +#include +#include + +namespace PS { template class span; } class OggStream { diff --git a/source/soundmanager/items/CBufferItem.h b/source/soundmanager/items/CBufferItem.h index e390955199..8fd55b48e6 100644 --- a/source/soundmanager/items/CBufferItem.h +++ b/source/soundmanager/items/CBufferItem.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 @@ -24,6 +24,8 @@ #include "CSoundBase.h" +class CSoundData; + class CBufferItem : public CSoundBase { public: diff --git a/source/soundmanager/items/CSoundBase.cpp b/source/soundmanager/items/CSoundBase.cpp index 24826ff5ec..73bdb43479 100644 --- a/source/soundmanager/items/CSoundBase.cpp +++ b/source/soundmanager/items/CSoundBase.cpp @@ -21,10 +21,15 @@ #if CONFIG2_AUDIO +#include "lib/path.h" #include "lib/timer.h" +#include "maths/Vector3D.h" +#include "ps/containers/Span.h" +#include "soundmanager/ISoundManager.h" #include "soundmanager/SoundManager.h" #include "soundmanager/data/SoundData.h" -#include "ps/CLogger.h" + +#include CSoundBase::CSoundBase() { diff --git a/source/soundmanager/items/CSoundBase.h b/source/soundmanager/items/CSoundBase.h index 0fa953c694..04720cbc10 100644 --- a/source/soundmanager/items/CSoundBase.h +++ b/source/soundmanager/items/CSoundBase.h @@ -22,13 +22,15 @@ #if CONFIG2_AUDIO -#include "soundmanager/data/SoundData.h" +#include "lib/file/vfs/vfs_path.h" #include "soundmanager/items/ISoundItem.h" #include -#include #include +class CSoundData; +class CVector3D; + class CSoundBase : public ISoundItem { protected: diff --git a/source/soundmanager/items/CSoundItem.cpp b/source/soundmanager/items/CSoundItem.cpp index 512260179a..d7fedf1ed7 100644 --- a/source/soundmanager/items/CSoundItem.cpp +++ b/source/soundmanager/items/CSoundItem.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 @@ -24,6 +24,8 @@ #include "soundmanager/SoundManager.h" #include "soundmanager/data/SoundData.h" +#include +#include #include CSoundItem::CSoundItem() diff --git a/source/soundmanager/items/CSoundItem.h b/source/soundmanager/items/CSoundItem.h index 563680a8e6..36657f0a40 100644 --- a/source/soundmanager/items/CSoundItem.h +++ b/source/soundmanager/items/CSoundItem.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 @@ -23,7 +23,8 @@ #if CONFIG2_AUDIO #include "CSoundBase.h" -#include "soundmanager/data/SoundData.h" + +class CSoundData; class CSoundItem : public CSoundBase { diff --git a/source/soundmanager/items/CStreamItem.cpp b/source/soundmanager/items/CStreamItem.cpp index df44f0a5de..309a627705 100644 --- a/source/soundmanager/items/CStreamItem.cpp +++ b/source/soundmanager/items/CStreamItem.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 @@ -21,8 +21,13 @@ #if CONFIG2_AUDIO +#include "soundmanager/ISoundManager.h" #include "soundmanager/SoundManager.h" #include "soundmanager/data/OggData.h" +#include "soundmanager/data/SoundData.h" + +#include +#include CStreamItem::CStreamItem(CSoundData* sndData) { diff --git a/source/soundmanager/items/CStreamItem.h b/source/soundmanager/items/CStreamItem.h index 923f1ce85e..a66cd5f51a 100644 --- a/source/soundmanager/items/CStreamItem.h +++ b/source/soundmanager/items/CStreamItem.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 @@ -22,9 +22,10 @@ #if CONFIG2_AUDIO -#include "soundmanager/data/SoundData.h" #include "CSoundBase.h" +class CSoundData; + class CStreamItem : public CSoundBase { public: diff --git a/source/soundmanager/scripting/JSInterface_Sound.cpp b/source/soundmanager/scripting/JSInterface_Sound.cpp index 1120dd4edd..66f8acdbbd 100644 --- a/source/soundmanager/scripting/JSInterface_Sound.cpp +++ b/source/soundmanager/scripting/JSInterface_Sound.cpp @@ -19,14 +19,12 @@ #include "JSInterface_Sound.h" #include "lib/config2.h" -#include "lib/utf8.h" -#include "maths/Vector3D.h" -#include "ps/Filesystem.h" +#include "lib/file/vfs/vfs_path.h" #include "scriptinterface/FunctionWrapper.h" -#include "scriptinterface/ScriptRequest.h" +#include "soundmanager/ISoundManager.h" #include "soundmanager/SoundManager.h" -#include +#include namespace JSI_Sound { diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp index 542c66aa47..809eca59b2 100644 --- a/source/soundmanager/scripting/SoundGroup.cpp +++ b/source/soundmanager/scripting/SoundGroup.cpp @@ -18,6 +18,7 @@ #include "precompiled.h" #include "SoundGroup.h" + #include "graphics/Camera.h" #include "graphics/GameView.h" #include "lib/rand.h" @@ -35,12 +36,26 @@ #include "soundmanager/SoundManager.h" #include -#include extern CGame *g_Game; #if CONFIG2_AUDIO +#include "lib/path.h" +#include "lib/status.h" +#include "lib/utf8.h" +#include "maths/Matrix3D.h" +#include "maths/Vector3D.h" +#include "ps/Errors.h" +#include "ps/XMB/XMBData.h" +#include "scriptinterface/ScriptInterface.h" +#include "soundmanager/ISoundManager.h" +#include "soundmanager/data/SoundData.h" + +#include +#include +#include + constexpr ALfloat DEFAULT_ROLLOFF = 0.5f; constexpr ALfloat MAX_ROLLOFF = 0.7f; diff --git a/source/soundmanager/scripting/SoundGroup.h b/source/soundmanager/scripting/SoundGroup.h index d274f080dd..ff8be23c26 100644 --- a/source/soundmanager/scripting/SoundGroup.h +++ b/source/soundmanager/scripting/SoundGroup.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,14 +18,17 @@ #ifndef INCLUDED_SOUNDGROUP_H #define INCLUDED_SOUNDGROUP_H +#include "lib/code_annotation.h" #include "lib/config2.h" #include "lib/file/vfs/vfs_path.h" #include "lib/types.h" #include "simulation2/system/Entity.h" -#include "soundmanager/data/SoundData.h" +#include +#include #include +class CSoundData; class CVector3D; enum eSndGrpFlags