diff --git a/source/ps/ArchiveBuilder.h b/source/ps/ArchiveBuilder.h index 3e578e6345..f856a283fa 100644 --- a/source/ps/ArchiveBuilder.h +++ b/source/ps/ArchiveBuilder.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2014 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,7 +19,15 @@ #define INCLUDED_ARCHIVEBUILDER #include "lib/file/vfs/vfs.h" -#include "ps/CStr.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/os_path.h" +#include "lib/status.h" + +#include +#include +#include + +class CFileInfo; /** * Packages a mod's files into a distributable archive. diff --git a/source/ps/CConsole.h b/source/ps/CConsole.h index ea5ed41d4b..767523c102 100644 --- a/source/ps/CConsole.h +++ b/source/ps/CConsole.h @@ -22,9 +22,11 @@ #ifndef INCLUDED_CCONSOLE #define INCLUDED_CCONSOLE +#include "lib/code_annotation.h" #include "lib/file/vfs/vfs_path.h" #include "lib/input.h" +#include #include #include #include @@ -32,6 +34,7 @@ class CCanvas2D; class CTextRenderer; +struct SDL_Event_; /** * In-game console. diff --git a/source/ps/CacheLoader.h b/source/ps/CacheLoader.h index 9580e36ef5..c77d3a24ea 100644 --- a/source/ps/CacheLoader.h +++ b/source/ps/CacheLoader.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 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,11 @@ #define INCLUDED_CACHELOADER #include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/status.h" +#include "lib/types.h" + +#include class MD5; diff --git a/source/ps/ConfigDB.h b/source/ps/ConfigDB.h index 478e7d1941..62dcf2d6a0 100644 --- a/source/ps/ConfigDB.h +++ b/source/ps/ConfigDB.h @@ -28,6 +28,7 @@ #define INCLUDED_CONFIGDB #include "lib/file/vfs/vfs_path.h" +#include "lib/types.h" #include "ps/CStr.h" #include @@ -35,8 +36,8 @@ #include #include #include +#include #include -#include #include #include @@ -65,8 +66,6 @@ using CConfigValueSet = std::vector; // Actually defined below - requires access to CConfigDB. class CConfigDBHook; -#define g_ConfigDB (*CConfigDB::Instance()) - class CConfigDB { friend CConfigDBHook; @@ -109,7 +108,7 @@ public: [[nodiscard]] static T GetIfInitialised(const std::string_view name, T defaultValue, const EConfigNamespace ns = CFG_USER) { - return IsInitialised() ? g_ConfigDB.Get(name, std::move(defaultValue), ns) : defaultValue; + return IsInitialised() ? Instance()->Get(name, std::move(defaultValue), ns) : defaultValue; } /** @@ -253,4 +252,7 @@ private: std::multimap>::iterator m_Ptr; CConfigDB& m_ConfigDB; }; + +#define g_ConfigDB (*CConfigDB::Instance()) + #endif // INCLUDED_CONFIGDB diff --git a/source/ps/FileIo.h b/source/ps/FileIo.h index 45e608b9e0..0ed15a2357 100644 --- a/source/ps/FileIo.h +++ b/source/ps/FileIo.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 @@ -30,10 +30,15 @@ #ifndef INCLUDED_FILEPACKER #define INCLUDED_FILEPACKER +#include "lib/file/io/write_buffer.h" #include "lib/file/vfs/vfs_path.h" -#include "ps/CStrForward.h" +#include "lib/types.h" #include "ps/Errors.h" -#include "ps/Filesystem.h" // WriteBuffer + +#include +#include + +class CStr8; ERROR_GROUP(File); ERROR_TYPE(File, OpenFailed); diff --git a/source/ps/Filesystem.h b/source/ps/Filesystem.h index 44d2fa6abd..b0d809d5a5 100644 --- a/source/ps/Filesystem.h +++ b/source/ps/Filesystem.h @@ -18,12 +18,17 @@ #ifndef INCLUDED_PS_FILESYSTEM #define INCLUDED_PS_FILESYSTEM -#include "lib/file/file.h" -#include "lib/file/io/write_buffer.h" -#include "lib/file/vfs/vfs_util.h" -#include "ps/CStrForward.h" +#include "lib/file/vfs/vfs.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/status.h" +#include "lib/types.h" #include "ps/Errors.h" +#include +#include + +class CStr8; + extern PIVFS g_VFS; extern bool VfsFileExists(const VfsPath& pathname); diff --git a/source/ps/Future.h b/source/ps/Future.h index c47d2b06ea..984ff12b95 100644 --- a/source/ps/Future.h +++ b/source/ps/Future.h @@ -18,12 +18,10 @@ #ifndef INCLUDED_FUTURE #define INCLUDED_FUTURE -#include "ps/FutureForward.h" - #include #include #include -#include +#include #include #include #include diff --git a/source/ps/FutureForward.h b/source/ps/FutureForward.h deleted file mode 100644 index d84ce02e55..0000000000 --- a/source/ps/FutureForward.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2021 Wildfire Games. - * This file is part of 0 A.D. - * - * 0 A.D. is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * 0 A.D. is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with 0 A.D. If not, see . - */ - -#ifndef INCLUDED_FUTURE_FORWARD -#define INCLUDED_FUTURE_FORWARD - -/** - * Lightweight header / forward declarations for Future. - * Include this in your header files where possible. - */ - -template -class Future; - -#endif // INCLUDED_FUTURE_FORWARD diff --git a/source/ps/Game.cpp b/source/ps/Game.cpp index 5c76f5624f..2d9a98696e 100644 --- a/source/ps/Game.cpp +++ b/source/ps/Game.cpp @@ -49,8 +49,7 @@ #include "simulation2/Simulation2.h" #include "simulation2/components/ICmpPlayer.h" #include "simulation2/components/ICmpPlayerManager.h" -#include "simulation2/system/CmpPtr.h" -#include "simulation2/system/Components.h" +#include "simulation2/system/Component.h" #include "simulation2/system/Entity.h" #include "simulation2/system/LocalTurnManager.h" #include "simulation2/system/ReplayTurnManager.h" @@ -66,8 +65,6 @@ #include #include -class IComponent; - extern GameLoopState* g_AtlasGameLoop; /** diff --git a/source/ps/Game.h b/source/ps/Game.h index 9dd390802c..545486f228 100644 --- a/source/ps/Game.h +++ b/source/ps/Game.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,13 +18,19 @@ #ifndef INCLUDED_GAME #define INCLUDED_GAME -#include "graphics/Color.h" +#include "lib/code_annotation.h" +#include "lib/os_path.h" +#include "lib/types.h" #include "ps/CStr.h" #include "ps/Errors.h" -#include "lib/os_path.h" #include "scriptinterface/ScriptTypes.h" #include "simulation2/helpers/Player.h" +#include +#include +#include +#include +#include #include class CGameView; @@ -32,6 +38,7 @@ class CSimulation2; class CTurnManager; class CWorld; class IReplayLogger; +struct CColor; /** * The container that holds the rules, resources and attributes of the game. diff --git a/source/ps/GameSetup/CmdLineArgs.h b/source/ps/GameSetup/CmdLineArgs.h index 5b0e3aa10f..e76be3c5fd 100644 --- a/source/ps/GameSetup/CmdLineArgs.h +++ b/source/ps/GameSetup/CmdLineArgs.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,14 +19,12 @@ #define INCLUDED_CMDLINEARGS #include "lib/os_path.h" -#include "ps/containers/Span.h" #include "ps/CStr.h" #include #include -class ScriptRequest; - +namespace PS { template class span; } class CmdLineArgs { diff --git a/source/ps/GameSetup/Config.h b/source/ps/GameSetup/Config.h index 9ad6e604ec..091e22dc7b 100644 --- a/source/ps/GameSetup/Config.h +++ b/source/ps/GameSetup/Config.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,8 +18,6 @@ #ifndef INCLUDED_PS_GAMESETUP_CONFIG #define INCLUDED_PS_GAMESETUP_CONFIG -#include "ps/CStr.h" - // flag to pause the game on window focus loss extern bool g_PauseOnFocusLoss; diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 66dc0bff2b..c72f74135c 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -73,6 +73,7 @@ #include "ps/VideoMode.h" #include "ps/World.h" #include "ps/XMB/XMBData.h" +#include "ps/XMB/XMBStorage.h" #include "ps/XML/Xeromyces.h" #include "ps/scripting/JSInterface_Game.h" #include "ps/scripting/JSInterface_Main.h" @@ -89,7 +90,7 @@ #include "scriptinterface/ScriptStats.h" #include "simulation2/Simulation2.h" #include "simulation2/scripting/JSInterface_Simulation.h" -#include "simulation2/system/ParamNode.h" +#include "simulation2/system/Component.h" #include "soundmanager/ISoundManager.h" #include diff --git a/source/ps/GameSetup/Paths.h b/source/ps/GameSetup/Paths.h index e21bb2703e..df5e11f658 100644 --- a/source/ps/GameSetup/Paths.h +++ b/source/ps/GameSetup/Paths.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 @@ -19,7 +19,8 @@ #define INCLUDED_PS_GAMESETUP_PATHS #include "lib/os_path.h" -#include "CmdLineArgs.h" + +class CmdLineArgs; /** * Wrapper class for OS paths used by the game diff --git a/source/ps/Globals.h b/source/ps/Globals.h index 3820413359..ef504e6e6c 100644 --- a/source/ps/Globals.h +++ b/source/ps/Globals.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 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,12 +18,15 @@ #ifndef INCLUDED_PS_GLOBALS #define INCLUDED_PS_GLOBALS -#include "lib/input.h" #include "lib/frequency_filter.h" +#include "lib/input.h" #include "ps/KeyName.h" +#include #include +struct SDL_Event_; + // thin abstraction layer on top of SDL. // game code should use it instead of SDL_GetMouseState etc. because // Atlas does not completely emulate SDL (it can only send events). diff --git a/source/ps/Hotkey.h b/source/ps/Hotkey.h index d47f477d7f..b407e9c5a4 100644 --- a/source/ps/Hotkey.h +++ b/source/ps/Hotkey.h @@ -31,13 +31,16 @@ * triggered. All with the hotkey name stored in ev.user.data1 as a const char*. */ -#include "CStr.h" #include "lib/input.h" +#include "lib/types.h" +#include "ps/CStr.h" #include "ps/containers/StaticVector.h" #include #include +struct SDL_Event_; + // SDL_Scancode is an enum, we'll use an explicit int to avoid including SDL in this header. using SDL_Scancode_ = int; diff --git a/source/ps/Joystick.h b/source/ps/Joystick.h index e123b6b5bf..c284f81720 100644 --- a/source/ps/Joystick.h +++ b/source/ps/Joystick.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,7 +18,7 @@ #ifndef INCLUDED_JOYSTICK #define INCLUDED_JOYSTICK -#include "lib/external_libraries/libsdl.h" +#include class CJoystick { diff --git a/source/ps/KeyName.h b/source/ps/KeyName.h index 61c4c1a80b..985c3ef0a3 100644 --- a/source/ps/KeyName.h +++ b/source/ps/KeyName.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,9 +18,10 @@ #ifndef INCLUDED_KEYNAME #define INCLUDED_KEYNAME -// Need SDLK_* enum values. -#include "lib/external_libraries/libsdl.h" -#include "ps/CStr.h" +#include +#include + +class CStr8; extern SDL_Scancode FindScancode(const CStr8& keyname); // Map a scancode to a locale-independent scancode name. diff --git a/source/ps/Loader.h b/source/ps/Loader.h index bd93d249e0..d8a8d821d3 100644 --- a/source/ps/Loader.h +++ b/source/ps/Loader.h @@ -21,10 +21,11 @@ #ifndef INCLUDED_LOADER #define INCLUDED_LOADER +#include "lib/debug.h" #include "lib/status.h" +#include #include -#include /* diff --git a/source/ps/Mod.h b/source/ps/Mod.h index 97654b3c51..a9fb9a5eff 100644 --- a/source/ps/Mod.h +++ b/source/ps/Mod.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 @@ -19,10 +19,11 @@ #define INCLUDED_MOD #include "ps/CStr.h" -#include "scriptinterface/ScriptForward.h" #include +class ScriptInterface; + #define g_Mods (Mod::Instance()) class Mod diff --git a/source/ps/ModInstaller.h b/source/ps/ModInstaller.h index 1f8236ca32..e666bf0ff7 100644 --- a/source/ps/ModInstaller.h +++ b/source/ps/ModInstaller.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 @@ -18,9 +18,11 @@ #ifndef INCLUDED_MODINSTALLER #define INCLUDED_MODINSTALLER -#include "CStr.h" #include "lib/file/vfs/vfs.h" - +#include "lib/file/vfs/vfs_path.h" +#include "lib/os_path.h" +#include "lib/path.h" +#include "ps/CStr.h" #include #include diff --git a/source/ps/ModIo.h b/source/ps/ModIo.h index 3bfd83c319..7df4c92076 100644 --- a/source/ps/ModIo.h +++ b/source/ps/ModIo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,15 +23,19 @@ #ifndef INCLUDED_MODIO #define INCLUDED_MODIO +#include "lib/code_annotation.h" #include "lib/external_libraries/curl.h" #include "lib/os_path.h" -#include "scriptinterface/ScriptForward.h" +#include "lib/types.h" +#include #include #include #include #include +class ScriptInterface; + // TODO: Allocate instance of the below two using sodium_malloc? struct PKStruct { diff --git a/source/ps/Profile.h b/source/ps/Profile.h index b01988ed61..d903f96c08 100644 --- a/source/ps/Profile.h +++ b/source/ps/Profile.h @@ -22,20 +22,18 @@ #ifndef INCLUDED_PROFILE #define INCLUDED_PROFILE -#include - #include "lib/adts/ring_buf.h" -#include "lib/posix/posix_pthread.h" +#include "lib/code_annotation.h" #include "ps/Profiler2.h" #include "ps/Singleton.h" +#include + +class CProfileNodeTable; #define PROFILE_AMORTIZE_FRAMES 30 #define PROFILE_AMORTIZE_TURNS 5 -class CProfileManager; -class CProfileNodeTable; - // To profile scripts usefully, we use a call hook that's called on every enter/exit, // and need to find the function name. But most functions are anonymous so we make do // with filename plus line number instead. diff --git a/source/ps/ProfileViewer.h b/source/ps/ProfileViewer.h index 6aa9bc01e6..e119e1e061 100644 --- a/source/ps/ProfileViewer.h +++ b/source/ps/ProfileViewer.h @@ -26,9 +26,11 @@ #include "ps/CStr.h" #include "ps/Singleton.h" +#include #include class CCanvas2D; +struct SDL_Event_; /** * Struct ProfileColumn: Describes one column of an AbstractProfileTable. diff --git a/source/ps/Profiler2.h b/source/ps/Profiler2.h index d10a07a092..612675cf9f 100644 --- a/source/ps/Profiler2.h +++ b/source/ps/Profiler2.h @@ -78,31 +78,27 @@ #ifndef INCLUDED_PROFILER2 #define INCLUDED_PROFILER2 +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/timer.h" +#include "lib/types.h" #include "ps/ThreadUtil.h" #include #include +#include +#include #include #include -#include #include -namespace Renderer -{ -namespace Backend -{ -class IDeviceCommandContext; -} -} - +class CProfiler2GPU; +namespace Renderer::Backend { class IDeviceCommandContext; } struct mg_context; // Note: Lots of functions are defined inline, to hypothetically // minimise performance overhead. -class CProfiler2GPU; - class CProfiler2 { friend class CProfiler2GPUImpl; diff --git a/source/ps/Replay.cpp b/source/ps/Replay.cpp index a6534a87a1..58ec6a6b09 100644 --- a/source/ps/Replay.cpp +++ b/source/ps/Replay.cpp @@ -50,7 +50,7 @@ #include "simulation2/components/ICmpGuiInterface.h" #include "simulation2/helpers/Player.h" #include "simulation2/helpers/SimulationCommand.h" -#include "simulation2/system/CmpPtr.h" +#include "simulation2/system/Component.h" #include "simulation2/system/Entity.h" #include diff --git a/source/ps/Replay.h b/source/ps/Replay.h index 54cfbd5610..a640399005 100644 --- a/source/ps/Replay.h +++ b/source/ps/Replay.h @@ -18,15 +18,20 @@ #ifndef INCLUDED_REPLAY #define INCLUDED_REPLAY +#include "lib/code_annotation.h" #include "lib/os_path.h" -#include "ps/CStr.h" +#include "lib/types.h" #include "scriptinterface/ScriptTypes.h" +#include +#include +#include +#include #include -struct SimulationCommand; class CSimulation2; class ScriptInterface; +struct SimulationCommand; /** * Replay log recorder interface. diff --git a/source/ps/SavedGame.cpp b/source/ps/SavedGame.cpp index 9b1090b103..316acfff5a 100644 --- a/source/ps/SavedGame.cpp +++ b/source/ps/SavedGame.cpp @@ -36,6 +36,7 @@ #include "lib/types.h" #include "maths/Vector3D.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/Filesystem.h" #include "ps/Game.h" #include "ps/Mod.h" diff --git a/source/ps/SavedGame.h b/source/ps/SavedGame.h index 3c0ca10ae4..e3632e5757 100644 --- a/source/ps/SavedGame.h +++ b/source/ps/SavedGame.h @@ -19,13 +19,16 @@ #define INCLUDED_SAVEDGAME #include "lib/status.h" -#include "ps/CStr.h" #include "scriptinterface/ScriptTypes.h" #include "scriptinterface/StructuredClone.h" +#include #include +#include class CSimulation2; +class CStrW; +class ScriptInterface; /** * @file diff --git a/source/ps/TaskManager.h b/source/ps/TaskManager.h index 04b3d00d08..9cf868191f 100644 --- a/source/ps/TaskManager.h +++ b/source/ps/TaskManager.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 @@ -21,8 +21,11 @@ #include "ps/Future.h" #include "ps/Singleton.h" +#include +#include #include -#include +#include +#include namespace Threading { diff --git a/source/ps/TemplateLoader.h b/source/ps/TemplateLoader.h index 5ac829943d..6ff7ca3fb5 100644 --- a/source/ps/TemplateLoader.h +++ b/source/ps/TemplateLoader.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 @@ -18,10 +18,12 @@ #ifndef INCLUDED_TEMPLATELOADER #define INCLUDED_TEMPLATELOADER -#include "simulation2/system/ParamNode.h" +#include "simulation2/system/Component.h" +#include #include #include +#include enum ETemplatesType { diff --git a/source/ps/Threading.h b/source/ps/Threading.h index 93dcbcb6ab..c87bd54af5 100644 --- a/source/ps/Threading.h +++ b/source/ps/Threading.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,7 +18,7 @@ #ifndef INCLUDED_THREADING #define INCLUDED_THREADING -#include "ThreadUtil.h" +#include "lib/sysdep/os.h" #if OS_WIN #include "lib/sysdep/os/win/wseh.h" diff --git a/source/ps/TouchInput.h b/source/ps/TouchInput.h index d7277cca29..d0475bd6a3 100644 --- a/source/ps/TouchInput.h +++ b/source/ps/TouchInput.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,6 +22,10 @@ #include "maths/Vector2D.h" #include "maths/Vector3D.h" +#include + +struct SDL_Event_; + /** * Maps touch events (e.g. on Android touchscreen devices) onto mouse events * and camera movement. diff --git a/source/ps/Util.h b/source/ps/Util.h index fc6ac8622d..36cd505f4e 100644 --- a/source/ps/Util.h +++ b/source/ps/Util.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,8 +21,12 @@ #include "lib/file/vfs/vfs_path.h" #include "lib/os_path.h" #include "lib/status.h" +#include "lib/types.h" #include "ps/CStr.h" +#include +#include + class Tex; const wchar_t* ErrorString(int err); diff --git a/source/ps/VideoMode.cpp b/source/ps/VideoMode.cpp index 629cdc7ef2..0d082db537 100644 --- a/source/ps/VideoMode.cpp +++ b/source/ps/VideoMode.cpp @@ -27,7 +27,7 @@ #include "lib/config2.h" #include "lib/debug.h" #include "lib/file/vfs/vfs.h" -#include "lib/file/vfs/vfs_path.h" +#include "lib/path.h" #include "lib/status.h" #include "lib/sysdep/os.h" #include "lib/tex/tex.h" @@ -45,6 +45,7 @@ #include "renderer/backend/dummy/DeviceForward.h" #include "renderer/backend/gl/DeviceForward.h" #include "renderer/backend/vulkan/DeviceForward.h" +#include "scriptinterface/ScriptInterface.h" #include #include diff --git a/source/ps/VideoMode.h b/source/ps/VideoMode.h index 80bb54c253..d33407a038 100644 --- a/source/ps/VideoMode.h +++ b/source/ps/VideoMode.h @@ -18,21 +18,14 @@ #ifndef INCLUDED_VIDEOMODE #define INCLUDED_VIDEOMODE -#include "graphics/Camera.h" -#include "ps/CStrForward.h" #include "renderer/backend/Backend.h" #include -typedef struct SDL_Window SDL_Window; +class CStrW; +namespace Renderer::Backend { class IDevice; } -namespace Renderer -{ -namespace Backend -{ -class IDevice; -} -} +typedef struct SDL_Window SDL_Window; class CVideoMode { diff --git a/source/ps/VisualReplay.cpp b/source/ps/VisualReplay.cpp index 81fecc6e5e..1c19411f88 100644 --- a/source/ps/VisualReplay.cpp +++ b/source/ps/VisualReplay.cpp @@ -30,6 +30,7 @@ #include "network/NetClient.h" #include "network/NetServer.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/Game.h" #include "ps/GameSetup/CmdLineArgs.h" #include "ps/GameSetup/Paths.h" @@ -46,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/source/ps/VisualReplay.h b/source/ps/VisualReplay.h index 6aa848b6cd..de3763158d 100644 --- a/source/ps/VisualReplay.h +++ b/source/ps/VisualReplay.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 @@ -19,10 +19,13 @@ #define INCLUDED_VISUAL_REPLAY #include "lib/os_path.h" -#include "ps/CStrForward.h" #include "scriptinterface/ScriptTypes.h" +#include + +class CStrW; class ScriptInterface; +namespace JS { class Value; } /** * Contains functions for visually replaying past games. diff --git a/source/ps/World.h b/source/ps/World.h index eadfc5d44e..7c4f45d539 100644 --- a/source/ps/World.h +++ b/source/ps/World.h @@ -24,15 +24,18 @@ #ifndef INCLUDED_WORLD #define INCLUDED_WORLD -#include "ps/CStrForward.h" #include "ps/Errors.h" -#include -#include #include -#include #include +class CGame; +class CMapReader; +class CStrW; +class CTerrain; +class CUnitManager; +class ScriptContext; + #ifndef ERROR_GROUP_GAME_DEFINED #define ERROR_GROUP_GAME_DEFINED ERROR_GROUP(Game); @@ -40,12 +43,6 @@ ERROR_GROUP(Game); ERROR_SUBGROUP(Game, World); ERROR_TYPE(Game_World, MapLoadFailed); -class CGame; -class CUnitManager; -class CTerrain; -class CMapReader; -class ScriptContext; - /** * CWorld is a general data class containing whatever is needed to accurately represent the world. * This includes the map, entities, influence maps, tiles, heightmap, etc. diff --git a/source/ps/algorithm.h b/source/ps/algorithm.h index 2e4e28fdbd..c2a5709ef7 100644 --- a/source/ps/algorithm.h +++ b/source/ps/algorithm.h @@ -19,6 +19,7 @@ #define ALGORITHM_H #include +#include #include #include diff --git a/source/ps/scripting/JSInterface_SavedGame.cpp b/source/ps/scripting/JSInterface_SavedGame.cpp index 7887b5dd83..ac3b1bc53c 100644 --- a/source/ps/scripting/JSInterface_SavedGame.cpp +++ b/source/ps/scripting/JSInterface_SavedGame.cpp @@ -23,6 +23,7 @@ #include "network/NetClient.h" #include "network/NetServer.h" #include "ps/CLogger.h" +#include "ps/CStr.h" #include "ps/Game.h" #include "ps/SavedGame.h" #include "scriptinterface/FunctionWrapper.h" diff --git a/source/ps/scripting/JSInterface_VFS.h b/source/ps/scripting/JSInterface_VFS.h index f9f93794d0..719e77aea8 100644 --- a/source/ps/scripting/JSInterface_VFS.h +++ b/source/ps/scripting/JSInterface_VFS.h @@ -21,6 +21,8 @@ #include "lib/types.h" #include "scriptinterface/ScriptTypes.h" +#include + class ScriptRequest; namespace JSI_VFS diff --git a/source/ps/tests/test_Future.h b/source/ps/tests/test_Future.h index c54e2a93fd..4cc8c29360 100644 --- a/source/ps/tests/test_Future.h +++ b/source/ps/tests/test_Future.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp index 6c5d2ab4c7..2fda1ed7ce 100644 --- a/source/scriptinterface/ScriptInterface.cpp +++ b/source/scriptinterface/ScriptInterface.cpp @@ -20,6 +20,7 @@ #include "ScriptInterface.h" #include "lib/debug.h" +#include "lib/file/vfs/vfs_util.h" #include "lib/utf8.h" #include "ps/CLogger.h" #include "ps/Filesystem.h" diff --git a/source/simulation2/components/tests/test_scripts.h b/source/simulation2/components/tests/test_scripts.h index 2a0a523a3e..5e19aa23bc 100644 --- a/source/simulation2/components/tests/test_scripts.h +++ b/source/simulation2/components/tests/test_scripts.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 @@ -15,6 +15,7 @@ * along with 0 A.D. If not, see . */ +#include "lib/file/vfs/vfs_util.h" #include "simulation2/system/ComponentTest.h" #include "simulation2/serialization/StdDeserializer.h" #include "simulation2/serialization/StdSerializer.h" diff --git a/source/simulation2/system/CmpPtr.h b/source/simulation2/system/CmpPtr.h index b77cc02262..648929e1ad 100644 --- a/source/simulation2/system/CmpPtr.h +++ b/source/simulation2/system/CmpPtr.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 @@ -20,6 +20,8 @@ #include "simulation2/system/Entity.h" +#include + class CSimContext; class CSimulation2; class IComponent; diff --git a/source/simulation2/system/Entity.h b/source/simulation2/system/Entity.h index 6c493e8d9b..4f7088c594 100644 --- a/source/simulation2/system/Entity.h +++ b/source/simulation2/system/Entity.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 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,6 +20,8 @@ #include "lib/types.h" +#include + class IComponent; /** diff --git a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp index 0a4618ffbe..e325fd1aed 100644 --- a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp @@ -33,6 +33,7 @@ #include "graphics/TerrainTextureManager.h" #include "lib/bits.h" #include "lib/file/vfs/vfs_path.h" +#include "lib/file/vfs/vfs_util.h" #include "lib/status.h" #include "maths/MathUtil.h" #include "ps/CLogger.h"