From fc5366c02604fdf655a3fe5558e39930e4511fbd Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Wed, 10 Apr 2024 13:51:53 -0500 Subject: [PATCH 1/5] Use `GDREGISTER` defines in example (cherry picked from commit a537b4af4ded29ee715a950f47887cb5367b9825) --- README.md | 2 +- test/src/register_types.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f4f3be0c..ca9a7384 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) { if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) { return; } - ClassDB::register_class(); + GDREGISTER_CLASS(Example); } ``` diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp index a673dee0..04bd7286 100644 --- a/test/src/register_types.cpp +++ b/test/src/register_types.cpp @@ -21,14 +21,14 @@ void initialize_example_module(ModuleInitializationLevel p_level) { return; } - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(true); - ClassDB::register_abstract_class(); - ClassDB::register_class(); - ClassDB::register_class(); - ClassDB::register_class(); + GDREGISTER_CLASS(ExampleRef); + GDREGISTER_CLASS(ExampleMin); + GDREGISTER_CLASS(Example); + GDREGISTER_VIRTUAL_CLASS(ExampleVirtual); + GDREGISTER_ABSTRACT_CLASS(ExampleAbstractBase); + GDREGISTER_CLASS(ExampleConcrete); + GDREGISTER_CLASS(ExampleBase); + GDREGISTER_CLASS(ExampleChild); } void uninitialize_example_module(ModuleInitializationLevel p_level) { From 66ced64c1ed790d9ef3b51ea5595b7aef2c202be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 19:23:26 +0000 Subject: [PATCH 2/5] Bump mymindstorm/setup-emsdk from 13 to 14 Bumps [mymindstorm/setup-emsdk](https://github.com/mymindstorm/setup-emsdk) from 13 to 14. - [Release notes](https://github.com/mymindstorm/setup-emsdk/releases) - [Commits](https://github.com/mymindstorm/setup-emsdk/compare/v13...v14) --- updated-dependencies: - dependency-name: mymindstorm/setup-emsdk dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] (cherry picked from commit 32ca574f494b3e45b1ce2224f4f4e271cbd7c822) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ada01e93..764a06f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: - name: Web dependencies if: ${{ matrix.platform == 'web' }} - uses: mymindstorm/setup-emsdk@v13 + uses: mymindstorm/setup-emsdk@v14 with: version: ${{env.EM_VERSION}} actions-cache-folder: ${{env.EM_CACHE_FOLDER}} From ef4d771444e60890ca8b1262ae868863db962347 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Thu, 18 Jan 2024 14:22:16 -0600 Subject: [PATCH 3/5] Implement `verbose` toggle from godot repo (cherry picked from commit b05c21bb1d41cfc1f94140884059da93a80ce43e) --- .github/workflows/ci.yml | 8 ++--- tools/godotcpp.py | 73 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 764a06f6..89258520 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,22 +134,22 @@ jobs: - name: Generate godot-cpp sources only run: | - scons platform=${{ matrix.platform }} build_library=no ${{ matrix.flags }} + scons platform=${{ matrix.platform }} verbose=yes build_library=no ${{ matrix.flags }} scons -c - name: Build godot-cpp (debug) run: | - scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} + scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} - name: Build test without rebuilding godot-cpp (debug) run: | cd test - scons platform=${{ matrix.platform }} target=template_debug ${{ matrix.flags }} build_library=no + scons platform=${{ matrix.platform }} verbose=yes target=template_debug ${{ matrix.flags }} build_library=no - name: Build test and godot-cpp (release) run: | cd test - scons platform=${{ matrix.platform }} target=template_release ${{ matrix.flags }} + scons platform=${{ matrix.platform }} verbose=yes target=template_release ${{ matrix.flags }} - name: Download latest Godot artifacts uses: dsnopek/action-download-artifact@1322f74e2dac9feed2ee76a32d9ae1ca3b4cf4e9 diff --git a/tools/godotcpp.py b/tools/godotcpp.py index 5ba2742b..13a57e96 100644 --- a/tools/godotcpp.py +++ b/tools/godotcpp.py @@ -3,6 +3,7 @@ import os, sys, platform from SCons.Variables import EnumVariable, PathVariable, BoolVariable from SCons.Variables.BoolVariable import _text2bool from SCons.Tool import Tool +from SCons.Action import Action from SCons.Builder import Builder from SCons.Errors import UserError from SCons.Script import ARGUMENTS @@ -66,6 +67,67 @@ def get_custom_platforms(env): return platforms +def no_verbose(env): + colors = {} + + # Colors are disabled in non-TTY environments such as pipes. This means + # that if output is redirected to a file, it will not contain color codes + if sys.stdout.isatty(): + colors["blue"] = "\033[0;94m" + colors["bold_blue"] = "\033[1;94m" + colors["reset"] = "\033[0m" + else: + colors["blue"] = "" + colors["bold_blue"] = "" + colors["reset"] = "" + + # There is a space before "..." to ensure that source file names can be + # Ctrl + clicked in the VS Code terminal. + compile_source_message = "{}Compiling {}$SOURCE{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + java_compile_source_message = "{}Compiling {}$SOURCE{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + compile_shared_source_message = "{}Compiling shared {}$SOURCE{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + link_program_message = "{}Linking Program {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + link_library_message = "{}Linking Static Library {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + ranlib_library_message = "{}Ranlib Library {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + link_shared_library_message = "{}Linking Shared Library {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + java_library_message = "{}Creating Java Archive {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + compiled_resource_message = "{}Creating Compiled Resource {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + generated_file_message = "{}Generating {}$TARGET{} ...{}".format( + colors["blue"], colors["bold_blue"], colors["blue"], colors["reset"] + ) + + env.Append(CXXCOMSTR=[compile_source_message]) + env.Append(CCCOMSTR=[compile_source_message]) + env.Append(SHCCCOMSTR=[compile_shared_source_message]) + env.Append(SHCXXCOMSTR=[compile_shared_source_message]) + env.Append(ARCOMSTR=[link_library_message]) + env.Append(RANLIBCOMSTR=[ranlib_library_message]) + env.Append(SHLINKCOMSTR=[link_shared_library_message]) + env.Append(LINKCOMSTR=[link_program_message]) + env.Append(JARCOMSTR=[java_library_message]) + env.Append(JAVACCOMSTR=[java_compile_source_message]) + env.Append(RCCOMSTR=[compiled_resource_message]) + env.Append(GENCOMSTR=[generated_file_message]) + + platforms = ["linux", "macos", "windows", "android", "ios", "web"] # CPU architecture options. @@ -254,6 +316,7 @@ def options(opts, env): ) opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", True)) opts.Add(BoolVariable("dev_build", "Developer build with dev-only debugging code (DEV_ENABLED)", False)) + opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False)) # Add platform options (custom tools can override platforms) for pl in sorted(set(platforms + custom_platforms)): @@ -381,8 +444,16 @@ def generate(env): env.Tool("compilation_db") env.Alias("compiledb", env.CompilationDatabase(normalize_path(env["compiledb_file"], env))) + # Formatting + if not env["verbose"]: + no_verbose(env) + # Builders - env.Append(BUILDERS={"GodotCPPBindings": Builder(action=scons_generate_bindings, emitter=scons_emit_files)}) + env.Append( + BUILDERS={ + "GodotCPPBindings": Builder(action=Action(scons_generate_bindings, "$GENCOMSTR"), emitter=scons_emit_files) + } + ) env.AddMethod(_godot_cpp, "GodotCPP") From ab5b9f2ceb5b3bb7e4188b14e7f361e0d162d545 Mon Sep 17 00:00:00 2001 From: thimenesup Date: Sun, 14 Apr 2024 20:27:53 +0200 Subject: [PATCH 4/5] Fix Projection create_orthogonal being incorrect Title (cherry picked from commit e4ae69f607fca68ca8521b384095acad2788390e) --- src/variant/projection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/variant/projection.cpp b/src/variant/projection.cpp index c28e6513..ddedc93f 100644 --- a/src/variant/projection.cpp +++ b/src/variant/projection.cpp @@ -136,7 +136,7 @@ Projection Projection::create_for_hmd(int p_eye, real_t p_aspect, real_t p_intra Projection Projection::create_orthogonal(real_t p_left, real_t p_right, real_t p_bottom, real_t p_top, real_t p_znear, real_t p_zfar) { Projection proj; - proj.set_orthogonal(p_left, p_right, p_bottom, p_top, p_zfar, p_zfar); + proj.set_orthogonal(p_left, p_right, p_bottom, p_top, p_znear, p_zfar); return proj; } From 77f1d228cd84051bcd60ce7792e25884902920a9 Mon Sep 17 00:00:00 2001 From: Chris Cranford Date: Tue, 16 Apr 2024 00:01:55 -0400 Subject: [PATCH 5/5] Fix PropertyInfo to use hint/usage default constants (cherry picked from commit e160966163a4ccf04b531903adc88d9531af309a) --- include/godot_cpp/core/property_info.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/godot_cpp/core/property_info.hpp b/include/godot_cpp/core/property_info.hpp index 0ecfa322..901cc951 100644 --- a/include/godot_cpp/core/property_info.hpp +++ b/include/godot_cpp/core/property_info.hpp @@ -47,9 +47,9 @@ struct PropertyInfo { Variant::Type type = Variant::NIL; StringName name; StringName class_name; - uint32_t hint = 0; + uint32_t hint = PROPERTY_HINT_NONE; String hint_string; - uint32_t usage = 7; + uint32_t usage = PROPERTY_USAGE_DEFAULT; PropertyInfo() = default;