Fix some includes in source/ps

Make include-what-you-use happy with some files in source/ps and fix
what needs to be fixed.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser 2025-07-23 19:19:42 +02:00
parent 08d8f0f61c
commit aed1570040
No known key found for this signature in database
51 changed files with 430 additions and 145 deletions

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2022 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
@ -27,6 +27,8 @@
#ifndef INCLUDED_X86_X64
#define INCLUDED_X86_X64
#include "lib/sysdep/arch.h"
#if !ARCH_X86_X64
#error "including x86_x64.h without ARCH_X86_X64=1"
#endif

View file

@ -21,14 +21,19 @@
#include "graphics/ColladaManager.h"
#include "graphics/TextureManager.h"
#include "lib/debug.h"
#include "lib/file/archive/archive.h"
#include "lib/file/archive/archive_zip.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs_util.h"
#include "lib/tex/tex_codec.h"
#include "lib/path.h"
#include "lib/tex/tex.h"
#include "ps/XMB/XMBStorage.h"
#include "ps/XML/Xeromyces.h"
#include "renderer/backend/Sampler.h"
#include "renderer/backend/dummy/Device.h"
#include <boost/algorithm/string/predicate.hpp>
#include <string>
CArchiveBuilder::CArchiveBuilder(const OsPath& mod, const OsPath& tempdir) :
m_TempDir(tempdir), m_NumBaseMods(0)

View file

@ -20,32 +20,54 @@
#include "CConsole.h"
#include "graphics/Canvas2D.h"
#include "graphics/Color.h"
#include "graphics/FontMetrics.h"
#include "graphics/TextRenderer.h"
#include "gui/CGUI.h"
#include "gui/GUIManager.h"
#include "lib/code_generation.h"
#include "lib/debug.h"
#include "lib/external_libraries/libsdl.h"
#include "lib/file/io/write_buffer.h"
#include "lib/file/vfs/vfs.h"
#include "lib/status.h"
#include "lib/timer.h"
#include "lib/types.h"
#include "lib/utf8.h"
#include "maths/MathUtil.h"
#include "ps/CLogger.h"
#include "maths/Rect.h"
#include "maths/Vector2D.h"
#include "ps/CStr.h"
#include "ps/CStrIntern.h"
#include "ps/ConfigDB.h"
#include "ps/CStrInternStatic.h"
#include "ps/Filesystem.h"
#include "ps/GameSetup/Config.h"
#include "ps/Globals.h"
#include "ps/Hotkey.h"
#include "ps/KeyName.h"
#include "ps/Profile.h"
#include "ps/Pyrogenesis.h"
#include "ps/VideoMode.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
#include <SDL_clipboard.h>
#include <SDL_events.h>
#include <SDL_keyboard.h>
#include <SDL_keycode.h>
#include <SDL_scancode.h>
#include <SDL_stdinc.h>
#include <algorithm>
#include <cmath>
#include <string_view>
#include <cstring>
#include <cwchar>
#include <iterator>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <unordered_map>
#include <utility>
#include <vector>
#include <wctype.h>
namespace
{

View file

@ -20,24 +20,28 @@
#include "CLogger.h"
#include "graphics/Canvas2D.h"
#include "graphics/Color.h"
#include "graphics/FontMetrics.h"
#include "graphics/TextRenderer.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/secure_crt.h"
#include "lib/timer.h"
#include "lib/utf8.h"
#include "maths/Vector2D.h"
#include "ps/CConsole.h"
#include "ps/CStr.h"
#include "ps/CStrInternStatic.h"
#include "ps/CStrIntern.h"
#include "ps/Profile.h"
#include "ps/Pyrogenesis.h"
#include <boost/algorithm/string/replace.hpp>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iostream>
#include <utility>
#include <boost/algorithm/string/replace.hpp>
CStrW g_UniqueLogPostfix;
static const double RENDER_TIMEOUT = 10.0; // seconds before messages are deleted
static const double RENDER_TIMEOUT_RATE = 10.0; // number of timed-out messages deleted per second

View file

@ -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,11 +19,13 @@
#include "CStrIntern.h"
#include "lib/debug.h"
#include "lib/fnv_hash.h"
#include "ps/CLogger.h"
#include "ps/ThreadUtil.h"
#include <cstring>
#include <unordered_map>
#include <utility>
class CStrInternInternals
{

View file

@ -20,7 +20,9 @@
#include "lib/types.h"
#include <cstddef>
#include <string>
#include <string_view>
class CStrInternInternals;

View file

@ -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,11 +19,15 @@
#include "CacheLoader.h"
#include "lib/debug.h"
#include "lib/file/file_system.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/utf8.h"
#include "maths/MD5.h"
#include "ps/CLogger.h"
#include "ps/Util.h"
#include <iomanip>
#include <ctime>
CCacheLoader::CCacheLoader(PIVFS vfs, const std::wstring& fileExtension) :
m_VFS(vfs), m_FileExtension(fileExtension)

View file

@ -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
@ -20,6 +20,7 @@
#include "Compress.h"
#include "lib/byte_order.h"
#include "lib/debug.h"
#include "lib/external_libraries/zlib.h"
void CompressZLib(const std::string& data, std::string& out, bool includeLengthHeader)

View file

@ -19,14 +19,23 @@
#include "ConfigDB.h"
#include "lib/alignment.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/debug.h"
#include "lib/file/vfs/vfs.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/path.h"
#include "lib/secure_crt.h"
#include "lib/status.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Filesystem.h"
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>
#include <cstddef>
#include <mutex>
#include <sstream>
#include <unordered_set>
namespace

View file

@ -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,8 +19,15 @@
#include "DllLoader.h"
#include "lib/timer.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/posix/posix_dlfcn.h"
#include "lib/sysdep/os.h"
#include "lib/timer.h"
#include <cstddef>
#include <sstream>
#include <string>
#if OS_MACOSX
# include "lib/sysdep/os/osx/osx_bundle.h"

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2013 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
@ -70,6 +70,8 @@ plus a few extra things for converting between error codes and exceptions.
*/
#include "lib/types.h"
#include <exception>
typedef u32 PSRETURN;

View file

@ -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
@ -22,10 +22,19 @@
#include "precompiled.h"
#include "FileIo.h"
#include "lib/byte_order.h"
#include "lib/code_annotation.h"
#include "lib/file/vfs/vfs.h"
#include "lib/lib.h"
#include "lib/status.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Filesystem.h"
#include "lib/byte_order.h"
#include <algorithm>
#include <cstring>
#include <string>
#pragma pack(push, 1)

View file

@ -19,12 +19,20 @@
#include "Filesystem.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/sysdep/dir_watch.h"
#include "lib/utf8.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Profile.h"
#include <algorithm>
#include <string>
#include <utility>
#include <vector>
PIVFS g_VFS;
static std::vector<std::pair<FileReloadFunc, void*> > g_ReloadFuncs;

View file

@ -1,4 +1,4 @@
/* Copyright (C) 2013 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,9 +15,15 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "lib/code_annotation.h"
#include "lib/secure_crt.h"
#include "lib/sysdep/sysdep.h"
#include "lib/types.h"
#include "ps/CStr.h"
#include <cstddef>
CStr ps_generate_guid(void)
{
// TODO: Ideally this will be guaranteed unique (and verified

View file

@ -19,41 +19,54 @@
#include "Game.h"
#include "graphics/Color.h"
#include "graphics/GameView.h"
#include "graphics/LOSTexture.h"
#include "graphics/ParticleManager.h"
#include "graphics/UnitManager.h"
#include "gui/GUIManager.h"
#include "gui/CGUI.h"
#include "lib/config2.h"
#include "lib/timer.h"
#include "gui/GUIManager.h"
#include "lib/code_generation.h"
#include "lib/debug.h"
#include "network/NetClient.h"
#include "network/NetServer.h"
#include "ps/CConsole.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/GameSetup/GameSetup.h"
#include "ps/Loader.h"
#include "ps/Profile.h"
#include "ps/Replay.h"
#include "ps/World.h"
#include "ps/VideoMode.h"
#include "ps/World.h"
#include "renderer/Renderer.h"
#include "renderer/SceneRenderer.h"
#include "renderer/TimeManager.h"
#include "renderer/WaterManager.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptContext.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/ScriptRequest.h"
#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/Entity.h"
#include "simulation2/system/LocalTurnManager.h"
#include "simulation2/system/ReplayTurnManager.h"
#include "soundmanager/ISoundManager.h"
#include "simulation2/system/TurnManager.h"
#include "tools/atlas/GameInterface/GameLoop.h"
#include <cstddef>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/Value.h>
#include <memory>
#include <sstream>
#include <utility>
class IComponent;
extern GameLoopState* g_AtlasGameLoop;

View file

@ -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,8 +19,11 @@
#include "Atlas.h"
#include "ps/GameSetup/CmdLineArgs.h"
#include "lib/debug.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/DllLoader.h"
#include "ps/GameSetup/CmdLineArgs.h"
//----------------------------------------------------------------------------
// Atlas (map editor) integration

View file

@ -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,11 +19,18 @@
#include "CmdLineArgs.h"
#include "lib/sysdep/sysdep.h"
#include "ps/containers/Span.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#include <algorithm>
#include <iterator>
#include <js/CallArgs.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <string>
#include <string_view>
#include <unordered_map>

View file

@ -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,11 +20,13 @@
#include "Config.h"
#include "lib/timer.h"
#include "ps/CConsole.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/GameSetup/CmdLineArgs.h"
#include <cstddef>
#include <vector>
// (these variables are documented in the header.)
bool g_PauseOnFocusLoss = false;

View file

@ -18,41 +18,68 @@
#include "precompiled.h"
#include "lib/build_version.h"
#include "lib/code_annotation.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/external_libraries/libsdl.h"
#include "lib/path.h"
#include "lib/posix/posix_utsname.h"
#include "lib/timer.h"
#include "lib/sysdep/arch.h"
#include "lib/sysdep/compiler.h"
#include "lib/sysdep/cpu.h"
#include "lib/sysdep/numa.h"
#include "lib/sysdep/os.h"
#include "lib/sysdep/os_cpu.h"
#include "lib/sysdep/smbios.h"
#include "lib/sysdep/sysdep.h" // sys_OpenFile
#include "lib/utf8.h"
#if CONFIG2_AUDIO
#include "soundmanager/SoundManager.h"
#endif
#include "lib/timer.h"
#include "lib/types.h"
#include "ps/CLogger.h"
#include "ps/ConfigDB.h"
#include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/Filesystem.h"
#include "ps/GameSetup/Config.h"
#include "ps/Profile.h"
#include "ps/Pyrogenesis.h"
#include "ps/scripting/JSInterface_ConfigDB.h"
#include "ps/scripting/JSInterface_Debug.h"
#include "ps/UserReport.h"
#include "ps/VideoMode.h"
#include "ps/scripting/JSInterface_ConfigDB.h"
#include "ps/scripting/JSInterface_Debug.h"
#include "renderer/backend/IDevice.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/StructuredClone.h"
#include "soundmanager/ISoundManager.h"
#include <SDL_cpuinfo.h>
#include <SDL_version.h>
#include <SDL_video.h>
#include <boost/version.hpp>
#include <cstdio>
#include <ctime>
#include <cwchar>
#include <fmt/format.h>
#include <freetype/fttypes.h>
#include <iterator>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <random>
#include <sstream>
#include <string>
#include <thread>
#include <vector>
// FreeType headers might have an include order.
#include <ft2build.h>
#include <freetype/freetype.h>
#include FT_FREETYPE_H
#if ARCH_AMD64
#include "lib/sysdep/arch/x86_x64/x86_x64.h"
#endif
#if OS_LINUX
#include <fstream>
@ -62,11 +89,6 @@
#include "nvtt/nvtt.h"
#endif
#include <random>
#include <sstream>
#include <string>
#include <thread>
namespace
{

View file

@ -16,18 +16,30 @@
*/
#include "precompiled.h"
#include "Paths.h"
#include "lib/debug.h"
#include "lib/file/file_system.h"
#include "lib/sysdep/sysdep.h" // sys_get_executable_name
#include "lib/path.h"
#include "lib/status.h"
#include "lib/sysdep/filesystem.h" // wrealpath
#include "lib/sysdep/os.h"
#include "lib/sysdep/sysdep.h" // sys_get_executable_name
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/GameSetup/CmdLineArgs.h"
#include <cerrno>
#include <cstdlib>
#include <string>
#if OS_WIN
# include "lib/sysdep/os/win/wutil.h" // wutil_*Path
#elif OS_MACOSX
# include "lib/sysdep/os/osx/osx_paths.h"
# include "lib/sysdep/os/osx/osx_bundle.h"
#endif
#include "ps/CLogger.h"
Paths::Paths(const CmdLineArgs& args)

View file

@ -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
@ -16,10 +16,13 @@
*/
#include "precompiled.h"
#include "lib/debug.h"
#include "ps/CStr.h"
#include "ps/Util.h"
#include <cstddef>
#include <sodium.h>
#include <string>
CStr8 HashCryptographically(const CStr8& string, const CStr8& salt)
{

View file

@ -21,12 +21,15 @@
#include "KeyName.h"
#include "lib/external_libraries/libsdl.h"
#include "ps/CStr.h"
#include <SDL_keyboard.h>
#include <SDL_keycode.h>
#include <algorithm>
#include <cstring>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
// Some scancodes <-> names that SDL doesn't recognise.

View file

@ -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,13 +20,18 @@
#include "precompiled.h"
#include <deque>
#include <numeric>
#include "lib/timer.h"
#include "CStr.h"
#include "Loader.h"
#include "lib/code_annotation.h"
#include "lib/secure_crt.h"
#include "lib/timer.h"
#include "lib/utf8.h"
#include "ps/CStr.h"
#include <deque>
#include <numeric>
#include <string>
#include <utility>
// set by LDR_EndRegistering; may be 0 during development when
// estimated task durations haven't yet been set.

View file

@ -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 @@
#ifndef INCLUDED_LOADER
#define INCLUDED_LOADER
#include "lib/status.h"
#include <functional>
#include <wchar.h>

View file

@ -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
@ -17,35 +17,46 @@
#include "precompiled.h"
#include "ps/Mod.h"
#include "Mod.h"
#include "i18n/L10n.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h"
#include "lib/path.h"
#include "lib/sysdep/os.h"
#include "lib/utf8.h"
#include "ps/CLogger.h"
#include "ps/Errors.h"
#include "ps/Filesystem.h"
#include "ps/GameSetup/GameSetup.h"
#include "ps/GameSetup/CmdLineArgs.h"
#include "ps/GameSetup/Paths.h"
#include "ps/Profiler2.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptExceptions.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#if !OS_WIN
#include <algorithm>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/constants.hpp>
#include <boost/algorithm/string/split.hpp>
#include <cstddef>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <sstream>
#include <string>
#include <unordered_map>
#include <utility>
#if OS_WIN
#include <filesystem>
#else
#include "lib/os_path.h"
#endif
#include <algorithm>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#if OS_WIN
#include <filesystem>
#endif
#include <fstream>
#include <sstream>
#include <unordered_map>
class ScriptInterface;
namespace
{

View file

@ -44,7 +44,6 @@
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/algorithm/string/split.hpp>
#include <iomanip>
ModIo* g_ModIo = nullptr;

View file

@ -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,11 +22,14 @@
#include "precompiled.h"
#include "Profile.h"
#include "ProfileViewer.h"
#include "ThreadUtil.h"
#include "lib/secure_crt.h"
#include "lib/timer.h"
#include "ps/CStr.h"
#include "ps/ProfileViewer.h"
#include "ps/ThreadUtil.h"
#include <cstddef>
#include <numeric>
///////////////////////////////////////////////////////////////////////////////////////////////

View file

@ -20,22 +20,35 @@
#include "ProfileViewer.h"
#include "graphics/Canvas2D.h"
#include "graphics/Color.h"
#include "graphics/FontMetrics.h"
#include "graphics/TextRenderer.h"
#include "lib/external_libraries/libsdl.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "maths/Rect.h"
#include "maths/Size2D.h"
#include "maths/Vector2D.h"
#include "ps/CLogger.h"
#include "ps/CStrInternStatic.h"
#include "ps/Filesystem.h"
#include "ps/CStrIntern.h"
#include "ps/Hotkey.h"
#include "ps/Profile.h"
#include "ps/Pyrogenesis.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptRequest.h"
#include <SDL_events.h>
#include <SDL_keycode.h>
#include <algorithm>
#include <ctime>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <string>
class ScriptInterface;
struct CProfileViewerInternals
{

View file

@ -25,21 +25,28 @@
#include "Profiler2.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/code_generation.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "ps/CLogger.h"
#include "ps/ConfigDB.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/Profiler2.h"
#include "ps/Profiler2GPU.h"
#include "ps/Pyrogenesis.h"
#include "third_party/mongoose/mongoose.h"
#include <algorithm>
#include <cstdio>
#include <fmt/format.h>
#include <fstream>
#include <iomanip>
#include <map>
#include <set>
#include <sstream>
#include <tuple>
#include <unordered_map>
#include <utility>
CProfiler2 g_Profiler2;

View file

@ -35,7 +35,6 @@
#include <cstddef>
#include <cstdint>
#include <deque>
#include <iterator>
#include <string>
#include <utility>
#include <vector>

View file

@ -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
@ -17,12 +17,14 @@
#include "precompiled.h"
#include <cstdio>
#include "Pyrogenesis.h"
#include "lib/sysdep/sysdep.h"
#include "lib/build_version.h"
#include "lib/path.h"
#include "lib/sysdep/sysdep.h"
#include <cstdio>
#include <cwchar>
const char* engine_version = PYROGENESIS_VERSION;
const char* main_window_name = "0 A.D.";

View file

@ -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 @@ Standard declarations which are included in all projects.
#ifndef INCLUDED_PYROGENESIS
#define INCLUDED_PYROGENESIS
#include <cstdio>
class Path;
using OsPath = Path;

View file

@ -19,38 +19,45 @@
#include "Replay.h"
#include "graphics/TerrainTextureManager.h"
#include "lib/timer.h"
#include "lib/code_generation.h"
#include "lib/debug.h"
#include "lib/file/file_system.h"
#include "lib/tex/tex.h"
#include "lib/path.h"
#include "lib/timer.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/Game.h"
#include "ps/GameSetup/GameSetup.h"
#include "ps/GameSetup/CmdLineArgs.h"
#include "ps/GameSetup/GameSetup.h"
#include "ps/GameSetup/Paths.h"
#include "ps/Loader.h"
#include "ps/Mod.h"
#include "ps/Profile.h"
#include "ps/ProfileViewer.h"
#include "ps/Profiler2.h"
#include "ps/Pyrogenesis.h"
#include "ps/Mod.h"
#include "ps/Util.h"
#include "ps/VisualReplay.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptContext.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptInterface.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/ScriptStats.h"
#include "scriptinterface/JSON.h"
#include "simulation2/Simulation2.h"
#include "simulation2/components/ICmpGuiInterface.h"
#include "simulation2/helpers/Player.h"
#include "simulation2/helpers/SimulationCommand.h"
#include "simulation2/Simulation2.h"
#include "simulation2/system/CmpPtr.h"
#include "simulation2/system/Entity.h"
#include <ctime>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/Value.h>
#include <memory>
/**
* Number of turns between two saved profiler snapshots.

View file

@ -20,23 +20,45 @@
#include "SavedGame.h"
#include "graphics/GameView.h"
#include "i18n/L10n.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/archive/archive.h"
#include "lib/file/archive/archive_zip.h"
#include "lib/file/file_system.h"
#include "lib/file/io/io.h"
#include "lib/utf8.h"
#include "lib/file/io/write_buffer.h"
#include "lib/file/vfs/vfs.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/file/vfs/vfs_util.h"
#include "lib/path.h"
#include "lib/sysdep/filesystem.h"
#include "lib/timer.h"
#include "lib/types.h"
#include "maths/Vector3D.h"
#include "ps/CLogger.h"
#include "ps/Filesystem.h"
#include "ps/Game.h"
#include "ps/Mod.h"
#include "ps/Pyrogenesis.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/StructuredClone.h"
#include "simulation2/Simulation2.h"
#include <cstdint>
#include <ctime>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <memory>
#include <sstream>
#include <utility>
class ScriptInterface;
// TODO: we ought to check version numbers when loading files
Status SavedGames::SavePrefix(const CStrW& prefix, const CStrW& description, CSimulation2& simulation, const Script::StructuredClone& guiMetadataClone)

View file

@ -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,6 +18,7 @@
#ifndef INCLUDED_SAVEDGAME
#define INCLUDED_SAVEDGAME
#include "lib/status.h"
#include "ps/CStr.h"
#include "scriptinterface/ScriptTypes.h"
#include "scriptinterface/StructuredClone.h"

View file

@ -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
@ -18,6 +18,7 @@
#ifndef INCLUDED_SINGLETON
#define INCLUDED_SINGLETON
#include "lib/code_annotation.h"
#include "lib/debug.h"
/**

View file

@ -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,17 +21,16 @@
#include "lib/debug.h"
#include "maths/MathUtil.h"
#include "ps/CLogger.h"
#include "ps/ConfigDB.h"
#include "ps/Threading.h"
#include "ps/ThreadUtil.h"
#include "ps/Profiler2.h"
#include "ps/Threading.h"
#include <atomic>
#include <condition_variable>
#include <deque>
#include <functional>
#include <memory>
#include <mutex>
#include <string>
#include <thread>
namespace Threading
@ -57,8 +56,6 @@ size_t GetDefaultNumberOfWorkers()
} // anonymous namespace
class Thread;
using QueueItem = std::function<void()>;
/**

View file

@ -19,11 +19,25 @@
#include "TemplateLoader.h"
#include "lib/code_annotation.h"
#include "lib/file/vfs/vfs_util.h"
#include "lib/path.h"
#include "lib/status.h"
#include "lib/utf8.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 <cstddef>
#include <cstdint>
#include <utility>
class CFileInfo;
static const wchar_t TEMPLATE_ROOT[] = L"simulation/templates/";
static const wchar_t ACTOR_ROOT[] = L"art/actors/";

View file

@ -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,6 +19,8 @@
#include "Threading.h"
#include "ps/ThreadUtil.h"
#include <thread>
static bool g_MainThreadSet;

View file

@ -19,14 +19,20 @@
#include "TouchInput.h"
#include <cinttypes>
#include "graphics/Camera.h"
#include "graphics/GameView.h"
#include "lib/timer.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/external_libraries/libsdl.h"
#include "lib/sysdep/os.h"
#include "lib/timer.h"
#include "maths/Matrix3D.h"
#include "ps/Game.h"
#include <SDL_events.h>
#include <SDL_mouse.h>
#include <cinttypes>
// When emulation is enabled:
// Left-click to put finger 0 down.
// Then left-click-and-drag to move finger 0.

View file

@ -17,16 +17,29 @@
#include "precompiled.h"
#include "ps/Util.h"
#include "Util.h"
#include "lib/allocators/dynarray.h"
#include "lib/allocators/shared_ptr.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h"
#include "lib/path.h"
#include "lib/posix/posix_types.h"
#include "lib/secure_crt.h"
#include "lib/tex/tex.h"
#include "ps/CLogger.h"
#include "lib/utf8.h"
#include "ps/Filesystem.h"
#include "ps/Pyrogenesis.h"
#include <ctime>
#include <iomanip>
#include <utility>
#include <memory>
#include <sstream>
#include <tuple>
struct tm;
// not thread-safe!
static const wchar_t* HardcodedErrorString(int err)

View file

@ -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,24 +17,29 @@
#include "precompiled.h"
#include "World.h"
#include "graphics/GameView.h"
#include "graphics/HeightMipmap.h"
#include "graphics/LightEnv.h"
#include "graphics/MapReader.h"
#include "graphics/MapWriter.h"
#include "graphics/Terrain.h"
#include "graphics/Terrain.h"
#include "graphics/UnitManager.h"
#include "lib/timer.h"
#include "lib/path.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/FileIo.h"
#include "ps/Game.h"
#include "ps/Loader.h"
#include "ps/World.h"
#include "renderer/Renderer.h"
#include "renderer/SceneRenderer.h"
#include "simulation2/Simulation2.h"
#include <js/RootingAPI.h>
#include <string>
class CTriggerManager;
/**
* Global light settings.
* It is not a member of CWorld because it is passed

View file

@ -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
@ -27,6 +27,10 @@
#include "ps/CStrForward.h"
#include "ps/Errors.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <memory>
#ifndef ERROR_GROUP_GAME_DEFINED

View file

@ -29,7 +29,6 @@
#include "scriptinterface/ScriptRequest.h"
#include <algorithm>
#include <iterator>
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>

View file

@ -19,7 +19,6 @@
#include "RelaxNG.h"
#include "lib/code_annotation.h"
#include "lib/timer.h"
#include "lib/types.h"
#include "ps/CLogger.h"

View file

@ -19,8 +19,6 @@
#include "Xeromyces.h"
#include "RelaxNG.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/vfs/vfs.h"
#include "lib/path.h"
@ -30,13 +28,13 @@
#include "ps/CStr.h"
#include "ps/CacheLoader.h"
#include "ps/Filesystem.h"
#include "ps/XML/RelaxNG.h"
#include <cstring>
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlversion.h>
#include <map>
#include <memory>
#include <mutex>
#include <type_traits>
#include <utility>

View file

@ -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_JSI_VFS
#define INCLUDED_JSI_VFS
#include "lib/types.h"
#include "scriptinterface/ScriptTypes.h"
class ScriptRequest;

View file

@ -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,10 +23,22 @@
#include "lib/self_test.h"
#include "lib/external_libraries/libsdl.h"
#include "ps/Hotkey.h"
#include "lib/file/file_system.h"
#include "lib/file/vfs/vfs.h"
#include "lib/input.h"
#include "lib/path.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/Globals.h"
#include "ps/Filesystem.h"
#include "ps/Globals.h"
#include "ps/Hotkey.h"
#include <SDL_events.h>
#include <SDL_keyboard.h>
#include <initializer_list>
#include <memory>
#include <unordered_map>
#include <vector>
class TestHotkey : public CxxTest::TestSuite

View file

@ -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
@ -26,7 +26,11 @@
#include "ps/ModIo.h"
#include "scriptinterface/ScriptInterface.h"
#include <cstddef>
#include <map>
#include <sodium.h>
#include <string>
#include <vector>
class TestModIo : public CxxTest::TestSuite
{

View file

@ -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
@ -17,12 +17,15 @@
#include "lib/self_test.h"
#include "lib/types.h"
#include "ps/Future.h"
#include "ps/TaskManager.h"
#include <atomic>
#include <condition_variable>
#include <cstddef>
#include <mutex>
#include <vector>
class TestTaskManager : public CxxTest::TestSuite
{

View file

@ -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
@ -15,10 +15,16 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include <fmt/printf.h>
#include "lib/self_test.h"
#include "ps/CStr.h"
#include <algorithm>
#include <clocale>
#include <cstdint>
#include <fmt/printf.h>
#include <string>
class TestFmt : public CxxTest::TestSuite
{
public: