From d7eca58551d635f5fa7ae46e354c2d3b4b987b4f Mon Sep 17 00:00:00 2001 From: MatthewBeshay <92357869+MatthewBeshay@users.noreply.github.com> Date: Wed, 8 Apr 2026 17:55:04 +1000 Subject: [PATCH] refactor: split App_Defines.h up by concern and drop the umbrella --- meson.build | 1 + targets/app/common/App_Defines.h | 135 ------------------ targets/app/common/App_structs.h | 3 +- targets/app/common/Audio/SoundEngine.cpp | 2 +- targets/app/common/Audio/SoundEngine.h | 2 +- targets/app/common/Game.cpp | 2 +- targets/app/common/GameSettingsManager.cpp | 4 +- targets/app/common/Game_XuiActions.cpp | 2 +- targets/app/common/Tutorial/TutorialEnum.h | 8 +- .../app/common/UI/All Platforms/UIStructs.h | 2 +- .../UIScene_CreateWorldMenu.cpp | 3 +- .../Frontend Menu screens/UIScene_EULA.cpp | 2 +- .../UIScene_JoinMenu.cpp | 2 +- .../UIScene_LaunchMoreOptionsMenu.cpp | 3 +- .../UIScene_LoadMenu.cpp | 3 +- .../UIScene_LoadOrJoinMenu.cpp | 2 +- .../UIScene_MainMenu.cpp | 3 +- .../UIScene_NewUpdateMessage.cpp | 2 +- .../UIScene_SaveMessage.cpp | 3 +- .../UIScene_TrialExitUpsell.cpp | 2 +- .../Help & Options/UIScene_LanguageSelector.h | 2 +- .../Help & Options/UIScene_SkinSelectMenu.cpp | 2 +- .../app/common/UI/Scenes/UIScene_Keyboard.cpp | 2 +- targets/app/linux/Linux_Minecraft.cpp | 2 +- targets/minecraft/GameHostOptions.h | 49 ++++++- targets/minecraft/GameTypes.h | 17 ++- .../minecraft/client/renderer/GameRenderer.h | 1 - .../world/level/storage/LevelData.cpp | 2 +- targets/platform/PlatformTypes.h | 5 + targets/platform/profile/ProfileConstants.h | 64 +++++++++ targets/platform/profile/stub/StubProfile.cpp | 2 - 31 files changed, 163 insertions(+), 171 deletions(-) delete mode 100644 targets/app/common/App_Defines.h diff --git a/meson.build b/meson.build index 84f6e6fac..2c4817142 100644 --- a/meson.build +++ b/meson.build @@ -24,6 +24,7 @@ global_cpp_defs = [ '-D_LARGE_WORLDS', '-D_EXTENDED_ACHIEVEMENTS', '-D_FORTIFY_SOURCE=2', + '-DMULTITHREAD_ENABLE', # always-on threading flag (formerly in App_Defines.h) ] # Debug-only defines: keep for debug + debugoptimized so iteration is unchanged. diff --git a/targets/app/common/App_Defines.h b/targets/app/common/App_Defines.h deleted file mode 100644 index f5d301268..000000000 --- a/targets/app/common/App_Defines.h +++ /dev/null @@ -1,135 +0,0 @@ -#pragma once - -// 4J Stu - For non-splitscreen menus, default to this screen -#define DEFAULT_XUI_MENU_USER 0 -#define MULTITHREAD_ENABLE -#define MAX_CAPENAME_SIZE 32 -#define MAX_BANNERNAME_SIZE 32 -#define MAX_TMSFILENAME_SIZE 40 -#define MAX_TYPE_SIZE 32 -#define MAX_EXTENSION_TYPES 3 - -#define MAX_LOCAL_PLAYERS 4 - -// 4J Stu - Required for sentient reporting of whether the volume level has been -// changed or not -#define DEFAULT_VOLUME_LEVEL 100 - -#define GAME_HOST_OPTION_BITMASK_DIFFICULTY 0x00000003 // 0 - 3 -#define GAME_HOST_OPTION_BITMASK_FRIENDSOFFRIENDS 0x00000004 -#define GAME_HOST_OPTION_BITMASK_GAMERTAGS 0x00000008 -#define GAME_HOST_OPTION_BITMASK_GAMETYPE 0x00000030 -#define GAME_HOST_OPTION_BITMASK_LEVELTYPE 0x00000040 -#define GAME_HOST_OPTION_BITMASK_STRUCTURES 0x00000080 -#define GAME_HOST_OPTION_BITMASK_BONUSCHEST 0x00000100 -#define GAME_HOST_OPTION_BITMASK_BEENINCREATIVE 0x00000200 -#define GAME_HOST_OPTION_BITMASK_PVP 0x00000400 -#define GAME_HOST_OPTION_BITMASK_TRUSTPLAYERS 0x00000800 -#define GAME_HOST_OPTION_BITMASK_TNT 0x00001000 -#define GAME_HOST_OPTION_BITMASK_FIRESPREADS 0x00002000 -#define GAME_HOST_OPTION_BITMASK_HOSTFLY 0x00004000 -#define GAME_HOST_OPTION_BITMASK_HOSTHUNGER 0x00008000 -#define GAME_HOST_OPTION_BITMASK_HOSTINVISIBLE 0x00010000 -#define GAME_HOST_OPTION_BITMASK_BEDROCKFOG 0x00020000 -#define GAME_HOST_OPTION_BITMASK_DISABLESAVE 0x00040000 -#define GAME_HOST_OPTION_BITMASK_NOTOWNER 0x00080000 -#define GAME_HOST_OPTION_BITMASK_WORLDSIZE \ - 0x00700000 // 3 bits, 5 values (unset(0), classic(1), small(2), medium(3), - // large(4)) -#define GAME_HOST_OPTION_BITMASK_MOBGRIEFING 0x00800000 -#define GAME_HOST_OPTION_BITMASK_KEEPINVENTORY 0x01000000 -#define GAME_HOST_OPTION_BITMASK_DOMOBSPAWNING 0x02000000 -#define GAME_HOST_OPTION_BITMASK_DOMOBLOOT 0x04000000 -#define GAME_HOST_OPTION_BITMASK_DOTILEDROPS 0x08000000 -#define GAME_HOST_OPTION_BITMASK_NATURALREGEN 0x10000000 -#define GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE 0x20000000 -#define GAME_HOST_OPTION_BITMASK_ALL 0xFFFFFFFF - -#define GAME_HOST_OPTION_BITMASK_WORLDSIZE_BITSHIFT 20 - -enum EGameHostOptionWorldSize { - e_worldSize_Unknown = 0, - e_worldSize_Classic, - e_worldSize_Small, - e_worldSize_Medium, - e_worldSize_Large -}; - -#define PROFILE_VERSION_8 10 -#define PROFILE_VERSION_9 11 - -#define PROFILE_VERSION_10 12 - -// 4J-JEV: New Statistics and Achievements for 'NexGen' platforms. -#define PROFILE_VERSION_11 13 - -// Java 1.6.4 -#define PROFILE_VERSION_12 14 - -#define PROFILE_VERSION_CURRENT PROFILE_VERSION_12 - -#define MAX_FAVORITE_SKINS \ - 10 // these are stored in the profile data so keep it small - -// defines for game settings - uiBitmaskValues - -#define GAMESETTING_CLOUDS 0x00000001 -#define GAMESETTING_ONLINE 0x00000002 -#define GAMESETTING_INVITEONLY 0x00000004 -#define GAMESETTING_FRIENDSOFFRIENDS 0x00000008 -#define GAMESETTING_DISPLAYUPDATEMSG 0x00000030 -#define GAMESETTING_BEDROCKFOG 0x00000040 -#define GAMESETTING_DISPLAYHUD 0x00000080 -#define GAMESETTING_DISPLAYHAND 0x00000100 -#define GAMESETTING_CUSTOMSKINANIM 0x00000200 -#define GAMESETTING_DEATHMESSAGES 0x00000400 -#define GAMESETTING_UISIZE 0x00001800 -#define GAMESETTING_UISIZE_SPLITSCREEN 0x00006000 -#define GAMESETTING_ANIMATEDCHARACTER 0x00008000 -#define GAMESETTING_PS3EULAREAD 0x00010000 -#define GAMESETTING_PSVITANETWORKMODEADHOC 0x00020000 - -// defines for languages - -#define MINECRAFT_LANGUAGE_DEFAULT 0x00 -#define MINECRAFT_LANGUAGE_ENGLISH 0x01 -#define MINECRAFT_LANGUAGE_JAPANESE 0x02 -#define MINECRAFT_LANGUAGE_GERMAN 0x03 -#define MINECRAFT_LANGUAGE_FRENCH 0x04 -#define MINECRAFT_LANGUAGE_SPANISH 0x05 -#define MINECRAFT_LANGUAGE_ITALIAN 0x06 -#define MINECRAFT_LANGUAGE_KOREAN 0x07 -#define MINECRAFT_LANGUAGE_TCHINESE 0x08 -#define MINECRAFT_LANGUAGE_PORTUGUESE 0x09 -#define MINECRAFT_LANGUAGE_BRAZILIAN 0x0A -#define MINECRAFT_LANGUAGE_RUSSIAN 0x0B -#define MINECRAFT_LANGUAGE_DUTCH 0x0C -#define MINECRAFT_LANGUAGE_FINISH 0x0D -#define MINECRAFT_LANGUAGE_SWEDISH 0x0E -#define MINECRAFT_LANGUAGE_DANISH 0x0F -#define MINECRAFT_LANGUAGE_NORWEGIAN 0x10 -#define MINECRAFT_LANGUAGE_POLISH 0x11 -#define MINECRAFT_LANGUAGE_TURKISH 0x12 -#define MINECRAFT_LANGUAGE_LATINAMERICANSPANISH 0x13 -#define MINECRAFT_LANGUAGE_GREEK 0x14 - -/* Match these - -const int XC_LANGUAGE_ENGLISH =1; const int XC_LANGUAGE_JAPANESE -=2; const int XC_LANGUAGE_GERMAN -=3; const int XC_LANGUAGE_FRENCH -=4; const int XC_LANGUAGE_SPANISH -=5; const int XC_LANGUAGE_ITALIAN -=6; const int XC_LANGUAGE_KOREAN -=7; const int XC_LANGUAGE_TCHINESE -=8; const int XC_LANGUAGE_PORTUGUESE =9; const int XC_LANGUAGE_BRAZILIAN -=10; const int XC_LANGUAGE_RUSSIAN -=11; const int XC_LANGUAGE_DUTCH -=12; const int XC_LANGUAGE_FINISH -=13; const int XC_LANGUAGE_SWEDISH -=14; const int XC_LANGUAGE_DANISH -=15; const int XC_LANGUAGE_NORWEGIAN =16; const int XC_LANGUAGE_POLISH -=17; const int XC_LANGUAGE_TURKISH -=18; const int XC_LANGUAGE_LATINAMERICANSPANISH =19; -const int XC_LANGUAGE_GREEK =20; -*/ diff --git a/targets/app/common/App_structs.h b/targets/app/common/App_structs.h index a128211e7..537048244 100644 --- a/targets/app/common/App_structs.h +++ b/targets/app/common/App_structs.h @@ -3,7 +3,8 @@ #include #include "platform/storage/storage.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" +#include "platform/profile/ProfileConstants.h" #include "minecraft/GameEnums.h" #include "minecraft/GameTypes.h" #include "app/common/Tutorial/TutorialEnum.h" diff --git a/targets/app/common/Audio/SoundEngine.cpp b/targets/app/common/Audio/SoundEngine.cpp index 9be84139d..ea647e328 100644 --- a/targets/app/common/Audio/SoundEngine.cpp +++ b/targets/app/common/Audio/SoundEngine.cpp @@ -11,7 +11,7 @@ #include #include "platform/PlatformTypes.h" -#include "app/common/App_Defines.h" +#include "platform/PlatformTypes.h" #include "app/common/Audio/Consoles_SoundEngine.h" #include "app/linux/Iggy/include/rrCore.h" #include "app/linux/LinuxGame.h" diff --git a/targets/app/common/Audio/SoundEngine.h b/targets/app/common/Audio/SoundEngine.h index 91b4ad585..d6b49b4af 100644 --- a/targets/app/common/Audio/SoundEngine.h +++ b/targets/app/common/Audio/SoundEngine.h @@ -6,7 +6,7 @@ class Random; #include -#include "app/common/App_Defines.h" +#include "platform/PlatformTypes.h" #include "app/common/Audio/Consoles_SoundEngine.h" #include "app/linux/Iggy/include/rrCore.h" #include "minecraft/sounds/SoundTypes.h" diff --git a/targets/app/common/Game.cpp b/targets/app/common/Game.cpp index 88b29a8d1..68aaa8b6a 100644 --- a/targets/app/common/Game.cpp +++ b/targets/app/common/Game.cpp @@ -5,7 +5,7 @@ #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" #include "platform/storage/storage.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/App_structs.h" #include "app/common/Console_Debug_enum.h" diff --git a/targets/app/common/GameSettingsManager.cpp b/targets/app/common/GameSettingsManager.cpp index 7cdafeeb8..1e09c6770 100644 --- a/targets/app/common/GameSettingsManager.cpp +++ b/targets/app/common/GameSettingsManager.cpp @@ -1,7 +1,9 @@ #include "app/common/GameSettingsManager.h" #include "app/common/Game.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameHostOptions.h" +#include "minecraft/GameTypes.h" +#include "platform/profile/ProfileConstants.h" #include "minecraft/GameEnums.h" #include "app/common/Console_Debug_enum.h" #include "app/common/Network/GameNetworkManager.h" diff --git a/targets/app/common/Game_XuiActions.cpp b/targets/app/common/Game_XuiActions.cpp index 909b0fdd9..e6e9bd8e0 100644 --- a/targets/app/common/Game_XuiActions.cpp +++ b/targets/app/common/Game_XuiActions.cpp @@ -1,4 +1,4 @@ -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "app/common/DLC/DLCManager.h" #include "app/common/Game.h" #include "app/common/GameRules/GameRuleManager.h" diff --git a/targets/app/common/Tutorial/TutorialEnum.h b/targets/app/common/Tutorial/TutorialEnum.h index c5cadb0a7..7d9e569eb 100644 --- a/targets/app/common/Tutorial/TutorialEnum.h +++ b/targets/app/common/Tutorial/TutorialEnum.h @@ -17,11 +17,9 @@ typedef struct { #define TUTORIAL_NO_TEXT -1 #define TUTORIAL_NO_ICON -1 -// If you want to make these bigger, be aware that that will affect what is -// stored after the tutorial data in the profile data See Xbox_App.h for the -// struct -#define TUTORIAL_PROFILE_STORAGE_BITS 512 -#define TUTORIAL_PROFILE_STORAGE_BYTES (TUTORIAL_PROFILE_STORAGE_BITS / 8) +// TUTORIAL_PROFILE_STORAGE_BITS / TUTORIAL_PROFILE_STORAGE_BYTES moved to +// platform/profile/ProfileConstants.h since they describe profile data +// layout. Anything that needs them should include that header directly. // 4J Stu - The total number of eTutorial_State and eTutorial_Hint must be less // than 512, as we only have 512 bits of profile data to flag whether or not the diff --git a/targets/app/common/UI/All Platforms/UIStructs.h b/targets/app/common/UI/All Platforms/UIStructs.h index 32a1f1950..4a51fa239 100644 --- a/targets/app/common/UI/All Platforms/UIStructs.h +++ b/targets/app/common/UI/All Platforms/UIStructs.h @@ -7,7 +7,7 @@ #include #include "platform/storage/storage.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameHostOptions.h" #include "UIEnums.h" #include "platform/C4JThread.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp index 4e90a5ab0..f5fd6afc8 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_CreateWorldMenu.cpp @@ -9,7 +9,8 @@ #include "platform/PlatformTypes.h" #include "platform/input/input.h" #include "platform/profile/profile.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameHostOptions.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCPack.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp index f54343940..3737ca710 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_EULA.cpp @@ -6,7 +6,7 @@ #include "platform/PlatformTypes.h" #include "platform/input/input.h" #include "platform/profile/profile.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_DynamicLabel.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp index b846bb591..791c2c9dc 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_JoinMenu.cpp @@ -4,7 +4,7 @@ #include #include -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "app/common/Network/GameNetworkManager.h" #include "app/common/Network/SessionInfo.h" #include "app/common/UI/All Platforms/UIStructs.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp index 444d53517..076b50bb8 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LaunchMoreOptionsMenu.cpp @@ -7,7 +7,8 @@ #include "platform/input/input.h" #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameHostOptions.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_CheckBox.h" #include "app/common/UI/Controls/UIControl_HTMLLabel.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp index 71015957d..5688fb328 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadMenu.cpp @@ -7,7 +7,8 @@ #include "platform/PlatformTypes.h" #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameHostOptions.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCPack.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp index a45cf9f2f..42627d430 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_LoadOrJoinMenu.cpp @@ -8,7 +8,7 @@ #include "platform/input/input.h" #include "platform/profile/profile.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/DLC/DLCManager.h" #include "app/common/GameRules/LevelGeneration/LevelGenerationOptions.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp index 46f40fe3b..4beac9a53 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_MainMenu.cpp @@ -9,7 +9,8 @@ #include "platform/PlatformTypes.h" #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" +#include "platform/PlatformTypes.h" #include "minecraft/GameEnums.h" #include "app/common/Network/GameNetworkManager.h" #include "app/common/UI/All Platforms/UIStructs.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp index 1edae7b8c..8c28db506 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_NewUpdateMessage.cpp @@ -3,7 +3,7 @@ #include -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "minecraft/GameEnums.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_DynamicLabel.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp index 5b36680b5..e078d407f 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_SaveMessage.cpp @@ -4,7 +4,8 @@ #include "platform/PlatformTypes.h" #include "platform/input/input.h" #include "platform/profile/profile.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" +#include "platform/profile/ProfileConstants.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_Label.h" #include "app/common/UI/UILayer.h" diff --git a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp index 408edb982..959d93e4a 100644 --- a/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp +++ b/targets/app/common/UI/Scenes/Frontend Menu screens/UIScene_TrialExitUpsell.cpp @@ -2,7 +2,7 @@ #include "UIScene_TrialExitUpsell.h" #include "platform/profile/profile.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "app/common/UI/UIScene.h" #include "app/linux/LinuxGame.h" #include "app/linux/Linux_UIController.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.h b/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.h index e183a6e9f..0101fe73c 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.h +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_LanguageSelector.h @@ -2,7 +2,7 @@ #include -#include "app/common/App_Defines.h" +#include "platform/profile/ProfileConstants.h" #include "app/common/UI/All Platforms/UIEnums.h" #include "app/common/UI/Controls/UIControl.h" #include "app/common/UI/Controls/UIControl_ButtonList.h" diff --git a/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp b/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp index 810830562..2312fda10 100644 --- a/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp +++ b/targets/app/common/UI/Scenes/Help & Options/UIScene_SkinSelectMenu.cpp @@ -7,7 +7,7 @@ #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" -#include "app/common/App_Defines.h" +#include "platform/profile/ProfileConstants.h" #include "app/common/Minecraft_Macros.h" #include "app/common/DLC/DLCManager.h" #include "app/common/DLC/DLCPack.h" diff --git a/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp b/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp index 96eee7240..23bdd0aec 100644 --- a/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp +++ b/targets/app/common/UI/Scenes/UIScene_Keyboard.cpp @@ -1,6 +1,6 @@ #include "UIScene_Keyboard.h" -#include "app/common/App_Defines.h" +#include "minecraft/GameTypes.h" #include "app/common/UI/Controls/UIControl_Button.h" #include "app/common/UI/Controls/UIControl_Label.h" #include "app/common/UI/Controls/UIControl_TextInput.h" diff --git a/targets/app/linux/Linux_Minecraft.cpp b/targets/app/linux/Linux_Minecraft.cpp index c9d5d3c5e..acacabad6 100644 --- a/targets/app/linux/Linux_Minecraft.cpp +++ b/targets/app/linux/Linux_Minecraft.cpp @@ -58,7 +58,7 @@ static void sigsegv_handler(int sig) { #include "platform/profile/profile.h" #include "platform/renderer/renderer.h" #include "platform/storage/storage.h" -#include "app/common/App_Defines.h" +#include "platform/profile/ProfileConstants.h" #include "app/common/Audio/SoundEngine.h" #include "app/common/Network/GameNetworkManager.h" #include "app/linux/LinuxGame.h" diff --git a/targets/minecraft/GameHostOptions.h b/targets/minecraft/GameHostOptions.h index 0d27f5dae..100ca67e1 100644 --- a/targets/minecraft/GameHostOptions.h +++ b/targets/minecraft/GameHostOptions.h @@ -2,12 +2,53 @@ #include -#include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" -// Stateless bitfield utilities - no app dependency. -// The global-state overloads (get/set with no settings arg) have moved -// to IgameServices().getGameHostOption / setGameHostOption. +// Bitmask layout for the game host option settings word, plus the +// stateless bitfield utilities used to read and write it. +// +// The global-state overloads (get/set with no settings arg) have moved to +// IGameServices::getGameHostOption / setGameHostOption. + +#define GAME_HOST_OPTION_BITMASK_DIFFICULTY 0x00000003 // 0 - 3 +#define GAME_HOST_OPTION_BITMASK_FRIENDSOFFRIENDS 0x00000004 +#define GAME_HOST_OPTION_BITMASK_GAMERTAGS 0x00000008 +#define GAME_HOST_OPTION_BITMASK_GAMETYPE 0x00000030 +#define GAME_HOST_OPTION_BITMASK_LEVELTYPE 0x00000040 +#define GAME_HOST_OPTION_BITMASK_STRUCTURES 0x00000080 +#define GAME_HOST_OPTION_BITMASK_BONUSCHEST 0x00000100 +#define GAME_HOST_OPTION_BITMASK_BEENINCREATIVE 0x00000200 +#define GAME_HOST_OPTION_BITMASK_PVP 0x00000400 +#define GAME_HOST_OPTION_BITMASK_TRUSTPLAYERS 0x00000800 +#define GAME_HOST_OPTION_BITMASK_TNT 0x00001000 +#define GAME_HOST_OPTION_BITMASK_FIRESPREADS 0x00002000 +#define GAME_HOST_OPTION_BITMASK_HOSTFLY 0x00004000 +#define GAME_HOST_OPTION_BITMASK_HOSTHUNGER 0x00008000 +#define GAME_HOST_OPTION_BITMASK_HOSTINVISIBLE 0x00010000 +#define GAME_HOST_OPTION_BITMASK_BEDROCKFOG 0x00020000 +#define GAME_HOST_OPTION_BITMASK_DISABLESAVE 0x00040000 +#define GAME_HOST_OPTION_BITMASK_NOTOWNER 0x00080000 +// 3 bits, 5 values: unset(0), classic(1), small(2), medium(3), large(4) +#define GAME_HOST_OPTION_BITMASK_WORLDSIZE 0x00700000 +#define GAME_HOST_OPTION_BITMASK_MOBGRIEFING 0x00800000 +#define GAME_HOST_OPTION_BITMASK_KEEPINVENTORY 0x01000000 +#define GAME_HOST_OPTION_BITMASK_DOMOBSPAWNING 0x02000000 +#define GAME_HOST_OPTION_BITMASK_DOMOBLOOT 0x04000000 +#define GAME_HOST_OPTION_BITMASK_DOTILEDROPS 0x08000000 +#define GAME_HOST_OPTION_BITMASK_NATURALREGEN 0x10000000 +#define GAME_HOST_OPTION_BITMASK_DODAYLIGHTCYCLE 0x20000000 +#define GAME_HOST_OPTION_BITMASK_ALL 0xFFFFFFFF + +#define GAME_HOST_OPTION_BITMASK_WORLDSIZE_BITSHIFT 20 + +enum EGameHostOptionWorldSize { + e_worldSize_Unknown = 0, + e_worldSize_Classic, + e_worldSize_Small, + e_worldSize_Medium, + e_worldSize_Large +}; + namespace GameHostOptions { unsigned int get(unsigned int settings, eGameHostOption option); diff --git a/targets/minecraft/GameTypes.h b/targets/minecraft/GameTypes.h index b233aa461..b95591a0c 100644 --- a/targets/minecraft/GameTypes.h +++ b/targets/minecraft/GameTypes.h @@ -4,9 +4,22 @@ #include "minecraft/GameEnums.h" -#ifndef MAX_CAPENAME_SIZE +// Vocabulary types and small game constants shared across minecraft/. +// Anything that used to live in app/common/App_Defines.h and represents a +// game-side concept (asset name sizes, default control indices, etc.) lives +// here. + #define MAX_CAPENAME_SIZE 32 -#endif +#define MAX_BANNERNAME_SIZE 32 +#define MAX_TMSFILENAME_SIZE 40 +#define MAX_TYPE_SIZE 32 +#define MAX_EXTENSION_TYPES 3 + +// Default UI controller index for non-splitscreen menus. +#define DEFAULT_XUI_MENU_USER 0 + +// Default sound/music volume level (0-100). +#define DEFAULT_VOLUME_LEVEL 100 struct MOJANG_DATA { eXUID eXuid; diff --git a/targets/minecraft/client/renderer/GameRenderer.h b/targets/minecraft/client/renderer/GameRenderer.h index 708e078dd..cc4302a0c 100644 --- a/targets/minecraft/client/renderer/GameRenderer.h +++ b/targets/minecraft/client/renderer/GameRenderer.h @@ -6,7 +6,6 @@ #include #include -#include "app/common/App_Defines.h" #include "platform/C4JThread.h" #include "minecraft/client/resources/ResourceLocation.h" #include "minecraft/util/SmoothFloat.h" diff --git a/targets/minecraft/world/level/storage/LevelData.cpp b/targets/minecraft/world/level/storage/LevelData.cpp index f92f56ea8..6aa119ecf 100644 --- a/targets/minecraft/world/level/storage/LevelData.cpp +++ b/targets/minecraft/world/level/storage/LevelData.cpp @@ -6,8 +6,8 @@ #include #include -#include "app/common/App_Defines.h" #include "minecraft/GameEnums.h" +#include "minecraft/GameHostOptions.h" #include "app/linux/LinuxGame.h" #include "java/System.h" #include "minecraft/world/level/GameRules.h" diff --git a/targets/platform/PlatformTypes.h b/targets/platform/PlatformTypes.h index 52ff5074b..33b74fdbd 100644 --- a/targets/platform/PlatformTypes.h +++ b/targets/platform/PlatformTypes.h @@ -74,6 +74,11 @@ inline constexpr int XUSER_MAX_COUNT = 4; inline constexpr int XUSER_NAME_SIZE = 32; inline constexpr int XUSER_INDEX_FOCUS = 254; +// Maximum local (split-screen) players. Same as XUSER_MAX_COUNT; kept as a +// separate name because gameplay code talks about "local players" rather +// than Xbox user slots. +#define MAX_LOCAL_PLAYERS 4 + using PlayerUID = unsigned long long; using PPlayerUID = PlayerUID*; inline constexpr PlayerUID INVALID_XUID = 0; diff --git a/targets/platform/profile/ProfileConstants.h b/targets/platform/profile/ProfileConstants.h index 6ae5cec98..4c90ceab1 100644 --- a/targets/platform/profile/ProfileConstants.h +++ b/targets/platform/profile/ProfileConstants.h @@ -1,7 +1,71 @@ #pragma once +// Profile data storage layout, schema versioning, and game settings stored +// in profile data. Owned by the platform/profile layer because the profile +// data structure is what defines these. + #define TITLEID_MINECRAFT 0x584111F7 +// Tutorial completion bits stored in profile data. The exact byte count is +// load-bearing for ProfileGameSettings layout in StubProfile.cpp. +#define TUTORIAL_PROFILE_STORAGE_BITS 512 +#define TUTORIAL_PROFILE_STORAGE_BYTES (TUTORIAL_PROFILE_STORAGE_BITS / 8) + +// Profile data schema versions +#define PROFILE_VERSION_8 10 +#define PROFILE_VERSION_9 11 +#define PROFILE_VERSION_10 12 +// 4J-JEV: New Statistics and Achievements for 'NexGen' platforms. +#define PROFILE_VERSION_11 13 +// Java 1.6.4 +#define PROFILE_VERSION_12 14 +#define PROFILE_VERSION_CURRENT PROFILE_VERSION_12 + +// Maximum favourite skins stored in profile data; keep small. +#define MAX_FAVORITE_SKINS 10 + +// Bitmask values for ProfileGameSettings::uiBitmaskValues. +#define GAMESETTING_CLOUDS 0x00000001 +#define GAMESETTING_ONLINE 0x00000002 +#define GAMESETTING_INVITEONLY 0x00000004 +#define GAMESETTING_FRIENDSOFFRIENDS 0x00000008 +#define GAMESETTING_DISPLAYUPDATEMSG 0x00000030 +#define GAMESETTING_BEDROCKFOG 0x00000040 +#define GAMESETTING_DISPLAYHUD 0x00000080 +#define GAMESETTING_DISPLAYHAND 0x00000100 +#define GAMESETTING_CUSTOMSKINANIM 0x00000200 +#define GAMESETTING_DEATHMESSAGES 0x00000400 +#define GAMESETTING_UISIZE 0x00001800 +#define GAMESETTING_UISIZE_SPLITSCREEN 0x00006000 +#define GAMESETTING_ANIMATEDCHARACTER 0x00008000 +#define GAMESETTING_PS3EULAREAD 0x00010000 +#define GAMESETTING_PSVITANETWORKMODEADHOC 0x00020000 + +// Profile-stored language IDs (ucLanguage). Match the Xbox XC_LANGUAGE_* +// values defined in XboxStubs.h. +#define MINECRAFT_LANGUAGE_DEFAULT 0x00 +#define MINECRAFT_LANGUAGE_ENGLISH 0x01 +#define MINECRAFT_LANGUAGE_JAPANESE 0x02 +#define MINECRAFT_LANGUAGE_GERMAN 0x03 +#define MINECRAFT_LANGUAGE_FRENCH 0x04 +#define MINECRAFT_LANGUAGE_SPANISH 0x05 +#define MINECRAFT_LANGUAGE_ITALIAN 0x06 +#define MINECRAFT_LANGUAGE_KOREAN 0x07 +#define MINECRAFT_LANGUAGE_TCHINESE 0x08 +#define MINECRAFT_LANGUAGE_PORTUGUESE 0x09 +#define MINECRAFT_LANGUAGE_BRAZILIAN 0x0A +#define MINECRAFT_LANGUAGE_RUSSIAN 0x0B +#define MINECRAFT_LANGUAGE_DUTCH 0x0C +#define MINECRAFT_LANGUAGE_FINISH 0x0D +#define MINECRAFT_LANGUAGE_SWEDISH 0x0E +#define MINECRAFT_LANGUAGE_DANISH 0x0F +#define MINECRAFT_LANGUAGE_NORWEGIAN 0x10 +#define MINECRAFT_LANGUAGE_POLISH 0x11 +#define MINECRAFT_LANGUAGE_TURKISH 0x12 +#define MINECRAFT_LANGUAGE_LATINAMERICANSPANISH 0x13 +#define MINECRAFT_LANGUAGE_GREEK 0x14 + + #define CONTEXT_GAME_STATE 0 #define CONTEXT_GAME_STATE_BLANK 0 #define CONTEXT_GAME_STATE_RIDING_PIG 1 diff --git a/targets/platform/profile/stub/StubProfile.cpp b/targets/platform/profile/stub/StubProfile.cpp index 9b019e519..0cff91666 100644 --- a/targets/platform/profile/stub/StubProfile.cpp +++ b/targets/platform/profile/stub/StubProfile.cpp @@ -6,8 +6,6 @@ #include "../ProfileConstants.h" #include "input/input.h" -#include "../../../app/common/Tutorial/TutorialEnum.h" // 4jcraft TODO -#include "../../../app/common/App_Defines.h" // 4jcraft TODO StubProfile stub_profile_instance; IPlatformProfile& PlatformProfile = stub_profile_instance;