Skip to content

Commit

Permalink
Merge branch 'godotengine:master' into 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
roalyr authored Oct 18, 2024
2 parents fac3a95 + 80f0b33 commit 88a3427
Show file tree
Hide file tree
Showing 1,099 changed files with 69,561 additions and 19,965 deletions.
320 changes: 200 additions & 120 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/runner.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 🔗 GHA
on: [push, pull_request]
on: [push, pull_request, merge_group]

concurrency:
group: ci-${{ github.actor }}-${{ github.head_ref || github.run_number }}-${{ github.ref }}-runner
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/windows_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,32 @@ jobs:
# Skip debug symbols, they're way too big with MSVC.
sconsflags: debug_symbols=no vsproj=yes vsproj_gen_only=no windows_subsystem=console
bin: ./bin/godot.windows.editor.x86_64.exe
artifact: true
compiler: msvc

- name: Editor w/ clang-cl (target=editor, tests=yes, use_llvm=yes)
cache-name: windows-editor-clang
target: editor
tests: true
sconsflags: debug_symbols=no windows_subsystem=console use_llvm=yes
bin: ./bin/godot.windows.editor.x86_64.llvm.exe
compiler: clang

- name: Template (target=template_release, tests=yes)
cache-name: windows-template
target: template_release
tests: true
sconsflags: debug_symbols=no
bin: ./bin/godot.windows.template_release.x86_64.console.exe
artifact: true
compiler: msvc

- name: Template w/ GCC (target=template_release, tests=yes, use_mingw=yes)
cache-name: windows-template-gcc
# MinGW takes MUCH longer to compile; save time by only targeting Template.
target: template_release
tests: true
sconsflags: debug_symbols=no use_mingw=yes
bin: ./bin/godot.windows.template_release.x86_64.console.exe
compiler: gcc

steps:
- name: Checkout
Expand All @@ -69,16 +79,21 @@ jobs:
uses: dsaltares/[email protected]
with:
repo: godotengine/godot-angle-static
version: tags/chromium/6029
file: Windows.6029-1.MSVC_17.x86_64.x86_32.zip
version: tags/chromium/6601.2
file: godot-angle-static-x86_64-${{ matrix.compiler == 'gcc' && 'gcc' || 'msvc' }}-release.zip
target: angle/angle.zip

- name: Extract pre-built ANGLE static libraries
run: Expand-Archive -Force angle/angle.zip ${{ github.workspace }}/

- name: Setup MSVC problem matcher
if: matrix.compiler == 'msvc'
uses: ammaraskar/msvc-problem-matcher@master

- name: Setup GCC problem matcher
if: matrix.compiler != 'msvc'
uses: ammaraskar/gcc-problem-matcher@master

- name: Compilation
uses: ./.github/actions/godot-build
with:
Expand All @@ -94,12 +109,12 @@ jobs:
continue-on-error: true

- name: Prepare artifact
if: ${{ matrix.artifact }}
if: matrix.compiler == 'msvc'
run: |
Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force
- name: Upload artifact
if: ${{ matrix.artifact }}
if: matrix.compiler == 'msvc'
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude: |
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.0
hooks:
- id: clang-format
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
Expand Down
76 changes: 38 additions & 38 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,44 @@ Copyright: 2011, Ole Kniemeyer, MAXON, www.maxon.net
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: ./modules/godot_physics_2d/godot_joints_2d.cpp
Comment: Chipmunk2D Joint Constraints
Copyright: 2007, Scott Lembcke
License: Expat

Files: ./modules/godot_physics_3d/gjk_epa.cpp
./modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.cpp
./modules/godot_physics_3d/joints/godot_generic_6dof_joint_3d.h
./modules/godot_physics_3d/joints/godot_hinge_joint_3d.cpp
./modules/godot_physics_3d/joints/godot_hinge_joint_3d_sw.h
./modules/godot_physics_3d/joints/godot_jacobian_entry_3d_sw.h
./modules/godot_physics_3d/joints/godot_pin_joint_3d.cpp
./modules/godot_physics_3d/joints/godot_pin_joint_3d.h
./modules/godot_physics_3d/joints/godot_slider_joint_3d.cpp
./modules/godot_physics_3d/joints/godot_slider_joint_3d.h
./modules/godot_physics_3d/godot_soft_body_3d.cpp
./modules/godot_physics_3d/godot_soft_body_3d.h
./modules/godot_physics_3d/godot_shape_3d.cpp
./modules/godot_physics_3d/godot_shape_3d.h
Comment: Bullet Continuous Collision Detection and Physics Library
Copyright: 2003-2008, Erwin Coumans
2014-present, Godot Engine contributors
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: ./modules/godot_physics_3d/godot_collision_solver_3d_sat.cpp
Comment: Open Dynamics Engine
Copyright: 2001-2003, Russell L. Smith, Alen Ladavac, Nguyen Binh
License: BSD-3-clause

Files: ./modules/godot_physics_3d/joints/godot_cone_twist_joint_3d.cpp
./modules/godot_physics_3d/joints/godot_cone_twist_joint_3d.h
Comment: Bullet Continuous Collision Detection and Physics Library
Copyright: 2007, Starbreeze Studios
2014-present, Godot Engine contributors
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: ./modules/lightmapper_rd/lm_compute.glsl
Comment: Joint Non-Local Means (JNLM) denoiser
Copyright: 2020, Manuel Prandini
Expand Down Expand Up @@ -93,44 +131,6 @@ Copyright: 2001, Robert Penner
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat

Files: ./servers/physics_2d/godot_joints_2d.cpp
Comment: Chipmunk2D Joint Constraints
Copyright: 2007, Scott Lembcke
License: Expat

Files: ./servers/physics_3d/collision_solver_3d_sat.cpp
Comment: Open Dynamics Engine
Copyright: 2001-2003, Russell L. Smith, Alen Ladavac, Nguyen Binh
License: BSD-3-clause

Files: ./servers/physics_3d/gjk_epa.cpp
./servers/physics_3d/joints/generic_6dof_joint_3d_sw.cpp
./servers/physics_3d/joints/generic_6dof_joint_3d_sw.h
./servers/physics_3d/joints/hinge_joint_3d_sw.cpp
./servers/physics_3d/joints/hinge_joint_3d_sw.h
./servers/physics_3d/joints/jacobian_entry_3d_sw.h
./servers/physics_3d/joints/pin_joint_3d_sw.cpp
./servers/physics_3d/joints/pin_joint_3d_sw.h
./servers/physics_3d/joints/slider_joint_3d_sw.cpp
./servers/physics_3d/joints/slider_joint_3d_sw.h
./servers/physics_3d/soft_body_3d_sw.cpp
./servers/physics_3d/soft_body_3d_sw.h
./servers/physics_3d/shape_3d_sw.cpp
./servers/physics_3d/shape_3d_sw.h
Comment: Bullet Continuous Collision Detection and Physics Library
Copyright: 2003-2008, Erwin Coumans
2014-present, Godot Engine contributors
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: ./servers/physics_3d/joints/cone_twist_joint_3d_sw.cpp
./servers/physics_3d/joints/cone_twist_joint_3d_sw.h
Comment: Bullet Continuous Collision Detection and Physics Library
Copyright: 2007, Starbreeze Studios
2014-present, Godot Engine contributors
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: ./servers/rendering/renderer_rd/shaders/ss_effects_downsample.glsl
./servers/rendering/renderer_rd/shaders/ssao_blur.glsl
./servers/rendering/renderer_rd/shaders/ssao_importance_map.glsl
Expand Down
76 changes: 45 additions & 31 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *

EnsureSConsVersion(3, 1, 2)
EnsurePythonVersion(3, 6)
Expand Down Expand Up @@ -298,7 +299,6 @@ opts.Add(BoolVariable("builtin_pcre2_with_jit", "Use JIT compiler for the built-
opts.Add(BoolVariable("builtin_recastnavigation", "Use the built-in Recast navigation library", True))
opts.Add(BoolVariable("builtin_rvo2_2d", "Use the built-in RVO2 2D library", True))
opts.Add(BoolVariable("builtin_rvo2_3d", "Use the built-in RVO2 3D library", True))
opts.Add(BoolVariable("builtin_squish", "Use the built-in squish library", True))
opts.Add(BoolVariable("builtin_xatlas", "Use the built-in xatlas library", True))
opts.Add(BoolVariable("builtin_zlib", "Use the built-in zlib library", True))
opts.Add(BoolVariable("builtin_zstd", "Use the built-in Zstd library", True))
Expand Down Expand Up @@ -639,25 +639,18 @@ if env.dev_build:
print("NOTE: Developer build, with debug optimization level and debug symbols (unless overridden).")

# Enforce our minimal compiler version requirements
cc_version = methods.get_compiler_version(env) or {
"major": None,
"minor": None,
"patch": None,
"metadata1": None,
"metadata2": None,
"date": None,
}
cc_version_major = int(cc_version["major"] or -1)
cc_version_minor = int(cc_version["minor"] or -1)
cc_version_metadata1 = cc_version["metadata1"] or ""

if methods.using_gcc(env):
if cc_version_major == -1:
print_warning(
"Couldn't detect compiler version, skipping version checks. "
"Build may fail if the compiler doesn't support C++17 fully."
)
elif cc_version_major < 9:
cc_version = methods.get_compiler_version(env)
cc_version_major = cc_version["major"]
cc_version_minor = cc_version["minor"]
cc_version_metadata1 = cc_version["metadata1"]

if cc_version_major == -1:
print_warning(
"Couldn't detect compiler version, skipping version checks. "
"Build may fail if the compiler doesn't support C++17 fully."
)
elif methods.using_gcc(env):
if cc_version_major < 9:
print_error(
"Detected GCC version older than 9, which does not fully support "
"C++17, or has bugs when compiling Godot. Supported versions are 9 "
Expand All @@ -677,17 +670,12 @@ if methods.using_gcc(env):
print_warning("GCC < 8 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option.")
env["debug_paths_relative"] = False
elif methods.using_clang(env):
if cc_version_major == -1:
print_warning(
"Couldn't detect compiler version, skipping version checks. "
"Build may fail if the compiler doesn't support C++17 fully."
)
# Apple LLVM versions differ from upstream LLVM version \o/, compare
# in https://en.wikipedia.org/wiki/Xcode#Toolchain_versions
elif env["platform"] == "macos" or env["platform"] == "ios":
if env["platform"] == "macos" or env["platform"] == "ios":
vanilla = methods.is_vanilla_clang(env)
if vanilla and cc_version_major < 6:
print_warning(
print_error(
"Detected Clang version older than 6, which does not fully support "
"C++17. Supported versions are Clang 6 and later."
)
Expand All @@ -712,6 +700,28 @@ elif methods.using_clang(env):
if env["debug_paths_relative"] and cc_version_major < 10:
print_warning("Clang < 10 doesn't support -ffile-prefix-map, disabling `debug_paths_relative` option.")
env["debug_paths_relative"] = False
elif env.msvc:
# Ensure latest minor builds of Visual Studio 2017/2019.
# https://github.com/godotengine/godot/pull/94995#issuecomment-2336464574
if cc_version_major == 16 and cc_version_minor < 11:
print_error(
"Detected Visual Studio 2019 version older than 16.11, which has bugs "
"when compiling Godot. Use a newer VS2019 version, or VS2022."
)
Exit(255)
if cc_version_major == 15 and cc_version_minor < 9:
print_error(
"Detected Visual Studio 2017 version older than 15.9, which has bugs "
"when compiling Godot. Use a newer VS2017 version, or VS2019/VS2022."
)
Exit(255)
if cc_version_major < 15:
print_error(
"Detected Visual Studio 2015 or earlier, which is unsupported in Godot. "
"Supported versions are Visual Studio 2017 and later."
)
Exit(255)


# Set optimize and debug_symbols flags.
# "custom" means do nothing and let users set their own optimization flags.
Expand Down Expand Up @@ -789,13 +799,17 @@ if env["lto"] != "none":
# This needs to come after `configure`, otherwise we don't have env.msvc.
if not env.msvc:
# Specifying GNU extensions support explicitly, which are supported by
# both GCC and Clang. Both currently default to gnu11 and gnu++14.
# both GCC and Clang. Both currently default to gnu11 and gnu++17.
env.Prepend(CFLAGS=["-std=gnu11"])
env.Prepend(CXXFLAGS=["-std=gnu++17"])
else:
# MSVC doesn't have clear C standard support, /std only covers C++.
# We apply it to CCFLAGS (both C and C++ code) in case it impacts C features.
env.Prepend(CCFLAGS=["/std:c++17"])
# MSVC started offering C standard support with Visual Studio 2019 16.8, which covers all
# of our supported VS2019 & VS2022 versions; VS2017 will only pass the C++ standard.
env.Prepend(CXXFLAGS=["/std:c++17"])
if cc_version_major < 16:
print_warning("Visual Studio 2017 cannot specify a C-Standard.")
else:
env.Prepend(CFLAGS=["/std:c11"])
# MSVC is non-conforming with the C++ standard by default, so we enable more conformance.
# Note that this is still not complete conformance, as certain Windows-related headers
# don't compile under complete conformance.
Expand Down
1 change: 1 addition & 0 deletions core/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *

Import("env")

Expand Down
1 change: 1 addition & 0 deletions core/config/SCsub
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from misc.utility.scons_hints import *

Import("env")

Expand Down
8 changes: 8 additions & 0 deletions core/config/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,14 @@ bool Engine::is_extra_gpu_memory_tracking_enabled() const {
return extra_gpu_memory_tracking;
}

void Engine::set_print_to_stdout(bool p_enabled) {
CoreGlobals::print_line_enabled = p_enabled;
}

bool Engine::is_printing_to_stdout() const {
return CoreGlobals::print_line_enabled;
}

void Engine::set_print_error_messages(bool p_enabled) {
CoreGlobals::print_error_enabled = p_enabled;
}
Expand Down
3 changes: 3 additions & 0 deletions core/config/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class Engine {
void set_time_scale(double p_scale);
double get_time_scale() const;

void set_print_to_stdout(bool p_enabled);
bool is_printing_to_stdout() const;

void set_print_error_messages(bool p_enabled);
bool is_printing_error_messages() const;
void print_header(const String &p_string) const;
Expand Down
21 changes: 7 additions & 14 deletions core/config/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
_THREAD_SAFE_METHOD_

if (!props.has(p_name)) {
WARN_PRINT("Property not found: " + String(p_name));
return false;
}
r_ret = props[p_name].variant;
Expand Down Expand Up @@ -1168,22 +1167,16 @@ bool ProjectSettings::is_project_loaded() const {
}

bool ProjectSettings::_property_can_revert(const StringName &p_name) const {
if (!props.has(p_name)) {
return false;
}

return props[p_name].initial != props[p_name].variant;
return props.has(p_name);
}

bool ProjectSettings::_property_get_revert(const StringName &p_name, Variant &r_property) const {
if (!props.has(p_name)) {
return false;
const RBMap<StringName, ProjectSettings::VariantContainer>::Element *value = props.find(p_name);
if (value) {
r_property = value->value().initial.duplicate();
return true;
}

// Duplicate so that if value is array or dictionary, changing the setting will not change the stored initial value.
r_property = props[p_name].initial.duplicate();

return true;
return false;
}

void ProjectSettings::set_setting(const String &p_setting, const Variant &p_value) {
Expand Down Expand Up @@ -1398,7 +1391,7 @@ void ProjectSettings::_add_builtin_input_map() {
}

Dictionary action;
action["deadzone"] = Variant(0.5f);
action["deadzone"] = Variant(0.2f);
action["events"] = events;

String action_name = "input/" + E.key;
Expand Down
Loading

0 comments on commit 88a3427

Please sign in to comment.