Fix some includes all over the place

Make include-what-you-use happy with some files in source 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-10 19:59:02 +02:00
parent 827116cd35
commit 3647921bed
No known key found for this signature in database
72 changed files with 261 additions and 149 deletions

View file

@ -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 <cstddef>
#include <fmt/format.h>
#include <js/Debug.h>
#include <jsapi.h>
#include <memory>
#include <thread>
#include <utility>
#if OS_WIN
#include <WinSock2.h>
@ -40,10 +50,7 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
#include <thread>
#include <ps/Filesystem.h>
namespace DAP
{

View file

@ -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 <condition_variable>
#include <iostream>
#include <thread>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <memory>
#include <mutex>
#include <string>
#include <stdexcept>
#include <string>
class ScriptContext;
class ScriptInterface;
namespace DAP
{

View file

@ -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 <fmt/format.h>
#include <memory>
#include <string>
class TestDapInterface : public CxxTest::TestSuite
{

View file

@ -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 <map>
#include <utility>

View file

@ -36,6 +36,7 @@
#include "ps/Errors.h"
#include "ps/Filesystem.h"
#include "ps/GameSetup/GameSetup.h"
#include "scriptinterface/ScriptInterface.h"
#include <algorithm>
#include <boost/algorithm/string/predicate.hpp>

View file

@ -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

View file

@ -18,6 +18,7 @@
#ifndef IXMPPCLIENT_H
#define IXMPPCLIENT_H
#include "lib/types.h"
#include "scriptinterface/ScriptTypes.h"
class ScriptRequest;

View file

@ -39,7 +39,6 @@
#include "scriptinterface/StructuredClone.h"
#include <iostream>
#include <iterator>
#include <js/GCAPI.h>
#include <js/PropertyAndElement.h>
#include <js/PropertyDescriptor.h>

View file

@ -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 <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <sodium/core.h>
#include <sodium/crypto_hash_sha256.h>
#include <sodium.h>
#include <stdexcept>
#include <string>

View file

@ -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 <SDL_events.h>
#include <SDL_stdinc.h>
#include <SDL_timer.h>
#include <SDL_video.h>
#include <chrono>
#include <cstdlib>
#include <ctime>
#include <exception>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#if OS_UNIX
#include <iostream>
@ -125,9 +147,6 @@ extern "C"
}
#endif
#include <chrono>
#include <utility>
extern CStrW g_UniqueLogPostfix;
// Determines the lifetime of the mainloop

View file

@ -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"

View file

@ -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

View file

@ -49,12 +49,11 @@
#include <functional>
#include <iterator>
#include <js/GCAPI.h>
#include <js/PropertyAndElement.h>
#include <js/TracingAPI.h>
#include <map>
#include <memory>
#include <sstream>
#include <type_traits>
#include <utility>
/**
* Once ping goes above turn length * command delay,

View file

@ -28,8 +28,7 @@
#include "ps/CStr.h"
#include <algorithm>
#include <memory>
#include <new>
#include <utility>
Status CNetFileTransferer::HandleMessageReceive(const CNetMessage& message)
{

View file

@ -27,7 +27,6 @@
#include <map>
#include <string>
#include <unordered_map>
#include <utility>
class CFileTransferAckMessage;
class CFileTransferDataMessage;

View file

@ -23,7 +23,6 @@
#include <algorithm>
#include <cstdint>
#include <utility>
namespace
{

View file

@ -55,8 +55,12 @@
#include <cstring>
#include <functional>
#include <iterator>
#include <js/PropertyAndElement.h>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#if CONFIG2_MINIUPNPC
#include <miniupnpc/igd_desc_parse.h>
#include <miniupnpc/miniupnpc.h>
@ -64,12 +68,6 @@
#include <miniupnpc/upnpdev.h>
#include <miniupnpc/upnperrors.h>
#endif
#include <new>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
/**
* Number of peers to allocate for the enet host.

View file

@ -30,8 +30,7 @@
#include "simulation2/system/TurnManager.h"
#include <limits>
#include <memory>
#include <new>
#include <utility>
#if 0
#include "ps/Util.h"

View file

@ -25,7 +25,6 @@
#include <map>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
class CNetServerSession;

View file

@ -28,7 +28,6 @@
#include <atomic>
#include <boost/lockfree/queue.hpp>
#include <utility>
class CNetClient;
class CNetMessage;

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
// IWYU pragma: begin_keep
#include "lib/precompiled.h" // common precompiled header
// IWYU pragma: end_keep

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
@ -15,6 +15,8 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// 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

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
@ -15,6 +15,8 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// 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

View file

@ -58,7 +58,6 @@
#include <cstddef>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/Value.h>
#include <memory>

View file

@ -26,7 +26,6 @@
#include <algorithm>
#include <js/CallArgs.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>

View file

@ -109,13 +109,9 @@
#include <fmt/format.h>
#include <fstream>
#include <js/CallArgs.h>
#include <js/Class.h>
#include <js/Object.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <jsapi.h>
#include <locale>
#include <memory>
#include <optional>

View file

@ -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"

View file

@ -41,7 +41,6 @@
#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>

View file

@ -43,7 +43,6 @@
#include <algorithm>
#include <ctime>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>

View file

@ -55,7 +55,6 @@
#include <ctime>
#include <fstream>
#include <js/PropertyAndElement.h>
#include <js/Value.h>
#include <memory>

View file

@ -51,7 +51,6 @@
#include <cstdint>
#include <ctime>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <memory>

View file

@ -30,7 +30,6 @@
#include <algorithm>
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/Value.h>
#include <jsapi.h>

View file

@ -25,7 +25,6 @@
#include "ps/VideoMode.h"
#include "scriptinterface/FunctionWrapper.h"
#include <js/PropertyAndElement.h>
#include <string>
#include <unordered_set>
#include <vector>

View file

@ -23,8 +23,6 @@
#include "ps/CLogger.h"
#include "scriptinterface/FunctionWrapper.h"
#include <js/PropertyAndElement.h>
namespace JS { class CallArgs; }
namespace JSI_Console

View file

@ -26,7 +26,6 @@
#include "scriptinterface/FunctionWrapper.h"
#include <ctime>
#include <js/PropertyAndElement.h>
#include <jsapi.h>
#include <string>
#include <unicode/locid.h>

View file

@ -41,7 +41,6 @@
#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>

View file

@ -40,7 +40,6 @@
#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>

View file

@ -31,7 +31,6 @@
#include <fmt/format.h>
#include <js/Array.h>
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>

View file

@ -27,7 +27,6 @@
#include "scriptinterface/Object.h"
#include "scriptinterface/ScriptRequest.h"
#include <js/PropertyAndElement.h>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>

View file

@ -33,7 +33,6 @@
#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>

View file

@ -27,7 +27,6 @@
#include "ps/UserReport.h"
#include "scriptinterface/FunctionWrapper.h"
#include <js/PropertyAndElement.h>
#include <string>
namespace JSI_UserReport

View file

@ -25,7 +25,6 @@
#include "ps/VisualReplay.h"
#include "scriptinterface/FunctionWrapper.h"
#include <js/PropertyAndElement.h>
#include <string>
namespace JSI_VisualReplay

View file

@ -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 <queue>
#include <cstdlib>
#include <js/RootingAPI.h>
#include <js/TypeDecls.h>
#include <js/Value.h>
#include <sstream>
#include <tuple>
#include <utility>
namespace RL
{

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,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 <condition_variable>
#include <exception>
#include <mutex>
#include <string>
#include <vector>
struct mg_context;
namespace RL
{
struct ScenarioConfig

View file

@ -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"

View file

@ -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"

View file

@ -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)

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
@ -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 <string>
BEGIN_INTERFACE_WRAPPER(RallyPoint)
END_INTERFACE_WRAPPER(RallyPoint)

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
@ -22,6 +22,7 @@
#include "simulation2/system/InterfaceScripted.h"
#include "simulation2/scripting/ScriptComponent.h"
#include <string>
BEGIN_INTERFACE_WRAPPER(Settlement)
END_INTERFACE_WRAPPER(Settlement)

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
@ -22,6 +22,8 @@
#include "simulation2/system/InterfaceScripted.h"
#include "simulation2/scripting/ScriptComponent.h"
#include <string>
BEGIN_INTERFACE_WRAPPER(TerritoryDecayManager)
END_INTERFACE_WRAPPER(TerritoryDecayManager)

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,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 <js/Value.h>
#include <string>
class CUnit;

View file

@ -31,7 +31,6 @@
#include <atomic>
#include <map>
#include <memory>
#include <new>
#include <vector>
/**

View file

@ -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 <algorithm>
#include <cstddef>
#include <cstdint>
#include <utility>
#include <vector>
/**

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,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

View file

@ -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 <SDL_timer.h>
#include <algorithm>
#include <cstring>
#include <thread>
#include <utility>
ISoundManager* g_SoundManager = NULL;

View file

@ -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 <AL/al.h>
#include <AL/alc.h>
#include <map>
#include <mutex>
#include <string>
#include <vector>
#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

View file

@ -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 <algorithm>
#include <cstddef>
#include <vector>
/*

View file

@ -28,7 +28,6 @@
#include "lib/file/vfs/vfs_path.h"
#include <AL/al.h>
#include <AL/alc.h>
#include <array>
/*

View file

@ -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 <AL/al.h>
#include <cstddef>
#include <utility>
DataMap CSoundData::sSoundData;

View file

@ -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 <map>
#include <string>
class CSoundData;
typedef std::map<std::wstring, CSoundData*> DataMap;

View file

@ -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 <AL/al.h>
#include <AL/alc.h>
#include <algorithm>
#include <fcntl.h>
#include <fmt/format.h>
#include <iterator>
#include <stdexcept>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>
static Status LibErrorFromVorbis(int err)
{

View file

@ -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 <AL/al.h>
#include <AL/alc.h>
#include <cstddef>
#include <memory>
namespace PS { template <typename T> class span; }
class OggStream
{

View file

@ -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:

View file

@ -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 <algorithm>
CSoundBase::CSoundBase()
{

View file

@ -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 <AL/al.h>
#include <AL/alc.h>
#include <mutex>
class CSoundData;
class CVector3D;
class CSoundBase : public ISoundItem
{
protected:

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 @@
#include "soundmanager/SoundManager.h"
#include "soundmanager/data/SoundData.h"
#include <AL/al.h>
#include <cstddef>
#include <mutex>
CSoundItem::CSoundItem()

View file

@ -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
{

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
@ -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 <AL/al.h>
#include <cstddef>
CStreamItem::CStreamItem(CSoundData* sndData)
{

View file

@ -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:

View file

@ -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 <sstream>
#include <string>
namespace JSI_Sound
{

View file

@ -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 <algorithm>
#include <random>
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 <AL/al.h>
#include <cmath>
#include <utility>
constexpr ALfloat DEFAULT_ROLLOFF = 0.5f;
constexpr ALfloat MAX_ROLLOFF = 0.7f;

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
@ -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 <cstddef>
#include <string>
#include <vector>
class CSoundData;
class CVector3D;
enum eSndGrpFlags