move C4JThread and ShutdownManager to platform/thread

This commit is contained in:
Tropical 2026-04-09 23:46:02 -05:00
parent 69c418213e
commit b7d200a5b1
29 changed files with 42 additions and 41 deletions

View file

@ -20,7 +20,7 @@
#include "minecraft/util/Mth.h"
#include "minecraft/world/entity/Mob.h"
#include "minecraft/world/level/storage/LevelData.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/PlatformTypes.h"
#include "platform/fs/fs.h"

View file

@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include "minecraft/network/INetworkService.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/network/NetTypes.h"
#include "platform/PlatformTypes.h"
#include "platform/network/IPlatformNetwork.h"

View file

@ -8,7 +8,7 @@
#include "UIEnums.h"
#include "minecraft/GameHostOptions.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/storage/storage.h"
class Container;

View file

@ -17,7 +17,7 @@
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/ProgressRenderer.h"
#include "minecraft/client/multiplayer/MultiPlayerGameMode.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/PlatformTypes.h"
#include "platform/profile/profile.h"
#include "strings.h"

View file

@ -45,7 +45,7 @@
#include "minecraft/client/skins/TexturePack.h"
#include "minecraft/client/skins/TexturePackRepository.h"
#include "minecraft/client/title/TitleScreen.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/XboxStubs.h"
#include "strings.h"
#include "util/StringHelpers.h"

View file

@ -50,7 +50,6 @@ if get_option('ui_backend') == 'shiggy'
client_dependencies += shiggy_dep
endif
client = executable(
'Minecraft.Client',
platform_sources + localisation[1],

View file

@ -9,7 +9,7 @@
#include "java/File.h"
#include "minecraft/client/resources/ResourceLocation.h"
#include "minecraft/network/packet/DisconnectPacket.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/PlatformTypes.h"
#include "platform/stubs.h"
#include "platform/leaderboard/leaderboard.h"

View file

@ -76,7 +76,7 @@
#include "minecraft/world/phys/HitResult.h"
#include "minecraft/world/phys/Vec3.h"
#include "platform/PlatformTypes.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
#include "platform/input/input.h"
#include "platform/renderer/renderer.h"
#include "platform/stubs.h"

View file

@ -9,7 +9,7 @@
#include "minecraft/client/resources/ResourceLocation.h"
#include "minecraft/util/SmoothFloat.h"
#include "minecraft/world/phys/Vec3.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class Minecraft;
class Entity;

View file

@ -6,7 +6,7 @@
#include "minecraft/world/level/Level.h"
#include "minecraft/world/level/LevelListener.h"
#include "minecraft/world/phys/AABB.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/network/NetTypes.h"
class ClipChunk;

View file

@ -18,7 +18,7 @@
#include "minecraft/network/packet/PacketListener.h"
#include "platform/network/network.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
#include "util/StringHelpers.h"
class SocketAddress;

View file

@ -12,7 +12,7 @@
#include "java/InputOutputStream/DataOutputStream.h"
#include "java/System.h"
#include "minecraft/network/packet/DisconnectPacket.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class DataInputStream;
class DataOutputStream;

View file

@ -10,7 +10,7 @@
#include "platform/network/network.h"
#include "minecraft/server/network/ServerConnection.h"
#include "platform/network/NetTypes.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
class SocketAddress {};

View file

@ -9,7 +9,7 @@
#include "java/InputOutputStream/InputStream.h"
#include "java/InputOutputStream/OutputStream.h"
#include "platform/network/network.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class INetworkPlayer;

View file

@ -80,7 +80,7 @@
#include "minecraft/world/level/chunk/SparseLightStorage.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/ConsoleSaveFileOriginal.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
#include "platform/input/input.h"
class ConsoleInputSource;

View file

@ -11,7 +11,7 @@
#include "minecraft/SharedConstants.h"
#include "minecraft/world/level/chunk/ChunkSource.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/FileHeader.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "util/Timer.h"
class ServerConnection;

View file

@ -10,7 +10,7 @@
#include "minecraft/world/level/biome/Biome.h"
#include "minecraft/world/level/chunk/ChunkSource.h"
#include "minecraft/world/level/levelgen/RandomLevelSource.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class ServerLevel;
class ChunkStorage;

View file

@ -60,7 +60,7 @@
#include "minecraft/world/level/tile/entity/ChestTileEntity.h"
#include "minecraft/world/level/tile/entity/TileEntity.h"
#include "minecraft/world/phys/Vec3.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
#include "platform/input/input.h"
#include "platform/storage/storage.h"
#include "strings.h"

View file

@ -18,7 +18,7 @@
#include "minecraft/world/level/TickNextTickData.h"
#include "minecraft/world/level/TileEventData.h"
#include "minecraft/world/level/biome/Biome.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class ServerChunkCache;
class MinecraftServer;

View file

@ -22,7 +22,7 @@
#include "minecraft/world/level/biome/Biome.h"
#include "minecraft/world/level/saveddata/SavedData.h"
#include "minecraft/world/phys/AABB.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/PlatformTypes.h"
class CompoundTag;

View file

@ -29,7 +29,7 @@
#include "minecraft/world/level/storage/LevelData.h"
#include "nbt/CompoundTag.h"
#include "nbt/NbtIo.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/input/input.h"
class DataInput;

View file

@ -96,7 +96,7 @@ void to_base36(int value, char* buf) {
}
File OldChunkStorage::getFile(int x, int z) {
inline constexpr int MAX_PATH_SIZE = 256;
constexpr int MAX_PATH_SIZE = 256;
char name[MAX_PATH_SIZE];
char path1[MAX_PATH_SIZE];

View file

@ -10,19 +10,6 @@ else
_defs = []
endif
# Core: thread + shutdown plumbing, no backend.
lib_platform_core = static_library('platform_core',
files('C4JThread.cpp', 'ShutdownManager.cpp'),
include_directories: [platform_inc, include_directories('..')],
dependencies: [_threads],
cpp_args: global_cpp_args + global_cpp_defs,
)
platform_dep = declare_dependency(
link_with: lib_platform_core,
include_directories: platform_inc,
)
# Per-subsystem source lists. Each subdir owns its own list of backend
# .cpp files via a `platform_<name>_sources` variable. The library
# build is centralised so we get one library per platform target rather
@ -38,6 +25,20 @@ subdir('sound')
subdir('network')
subdir('leaderboard')
subdir('game')
subdir('thread')
# Core: thread + shutdown plumbing, no backend.
lib_platform_core = static_library('platform_core',
platform_thread_sources,
include_directories: [platform_inc, include_directories('..')],
dependencies: [_threads],
cpp_args: global_cpp_args + global_cpp_defs,
)
platform_dep = declare_dependency(
link_with: lib_platform_core,
include_directories: platform_inc,
)
lib_platform_sdl2 = static_library('platform_sdl2',
platform_input_sources

View file

@ -8,7 +8,7 @@
#include "StubNetworkPlayer.h"
#include "app/common/Network/GameNetworkManager.h"
#include "minecraft/network/Socket.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
#include "platform/network/NetTypes.h"
#include "platform/network/network.h"

View file

@ -26,8 +26,8 @@
#include <unistd.h>
#endif
#include "platform/C4JThread.h"
#include "platform/ShutdownManager.h"
#include "platform/thread/C4JThread.h"
#include "platform/thread/ShutdownManager.h"
class Level;

View file

@ -1,8 +1,8 @@
// Linux stub implementations for ShutdownManager
// The PS3/PSVita versions have full implementations; on Linux these are no-ops.
#include "platform/ShutdownManager.h"
#include "platform/thread/ShutdownManager.h"
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
void ShutdownManager::Initialise() {}
void ShutdownManager::StartShutdown() {}

View file

@ -6,7 +6,7 @@
#include <cstddef>
#include <mutex>
#include "platform/C4JThread.h"
#include "platform/thread/C4JThread.h"
class ShutdownManager {
public:

View file

@ -0,0 +1 @@
platform_thread_sources = files('C4JThread.cpp', 'ShutdownManager.cpp')