1214 Commits

Author SHA1 Message Date
4d5d707d60 Merge pull request #1572 from dsnopek/4.1-cherrypicks-13
Cherry-picks for the godot-cpp 4.1 branch - 13th batch
2024-09-11 17:15:09 -05:00
fad74366cd Fix GCC 14 -Wtemplate-id-cdtor warning
As was fixed with godotengine/godot#91208

(cherry picked from commit 7b31f39bea)
2024-09-04 10:16:26 -05:00
d421c98461 [Web/SCons] Use CCFLAGS for SIDE_MODULE option
Was using CPPFLAGS, but should use the explicit scons CCFLAGS which
makes it clear they are applied to both the C and C++ compiler.

CPPFLAGS was also fine (they are preprocessor flags, also applied to
both C and C++), but we should try to stay consistent with what we do
in Godot.

(cherry picked from commit f36acd8e31)
2024-09-04 10:16:17 -05:00
592a7762cd [4.2] Fix missing MAKE_TYPED_ARRAY_INFO for Packed*Arrays
(cherry picked from commit a0d56336c3)
2024-09-04 10:16:01 -05:00
76c0a4b4ae Fix incorrect generation of some C++ operators
(cherry picked from commit 9949d09f3e)
2024-09-04 10:13:33 -05:00
67145b323b Avoid hardcoded type conversion for metadata
The engine uses the names `int` and `float` to refer to the 64-bit types, so in the bindings generator we have a hardcoded conversion for those types.

But this type conversion should not be used for metadata. Even though the underlying type should still be 64-bit for interop, metadata is meant to specify the correct type to expose. So if metadata says `float` it means the type is really meant to be a 32-bit `float` and not `double`. Other hardcoded type conversions (`int` and `Nil`) won't ever be metadata.

This change corrects the `float` type, to use the right type in the generated C++ code. Before we were always using `double` due to this type conversion.

(cherry picked from commit 4829199081)
2024-09-04 10:13:23 -05:00
d529fc5b69 removes warnings generated by GDCLASS usage
This change removes the warnings (unused parameters) coming from code injected by the GDCLASS macro.
Contrary to warnings coming from the normal source code which can be suppressed with most compiles by specifying the include directories of this library as external or system,
when the code is injected through a macro it is considered in the context of the user, which is the source code of user of the library.
That forces the users to modify their code to hide the warnings coming from the mandatory `GDCLASS` here.
That's why it's important to remove these warning from that specific macro and ideally any other macro that the user must use.

(cherry picked from commit 738859f49b)
2024-09-04 10:10:04 -05:00
9a4ba00b0e Make sure _get and _set dispatch up the class hierarchy
(cherry picked from commit c77d44f3f6)
2024-09-04 10:09:27 -05:00
bc6cfd70d8 SCons: Remove old Python 2 compat code
(cherry picked from commit 958776dfc3)
2024-09-04 10:09:15 -05:00
09b735ac97 [CI] Upload build cache before running tests
(cherry picked from commit 76b38de01a)
2024-09-04 10:03:23 -05:00
9e860a84a0 [Web] Force emcc to use "wasm" longjmp mode
SUPPORT_LONGJMP have changed since emscripten 3.1.32 to default to
"wasm" mode when exceptions are enabled, and "emscripten" mode when
disabled.

While we generally doesn't use exception in core, linked libraries may
need them, and emscripten don't plan to support WASM EH + Emscripten
SjLj in the long term.

(cherry picked from commit 1bb543b6f4)
2024-09-04 10:03:13 -05:00
9b4c5f0562 [SCons] Add option to build without threads
This is relevant for the Web platform, where builds with and without
threads are incompatible.

(cherry picked from commit b0296bb562)
2024-09-04 09:58:58 -05:00
a4f9d22ac5 Merge pull request #1529 from dsnopek/4.1-cherrypicks-12
Cherry-picks for the godot-cpp 4.1 branch - 12th batch
2024-07-17 12:28:25 -05:00
7dd2d24805 Fix sharing of typed arrays from constructor
(cherry picked from commit 41aa71f8c3)
2024-07-17 09:58:09 -05:00
18b81efbf3 Fix argument metadata when binding methods
While there doesn't seem to be any runtime issues,
this triggers the address sanitizer in a few ways,
depending on what kind of method you're
binding.

(cherry picked from commit 2b34bd0d8b)
2024-07-17 09:57:10 -05:00
430637bf1a SCons: Add silence_msvc option
(cherry picked from commit 1989b1bf57)
2024-07-17 09:57:01 -05:00
ca26922a19 Integrate .pre-commit-config.yaml
(cherry picked from commit e0d363aad8)
2024-07-17 09:56:32 -05:00
edce0b7178 Fix #include formatting
(cherry picked from commit 999018e7d1)
2024-07-17 09:53:29 -05:00
23325b9ab0 Add .editorconfig, consolidate .gitattributes
(cherry picked from commit 7a96d0314e)
2024-07-17 09:53:19 -05:00
208b70dbef [CI] Update macOS workers to macos-latest
GitHub actions no longer allow `macos-11` runners

(cherry picked from commit 2dd8917508)
2024-07-17 09:53:07 -05:00
1f57a8d76e Fix some style details in generation
(cherry picked from commit e7a13e3bf4)
2024-07-17 09:48:31 -05:00
f16814ee05 Enforce p_ prefixes for arguments in binds
(cherry picked from commit 9e2771f918)
2024-07-17 09:37:59 -05:00
22beef8cbc Add support for build profiles.
Allow enabling or disabling specific classes (which will not be built).

(cherry picked from commit 1186c488bd)
2024-07-17 09:34:07 -05:00
2e7f5512d1 Merge pull request #1491 from dsnopek/4.1-cherrypicks-11
Cherry-picks for the godot-cpp 4.1 branch - 11th batch
2024-06-14 13:32:54 -05:00
5880be034c [4.1] Allow selecting Godot version to run the tests with
(cherry picked from commit f88b6a2f00)
2024-06-14 11:44:39 -05:00
a648650c5d Add default argument processing for NodePath
(cherry picked from commit 37e7a6da05)
2024-06-14 10:40:04 -05:00
65058828a6 Fix generating default values for StringName
Cases other than `&""` were not processed correctly

(cherry picked from commit 6cd6c8923a)
2024-06-14 10:38:34 -05:00
f067a9bff0 Fix vararg methods forwarded to the ClassDB singleton
(cherry picked from commit e04a26b2bc)
2024-06-14 10:37:44 -05:00
6ba31a1800 Fix warnings emitted with -Wall
(cherry picked from commit 8c6cc1ec15)
2024-06-14 10:37:27 -05:00
8269c0102a Explicitly refer to godot namespace in GDREGISTER_*_CLASS() macros
(cherry picked from commit 246a803954)
2024-06-14 10:31:04 -05:00
5f864cd8de [Scons] Added the ability to change the visibility of symbols
(cherry picked from commit f5e4f95cde)
2024-06-14 10:28:30 -05:00
32becf6a13 Merge pull request #1466 from dsnopek/4.1-cherrypicks-10
Cherry-picks for the godot-cpp 4.1 branch - 10th batch
2024-05-28 08:35:20 -05:00
7b93607779 Fix NOTIFICATION_POSTINITIALIZE sent twice to native parent class
(cherry picked from commit 06373ce1cf)
2024-05-17 17:11:27 -05:00
1ab42ec6c5 mark return value of get_class_static and get_parent_class_static as const
(cherry picked from commit 3db8549e19)
2024-05-17 16:58:32 -05:00
6328728dc2 Allow forwarding from ClassDB to ClassDBSingleton to support enumerations
(cherry picked from commit e1b3b32db5)
2024-05-17 16:57:33 -05:00
6123c86f06 Correctly handle Object * arguments that were encoded as nullptr
(cherry picked from commit 37542dc2ec)
2024-05-17 16:56:37 -05:00
fff665e0f5 Give compile-time error if registering a class without its own _bind_methods() function
(cherry picked from commit ca46ef4d25)
2024-05-17 16:55:41 -05:00
82ea3f74a4 Add static_assert() for register_class
(cherry picked from commit 1fa7a9cb19)
2024-05-17 16:54:44 -05:00
11cd9a0727 [Math] Add is_finite methods
(cherry picked from commit d389171905)
2024-05-17 16:54:00 -05:00
a75e33c333 Implement to/from dict helpers for PropertyInfo/MethodInfo
(cherry picked from commit 2a041b5240)
2024-05-17 16:53:43 -05:00
d24983d682 Backport miscellaneous changes that can't be cherry-picked
(cherry picked from commit 9afbdb9cf6)
2024-05-17 16:51:42 -05:00
4b0ee13327 gdextension: Sync with upstream commit fe0e8e55752b0c2e64997025717b491703e0f8ad (4.1.4-stable) godot-4.1.4-stable 2024-04-17 13:02:32 -05:00
e4978558e6 Merge pull request #1441 from dsnopek/4.1-cherrypicks-9
Cherry-picks for the godot-cpp 4.1 branch - 9th batch
2024-04-17 12:58:30 -05:00
30ebe5fdf9 Fix PropertyInfo to use hint/usage default constants
(cherry picked from commit e160966163)
2024-04-17 11:01:33 -05:00
e897dbe58a Fix Projection create_orthogonal being incorrect
Title

(cherry picked from commit e4ae69f607)
2024-04-17 11:00:56 -05:00
28a6609c0b Implement verbose toggle from godot repo
(cherry picked from commit b05c21bb1d)
2024-04-17 10:58:41 -05:00
7f3e725a8a 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] <support@github.com>
(cherry picked from commit 32ca574f49)
2024-04-17 10:58:31 -05:00
8e5d7c9268 Use GDREGISTER defines in example
(cherry picked from commit a537b4af4d)
2024-04-17 10:58:16 -05:00
974e6c6f86 Merge pull request #1411 from dsnopek/4.1-cherrypicks-8
Cherry-picks for the godot-cpp 4.1 branch - 8th batch
2024-04-08 13:09:01 -05:00
c8fa4c0fd0 Fix incorrect utility call signature
(cherry picked from commit d055b575fb)
2024-04-08 11:40:05 -05:00