Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
7b8264d
vtracer: split disconnected pixels
nikitalita Apr 17, 2026
3804134
fix svg tests
nikitalita Apr 17, 2026
f289de5
Fix bytecode function arg count testing
nikitalita Apr 17, 2026
d7c7a32
fix rust warnings
nikitalita Apr 17, 2026
8d9a660
resync with master @ 90113707f2f
nikitalita Apr 17, 2026
a7c26db
fix warnings
nikitalita Apr 17, 2026
817b87a
Fix ResourceCompatLoader bindings after resync
nikitalita Apr 17, 2026
87b4a9a
Fix loading empty scripts
nikitalita Apr 17, 2026
ca8958c
fix progress bar not redrawing
nikitalita Apr 17, 2026
f6c2748
update dispatch_to_main_thread to take in variadic args
nikitalita Apr 17, 2026
b7a0f84
allow return values in main thread dispatches
nikitalita Apr 17, 2026
4c8949b
fix errors when converting packedscene to text
nikitalita Apr 17, 2026
81939c0
scene: remove unused mesh counting
nikitalita Apr 17, 2026
1073734
scene: split off recompute_animation_tracks_for_library
nikitalita Apr 17, 2026
aaaf995
scene: minor fix
nikitalita Apr 17, 2026
77dd143
scene: ensure functions run on main thread
nikitalita Apr 17, 2026
cdea230
make scene exporter truly multithreaded, don't use batch
nikitalita Apr 17, 2026
9741512
cleanup scene multithread implementation
nikitalita Apr 17, 2026
f22f46f
simplify ResourceFormatSaverCompatTextInstance::ensure_packed_scenes
nikitalita Apr 17, 2026
da2cc01
scene: make debug copy behavior configurable
nikitalita Apr 17, 2026
a3102f1
Better steam detection
nikitalita Apr 17, 2026
5c07877
autoconverted: override resource version with project version
nikitalita Apr 17, 2026
196ba0b
scene: remove ignorable errors in report
nikitalita Apr 17, 2026
4e140bd
svg: don't break up disconnected pixels
nikitalita Apr 17, 2026
4f5b6f3
vtracer: Only re-create header if it doesn't match
nikitalita Apr 17, 2026
c0f8f2e
CI: compile with ANGLE support on win & mac
nikitalita Apr 17, 2026
0e5c57a
Use python script to install swappy
nikitalita Apr 17, 2026
b596bc6
CI: Continue on error for android keystore step
nikitalita Apr 17, 2026
929aacf
Update import/export report labels for clarity
nikitalita Apr 17, 2026
5fa19e8
minor translation exporter optimization
nikitalita Apr 17, 2026
049328f
rebase @ a8643700ce8 with `fix-cli-parser` fix
nikitalita Apr 17, 2026
3bce6a0
append cmdline user args to CLI args to parse
nikitalita Apr 17, 2026
677d255
Quit headless if no commands are input
nikitalita Apr 17, 2026
3e29afa
update .net sdk note in readme
nikitalita Apr 17, 2026
1000307
build (macos): throw error if we can't find the bundle
nikitalita Apr 17, 2026
43cfa8a
Patch main.cpp with cli_helper, apply during SCons configuration
nikitalita Apr 17, 2026
227e472
add documentation for gdre tools command line
nikitalita Apr 17, 2026
3081769
fix md5 check not running when the first pack isn't a PCK but others …
nikitalita Apr 17, 2026
fa2bd0a
rerun doctool on classes
nikitalita Apr 17, 2026
34f5434
update documentation
nikitalita Apr 29, 2026
90466e9
Hacks for pre-1.0 Godot games
nikitalita Apr 29, 2026
55a23ab
Better pre-1.0 handling
nikitalita Apr 30, 2026
4a1c66b
Fix setting version in saver flags
nikitalita Apr 30, 2026
cdb9e35
add XML highlighter to code editor
nikitalita Apr 30, 2026
3583d06
fix old remap key not always being 'all'
nikitalita Apr 30, 2026
a98459a
add ResourceLoaderCompatOBDB for loading pre-1.x resources
nikitalita Apr 30, 2026
d9684b7
fix resource format xml output on versions 1.x and below
nikitalita Apr 30, 2026
6694308
remove unnecessary dir check in gdre_main::recovery
nikitalita Apr 30, 2026
dccafad
fix pre-v1 checking
nikitalita Apr 30, 2026
8152645
add bytecode 2b64f73, fix bytecode 48f1d02
nikitalita Apr 30, 2026
e343ca2
fix get_version_from_bin_resources failing when bytecode testing fails
nikitalita Apr 30, 2026
c6886db
fix loading image textures on pre-1.x games
nikitalita Apr 30, 2026
dfc3bec
remove old pre-1.x parsing attempt from compat binary loader
nikitalita Apr 30, 2026
d063ae3
fix unzipping tar files from plugin downloads
nikitalita May 1, 2026
209b186
update prepop cache
nikitalita May 1, 2026
5b5fe29
Check if assembly is NativeAOT
nikitalita May 1, 2026
007761e
split plugin_info
nikitalita May 1, 2026
45a7a45
add 'unsigned_hash' library
nikitalita May 1, 2026
6d33599
update plugin manager to use unsigned-hash libraries to hash librarie…
nikitalita May 2, 2026
61a73de
force `lf` checkouts on windows
nikitalita May 3, 2026
30c739b
fix static checks
nikitalita May 3, 2026
70fce8e
fix cancellation when adding mesh instances from script
nikitalita May 4, 2026
b850abb
wget_sync: add timeout for request
nikitalita May 4, 2026
f76e551
Add support for writing double precision variants to scripts/project …
nikitalita May 4, 2026
3baebe1
Scene: fix issue with physics_material_override not being set
nikitalita May 4, 2026
a705cfd
scene: fix crash during multi-threaded scene export
nikitalita May 4, 2026
4485bc5
Fix writing uid files for custom non-imported resources
nikitalita May 4, 2026
f306151
fix real_is_double warning
nikitalita May 4, 2026
2753535
scene: force append '.0' to floats when exporting json
nikitalita May 4, 2026
7e9814a
csharp: check dependent packages of source generators
nikitalita May 4, 2026
7d180fe
csharp: include references if package reference wasn't written
nikitalita May 4, 2026
d918870
csharp: fix package references
nikitalita May 4, 2026
d11588a
fix getting base type in csharp scripts
nikitalita May 4, 2026
3f8c645
write_project_metadata_cfg: fix getting `_custom_features` option
nikitalita May 4, 2026
1a3726a
minor variant writer fixes
nikitalita May 5, 2026
adf17c5
write objs with full precision, support double precision
nikitalita May 5, 2026
f1a92e5
add double precision messages to report
nikitalita May 5, 2026
41e28f8
scene: improve parameter setting logic and add shader texture name ma…
nikitalita May 5, 2026
b83abc6
move shader material converter logic to seperate file
nikitalita May 5, 2026
bfac1e4
use real hints instead of string comparison
nikitalita May 5, 2026
b06f248
refactor
nikitalita May 5, 2026
b3b6606
fixes
nikitalita May 6, 2026
f5d8669
fix texture_loader_compat being enabled on non v2 and below
nikitalita May 6, 2026
7a7a519
fix text resources having uids be written
nikitalita May 6, 2026
276d204
handle non-2d textures
nikitalita May 6, 2026
f7f2f9c
allow setting the key in cli when starting GDRE in gui mode
nikitalita May 6, 2026
6408219
don't require KHR_node_visibility unless explicitly forced
nikitalita May 6, 2026
9809e2f
Replace global material overrides in mesh instances
nikitalita May 6, 2026
68503e6
fix v3 param setting
nikitalita May 6, 2026
b8ec877
Store global shader params in GDRESettings so it works on headless
nikitalita May 6, 2026
79fbee3
Compile shader instead of parsing it
nikitalita May 6, 2026
080360d
Set base material params from render modes
nikitalita May 6, 2026
8898790
fix compiling shader
nikitalita May 6, 2026
723cde5
fix compiling
nikitalita May 6, 2026
fa1b148
fix crash during converting animation libraries
nikitalita May 6, 2026
fbcac49
scene: fix caching preloaded dependencies
nikitalita May 6, 2026
e60a655
scene: fix removing errors
nikitalita May 6, 2026
051ea62
add 3.x VisualShader compatibility support and converters
nikitalita May 6, 2026
6b5c1d3
scene: skip duplicate messages
nikitalita May 6, 2026
cc611b0
fix setting use_vertex_color and alpha_scissor_threshold
nikitalita May 6, 2026
f2e91bc
add font file export
nikitalita May 6, 2026
c960d24
disable packed font checking, Godot doesn't currently support them
nikitalita May 6, 2026
8f5455c
add bmfont tests
nikitalita May 7, 2026
946ce87
fix image saving in fontfiles
nikitalita May 7, 2026
bfe326f
Fix ImageSaver not duplicating before clearing mipmaps or decompressing
nikitalita May 7, 2026
a70f1cc
add func_godot exporters
nikitalita May 7, 2026
4e26dd5
Add archive sha256 to plugin cache, make generating the static cache …
nikitalita May 7, 2026
7edecdd
regen plugin cache
nikitalita May 7, 2026
0105e65
Cache plugin downloads in user dir
nikitalita May 7, 2026
aac84ba
Make ResourceCompatLoader globally available when loading the project…
nikitalita May 7, 2026
5e73095
fix TextureExporter::get_default_export_extension
nikitalita May 7, 2026
740442e
Ensure we can save DPITextures as non-svgs
nikitalita May 7, 2026
66a741b
add `ResourceCompatLoader::get_type_for_extension()`
nikitalita May 7, 2026
f5d6ca7
Add GDREMainLoop
nikitalita May 8, 2026
b1d889f
move wait_until_next_frame into GDREMainLoop
nikitalita May 8, 2026
90ca150
move fixtures
nikitalita May 8, 2026
9dc6568
add tests
nikitalita May 8, 2026
7d79042
move main iteration stuff into GDREMainLoop
nikitalita May 8, 2026
8cc9026
move process logic into gdre_main_loop
nikitalita May 8, 2026
9a91117
fix get_base_extensions
nikitalita May 8, 2026
29eec43
finish moving `wait_until_next_frame` to gdre_main_loop
nikitalita May 10, 2026
b187fc6
Fix progress dialog not hiding
nikitalita May 10, 2026
e7a8b7e
CompatFormatLoader: set original_path in compat
nikitalita May 10, 2026
87aaa9a
handle empty ImageTexture more gracefully, ensure we double check ima…
nikitalita May 10, 2026
ddb4367
prevent race condition causing crash in ShaderMaterialConverter
nikitalita May 10, 2026
8e05ba3
fix GDREMainLoop::wait_until_next_frame
nikitalita May 10, 2026
70c7610
add test_import_options() skeleton
nikitalita May 10, 2026
cbe8965
fix after_preload()
nikitalita May 10, 2026
fad3564
fix generating physics when mesh instance is replaced
nikitalita May 10, 2026
2148a7f
regen plugin cache
nikitalita May 10, 2026
d022a93
Normalize datestrings in plugin cache, update static cache
nikitalita May 10, 2026
05726ce
fix test_import_options test
nikitalita May 10, 2026
733cd9b
fix static checks
nikitalita May 10, 2026
0bb2a5e
fix static checks
nikitalita May 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 39 additions & 14 deletions .github/workflows/all_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ env:
# TODO: change this back to godotengine/godot and target master when #109685 and #109475 are merged
GODOT_REPOSITORY: nikitalita/godot
# Change the README too
GODOT_MAIN_SYNC_REF: gdre-wb-babc272d44e
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes
GODOT_MAIN_SYNC_REF: gdre-wb-a8643700ce8
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes deprecated=yes angle=yes accesskit=no
SCONSFLAGS_TEMPLATE: disable_path_overrides=no no_editor_splash=yes module_camera_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_websocket_enabled=no module_csg_enabled=yes module_gridmap_enabled=yes use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libvorbis=yes builtin_libogg=yes disable_3d=no
SCONS_CACHE_MSVC_CONFIG: true

Expand Down Expand Up @@ -137,6 +137,11 @@ jobs:
bin: ./bin/godot.macos.editor.arm64

steps:
- name: Set git to use LF
if: matrix.platform == 'windows'
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: checkout-godot
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -189,10 +194,36 @@ jobs:
- name: Setup python and scons
uses: ./.github/actions/godot-deps

- name: Download pre-built ANGLE
if: matrix.platform == 'macos' || matrix.platform == 'windows'
shell: sh
id: angle-sdk
run: |
if python ./misc/scripts/install_angle.py; then
echo "ANGLE_ENABLED=yes" >> "$GITHUB_OUTPUT"
else
echo "::warning::ANGLE SDK installation failed, building without ANGLE support."
echo "ANGLE_ENABLED=no" >> "$GITHUB_OUTPUT"
fi

# TODO: Enable this when we figure out how to resolve linking issues with AccessKit; getting duplicate symbols for `_rust_eh_personality`.
# - name: Download pre-built AccessKit
# shell: sh
# id: accesskit-sdk
# if: matrix.platform == 'macos' || matrix.platform == 'windows' || matrix.platform == 'linux'
# run: |
# if python ./misc/scripts/install_accesskit.py; then
# echo "ACCESSKIT_ENABLED=yes" >> "$GITHUB_OUTPUT"
# else
# echo "::warning::AccessKit SDK installation failed, building without AccessKit support."
# echo "ACCESSKIT_ENABLED=no" >> "$GITHUB_OUTPUT"
# fi

- name: Setup Vulkan SDK
if: matrix.platform == 'macos'
run: |
sh misc/scripts/install_vulkan_sdk_macos.sh

- name: Download Direct3D 12 SDK components
if: matrix.platform == 'windows'
shell: sh
Expand All @@ -205,6 +236,7 @@ jobs:
echo "D3D12_ENABLED=no" >> "$GITHUB_OUTPUT"
fi
continue-on-error: true

- name: Show targets
shell: sh
run: |
Expand All @@ -228,16 +260,7 @@ jobs:

- name: Download pre-built Android Swappy Frame Pacing Library
if: matrix.platform == 'android'
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: godotengine/godot-swappy
version: tags/from-source-2025-01-31
file: godot-swappy.7z
target: swappy/godot-swappy.7z

- name: Extract pre-built Android Swappy Frame Pacing Library
if: matrix.platform == 'android'
run: 7za x -y swappy/godot-swappy.7z -o${{github.workspace}}/thirdparty/swappy-frame-pacing
run: python ./misc/scripts/install_swappy_android.py

- name: Compile Editor
if: matrix.target == 'editor'
Expand Down Expand Up @@ -462,15 +485,17 @@ jobs:
if: matrix.platform == 'android' && github.event_name != 'pull_request'
run: |
set -Eeuo pipefail
if [ -z "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" ]; then
echo "ANDROID_RELEASE_KEYSTORE is not set"
if [ -z "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" ] || [ -z "${{ secrets.ANDROID_KEY_ALIAS }}" ] || [ -z "${{ secrets.ANDROID_KEY_PASSWORD }}" ]; then
echo "One or more Android signing secrets are missing (ANDROID_RELEASE_KEYSTORE, ANDROID_KEY_ALIAS, ANDROID_KEY_PASSWORD)"
echo "Android release build will be signed with a generated keystore"
exit 1
fi
echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" > release.keystore.b64
openssl base64 -d -out ~/release.keystore -in release.keystore.b64
echo "GODOT_ANDROID_KEYSTORE_RELEASE_PATH=$HOME/release.keystore" >> "$GITHUB_ENV"
echo "GODOT_ANDROID_KEYSTORE_RELEASE_USER=${{ secrets.ANDROID_KEY_ALIAS }}" >> "$GITHUB_ENV"
echo "GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD=${{ secrets.ANDROID_KEY_PASSWORD }}" >> "$GITHUB_ENV"
continue-on-error: true

- name: Export standalone GDRE Tools
shell: pwsh
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
static-check-clang-format:
runs-on: "ubuntu-24.04"
runs-on: "ubuntu-26.04"
name: Static checks (clang-format)
steps:
- name: checkout-gdsdecomp
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install Linux deps
run: |
sudo apt-get update
sudo apt-get install clang-format-18
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-18 100
sudo apt-get install clang-format-21
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-21 100
- name: check clang_format
run: bash ./.scripts/clang_format.sh
5 changes: 2 additions & 3 deletions .scripts/rebase_godot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ BRANCHES_TO_MERGE=(
material-fix-deprecated-param
fix-pack-error
convert-3.x-escn
fix-svg
fix-compat-array-shapes
fix-diraccess-windows
gltf-fix-value-track-interpolation
fix-cli-parser
)

# set fail on error
Expand All @@ -55,7 +54,7 @@ else
sed_in_place() { sed -i "$@"; }
fi

git push nikitalita $NEW_BRANCH_NAME --set-upstream
# git push nikitalita $NEW_BRANCH_NAME --set-upstream

# change the branch name in .github/workflows/all_builds.yml and the README.md
sed_in_place "s/GODOT_MAIN_SYNC_REF: .*/GODOT_MAIN_SYNC_REF: $NEW_BRANCH_NAME/" "$GDRE_PATH/.github/workflows/all_builds.yml"
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ Main commands:
--bin-to-txt=<FILE> Convert binary scene or resource files to text-based format (can be repeated)
--patch-translations=<CSV_FILE>=<SRC_PATH> Patch translations with the specified CSV file and source path
(e.g. "/path/to/translation.csv=res://translations/translation.csv") (can be repeated)
--gdre-help Print the help message and exit
--gdre-version Print the version of GDRE tools and exit
--godot-version Print the version of Godot engine and exit
--godot-help Print the help message of Godot engine and exit
--help, --gdre-help Print this help message and exit
--version, --gdre-version Print this version of GDRE tools and exit

Recover/Extract Options:

Expand Down Expand Up @@ -141,15 +143,19 @@ Support has yet to be implemented for converting the following resources:
Clone this repository into Godot's `modules` subfolder as `gdsdecomp`.
Rebuild Godot engine as described in https://docs.godotengine.org/en/latest/development/compiling/index.html.

You will also need [rustup](https://rustup.rs) and [dotnet 9 sdk](https://dotnet.microsoft.com/en-us/download/dotnet/9.0).
You will also need [rustup](https://rustup.rs) and [dotnet 10 sdk](https://dotnet.microsoft.com/en-us/download/dotnet/10.0).

For ease of bootstrapping development, we have included launch, build, and settings templates for vscode in the .vscode directory. Once you have read the instructions for compiling Godot above and set up your build environment: put these in the .vscode folder in the Godot directory (not gdsdecomp), remove the ".template" from each, and launch vscode from the Godot directory.

Note: Make sure to build the editor build first, and to launch the editor to edit the project in the `standalone` directory at least once so that resources are imported before running.
Make sure to build the editor build first, and to launch the editor to edit the project in the `standalone` directory at least once so that resources are imported before running.

### Note:

During SCons configure, the module auto-applies the patches under `modules/gdsdecomp/patches/` to Godot core files (currently just `main/main.cpp`, to hook `gdre::modify_cli_args` into CLI parsing). The application is idempotent: re-running `scons` is a no-op once patched. If you remove the module or want to restore the originals, revert the affected files manually with `git checkout -- main/main.cpp`.

### Requirements

[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-babc272d44e`
[Our fork of godot](https://github.com/nikitalita/godot) @ branch `gdre-wb-a8643700ce8`

- Support for building on 3.x has been dropped and no new features are being pushed
- Godot RE Tools still retains the ability to decompile 3.x and 2.x projects, however.
Expand Down
33 changes: 17 additions & 16 deletions SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ VTRACER_DIR = get_vtracer_dir(MODULE_DIR)
VTRACER_BUILD_DIR = get_vtracer_build_dir(MODULE_DIR)
GODOT_MONO_DECOMP_DIR = get_godot_mono_decomp_dir(MODULE_DIR)

INCLUDE_DIRS = [
VTRACER_INCLUDE_DIR,
GODOT_MONO_DECOMP_INCLUDE_DIR,
MODULE_INCLUDE_DIR,
MMP3_THIRDPARTY_DIR,
LIBOGG_THIRDPARTY_DIR,
LIBVORBIS_THIRDPARTY_DIR,
LIBTHEORA_THIRDPARTY_DIR,
MBEDTLS_THIRDPARTY_DIR,
UNSIGNED_HASH_INCLUDE_DIR
]

# TODO: Keep static branch intact for future use. Runtime/dotnet issues still block rollout.
mono_native_lib_type = "Shared"
is_using_clang = env["CXX"].lower().endswith("clang++")
Expand All @@ -57,26 +69,12 @@ if env["tests"]:
env_gdsdecomp.Append(CPPDEFINES=["TESTS_ENABLED"])
append_cpppaths(
env,
[
VTRACER_INCLUDE_DIR,
GODOT_MONO_DECOMP_INCLUDE_DIR,
MODULE_INCLUDE_DIR,
MMP3_THIRDPARTY_DIR,
LIBOGG_THIRDPARTY_DIR,
LIBVORBIS_THIRDPARTY_DIR,
],
INCLUDE_DIRS,
)

append_cpppaths(
env_gdsdecomp,
[
VTRACER_INCLUDE_DIR,
GODOT_MONO_DECOMP_INCLUDE_DIR,
MODULE_INCLUDE_DIR,
THORSVG_THIRDPARTY_DIR,
LIBTHEORA_THIRDPARTY_DIR,
MBEDTLS_THIRDPARTY_DIR,
],
INCLUDE_DIRS,
)

if env["disable_exceptions"]:
Expand Down Expand Up @@ -115,11 +113,14 @@ common_sources = [
"crypto/*.cpp",
"exporters/*.cpp",
"gui/*.cpp",
"main/*.cpp",
"plugin_manager/*.cpp",
"utility/*.cpp",
"external/tga/*.cpp",
"external/tinygltf/tiny_gltf.cc",
"module_etc_decompress/*.cpp",
f'{UNSIGNED_HASH_SRC_DIR}/*.cpp',
f'{UNSIGNED_HASH_SRC_DIR}/*.c',
]
add_source_groups(env_gdsdecomp, module_obj, common_sources)
if env["target"] == "editor":
Expand Down
54 changes: 54 additions & 0 deletions build/patches.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import os
import subprocess

from SCons.Errors import UserError


CORE_PATCHES = [
{
"patch": "modules/gdsdecomp/patches/main-cli-parse-inject.patch",
"target": "main/main.cpp",
"marker": "gdre::modify_cli_args",
},
]


def _is_applied(repo_root, target, marker):
target_path = os.path.join(repo_root, target)
try:
with open(target_path, "r", encoding="utf-8") as f:
return marker in f.read()
except OSError as e:
raise UserError(f"gdsdecomp: cannot read {target} to verify patch state: {e}")


def _git_apply(repo_root, patch_rel_path):
patch_abs_path = os.path.join(repo_root, patch_rel_path)
if not os.path.isfile(patch_abs_path):
raise UserError(f"gdsdecomp: patch file not found at {patch_rel_path}")
result = subprocess.run(
["git", "-C", repo_root, "apply", "--whitespace=nowarn", patch_rel_path],
capture_output=True,
text=True,
)
if result.returncode != 0:
raise UserError(
"gdsdecomp: failed to apply "
+ patch_rel_path
+ "\n"
+ (result.stderr or result.stdout or "<no output>")
)


def apply_core_patches(env):
repo_root = env.Dir("#").abspath
for entry in CORE_PATCHES:
patch_rel = entry["patch"]
target = entry["target"]
marker = entry["marker"]
patch_name = os.path.basename(patch_rel)
if _is_applied(repo_root, target, marker):
print(f"gdsdecomp: {patch_name} already applied to {target}, skipping")
continue
_git_apply(repo_root, patch_rel)
print(f"gdsdecomp: applied {patch_name} to {target}")
3 changes: 3 additions & 0 deletions build/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
LIBVORBIS_THIRDPARTY_DIR = "#thirdparty/libvorbis/"
WEBP_THIRDPARTY_DIR = "#thirdparty/libwebp/"
THORSVG_THIRDPARTY_DIR = "#thirdparty/thorsvg/"
UNSIGNED_HASH_DIR = "#modules/gdsdecomp/external/unsigned-hash-cpp"
UNSIGNED_HASH_INCLUDE_DIR = f'{UNSIGNED_HASH_DIR}/include'
UNSIGNED_HASH_SRC_DIR = f'{UNSIGNED_HASH_DIR}/src'
MODULE_INCLUDE_DIR = "#modules/gdsdecomp/"
VTRACER_INCLUDE_DIR = "#modules/gdsdecomp/external/vtracer/include"
GODOT_MONO_DECOMP_INCLUDE_DIR = "#modules/gdsdecomp/godot-mono-decomp/GodotMonoDecompNativeAOT/include"
Expand Down
Loading
Loading