Commit Graph
93 Commits
Author SHA1 Message Date
MatthewBeshay 26222f26e0 refactor: fold 4J.Common into platform types, eliminate last 4J directory 2026-04-02 16:27:06 +11:00
MatthewBeshay 11f9bd6046 refactor: move Minecraft.Client into app 2026-04-02 16:09:32 +11:00
MatthewBeshay e5a859f8a7 refactor: move 4J implementations into platform/sdl2 2026-04-02 16:03:08 +11:00
MatthewBeshay 35b63da24d refactor: migrate CPlatformNetworkManager into IPlatformNetwork 2026-04-02 15:42:22 +11:00
MatthewBeshay 7b1a6092e1 refactor: extract IPlatformLeaderboard from LeaderboardManager 2026-04-02 15:36:42 +11:00
MatthewBeshay f70d4b703b refactor: split extraX64.h into NetTypes.h and XboxStubs.h
World no longer depends on Xbox/network stubs. INVALID_XUID moved to
4J_Compat.h. XPhysicalAlloc replaced with std::vector in HellFlatLevelSource.
2026-04-01 17:48:04 +11:00
MatthewBeshay b4feb6ce92 chore: mark comment 4jcraft 2026-04-01 16:28:57 +11:00
MatthewBeshay cca286b73a fix: getSubimage pixel data written to copy, not actual buffer 2026-04-01 16:18:40 +11:00
MatthewBeshay be3cb9ad92 fix: undef stb_vorbis macros leaking into unity build chunks 2026-04-01 13:47:25 +11:00
MatthewBeshay 4271e562a6 fix: clean up __valid macro leak at source in sal.h instead of patching every include site 2026-04-01 13:15:16 +11:00
MatthewBeshay ee31bfcec5 refactor: replace POSIX/Win32 APIs with standard C++ equivalents
Replaces platform-specific APIs across 21 files with std::chrono, std::fstream, std::filesystem, and std::this_thread. Adds PlatformTime.h utility header wrapping std::chrono::steady_clock for GetTickCount/QueryPerformanceCounter patterns.
2026-04-01 05:01:37 +11:00
MatthewBeshay 2f92b07c1f fix: resolve ByteBuffer hardcoded path and static const linker errors 2026-03-31 21:50:15 +11:00
MatthewBeshay a18cb3d484 refactor: replace shared_ptr(new T) with make_shared<T> 2026-03-31 20:42:45 +11:00
MatthewBeshay 8b836cf604 refactor: remove remaining trial/upsell from platform interfaces 2026-03-31 20:12:15 +11:00
MatthewBeshay f7241f8064 chore: add TODO for std::function migration in platform interfaces 2026-03-31 20:05:59 +11:00
MatthewBeshay 940b214539 refactor: apply C++ best practices to platform interfaces
Extract shared types to PlatformTypes.h, add [[nodiscard]] to query
methods, convert file-scope enums to enum class with compat aliases.
2026-03-31 20:05:59 +11:00
MatthewBeshay 5b02454b4f refactor: add IPlatformSound, IPlatformNetwork, IPlatformUIController interfaces 2026-03-31 20:05:59 +11:00
MatthewBeshay 42839182cd refactor: break World dependency on 4J modules via platform interfaces 2026-03-31 20:05:59 +11:00
MatthewBeshay 5c3668ec3c refactor: remove IsFullVersion and all trial mode code 2026-03-31 20:05:59 +11:00
MatthewBeshay 9e207250cb refactor: add platform interfaces, move GetPrimaryPad to Input, gut Profile stubs 2026-03-31 20:05:59 +11:00
MatthewBeshay e942d0d472 refactor: revert GameMath rename back to Mth 2026-03-31 13:38:53 +11:00
MatthewBeshay 2a7e5dc1d4 refactor: migrate NBT storage to unique_ptr, remove -fpermissive
CompoundTag/ListTag now use unique_ptr internally, fixing multiple memory leaks in getCompound/getList/getAllTags and tag overwrite paths.
2026-03-31 13:27:00 +11:00
MatthewBeshay 8f0c2a3f26 refactor: replace Mth with GameMath, switch to stdlib math and std::numbers::pi
Inlined trivial wrappers, moved ranged random methods to Random, replaced M_PI with std::numbers::pi, unified DEGRAD/RAD_TO_GRAD as DEG_TO_RAD, fixed getInt/getDouble default fallback bug, and switched non-worldgen sin/cos to sinf/cosf.
2026-03-31 13:12:34 +11:00
MatthewBeshay 7ddfaeb59e refactor: remove arrayWithLength, replace with std::vector
Eliminates the custom arrayWithLength<T> wrapper and all typedefs, replacing with std::vector<T> directly.
2026-03-31 12:06:19 +11:00
MatthewBeshay e911e07a58 Refactor C4JThread: modernise API naming and replace Windows constants
Rename all PascalCase methods to camelCase, replace Windows macro constants with C++ constexpr members, convert ThreadPriority to enum class, remove unused Sleep(), fix memory ordering on inline accessors, extract platform code into helpers.
2026-03-31 01:06:06 +11:00
MatthewBeshay 156a23d744 Remove dead _ENTITIES_RW_SECTION code and update stale critical section comments
The RW section code path was never compiled. Updated remaining comments to reflect mutex/lock terminology.
2026-03-31 00:23:35 +11:00
MatthewBeshay a513fa7597 Rename CriticalSection wrapper functions to match std::mutex usage
EnterCallbackIdCriticalSection/LeaveCallbackIdCriticalSection -> lockCallbackScenes/unlockCallbackScenes, EnterSaveNotificationSection/LeaveSaveNotificationSection -> lockSaveNotification/unlockSaveNotification, m_saveNotificationCriticalSection -> m_saveNotificationMutex.
2026-03-31 00:16:16 +11:00
MatthewBeshay e4520df31f Restore recursive locking for mutexes converted from CRITICAL_SECTION
CRITICAL_SECTION is reentrant; std::mutex is not. This caused deadlocks during world generation, post-processing, and saving.
2026-03-30 22:14:14 +11:00
MatthewBeshay 57e4bdd973 Fix dirtyChunksLock scope in updateDirtyChunks
Move unique_lock declaration before the FRAME_PROFILE_SCOPE block so it remains in scope for the unlock() calls in the #if/#else branches below.
2026-03-30 19:12:22 +11:00
MatthewBeshay f1df21590b Merge dev and resolve formatting conflicts 2026-03-30 19:00:30 +11:00
MatthewBeshay 123c326881 Merge remote-tracking branch 'origin/dev' into refactor/nuke-critical-sections 2026-03-30 18:54:27 +11:00
MatthewBeshay bc6013ab70 Replace all CRITICAL_SECTION usage with std::mutex and std::lock_guard
Migrates 59 files from WinAPI CRITICAL_SECTION to portable C++ std::mutex/std::lock_guard/std::unique_lock. Removes Linux CRITICAL_SECTION shims from winapi_stubs.h.
2026-03-30 18:45:55 +11:00
MatthewBeshay c772cfe8b3 Merge pull request #361 from 4jcraft/in-tree-4jlibs
refactor: bring 4jlibs back in-tree
2026-03-30 18:09:11 +11:00
MatthewBeshay 8a6d279230 Merge branch '4jcraft:dev' into refactor/nuke-winapi-types 2026-03-30 17:37:02 +11:00
MatthewBeshay 28d68befd4 Replace remaining WinAPI types with standard C++ equivalents
DWORD→uint32_t, BYTE→uint8_t, HRESULT→int32_t, HANDLE→void*, UINT→uint32_t, INT→int32_t, WORD→uint16_t, LONG→int32_t, SHORT→int16_t, LONGLONG→int64_t, ULONG_PTR→uintptr_t, PBYTE→uint8_t*, LPWSTR/PWSTR→wchar_t*, FLOAT→float, CHAR→char, boolean→bool, CONST→const, TRUE→true, FALSE→false across 176 files (excluding vendor libs and Linux stubs).
2026-03-30 17:36:15 +11:00
MatthewBeshay 56290446db Merge pull request #359 from 4jcraft/nuke-zlib
remove xuiscene_base
2026-03-30 17:26:53 +11:00
MatthewBeshay b9c32b580c Merge pull request #358 from 4jcraft/nuke-zlib
nuke in-tree zlib
2026-03-30 16:57:57 +11:00
MatthewBeshay b28650976d Merge pull request #357 from 4jcraft/refactor/expand-auto-var
nuke more winapi types
2026-03-30 16:44:08 +11:00
MatthewBeshay a0fdc643d1 Merge branch 'upstream-dev' into cleanup/nullptr-replacement
# Conflicts:
#	Minecraft.Client/Network/PlayerChunkMap.cpp
#	Minecraft.Client/Network/PlayerList.cpp
#	Minecraft.Client/Network/ServerChunkCache.cpp
#	Minecraft.Client/Platform/Common/Consoles_App.cpp
#	Minecraft.Client/Platform/Common/DLC/DLCManager.cpp
#	Minecraft.Client/Platform/Common/GameRules/LevelGenerationOptions.cpp
#	Minecraft.Client/Platform/Common/GameRules/LevelRuleset.cpp
#	Minecraft.Client/Platform/Common/Tutorial/Tutorial.cpp
#	Minecraft.Client/Platform/Common/Tutorial/TutorialTask.cpp
#	Minecraft.Client/Platform/Common/UI/IUIScene_CreativeMenu.cpp
#	Minecraft.Client/Platform/Common/UI/UIComponent_Panorama.cpp
#	Minecraft.Client/Platform/Common/UI/UIController.cpp
#	Minecraft.Client/Platform/Common/UI/UIController.h
#	Minecraft.Client/Platform/Extrax64Stubs.cpp
#	Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Input.h
#	Minecraft.Client/Platform/Windows64/4JLibs/inc/4J_Storage.h
#	Minecraft.Client/Player/EntityTracker.cpp
#	Minecraft.Client/Player/ServerPlayer.cpp
#	Minecraft.Client/Rendering/EntityRenderers/PlayerRenderer.cpp
#	Minecraft.Client/Textures/Packs/DLCTexturePack.cpp
#	Minecraft.Client/Textures/Stitching/StitchedTexture.cpp
#	Minecraft.Client/Textures/Stitching/TextureMap.cpp
#	Minecraft.Client/Textures/Textures.cpp
#	Minecraft.World/Blocks/NotGateTile.cpp
#	Minecraft.World/Blocks/PressurePlateTile.cpp
#	Minecraft.World/Blocks/TileEntities/PotionBrewing.cpp
#	Minecraft.World/Enchantments/EnchantmentHelper.cpp
#	Minecraft.World/Entities/HangingEntity.cpp
#	Minecraft.World/Entities/LeashFenceKnotEntity.cpp
#	Minecraft.World/Entities/LivingEntity.cpp
#	Minecraft.World/Entities/Mobs/Boat.cpp
#	Minecraft.World/Entities/Mobs/Minecart.cpp
#	Minecraft.World/Entities/Mobs/Witch.cpp
#	Minecraft.World/Entities/SyncedEntityData.cpp
#	Minecraft.World/Items/LeashItem.cpp
#	Minecraft.World/Items/PotionItem.cpp
#	Minecraft.World/Level/BaseMobSpawner.cpp
#	Minecraft.World/Level/CustomLevelSource.cpp
#	Minecraft.World/Level/Level.cpp
#	Minecraft.World/Level/Storage/DirectoryLevelStorage.cpp
#	Minecraft.World/Level/Storage/McRegionLevelStorage.cpp
#	Minecraft.World/Level/Storage/RegionFileCache.cpp
#	Minecraft.World/Player/Player.cpp
#	Minecraft.World/WorldGen/Biomes/BiomeCache.cpp
#	Minecraft.World/WorldGen/Features/RandomScatteredLargeFeature.cpp
#	Minecraft.World/WorldGen/Layers/BiomeOverrideLayer.cpp
2026-03-30 16:28:40 +11:00
MatthewBeshay dfb0e3b03e refactor: replace NULL with nullptr across C++ codebase
Excludes vendored C libs (zlib, Miles, DirectXMath, boost, Iggy).
2026-03-30 16:25:52 +11:00
MatthewBeshay 00cd713cc8 Merge pull request #355 from 4jcraft/refactor/expand-auto-var
refactor: replace some win32 typedefs
2026-03-30 16:21:16 +11:00
MatthewBeshay e65a78d6a7 Merge pull request #354 from 4jcraft/refactor/expand-auto-var
refactor: replace double-underscore MSVC integer types with stdint
2026-03-30 16:12:18 +11:00
MatthewBeshay a104252557 Merge branch 'upstream-dev' into cleanup/shared-portability-reset-v2
# Conflicts:
#	Minecraft.Client/Platform/Common/Consoles_App.cpp
#	Minecraft.World/IO/Files/File.cpp
2026-03-30 15:28:11 +11:00
MatthewBeshay 9375009dd3 Merge pull request #351 from 4jcraft/fix/pathhelper-include
fix: PathHelper include path
2026-03-30 15:25:10 +11:00
MatthewBeshay 6000900285 Merge branch 'upstream-dev' into cleanup/shared-portability-reset-v2
# Conflicts:
#	Minecraft.Client/Level/ServerLevel.cpp
#	Minecraft.Client/Minecraft.cpp
#	Minecraft.Client/MinecraftServer.cpp
#	Minecraft.Client/Network/ClientConnection.cpp
#	Minecraft.Client/Network/ServerChunkCache.cpp
#	Minecraft.Client/Platform/Common/Audio/SoundEngine.cpp
#	Minecraft.Client/Platform/Common/Consoles_App.cpp
#	Minecraft.Client/Platform/Common/Network/GameNetworkManager.cpp
#	Minecraft.Client/Platform/Common/Network/Sony/SonyCommerce.cpp
#	Minecraft.Client/Platform/Common/Network/Sony/SonyRemoteStorage.cpp
#	Minecraft.Client/Platform/Common/UI/UIController.cpp
#	Minecraft.Client/Platform/Common/UI/UIScene_CreateWorldMenu.cpp
#	Minecraft.Client/Platform/Common/UI/UIScene_EnchantingMenu.cpp
#	Minecraft.Client/Platform/Common/UI/UIScene_LaunchMoreOptionsMenu.cpp
#	Minecraft.Client/Platform/Common/UI/UIScene_LoadOrJoinMenu.cpp
#	Minecraft.Client/Platform/Common/UI/UIScene_MainMenu.cpp
#	Minecraft.Client/Platform/Common/XUI/XUI_Death.cpp
#	Minecraft.Client/Platform/Common/XUI/XUI_Leaderboards.cpp
#	Minecraft.Client/Platform/Common/XUI/XUI_MultiGameJoinLoad.cpp
#	Minecraft.Client/Platform/Common/XUI/XUI_PauseMenu.cpp
#	Minecraft.Client/Platform/Common/XUI/XUI_TransferToXboxOne.cpp
#	Minecraft.Client/Platform/Durango/Durango_Minecraft.cpp
#	Minecraft.Client/Platform/Linux/Linux_Minecraft.cpp
#	Minecraft.Client/Platform/Orbis/Orbis_Minecraft.cpp
#	Minecraft.Client/Platform/PS3/PS3Extras/boost_1_53_0/boost/spirit/home/lex/lexer/lexertl/lexer.hpp
#	Minecraft.Client/Platform/PS3/PS3_Minecraft.cpp
#	Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/TileRenderer_SPU.cpp
#	Minecraft.Client/Platform/PS3/SPU_Tasks/ChunkUpdate/Tile_SPU.cpp
#	Minecraft.Client/Platform/PS3/Xbox_Minecraft.cpp
#	Minecraft.Client/Platform/PSVita/PSVita_Minecraft.cpp
#	Minecraft.Client/Platform/Xbox/Xbox_Minecraft.cpp
#	Minecraft.Client/Platform/stdafx.h
#	Minecraft.Client/Player/LocalPlayer.cpp
#	Minecraft.Client/Rendering/Chunk.cpp
#	Minecraft.Client/Rendering/EntityRenderers/ItemRenderer.cpp
#	Minecraft.Client/Rendering/GameRenderer.cpp
#	Minecraft.Client/Rendering/LevelRenderer.cpp
#	Minecraft.Client/Textures/BufferedImage.cpp
#	Minecraft.Client/UI/Screens/AchievementScreen.cpp
#	Minecraft.Client/UI/Screens/ContainerScreen.cpp
#	Minecraft.Client/UI/Screens/TrapScreen.cpp
#	Minecraft.World/IO/Files/ConsoleSaveFileOriginal.cpp
#	Minecraft.World/IO/Files/File.cpp
#	Minecraft.World/Player/Player.cpp
#	Minecraft.World/Util/C4JThread.cpp
2026-03-30 15:21:08 +11:00
MatthewBeshay 8f61c9b01a fix: update 4jlibs flake input to latest main
Resolves build failure caused by 4jlibs:gles being an unknown option.
2026-03-30 14:57:56 +11:00
MatthewBeshay 7545b7dd87 fix: remove extra blank lines to pass clang-format check 2026-03-30 14:41:27 +11:00
MatthewBeshay 95e0a14b36 refactor: use convStringToWstring for text input instead of uint16 helpers
GetText now returns UTF-8 directly so callers go through simdutf via
convStringToWstring(). Remove dead uint16_to_wstring helpers.
2026-03-30 14:10:14 +11:00
MatthewBeshay e89198f56c fix: sign entry crash and remove blocking callback workaround
- Initialize m_iEditingLine to 0 in SignEntryMenu constructor
  (was uninitialized, causing out-of-bounds array access)
- Add bounds check on m_iEditingLine before array access in callback
- Only truncate sign text if longer than 15 chars (avoid padding)
- Remove manual KeyboardCompleteSeedCallback call in
  LaunchMoreOptionsMenu (no longer needed since RequestKeyboard
  now fires callbacks asynchronously from Tick)
2026-03-30 13:41:54 +11:00
MatthewBeshay fe4c9bd36c Merge branch '4jcraft:dev' into feat/text-input-support 2026-03-30 13:22:48 +11:00
MatthewBeshay 31f6e7012c Merge branch '4jcraft:dev' into feat/text-input-support 2026-03-30 13:12:06 +11:00
MatthewBeshay c6fa51d592 perf(render): optimise tile entity cleanup and profiling 2026-03-29 20:56:00 -05:00
MatthewBeshay a3f7f7d03c perf(render): improve chunk scheduling and refine rebuild profiling 2026-03-29 20:55:59 -05:00
MatthewBeshay 47b7d90835 feat(profiling): add low-overhead in-engine frame profiler 2026-03-29 20:55:59 -05:00
MatthewBeshay b5b4fc34fe fix(linux): increase iggy render-target budget to 64mb 2026-03-29 20:55:59 -05:00
MatthewBeshay f499eaee9c chore(linux): add diagnostics for iggy render-target exhaustion 2026-03-29 20:55:59 -05:00
MatthewBeshay 31acc46308 fix(linux): localise chunk transforms and guard optional iggy paths 2026-03-29 20:55:57 -05:00
MatthewBeshay d53831186e fix(linux): stop core-profile GL state leakage in iggy title rendering 2026-03-29 20:55:57 -05:00
MatthewBeshay 8dfd9e5044 fix(gui): always rebind textures for java font rendering 2026-03-29 20:55:57 -05:00
MatthewBeshay 9680753f5e fix(linux): restore UI GL state handoff for core renderer 2026-03-29 20:55:57 -05:00
MatthewBeshay 831d5fb0b3 Merge branch '4jcraft:dev' into feat/text-input-support 2026-03-30 12:50:18 +11:00
MatthewBeshay 1ead072c45 Add text input support: safe uint16_t* to wstring conversion
Replace unsafe (wchar_t*)pchText casts with uint16_to_wstring() in all
keyboard callbacks. The direct cast is incorrect on platforms where
wchar_t is 4 bytes (Linux/macOS). New helpers in StringHelpers route
through u16string for proper UTF-16 to wchar_t conversion.

- Add uint16_len, uint16_to_u16string, uint16_to_wstring to StringHelpers
- Fix casts in AnvilMenu, CreateWorldMenu, DebugCreateSchematic,
  DebugSetCamera, LaunchMoreOptionsMenu, SignEntryMenu
- Truncate sign text to 15 chars in SignEntryMenu
- Move m_bIgnoreInput reset after if-block in LaunchMoreOptionsMenu
2026-03-30 12:46:50 +11:00
MatthewBeshay c12f32f637 fix: restore ghast reach checks and fire collision bounds after AABB refactor 2026-03-28 20:43:36 +11:00
MatthewBeshay 039c2884ef fix: restore Linux/common build after dead-branch purge 2026-03-26 20:54:08 +11:00
MatthewBeshay 8d3c504ee6 cleanup: flatten dead branches in world io level network and stats 2026-03-26 20:53:52 +11:00
MatthewBeshay 12ff12a263 cleanup: flatten dead branches in client render texture and runtime code 2026-03-26 20:29:59 +11:00
MatthewBeshay f19563bbd7 cleanup: flatten dead branches in common app and ui code 2026-03-26 20:18:29 +11:00
MatthewBeshay 1fecbf297a cleanup: remove console branches from render texture and world helpers 2026-03-26 19:24:04 +11:00
MatthewBeshay 6ef7d05f7e cleanup: collapse common app and ui console branches 2026-03-26 18:49:24 +11:00
MatthewBeshay ad5da38321 cleanup: remove console platform code from shared includes and build paths 2026-03-26 17:53:37 +11:00
MatthewBeshay 2117a772d7 checkpoint: refresh supported-path portability baseline 2026-03-26 17:05:31 +11:00
MatthewBeshay fdb2a1098b fix: restore block lightmap sampling 2026-03-24 08:21:19 +11:00
MatthewBeshay cc24fc996a fix: clean up sanitizer startup issues 2026-03-23 19:34:58 +11:00
MatthewBeshay fed9cf2d95 fix: resolve all build warnings and notes 2026-03-23 18:53:18 +11:00
MatthewBeshay b6efb6265d fix(textures): guard StitchedTexture frame cleanup for SimpleIcon instances 2026-03-23 09:27:28 +11:00
MatthewBeshay e71af5ef46 fix: Missing includes 2026-03-23 08:45:24 +11:00
MatthewBeshay 91b13bccee TU19: fix build fallout across Client, World, NBT and Network 2026-03-22 12:45:21 +11:00
MatthewBeshay 993617025b TU19: merge Minecraft.World/IO 2026-03-22 10:13:01 +11:00
MatthewBeshay e0f4194bfb Delete in-tree 4J libraries after extraction 2026-03-21 00:38:32 +11:00
MatthewBeshay fab917db19 Drop redundant 4jlibs smoke include path 2026-03-21 00:11:19 +11:00
MatthewBeshay 6c4306258b Consume 4jlibs via wrap fallback 2026-03-20 11:32:15 +11:00
MatthewBeshay 1845c64ad4 Decouple 4J libs for extraction to 4jlibs 2026-03-20 11:08:45 +11:00
MatthewBeshay a9e0906cbe Update .gitignore to include subprojects/.wraplock
Add exception for subprojects/.wraplock in .gitignore
2026-03-19 07:07:50 +11:00
MatthewBeshay cb6bea3f36 Update .gitignore 2026-03-18 11:24:10 +11:00
MatthewBeshay 7a9565feef Merge pull request #260 from MatthewBeshay/chore/cpp26
Upgrade the project default to C++26
2026-03-17 00:13:28 +11:00
MatthewBeshay 66961260b4 Merge branch '4jcraft:dev' into chore/cpp26 2026-03-17 00:12:06 +11:00
MatthewBeshay a28d1fea21 Merge branch '4jcraft:dev' into issue/64-remove-winapi-primitives 2026-03-15 09:08:47 +11:00
MatthewBeshay dbdf4fdd22 Merge branch 'dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-12 10:21:19 +11:00
MatthewBeshay a9d1322a6e Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-11 19:53:03 +11:00
MatthewBeshay 42508c8399 Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-11 18:27:03 +11:00
MatthewBeshay ca942717cb Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-11 06:44:56 +11:00
MatthewBeshay d8ed82d703 Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-10 21:06:10 +11:00
MatthewBeshay 2a2558ace3 Merge branch '4jcraft:dev' into issue/51-phase-1-portable-win32-cleanup 2026-03-10 18:39:30 +11:00