Full meson asset build and copy hooked up

This commit is contained in:
Pyogenics 2026-03-07 02:58:30 +00:00
parent b9247c698c
commit d93b5b4a08
3 changed files with 8972 additions and 46 deletions

File diff suppressed because it is too large Load diff

View file

@ -50,37 +50,425 @@ executable('Minecraft.Client',
'-include', meson.current_source_dir() / 'Build/stdafx.h',
],
c_args : global_cpp_defs + ['-DUNICODE', '-D_UNICODE'],
install : false,
install : true,
install_dir : ''
)
# This is shitty because we don't actually know what files we want to pack into an arc
# until we check the filter files (movies.txt media.txt etc....), we should get rid of
# the filters and use a dedicated asset dir that we can just entirely pack into an arc
# so we can have changes in our asset files cause arc rebuild instead of doing it every build
archive_target_dir = meson.current_source_dir() / 'Build/Common/Media'
custom_target('Minecraft.Client_Archive',
output : 'MediaWindows64.arc',
command : [
'python3', meson.project_source_root() / 'scripts/pack_arc.py',
archive_target_dir,
'@OUTPUT@',
archive_target_dir / 'movies1080.txt',
archive_target_dir / 'media.txt'
],
install : true,
install_dir : 'Common/Media',
build_subdir : 'Common/Media',
build_by_default : true,
build_always_stale : true
)
custom_target('Minecraft.Client_Localisation',
#
# Assets
#
asset_dir = meson.current_source_dir() / 'Build/Assets'
install_subdir(asset_dir / 'music', install_dir : '')
install_data(asset_dir / 'levels/TrialLevel.mcs', install_dir : 'Common/Trial')
install_data(asset_dir / 'levels/Tutorial', install_dir : 'Common/Tutorial') # This tutorial file might not be needed
install_subdir(asset_dir / 'res', install_dir : 'Common')
install_subdir(asset_dir / 'font', install_dir : 'Common/Media')
install_subdir(meson.current_source_dir() / 'Platform/Durango/Sound', install_dir : 'Durango')
# install_subdir(meson.current_source_dir() / 'Platform/Windows64Media/DLC', install_dir : 'Windows64Media')
install_subdir(meson.current_source_dir() / 'Platform/DurangoMedia/DLC', install_dir : 'Windows64Media') # Use this just for funsies so we get access to more dlc
localisation = custom_target('Minecraft.Client_Localisation',
output : 'languages.loc',
command : [
'python3', meson.project_source_root() / 'scripts/pack_loc.py',
meson.current_source_dir() / 'Platform/Windows64Media/loc',
'@OUTPUT@'
],
build_by_default : true,
build_always_stale : true
]
)
colour_table = custom_target('Minecraft.Client_Colour_Table',
output : 'HTMLColours.col',
input : asset_dir / 'HTMLColours.xml',
command : [
'python3', meson.project_source_root() / 'scripts/build_col.py',
'@INPUT@',
'@OUTPUT@'
]
)
movies_path = meson.current_source_dir() / 'Build/Assets/movies'
archive_sources = [
localisation,
colour_table,
asset_dir / 'splashes.txt',
asset_dir / 'graphics\SaveChest.png',
asset_dir / 'graphics\MinecraftIcon.png',
asset_dir / 'graphics\TexturePackIcon.png'
]
archive_sources_movies1080 = [
movies_path / 'skinHDGraphics.swf',
movies_path / 'skinHDGraphicsHud.swf',
movies_path / 'skinHDGraphicsLabels.swf',
movies_path / 'skinHDGraphicsInGame.swf',
movies_path / 'skinHD.swf',
movies_path / 'skinHDHud.swf',
movies_path / 'skinHDLabels.swf',
movies_path / 'skinHDInGame.swf',
movies_path / 'AnvilMenu1080.swf',
movies_path / 'BrewingStandMenu1080.swf',
movies_path / 'ChestMenu1080.swf',
movies_path / 'ChestLargeMenu1080.swf',
movies_path / 'ComponentLogo1080.swf',
movies_path / 'ComponentLogoSplit1080.swf',
movies_path / 'Controls1080.swf',
movies_path / 'ControlsRemotePlay1080.swf',
movies_path / 'CreateWorldMenu1080.swf',
movies_path / 'CreativeMenu1080.swf',
movies_path / 'Credits1080.swf',
movies_path / 'Crafting2x2Menu1080.swf',
movies_path / 'Crafting3x3Menu1080.swf',
movies_path / 'DeathMenu1080.swf',
movies_path / 'DebugCreateSchematic1080.swf',
movies_path / 'DebugMenu1080.swf',
movies_path / 'DebugOptionsMenu1080.swf',
movies_path / 'DebugSetCamera1080.swf',
movies_path / 'DebugUIConsoleComponent1080.swf',
movies_path / 'DebugUIMarketingGuide1080.swf',
movies_path / 'DLCMainMenu1080.swf',
movies_path / 'DispenserMenu1080.swf',
movies_path / 'EnchantingMenu1080.swf',
movies_path / 'EndPoem1080.swf',
movies_path / 'EULA1080.swf',
movies_path / 'FullscreenProgress1080.swf',
movies_path / 'FurnaceMenu1080.swf',
movies_path / 'HelpAndOptionsMenu1080.swf',
movies_path / 'HowToPlay1080.swf',
movies_path / 'HowToPlayMenu1080.swf',
movies_path / 'HUD1080.swf',
movies_path / 'InGameHostOptions1080.swf',
movies_path / 'InGameInfoMenu1080.swf',
movies_path / 'InGamePlayerOptions1080.swf',
movies_path / 'InGameTeleportMenu1080.swf',
movies_path / 'Intro1080.swf',
movies_path / 'InventoryMenu1080.swf',
movies_path / 'JoinMenu1080.swf',
movies_path / 'LoadOrJoinMenu1080.swf',
movies_path / 'LaunchMoreOptionsMenu1080.swf',
movies_path / 'LeaderboardMenu1080.swf',
movies_path / 'LoadMenu1080.swf',
movies_path / 'MainMenu1080.swf',
movies_path / 'MenuBackground1080.swf',
movies_path / 'MessageBox1080.swf',
movies_path / 'NewUpdateMessage1080.swf',
movies_path / 'Panorama1080.swf',
movies_path / 'PauseMenu1080.swf',
movies_path / 'PressStartToPlay1080.swf',
movies_path / 'QuadrantSignin1080.swf',
movies_path / 'ReinstallMenu1080.swf',
movies_path / 'SaveMenu1080.swf',
movies_path / 'SaveMessage1080.swf',
movies_path / 'SettingsMenu1080.swf',
movies_path / 'SettingsAudioMenu1080.swf',
movies_path / 'SettingsControlMenu1080.swf',
movies_path / 'SettingsGraphicsMenu1080.swf',
movies_path / 'SettingsOptionsMenu1080.swf',
movies_path / 'SettingsUIMenu1080.swf',
movies_path / 'SignEntryMenu1080.swf',
movies_path / 'SkinSelectMenu1080.swf',
movies_path / 'Timer1080.swf',
movies_path / 'ToolTips1080.swf',
movies_path / 'TradingMenu1080.swf',
movies_path / 'TutorialPopup1080.swf',
movies_path / 'AnvilMenuSplit1080.swf',
movies_path / 'BrewingStandMenuSplit1080.swf',
movies_path / 'ChestMenuSplit1080.swf',
movies_path / 'ChestLargeMenuSplit1080.swf',
movies_path / 'ControlsSplit1080.swf',
movies_path / 'Crafting2x2MenuSplit1080.swf',
movies_path / 'Crafting3x3MenuSplit1080.swf',
movies_path / 'CreativeMenuSplit1080.swf',
movies_path / 'DeathMenuSplit1080.swf',
movies_path / 'DispenserMenuSplit1080.swf',
movies_path / 'EnchantingMenuSplit1080.swf',
movies_path / 'FurnaceMenuSplit1080.swf',
movies_path / 'FullscreenProgressSplit1080.swf',
movies_path / 'HelpAndOptionsMenuSplit1080.swf',
movies_path / 'HowToPlaySplit1080.swf',
movies_path / 'HowToPlayMenuSplit1080.swf',
movies_path / 'HUDSplit1080.swf',
movies_path / 'InGameHostOptionsSplit1080.swf',
movies_path / 'InGameInfoMenuSplit1080.swf',
movies_path / 'InGameTeleportMenuSplit1080.swf',
movies_path / 'InGamePlayerOptionsSplit1080.swf',
movies_path / 'InventoryMenuSplit1080.swf',
movies_path / 'MessageBoxSplit1080.swf',
movies_path / 'PanoramaSplit1080.swf',
movies_path / 'PauseMenuSplit1080.swf',
movies_path / 'ReinstallMenuSplit1080.swf',
movies_path / 'SettingsAudioMenuSplit1080.swf',
movies_path / 'SettingsControlMenuSplit1080.swf',
movies_path / 'SettingsGraphicsMenuSplit1080.swf',
movies_path / 'SettingsMenuSplit1080.swf',
movies_path / 'SettingsOptionsMenuSplit1080.swf',
movies_path / 'SettingsUIMenuSplit1080.swf',
movies_path / 'SignEntryMenuSplit1080.swf',
movies_path / 'SkinSelectMenuSplit1080.swf',
movies_path / 'TimerSplit1080.swf',
movies_path / 'ToolTipsSplit1080.swf',
movies_path / 'TradingMenuSplit1080.swf',
movies_path / 'TutorialPopupSplit1080.swf',
movies_path / 'Keyboard1080.swf',
movies_path / 'KeyboardSplit1080.swf'
]
archive_sources_movies720 = [
movies_path / 'skinGraphics.swf',
movies_path / 'skinGraphicsHud.swf',
movies_path / 'skinGraphicsLabels.swf',
movies_path / 'skinGraphicsInGame.swf',
movies_path / 'skin.swf',
movies_path / 'skinHud.swf',
movies_path / 'skinLabels.swf',
movies_path / 'skinInGame.swf',
movies_path / 'AnvilMenu720.swf',
movies_path / 'BrewingStandMenu720.swf',
movies_path / 'ChestMenu720.swf',
movies_path / 'ChestLargeMenu720.swf',
movies_path / 'ComponentLogo720.swf',
movies_path / 'Controls720.swf',
movies_path / 'CreateWorldMenu720.swf',
movies_path / 'CreativeMenu720.swf',
movies_path / 'Credits720.swf',
movies_path / 'Crafting2x2Menu720.swf',
movies_path / 'Crafting3x3Menu720.swf',
movies_path / 'DeathMenu720.swf',
movies_path / 'DebugCreateSchematic720.swf',
movies_path / 'DebugMenu720.swf',
movies_path / 'DebugOptionsMenu720.swf',
movies_path / 'DebugSetCamera720.swf',
movies_path / 'DebugUIConsoleComponent720.swf',
movies_path / 'DebugUIMarketingGuide720.swf',
movies_path / 'DLCMainMenu720.swf',
movies_path / 'DispenserMenu720.swf',
movies_path / 'EnchantingMenu720.swf',
movies_path / 'EndPoem720.swf',
movies_path / 'EULA720.swf',
movies_path / 'FullscreenProgress720.swf',
movies_path / 'FurnaceMenu720.swf',
movies_path / 'HelpAndOptionsMenu720.swf',
movies_path / 'HowToPlay720.swf',
movies_path / 'HowToPlayMenu720.swf',
movies_path / 'HUD720.swf',
movies_path / 'InGameHostOptions720.swf',
movies_path / 'InGameInfoMenu720.swf',
movies_path / 'InGamePlayerOptions720.swf',
movies_path / 'InGameTeleportMenu720.swf',
movies_path / 'Intro720.swf',
movies_path / 'InventoryMenu720.swf',
movies_path / 'JoinMenu720.swf',
movies_path / 'LoadOrJoinMenu720.swf',
movies_path / 'LaunchMoreOptionsMenu720.swf',
movies_path / 'LeaderboardMenu720.swf',
movies_path / 'LoadMenu720.swf',
movies_path / 'MainMenu720.swf',
movies_path / 'MenuBackground720.swf',
movies_path / 'MessageBox720.swf',
movies_path / 'NewUpdateMessage720.swf',
movies_path / 'Panorama720.swf',
movies_path / 'PauseMenu720.swf',
movies_path / 'PressStartToPlay720.swf',
movies_path / 'QuadrantSignin720.swf',
movies_path / 'ReinstallMenu720.swf',
movies_path / 'SaveMessage720.swf',
movies_path / 'SettingsMenu720.swf',
movies_path / 'SettingsAudioMenu720.swf',
movies_path / 'SettingsControlMenu720.swf',
movies_path / 'SettingsGraphicsMenu720.swf',
movies_path / 'SettingsOptionsMenu720.swf',
movies_path / 'SettingsUIMenu720.swf',
movies_path / 'SignEntryMenu720.swf',
movies_path / 'SkinSelectMenu720.swf',
movies_path / 'Timer720.swf',
movies_path / 'ToolTips720.swf',
movies_path / 'TradingMenu720.swf',
movies_path / 'TutorialPopup720.swf',
movies_path / 'AnvilMenuSplit720.swf',
movies_path / 'BrewingStandMenuSplit720.swf',
movies_path / 'ChestMenuSplit720.swf',
movies_path / 'ChestLargeMenuSplit720.swf',
movies_path / 'ControlsSplit720.swf',
movies_path / 'ComponentLogoSplit720.swf',
movies_path / 'Crafting2x2MenuSplit720.swf',
movies_path / 'Crafting3x3MenuSplit720.swf',
movies_path / 'CreativeMenuSplit720.swf',
movies_path / 'DeathMenuSplit720.swf',
movies_path / 'DispenserMenuSplit720.swf',
movies_path / 'EnchantingMenuSplit720.swf',
movies_path / 'FurnaceMenuSplit720.swf',
movies_path / 'FullscreenProgressSplit720.swf',
movies_path / 'GamertagSplit720.swf',
movies_path / 'HelpAndOptionsMenuSplit720.swf',
movies_path / 'HowToPlaySplit720.swf',
movies_path / 'HowToPlayMenuSplit720.swf',
movies_path / 'HUDSplit720.swf',
movies_path / 'InGameHostOptionsSplit720.swf',
movies_path / 'InGameInfoMenuSplit720.swf',
movies_path / 'InGamePlayerOptionsSplit720.swf',
movies_path / 'InventoryMenuSplit720.swf',
movies_path / 'MessageBoxSplit720.swf',
movies_path / 'PanoramaSplit720.swf',
movies_path / 'PauseMenuSplit720.swf',
movies_path / 'ReinstallMenuSplit720.swf',
movies_path / 'SettingsAudioMenuSplit720.swf',
movies_path / 'SettingsControlMenuSplit720.swf',
movies_path / 'SettingsGraphicsMenuSplit720.swf',
movies_path / 'SettingsMenuSplit720.swf',
movies_path / 'SettingsOptionsMenuSplit720.swf',
movies_path / 'SettingsUIMenuSplit720.swf',
movies_path / 'SignEntryMenuSplit720.swf',
movies_path / 'InGameTeleportMenuSplit720.swf',
movies_path / 'ToolTipsSplit720.swf',
movies_path / 'TradingMenuSplit720.swf',
movies_path / 'TrialExitUpsell720.swf',
movies_path / 'TutorialPopupSplit720.swf',
movies_path / 'SkinSelectMenuSplit720.swf'
]
archive_sources_movies480 = [
movies_path / 'AnvilMenu480.swf',
movies_path / 'BrewingStandMenu480.swf',
movies_path / 'ChestLargeMenu480.swf',
movies_path / 'ChestMenu480.swf',
movies_path / 'Controls480.swf',
movies_path / 'ComponentLogo480.swf',
movies_path / 'Crafting2x2Menu480.swf',
movies_path / 'Crafting3x3Menu480.swf',
movies_path / 'CreateWorldMenu480.swf',
movies_path / 'CreativeMenu480.swf',
movies_path / 'Credits480.swf',
movies_path / 'DeathMenu480.swf',
movies_path / 'DispenserMenu480.swf',
movies_path / 'DLCMainMenu480.swf',
movies_path / 'EnchantingMenu480.swf',
movies_path / 'EndPoem480.swf',
movies_path / 'EULA480.swf',
movies_path / 'FullscreenProgress480.swf',
movies_path / 'FurnaceMenu480.swf',
movies_path / 'HelpAndOptionsMenu480.swf',
movies_path / 'HowToPlay480.swf',
movies_path / 'HowToPlayMenu480.swf',
movies_path / 'HUD480.swf',
movies_path / 'InGameHostOptions480.swf',
movies_path / 'InGameInfoMenu480.swf',
movies_path / 'InGamePlayerOptions480.swf',
movies_path / 'Intro480.swf',
movies_path / 'InventoryMenu480.swf',
movies_path / 'JoinMenu480.swf',
movies_path / 'LaunchMoreOptionsMenu480.swf',
movies_path / 'LeaderboardMenu480.swf',
movies_path / 'LoadMenu480.swf',
movies_path / 'LoadOrJoinMenu480.swf',
movies_path / 'MainMenu480.swf',
movies_path / 'MenuBackground480.swf',
movies_path / 'MessageBox480.swf',
movies_path / 'NewUpdateMessage480.swf',
movies_path / 'Panorama480.swf',
movies_path / 'PauseMenu480.swf',
movies_path / 'PressStartToPlay480.swf',
movies_path / 'ReinstallMenu480.swf',
movies_path / 'SaveMessage480.swf',
movies_path / 'SettingsAudioMenu480.swf',
movies_path / 'SettingsControlMenu480.swf',
movies_path / 'SettingsGraphicsMenu480.swf',
movies_path / 'SettingsMenu480.swf',
movies_path / 'SettingsOptionsMenu480.swf',
movies_path / 'SettingsUIMenu480.swf',
movies_path / 'SignEntryMenu480.swf',
movies_path / 'SkinSelectMenu480.swf',
movies_path / 'InGameTeleportMenu480.swf',
movies_path / 'Timer480.swf',
movies_path / 'ToolTips480.swf',
movies_path / 'TradingMenu480.swf',
movies_path / 'TrialExitUpsell480.swf',
movies_path / 'TutorialPopup480.swf'
]
archive_sources_moviesVita = [
movies_path / 'skinGraphics.swf',
movies_path / 'skinGraphicsHud.swf',
movies_path / 'skinGraphicsLabels.swf',
movies_path / 'skinGraphicsInGame.swf',
movies_path / 'skin.swf',
movies_path / 'skinHud.swf',
movies_path / 'skinLabels.swf',
movies_path / 'skinInGame.swf',
movies_path / 'AnvilMenuVita.swf',
movies_path / 'BrewingStandMenuVita.swf',
movies_path / 'ChestLargeMenuVita.swf',
movies_path / 'ChestMenuVita.swf',
movies_path / 'ComponentLogoVita.swf',
movies_path / 'ControlsVita.swf',
movies_path / 'ControlsTVVita.swf',
movies_path / 'Crafting2x2MenuVita.swf',
movies_path / 'Crafting3x3MenuVita.swf',
movies_path / 'CreateWorldMenuVita.swf',
movies_path / 'CreativeMenuVita.swf',
movies_path / 'CreditsVita.swf',
movies_path / 'DeathMenuVita.swf',
movies_path / 'DispenserMenuVita.swf',
movies_path / 'DLCMainMenuVita.swf',
movies_path / 'EnchantingMenuVita.swf',
movies_path / 'EndPoemVita.swf',
movies_path / 'EULAVita.swf',
movies_path / 'FullscreenProgressVita.swf',
movies_path / 'FurnaceMenuVita.swf',
movies_path / 'HelpAndOptionsMenuVita.swf',
movies_path / 'HowToPlayMenuVita.swf',
movies_path / 'HowToPlayVita.swf',
movies_path / 'HUDVita.swf',
movies_path / 'InGameHostOptionsVita.swf',
movies_path / 'InGameInfoMenuVita.swf',
movies_path / 'InGamePlayerOptionsVita.swf',
movies_path / 'InGameTeleportMenuVita.swf',
movies_path / 'IntroVita.swf',
movies_path / 'InventoryMenuVita.swf',
movies_path / 'JoinMenuVita.swf',
movies_path / 'LaunchMoreOptionsMenuVita.swf',
movies_path / 'LeaderboardMenuVita.swf',
movies_path / 'LoadMenuVita.swf',
movies_path / 'LoadOrJoinMenuVita.swf',
movies_path / 'MainMenuVita.swf',
movies_path / 'MenuBackgroundVita.swf',
movies_path / 'MessageBoxVita.swf',
movies_path / 'NewUpdateMessageVita.swf',
movies_path / 'PanoramaVita.swf',
movies_path / 'PauseMenuVita.swf',
movies_path / 'PressStartToPlayVita.swf',
movies_path / 'ReinstallMenuVita.swf',
movies_path / 'SaveMessageVita.swf',
movies_path / 'SettingsAudioMenuVita.swf',
movies_path / 'SettingsControlMenuVita.swf',
movies_path / 'SettingsGraphicsMenuVita.swf',
movies_path / 'SettingsMenuVita.swf',
movies_path / 'SettingsOptionsMenuVita.swf',
movies_path / 'SettingsUIMenuVita.swf',
movies_path / 'SignEntryMenuVita.swf',
movies_path / 'SkinSelectMenuVita.swf',
movies_path / 'TimerVita.swf',
movies_path / 'ToolTipsVita.swf',
movies_path / 'TradingMenuVita.swf',
movies_path / 'TutorialPopupVita.swf',
movies_path / 'DebugCreateSchematic720.swf',
movies_path / 'DebugMenu720.swf',
movies_path / 'DebugOptionsMenu720.swf',
movies_path / 'DebugSetCamera720.swf',
movies_path / 'DebugUIConsoleComponent720.swf',
movies_path / 'DebugUIMarketingGuide720.swf'
]
custom_target('Minecraft.Client_Archive',
output : 'MediaWindows64.arc',
input : archive_sources + archive_sources_movies1080 + archive_sources_movies720 + archive_sources_movies480 + archive_sources_moviesVita,
command : [
'python3', meson.project_source_root() / 'scripts/pack_arc.py',
'@OUTPUT@',
'@INPUT@'
],
install : true,
install_dir : 'Common/Media',
build_subdir : 'Common/Media',
build_by_default : true,
)

View file

@ -23,18 +23,14 @@ SOFTWARE.
'''
Simple tool to pack arc files from a target folder
--------------------------------------------------
Usage: pack_arc.py path/to/target/files path/to/output.arc filesToIncludeList1.txt filesToIncludeList2.txt filesToIncludeList3.txt ....
The tool makes use of the txt files inside Common/Media/ that define what files should be included. We should probably put those in
a better place and maybe use something like json instead.
You can just omit the "files to include lists" to use all files available in the folder instead.
Usage: pack_arc.py path/to/output.arc fileToInclude1.swf fileToInclude2.swf fileToInclude3.txt ....
'''
from sys import argv
from glob import glob
from struct import pack
from dataclasses import dataclass
from os import path
@dataclass
@ -55,29 +51,24 @@ def write_string(string, stream):
stream.write(string)
target_dir = argv[1]
output_file_path = argv[2]
filter_file_paths = argv[3::]
# Build target file list
target_file_paths = []
if len(filter_file_paths) == 0:
target_file_paths = glob(f"{target_dir}/*.*", recursive=True)
else:
for filter_path in filter_file_paths:
with open(filter_path) as filter_file:
print(f"Reading filter file: {filter_path}")
target_file_paths += filter_file.readlines()
output_file_path = argv[1]
target_file_paths = argv[2::]
print(f"Selected {len(target_file_paths)} files for {output_file_path}")
# Read our target files
target_files = []
for target_path in target_file_paths:
file_dir, file_name = path.split(target_path)
# This is such a massive hack but I want to go to sleep now, deal with this shit later
if path.split(file_dir)[1].lower() == "graphics":
file_name = f"Graphics\\{file_name}"
real_target_path = target_path.replace("\\", "/")
with open(f"{target_dir}/{real_target_path.strip()}", "rb") as file:
with open(real_target_path.strip(), "rb") as file:
file_data = file.read()
meta_data = FileMetaData(
target_path,
file_name,
len(file_data),
file_data
)