1
0
forked from mirrors/0ad

Fix includes in source/ps

Make include-what-you-use happy with some iles 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-08-02 16:05:58 +02:00
parent 7dece41990
commit 8a6d7b6c65
41 changed files with 382 additions and 101 deletions
+5 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2022 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -19,14 +19,16 @@
#include "JSInterface_ConfigDB.h"
#include "ps/ConfigDB.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/VideoMode.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include <js/PropertyAndElement.h>
#include <string>
#include <unordered_set>
#include <vector>
namespace JSI_ConfigDB
{
+5 -1
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
@@ -23,6 +23,10 @@
#include "ps/CLogger.h"
#include "scriptinterface/FunctionWrapper.h"
#include <js/PropertyAndElement.h>
namespace JS { class CallArgs; }
namespace JSI_Console
{
CConsole* ConsoleGetter(const ScriptRequest&, JS::CallArgs&)
+6 -2
View File
@@ -22,12 +22,16 @@
#include "i18n/L10n.h"
#include "lib/build_version.h"
#include "lib/debug.h"
#include "lib/utf8.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include <unicode/smpdtfmt.h>
#include <ctime>
#include <js/PropertyAndElement.h>
#include <jsapi.h>
#include <string>
#include <unicode/locid.h>
#include <unicode/smpdtfmt.h>
#include <unicode/utypes.h>
namespace JSI_Debug
{
+16 -2
View File
@@ -19,7 +19,13 @@
#include "JSInterface_Game.h"
#include "graphics/HeightMipmap.h"
#include "graphics/Terrain.h"
#include "lib/config2.h"
#include "lib/debug.h"
#include "lib/file/vfs/vfs.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "network/NetClient.h"
#include "network/NetServer.h"
#include "ps/CLogger.h"
@@ -29,12 +35,20 @@
#include "ps/Replay.h"
#include "ps/World.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/StructuredClone.h"
#include "simulation2/system/TurnManager.h"
#include "simulation2/Simulation2.h"
#include "soundmanager/SoundManager.h"
#include "simulation2/system/TurnManager.h"
#include "soundmanager/ISoundManager.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <stdexcept>
#include <string>
class ScriptInterface;
namespace JSI_Game
{
+14 -4
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,17 +19,27 @@
#include "JSInterface_Hotkey.h"
#include "lib/external_libraries/libsdl.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/ConfigDB.h"
#include "ps/Hotkey.h"
#include "ps/KeyName.h"
#include "ps/containers/StaticVector.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#include <unordered_map>
#include <vector>
#include <SDL_scancode.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <jsapi.h>
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
/**
* Convert an unordered map to a JS object, mapping keys to values.
+15 -3
View File
@@ -22,20 +22,32 @@
#include "graphics/FontMetrics.h"
#include "graphics/MapReader.h"
#include "lib/code_generation.h"
#include "lib/file/vfs/vfs_path.h"
#include "lib/frequency_filter.h"
#include "lib/sysdep/sysdep.h"
#include "lib/utf8.h"
#include "maths/Size2D.h"
#include "lib/types.h"
#include "maths/MD5.h"
#include "maths/Size2D.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/CStrIntern.h"
#include "ps/Errors.h"
#include "ps/GUID.h"
#include "ps/GameSetup/Atlas.h"
#include "ps/Globals.h"
#include "ps/Hotkey.h"
#include "ps/Util.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include "tools/atlas/GameInterface/GameLoop.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <string>
class ScriptInterface;
namespace JSI_Main
{
bool AtlasIsAvailable()
+13
View File
@@ -19,14 +19,27 @@
#include "JSInterface_Mod.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Mod.h"
#include "ps/Pyrogenesis.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#include <fmt/format.h>
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <stdexcept>
#include <vector>
class ScriptInterface;
namespace JS { class CallArgs; }
extern void RestartEngine();
+15 -1
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,10 +19,24 @@
#include "JSInterface_ModIo.h"
#include "lib/debug.h"
#include "lib/types.h"
#include "ps/CLogger.h"
#include "ps/ModIo.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptRequest.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <map>
#include <string>
#include <utility>
#include <vector>
namespace JS { class CallArgs; }
namespace JSI_ModIo
{
+11 -1
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,17 +19,27 @@
#include "JSInterface_SavedGame.h"
#include "lib/debug.h"
#include "network/NetClient.h"
#include "network/NetServer.h"
#include "ps/CLogger.h"
#include "ps/Game.h"
#include "ps/SavedGame.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptRequest.h"
#include "scriptinterface/StructuredClone.h"
#include "simulation2/Simulation2.h"
#include "simulation2/system/TurnManager.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <optional>
#include <string>
class ScriptInterface;
namespace JSI_SavedGame
{
@@ -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,12 +19,15 @@
#include "JSInterface_UserReport.h"
#include "lib/file/vfs/vfs.h"
#include "lib/path.h"
#include "lib/status.h"
#include "ps/Filesystem.h"
#include "ps/Pyrogenesis.h"
#include "ps/UserReport.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include <js/PropertyAndElement.h>
#include <string>
namespace JSI_UserReport
+24
View File
@@ -19,18 +19,42 @@
#include "JSInterface_VFS.h"
#include "lib/debug.h"
#include "lib/file/file_system.h"
#include "lib/file/io/write_buffer.h"
#include "lib/file/vfs/vfs.h"
#include "lib/file/vfs/vfs_util.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/status.h"
#include "lib/sysdep/filesystem.h"
#include "lib/utf8.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Errors.h"
#include "ps/Filesystem.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/JSON.h"
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptConversions.h"
#include "scriptinterface/ScriptRequest.h"
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <fmt/format.h>
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <sstream>
#include <stdexcept>
#include <string>
#include <string_view>
class ScriptInterface;
namespace JSI_VFS
{
@@ -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,14 @@
#include "JSInterface_VisualReplay.h"
#include "lib/os_path.h"
#include "lib/utf8.h"
#include "ps/CStr.h"
#include "ps/VisualReplay.h"
#include "scriptinterface/FunctionWrapper.h"
#include "scriptinterface/ScriptRequest.h"
#include <js/PropertyAndElement.h>
#include <string>
namespace JSI_VisualReplay
{