Skip to content

Commit

Permalink
Merge commit '89f70e98d209563abb4dbc1f8cd5d76c81eb7940' of https://gi…
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelVidaurre committed Mar 24, 2024
2 parents 2e40be4 + 89f70e9 commit 0b07be6
Show file tree
Hide file tree
Showing 1,343 changed files with 89,980 additions and 44,629 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ bd282ff43f23fe845f29a3e25c8efc01bd65ffb0

# Add "Godot Engine contributors" copyright line
df61dc4b2bd54a5a40c515493c76f5a458e5b541

# Enforce template syntax `typename` over `class`
9903e6779b70fc03aae70a37b9cf053f4f355b91
2 changes: 1 addition & 1 deletion .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
using: "composite"
steps:
- name: Download Godot Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
2 changes: 1 addition & 1 deletion .github/actions/godot-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
steps:
# Upload cache on completion and check it out now
- name: Load .scons_cache directory
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{inputs.scons-cache}}
key: ${{inputs.cache-name}}-${{env.GODOT_BASE_BRANCH}}-${{github.ref}}-${{github.sha}}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/godot-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
steps:
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: ${{ inputs.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
using: "composite"
steps:
- name: Upload Godot Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,6 @@ jobs:
- name: Setup python and scons
uses: ./.github/actions/godot-deps

- name: Set up .NET Sdk
uses: actions/setup-dotnet@v3
if: ${{ matrix.build-mono }}
with:
dotnet-version: '6.0.x'

- name: Setup GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master

Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/static_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,6 @@ jobs:
run: |
doc/tools/doc_status.py doc/classes modules/*/doc_classes platform/*/doc_classes
- name: Style checks via dotnet format (dotnet_format.sh)
run: |
if grep -q "modules/mono" changed.txt || [ -z "$(cat changed.txt)" ]; then
bash ./misc/scripts/dotnet_format.sh
else
echo "Skipping dotnet format as no C# files were changed."
fi
- name: Spell checks via codespell
if: github.event_name == 'pull_request' && env.CHANGED_FILES != ''
uses: codespell-project/actions-codespell@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ logs/

# Generated by unit tests
tests/data/*.translation
tests/data/crypto/out*

############################
### General build output ###
Expand Down
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.6
rev: v17.0.6
hooks:
- id: clang-format
files: \.(c|h|cpp|hpp|cc|cxx|m|mm|inc|java|glsl)$
Expand All @@ -14,7 +14,7 @@ repos:
)
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black
files: (\.py$|SConstruct|SCsub)
Expand Down Expand Up @@ -47,3 +47,9 @@ repos:
platform/android/java/lib/src/org/godotengine/godot/gl/EGLLogWrapper.*|
platform/android/java/lib/src/org/godotengine/godot/utils/ProcessPhoenix.*
)
- id: dotnet-format
name: dotnet-format
language: python
entry: python3 misc/scripts/dotnet_format.py
types_or: [c#]
12 changes: 6 additions & 6 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ License: BSD-3-clause

Files: ./thirdparty/astcenc/
Comment: Arm ASTC Encoder
Copyright: 2011-2023, Arm Limited
Copyright: 2011-2024, Arm Limited
License: Apache-2.0

Files: ./thirdparty/basis_universal/
Expand All @@ -185,7 +185,7 @@ License: MPL-2.0

Files: ./thirdparty/clipper2/
Comment: Clipper2
Copyright: 2010-2013, Angus Johnson
Copyright: 2010-2023, Angus Johnson
License: BSL-1.0

Files: ./thirdparty/cvtt/
Expand Down Expand Up @@ -306,8 +306,8 @@ License: BSD-3-clause

Files: ./thirdparty/libpng/
Comment: libpng
Copyright: 1995-2019, The PNG Reference Library Authors.
2018-2019, Cosmin Truta.
Copyright: 1995-2024, The PNG Reference Library Authors.
2018-2024, Cosmin Truta.
2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
1996-1997, Andreas Dilger.
1995-1996, Guy Eric Schalnat, Group 42, Inc.
Expand Down Expand Up @@ -457,8 +457,8 @@ License: Apache-2.0

Files: ./thirdparty/pcre2/
Comment: PCRE2
Copyright: 1997-2022, University of Cambridge
2009-2022, Zoltan Herczeg
Copyright: 1997-2024, University of Cambridge
2009-2024, Zoltan Herczeg
License: BSD-3-clause

Files: ./thirdparty/recastnavigation/
Expand Down
36 changes: 23 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -930,17 +930,17 @@ if selected_platform in platform_list:

GLSL_BUILDERS = {
"RD_GLSL": env.Builder(
action=env.Run(glsl_builders.build_rd_headers, 'Building RD_GLSL header: "$TARGET"'),
action=env.Run(glsl_builders.build_rd_headers),
suffix="glsl.gen.h",
src_suffix=".glsl",
),
"GLSL_HEADER": env.Builder(
action=env.Run(glsl_builders.build_raw_headers, 'Building GLSL header: "$TARGET"'),
action=env.Run(glsl_builders.build_raw_headers),
suffix="glsl.gen.h",
src_suffix=".glsl",
),
"GLES3_GLSL": env.Builder(
action=env.Run(gles3_builders.build_gles3_headers, 'Building GLES3 GLSL header: "$TARGET"'),
action=env.Run(gles3_builders.build_gles3_headers),
suffix="glsl.gen.h",
src_suffix=".glsl",
),
Expand All @@ -956,25 +956,25 @@ if selected_platform in platform_list:
env.vs_incs = []
env.vs_srcs = []

if env["compiledb"]:
# Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later.
from SCons import __version__ as scons_raw_version

scons_ver = env._get_major_minor_revision(scons_raw_version)

if scons_ver < (4, 0, 0):
print("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version)
Exit(255)
# CompileDB
from SCons import __version__ as scons_raw_version

scons_ver = env._get_major_minor_revision(scons_raw_version)
if env["compiledb"] and scons_ver < (4, 0, 0):
# Generating the compilation DB (`compile_commands.json`) requires SCons 4.0.0 or later.
print("The `compiledb=yes` option requires SCons 4.0 or later, but your version is %s." % scons_raw_version)
Exit(255)
if scons_ver >= (4, 0, 0):
env.Tool("compilation_db")
env.Alias("compiledb", env.CompilationDatabase())

# Threads
if env["threads"]:
env.Append(CPPDEFINES=["THREADS_ENABLED"])

# Build subdirs, the build order is dependent on link order.
Export("env")

# Build subdirs, the build order is dependent on link order.
SConscript("core/SCsub")
SConscript("servers/SCsub")
SConscript("scene/SCsub")
Expand Down Expand Up @@ -1038,3 +1038,13 @@ def print_elapsed_time():


atexit.register(print_elapsed_time)


def purge_flaky_files():
for build_failure in GetBuildFailures():
path = build_failure.node.abspath
if os.path.isfile(path):
os.remove(path)


atexit.register(purge_flaky_files)
14 changes: 5 additions & 9 deletions core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if "SCRIPT_AES256_ENCRYPTION_KEY" in os.environ:
Exit(255)

# NOTE: It is safe to generate this file here, since this is still executed serially
with open("script_encryption_key.gen.cpp", "w") as f:
with open("script_encryption_key.gen.cpp", "w", encoding="utf-8", newline="\n") as f:
f.write('#include "core/config/project_settings.h"\nuint8_t script_encryption_key[32]={' + txt + "};\n")


Expand Down Expand Up @@ -202,27 +202,23 @@ env.Depends(
env.CommandNoCache(
"#core/io/certs_compressed.gen.h",
"#thirdparty/certs/ca-certificates.crt",
env.Run(core_builders.make_certs_header, "Building ca-certificates header."),
env.Run(core_builders.make_certs_header),
)

# Authors
env.Depends("#core/authors.gen.h", "../AUTHORS.md")
env.CommandNoCache(
"#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header, "Generating authors header.")
)
env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", env.Run(core_builders.make_authors_header))

# Donors
env.Depends("#core/donors.gen.h", "../DONORS.md")
env.CommandNoCache(
"#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header, "Generating donors header.")
)
env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", env.Run(core_builders.make_donors_header))

# License
env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache(
"#core/license.gen.h",
["../COPYRIGHT.txt", "../LICENSE.txt"],
env.Run(core_builders.make_license_header, "Generating license header."),
env.Run(core_builders.make_license_header),
)

# Chain load SCsubs
Expand Down
45 changes: 45 additions & 0 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@
#include "core/io/file_access.h"
#include "core/io/file_access_pack.h"
#include "core/io/marshalls.h"
#include "core/io/resource_uid.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/templates/rb_set.h"
#include "core/variant/typed_array.h"
#include "core/variant/variant_parser.h"
#include "core/version.h"
Expand Down Expand Up @@ -477,6 +480,14 @@ bool ProjectSettings::_load_resource_pack(const String &p_pack, bool p_replace_f
return false;
}

if (project_loaded) {
// This pack may have declared new global classes (make sure they are picked up).
refresh_global_class_list();

// This pack may have defined new UIDs, make sure they are cached.
ResourceUID::get_singleton()->load_from_cache(false);
}

//if data.pck is found, all directory access will be from here
DirAccess::make_default<DirAccessPack>(DirAccess::ACCESS_RESOURCES);
using_datapack = true;
Expand Down Expand Up @@ -1188,6 +1199,19 @@ Variant ProjectSettings::get_setting(const String &p_setting, const Variant &p_d
}
}

void ProjectSettings::refresh_global_class_list() {
// This is called after mounting a new PCK file to pick up class changes.
is_global_class_list_loaded = false; // Make sure we read from the freshly mounted PCK.
Array script_classes = get_global_class_list();
for (int i = 0; i < script_classes.size(); i++) {
Dictionary c = script_classes[i];
if (!c.has("class") || !c.has("language") || !c.has("path") || !c.has("base")) {
continue;
}
ScriptServer::add_global_class(c["class"], c["base"], c["language"], c["path"]);
}
}

TypedArray<Dictionary> ProjectSettings::get_global_class_list() {
if (is_global_class_list_loaded) {
return global_class_list;
Expand Down Expand Up @@ -1318,6 +1342,26 @@ const HashMap<StringName, HashSet<StringName>> &ProjectSettings::get_scene_group
return scene_groups_cache;
}

#ifdef TOOLS_ENABLED
void ProjectSettings::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {
const String pf = p_function;
if (p_idx == 0) {
if (pf == "has_setting" || pf == "set_setting" || pf == "get_setting" || pf == "get_setting_with_override" ||
pf == "set_order" || pf == "get_order" || pf == "set_initial_value" || pf == "set_as_basic" ||
pf == "set_as_internal" || pf == "set_restart_if_changed" || pf == "clear") {
for (const KeyValue<StringName, VariantContainer> &E : props) {
if (E.value.hide_from_editor) {
continue;
}

r_options->push_back(String(E.key).quote());
}
}
}
Object::get_argument_options(p_function, p_idx, r_options);
}
#endif

void ProjectSettings::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_setting", "name"), &ProjectSettings::has_setting);
ClassDB::bind_method(D_METHOD("set_setting", "name", "value"), &ProjectSettings::set_setting);
Expand Down Expand Up @@ -1514,6 +1558,7 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF_INTERNAL("internationalization/locale/translation_remaps", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translations", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translations_pot_files", PackedStringArray());
GLOBAL_DEF_INTERNAL("internationalization/locale/translation_add_builtin_strings_to_pot", false);

ProjectSettings::get_singleton()->add_hidden_prefix("input/");
}
Expand Down
9 changes: 5 additions & 4 deletions core/config/project_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
#define PROJECT_SETTINGS_H

#include "core/object/class_db.h"
#include "core/os/thread_safe.h"
#include "core/templates/hash_map.h"
#include "core/templates/local_vector.h"
#include "core/templates/rb_set.h"

template <typename T>
class TypedArray;
Expand Down Expand Up @@ -158,6 +154,7 @@ class ProjectSettings : public Object {
void set_setting(const String &p_setting, const Variant &p_value);
Variant get_setting(const String &p_setting, const Variant &p_default_value = Variant()) const;
TypedArray<Dictionary> get_global_class_list();
void refresh_global_class_list();
void store_global_class_list(const Array &p_classes);
String get_global_class_list_path() const;

Expand Down Expand Up @@ -222,6 +219,10 @@ class ProjectSettings : public Object {
String get_scene_groups_cache_path() const;
void load_scene_groups_cache();

#ifdef TOOLS_ENABLED
virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override;
#endif

ProjectSettings();
~ProjectSettings();
};
Expand Down
Loading

0 comments on commit 0b07be6

Please sign in to comment.