Skip to content

Commit

Permalink
Merge branch 'godotengine:master' into Fix_lossless_formats_in_Portab…
Browse files Browse the repository at this point in the history
…leCompressedTexture2D
  • Loading branch information
nklbdev committed Oct 10, 2023
2 parents 3f8c5f4 + b931a6e commit bd5d990
Show file tree
Hide file tree
Showing 1,647 changed files with 149,769 additions and 187,973 deletions.
29 changes: 23 additions & 6 deletions COPYRIGHT.txt
Expand Up @@ -63,6 +63,13 @@ Copyright: 2011, Ole Kniemeyer, MAXON, www.maxon.net
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
2014-present, Godot Engine contributors
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat

Files: ./platform/android/java/lib/aidl/com/android/*
./platform/android/java/lib/res/layout/status_bar_ongoing_event_progress_bar.xml
./platform/android/java/lib/src/com/google/android/*
Expand All @@ -85,6 +92,11 @@ 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
Expand Down Expand Up @@ -141,6 +153,11 @@ Comment: AMD FidelityFX Super Resolution
Copyright: 2021, Advanced Micro Devices, Inc.
License: Expat

Files: ./thirdparty/amd-fsr2/
Comment: AMD FidelityFX Super Resolution 2
Copyright: 2022-2023, Advanced Micro Devices, Inc.
License: Expat

Files: ./thirdparty/angle/
Comment: ANGLE
Copyright: 2018, The ANGLE Project Authors.
Expand All @@ -166,6 +183,11 @@ Comment: CA certificates
Copyright: Mozilla Contributors
License: MPL-2.0

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

Files: ./thirdparty/cvtt/
Comment: Convection Texture Tools Stand-Alone Kernels
Copyright: 2018, Eric Lasota
Expand Down Expand Up @@ -413,11 +435,6 @@ Comment: Stripped down version of "nvapi.h" from the NVIDIA NVAPI SDK
Copyright: 2019-2022, NVIDIA Corporation
License: Expat

Files: ./thirdparty/oidn/
Comment: Intel Open Image Denoise
Copyright: 2009-2019, Intel Corporation
License: Apache-2.0

Files: ./thirdparty/openxr/
Comment: OpenXR Loader
Copyright: 2020-2023, The Khronos Group Inc.
Expand Down Expand Up @@ -451,7 +468,7 @@ License: Expat

Files: ./thirdparty/thorvg/
Comment: ThorVG
Copyright: 2020-2022, Samsung Electronics Co., Ltd.
Copyright: 2020-2023, The ThorVG Project
License: Expat

Files: ./thirdparty/tinyexr/
Expand Down
15 changes: 11 additions & 4 deletions SConstruct
Expand Up @@ -207,6 +207,7 @@ opts.Add(BoolVariable("progress", "Show a progress indicator during compilation"
opts.Add(EnumVariable("warnings", "Level of compilation warnings", "all", ("extra", "all", "moderate", "no")))
opts.Add(BoolVariable("werror", "Treat compiler warnings as errors", False))
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
opts.Add("object_prefix", "Custom prefix added to the base filename of all generated object files", "")
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
opts.Add("vsproj_name", "Name of the Visual Studio solution", "godot")
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False))
Expand All @@ -226,6 +227,7 @@ opts.Add("scu_limit", "Max includes per SCU file when using scu_build (determine
# Thirdparty libraries
opts.Add(BoolVariable("builtin_brotli", "Use the built-in Brotli library", True))
opts.Add(BoolVariable("builtin_certs", "Use the built-in SSL certificates bundles", True))
opts.Add(BoolVariable("builtin_clipper2", "Use the built-in Clipper2 library", True))
opts.Add(BoolVariable("builtin_embree", "Use the built-in Embree library", True))
opts.Add(BoolVariable("builtin_enet", "Use the built-in ENet library", True))
opts.Add(BoolVariable("builtin_freetype", "Use the built-in FreeType library", True))
Expand Down Expand Up @@ -374,6 +376,8 @@ for name, path in modules_detected.items():
else:
enabled = False

opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled))

# Add module-specific options.
try:
for opt in config.get_opts(selected_platform):
Expand All @@ -383,7 +387,6 @@ for name, path in modules_detected.items():

sys.path.remove(path)
sys.modules.pop("config")
opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled))

methods.write_modules(modules_detected)

Expand Down Expand Up @@ -892,6 +895,9 @@ if selected_platform in platform_list:
env["LIBSUFFIX"] = suffix + env["LIBSUFFIX"]
env["SHLIBSUFFIX"] = suffix + env["SHLIBSUFFIX"]

env["OBJPREFIX"] = env["object_prefix"]
env["SHOBJPREFIX"] = env["object_prefix"]

if env["disable_3d"]:
if env.editor_build:
print("Build option 'disable_3d=yes' cannot be used for editor builds, only for export template builds.")
Expand Down Expand Up @@ -986,9 +992,10 @@ if selected_platform in platform_list:
# Check for the existence of headers
conf = Configure(env)
if "check_c_headers" in env:
for header in env["check_c_headers"]:
if conf.CheckCHeader(header[0]):
env.AppendUnique(CPPDEFINES=[header[1]])
headers = env["check_c_headers"]
for header in headers:
if conf.CheckCHeader(header):
env.AppendUnique(CPPDEFINES=[headers[header]])

elif selected_platform != "":
if selected_platform == "list":
Expand Down
18 changes: 18 additions & 0 deletions core/SCsub
Expand Up @@ -89,6 +89,24 @@ if env["brotli"] and env["builtin_brotli"]:

env_thirdparty.add_source_files(thirdparty_obj, thirdparty_brotli_sources)

# Clipper2 Thirdparty source files used for polygon and polyline boolean operations.
if env["builtin_clipper2"]:
thirdparty_clipper_dir = "#thirdparty/clipper2/"
thirdparty_clipper_sources = [
"src/clipper.engine.cpp",
"src/clipper.offset.cpp",
"src/clipper.rectclip.cpp",
]
thirdparty_clipper_sources = [thirdparty_clipper_dir + file for file in thirdparty_clipper_sources]

env_thirdparty.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])
env.Prepend(CPPPATH=[thirdparty_clipper_dir + "include"])

env_thirdparty.Append(CPPDEFINES=["CLIPPER2_ENABLED"])
env.Append(CPPDEFINES=["CLIPPER2_ENABLED"])

env_thirdparty.add_source_files(thirdparty_obj, thirdparty_clipper_sources)

# Zlib library, can be unbundled
if env["builtin_zlib"]:
thirdparty_zlib_dir = "#thirdparty/zlib/"
Expand Down
30 changes: 28 additions & 2 deletions core/config/engine.cpp
Expand Up @@ -260,14 +260,21 @@ bool Engine::is_printing_error_messages() const {
}

void Engine::add_singleton(const Singleton &p_singleton) {
ERR_FAIL_COND_MSG(singleton_ptrs.has(p_singleton.name), "Can't register singleton that already exists: " + String(p_singleton.name));
ERR_FAIL_COND_MSG(singleton_ptrs.has(p_singleton.name), vformat("Can't register singleton '%s' because it already exists.", p_singleton.name));
singletons.push_back(p_singleton);
singleton_ptrs[p_singleton.name] = p_singleton.ptr;
}

Object *Engine::get_singleton_object(const StringName &p_name) const {
HashMap<StringName, Object *>::ConstIterator E = singleton_ptrs.find(p_name);
ERR_FAIL_COND_V_MSG(!E, nullptr, "Failed to retrieve non-existent singleton '" + String(p_name) + "'.");
ERR_FAIL_COND_V_MSG(!E, nullptr, vformat("Failed to retrieve non-existent singleton '%s'.", p_name));

#ifdef TOOLS_ENABLED
if (!is_editor_hint() && is_singleton_editor_only(p_name)) {
ERR_FAIL_V_MSG(nullptr, vformat("Can't retrieve singleton '%s' outside of editor.", p_name));
}
#endif

return E->value;
}

Expand All @@ -282,6 +289,19 @@ bool Engine::is_singleton_user_created(const StringName &p_name) const {

return false;
}

bool Engine::is_singleton_editor_only(const StringName &p_name) const {
ERR_FAIL_COND_V(!singleton_ptrs.has(p_name), false);

for (const Singleton &E : singletons) {
if (E.name == p_name && E.editor_only) {
return true;
}
}

return false;
}

void Engine::remove_singleton(const StringName &p_name) {
ERR_FAIL_COND(!singleton_ptrs.has(p_name));

Expand All @@ -300,6 +320,12 @@ bool Engine::has_singleton(const StringName &p_name) const {

void Engine::get_singletons(List<Singleton> *p_singletons) {
for (const Singleton &E : singletons) {
#ifdef TOOLS_ENABLED
if (!is_editor_hint() && E.editor_only) {
continue;
}
#endif

p_singletons->push_back(E);
}
}
Expand Down
13 changes: 12 additions & 1 deletion core/config/engine.h
Expand Up @@ -44,8 +44,11 @@ class Engine {
struct Singleton {
StringName name;
Object *ptr = nullptr;
StringName class_name; //used for binding generation hinting
StringName class_name; // Used for binding generation hinting.
// Singleton scope flags.
bool user_created = false;
bool editor_only = false;

Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr, const StringName &p_class_name = StringName());
};

Expand Down Expand Up @@ -79,6 +82,7 @@ class Engine {

bool editor_hint = false;
bool project_manager_hint = false;
bool extension_reloading = false;

static Engine *singleton;

Expand Down Expand Up @@ -129,19 +133,26 @@ class Engine {
Object *get_singleton_object(const StringName &p_name) const;
void remove_singleton(const StringName &p_name);
bool is_singleton_user_created(const StringName &p_name) const;
bool is_singleton_editor_only(const StringName &p_name) const;

#ifdef TOOLS_ENABLED
_FORCE_INLINE_ void set_editor_hint(bool p_enabled) { editor_hint = p_enabled; }
_FORCE_INLINE_ bool is_editor_hint() const { return editor_hint; }

_FORCE_INLINE_ void set_project_manager_hint(bool p_enabled) { project_manager_hint = p_enabled; }
_FORCE_INLINE_ bool is_project_manager_hint() const { return project_manager_hint; }

_FORCE_INLINE_ void set_extension_reloading_enabled(bool p_enabled) { extension_reloading = p_enabled; }
_FORCE_INLINE_ bool is_extension_reloading_enabled() const { return extension_reloading; }
#else
_FORCE_INLINE_ void set_editor_hint(bool p_enabled) {}
_FORCE_INLINE_ bool is_editor_hint() const { return false; }

_FORCE_INLINE_ void set_project_manager_hint(bool p_enabled) {}
_FORCE_INLINE_ bool is_project_manager_hint() const { return false; }

_FORCE_INLINE_ void set_extension_reloading_enabled(bool p_enabled) {}
_FORCE_INLINE_ bool is_extension_reloading_enabled() const { return false; }
#endif

Dictionary get_version_info() const;
Expand Down
1 change: 1 addition & 0 deletions core/config/project_settings.cpp
Expand Up @@ -962,6 +962,7 @@ Error ProjectSettings::_save_custom_bnd(const String &p_file) { // add other par
#ifdef TOOLS_ENABLED
bool _csproj_exists(String p_root_dir) {
Ref<DirAccess> dir = DirAccess::open(p_root_dir);
ERR_FAIL_COND_V(dir.is_null(), false);

dir->list_dir_begin();
String file_name = dir->_get_next();
Expand Down
3 changes: 1 addition & 2 deletions core/core_bind.cpp
Expand Up @@ -1211,8 +1211,7 @@ void Thread::_start_func(void *ud) {
Ref<Thread> t = *tud;
memdelete(tud);

Object *target_instance = t->target_callable.get_object();
if (!target_instance) {
if (!t->target_callable.is_valid()) {
t->running.clear();
ERR_FAIL_MSG(vformat("Could not call function '%s' on previously freed instance to start thread %s.", t->target_callable.get_method(), t->get_id()));
}
Expand Down

0 comments on commit bd5d990

Please sign in to comment.