Commit graph

4235 commits

Author SHA1 Message Date
Bastiaan Olij 5228871e26
Only cleanup meta data if GDNative library is reloadable and we're about to unload it
(cherry picked from commit 81131bd844)
2021-04-06 10:03:41 +02:00
Jan Haller f64d9423a5
Fixes #47607 (forgotten statement in GDNative cleanup)
Co-authored-by: geekrelief <geekrelief@gmail.com>
(cherry picked from commit 0fe851da23)
2021-04-05 12:02:56 +02:00
Francois Belair 4e8e887748 Implement LSP didDeleteFiles to clear diagnostics
Fixes #43133
2021-04-01 13:41:53 -04:00
Kyle b38a36923a
Fix gdnative config file set as null
Fixes #45997.

Setting a GDNativeLibrary config file as null or any other object but a ConfigFile will now cause an error.

(cherry picked from commit 618dd892f5)
2021-03-31 21:32:12 +02:00
geekrelief 2bf0b2996a
fixes #46839, ensure library_classes is cleared and free funcs are called
Co-authored-by: toasteater <48371905+toasteater@users.noreply.github.com>
Co-authored-by: Jan Haller <bromeon@gmail.com>
(cherry picked from commit 58fa4973f6)
2021-03-29 16:26:40 +02:00
Rémi Verschelde acbd1e8b02
Merge pull request #46781 from BastiaanOlij/gdn_set_interface
Add set_interface for access by GDNative
2021-03-26 11:27:27 +01:00
Rémi Verschelde 015973df04
doc: Make all tutorial links point to 3.3 branch of docs 2021-03-26 10:43:43 +01:00
Paul Joannon 596169d7df
class reference proofreading
(cherry picked from commit 8455e901f3)
2021-03-26 09:49:07 +01:00
Bastiaan Olij 717f3227ec ARVR GDNative enhancements:
- add set_interface function
- add access to depth buffer
- add supplying a depth buffer from an ARVR plugin
2021-03-25 22:37:47 +11:00
Francois Belair 7f8fe58825 Make LSP parser aware of variables in sub-blocks
Fixes #43164 and Fixes godotengine/godot-vscode-plugin#207
2021-03-24 16:52:38 -04:00
Rémi Verschelde 92daf26043
SCons: Don't pass -msse2 to MSVC for Embree
This is a flag only supported by GCC/Clang.
2021-03-24 13:13:18 +01:00
Rémi Verschelde 1aba997d75
doc: Sync classref with 3.3 version bump 2021-03-23 13:40:34 +01:00
Alex Hirsch 44855c40da
FBX Import: Normalize rotation quaternions
fix #47174

(cherry picked from commit 72d3bfc88c)
2021-03-23 13:16:09 +01:00
Matthew A. Robinson b4455ffd75 Add mutex protecting script bindings map from getting corrupted 2021-03-22 20:26:44 -04:00
Alex Hirsch 2c93256432
FBX Import: Check bone map access for valid cluster target node id
fix #47184

(cherry picked from commit d03f4cefea)
2021-03-20 23:09:02 +01:00
Rémi Verschelde a0f56b5459
Mono: Fix Android build after #46900
(cherry picked from commit 2274d4eebc)
2021-03-18 17:58:49 +01:00
Ilya Kuznetsov cacf96962d
Added mono_unhandled_exception call to unhandled_exception hook
(cherry picked from commit 6061ff7ba1)
2021-03-17 15:17:02 +01:00
Rémi Verschelde 33628c482f
miniupnpc: Update to version 2.2.2
(cherry picked from commit 69486b1059)
2021-03-17 15:16:59 +01:00
Rémi Verschelde e6b291b152
Mono: Bump Godot.NET.Sdk to 3.3.0
Using only 3.3 results in a build warning.

Follow-up to #47055.
2021-03-17 14:46:26 +01:00
Rémi Verschelde 0341251d0f
Bump version to 3.3-rc
We decided to rename the upcoming 3.2.4 release to 3.3 to better reflect that
it is a significant feature release, and not a maintenance update.

The `3.2` branch was also renamed to `3.x` and will now be the development
branch for future 3.x releases (3.3, 3.4, etc.).
2021-03-16 12:16:36 +01:00
Hugo Locurcio ee8661158c
Document the valid input range for acos() and atan()
(cherry picked from commit d359e159da)
2021-03-16 11:37:26 +01:00
Haoyu Qiu 871843bbdc Fix uninitialized GridMapEditor::node 2021-03-16 10:20:56 +08:00
Fabio Alessandrelli 50f0f51604 [Net] Fix miniupnpc when no interface is specified
This is a tricky one, it used to work, but it was wrong, because in such
a scenario instead of passing NULL as required by the API, it would pass
a buffer containing the `\0` terminator.
This stopped working on a specific miniupnpc version, when they fixed
some network endianess issue on Windows, to which we made a workaround,
which in turn would probably result in failures when the interface is
specified.

This commit address the issue properly, by checking the specified
interface string size, and correctly passing NULL instead of the empty
string when necessary.

Also reverts the commit that introduced the bogus workaround:
388adac947

One of those PR when the explanation is much longer then code changes
:).
2021-03-15 18:12:05 +01:00
Ev1lbl0w a586f9daae
Replace malloc's with Godot's memalloc macro
(cherry picked from commit 838e7d0a8d)
2021-03-13 22:01:27 +01:00
Ignacio Etcheverry 10c8438178
C#: Fix StringName leak warnings after generating bindings
`Main::cleanup()` prints warnings if it finds `StringName`s still alive.
We need the `BindingsGenerator` to be destructed before calling cleanup.

(cherry picked from commit d9603b2d73)
2021-03-13 21:56:31 +01:00
jfons ab3b7a57f2 Fix visibility toggle for baked GridMaps
(cherry picked from commit 809d88b925)
2021-03-12 13:26:10 +01:00
Rémi Verschelde 3f246ebeed
Merge pull request #46932 from JFonS/fix_lm_capture_env
[3.2] Batch of lightmapper fixes and minor improvements
2021-03-12 12:30:36 +01:00
JFonS e2c28675ef Batch of lightmapper fixes and minor improvements
- Fix objects with no material being considered as fully transparent by the lightmapper.
- Added "environment_min_light" property: gives artistic control over the shadow color.
- Fixed "Custom Color" environment mode, it was ignored before.
- Added "interior" property to BakedLightmapData: controls whether dynamic capture objects receive environment light or not.
- Automatically update dynamic capture objects when the capture data changes (also works for "energy" which used to require object movement to trigger the update).
- Added "use_in_baked_light" property to GridMap: controls whether the GridMap will be included in BakedLightmap bakes.
- Set "flush zero" and "denormal zero" mode for SSE2 instructions in the Embree raycaster. According to Embree docs it should give a performance improvement.
2021-03-12 12:00:53 +01:00
O01eg 18eca32761 Fix visibility for GCC
(cherry picked from commit 1393ededfd)
2021-03-12 10:07:48 +01:00
Rémi Verschelde 0d8182d2b1 NoiseTexture: Fix regression in starting thread
Was a regression from #45618.

Fixes #46907.
2021-03-11 21:58:53 +01:00
Duddino aabb8d78ef Added some checks to prevent accessing a null collider
Previously godot would try to access
`CollisionObjectBullet::bt_collision_object` even if it was null.
Fixes #46651

(cherry picked from commit c47070e165)
2021-03-07 22:51:06 +01:00
Rémi Verschelde 558d524bcb Mono: Don't use C++17 [[maybe_unused]] to preserve C++14 compatibility
The 3.2 branch compiles against the C++14 standard to keep good compatibility
with somewhat older compilers.

Fixes #45839.
2021-03-05 23:28:09 +01:00
Shane Liesegang 4d06a5c2b0 Mono/macOS: Separate data dir into frameworks and resources for codesigning
Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
(cherry picked from commit 42eb09ddcc)
2021-03-04 12:21:17 +01:00
Fabian 2aafe2b25e Add set_peer_timeout to NetworkedMultiplayerENet.
(cherry picked from commit 1b54de3039)
2021-03-02 10:26:14 +01:00
Aaron Franke b2d723b039 Add generic support to PackedScene.Instance
(cherry picked from commit 3f50954ced)
2021-03-02 10:26:14 +01:00
Bastiaan Olij 9c296bcb59 Fix duplicate check for bone names in FBX import 2021-03-02 10:55:29 +11:00
Jack Linhart 8190305075 Added GridMap description to get_bake_meshes()
(cherry picked from commit 03fd2b4c86)
2021-02-25 22:37:29 +01:00
Hugo Locurcio b3c01392fd Document seamless noise having a lower contrast than non-seamless noise
See #41787.

(cherry picked from commit 2e8e6e26a8)
2021-02-25 22:37:04 +01:00
Taylor C. Richberger 59b82e1b6a remove invalid codeLensProvider value from lsp
codeLensProvider was false, it may not be a boolean like some of the other providers can, only optionally present.

(cherry picked from commit 91ce8d5fff)
2021-02-25 22:34:56 +01:00
Rémi Verschelde 92d59d0879 SCons: Properly handle overriding default values to bool options
The `dev=yes` and `production=yes` options work as aliases to set a number of
options, while still aiming to allow overriding specific options if the user
wishes so. (E.g. `production=yes use_lto=no` should work to enable production
defaults *but* disable LTO.)

That wasn't working as `ARGUMENTS.get()` returns a string and not a boolean as
expected by `BoolVariable`, and this wasn't flagged as a bug... So added a
helper method using SCons' `BoolVariable._text2bool` to do the conversion
manually.
2021-02-24 10:20:46 +01:00
Rémi Verschelde 6b2cfa416c SCons: Work around compilation issue on Linux ARM64
Fixes #45687.

This is really just a band-aid, our current buildsystem doesn't work well for
cross-compilation and needs a thorough refactoring to do so.
2021-02-23 14:08:45 +01:00
Pedro J. Estébanez 6f4f49c1d5 Make glue generation shutdown more graceful
(cherry picked from commit 23907e6f19)
2021-02-22 21:40:16 +01:00
Angad Kambli 327586f582 fix minor issue in smooth step function's documentation
(cherry picked from commit 892060fa47)
2021-02-22 14:16:42 +01:00
Marcel Admiraal e89ba5fb49 Add missing semicolons to webxr.eterns.js
(cherry picked from commit 92e0a84a4c)
2021-02-22 10:17:23 +01:00
Vignesh1-art 13871deb57 Fixed Invalid function bindings #46135
Fixed  GDScriptLanguageProtocol::notify_client - have 3 arguments, but only 2 are binded

(cherry picked from commit a5d931033e)
2021-02-18 23:46:54 +01:00
Rémi Verschelde 001aaa7131
Merge pull request #45356 from asmaloney/fix-lightmap-raycaster-compile
[3.2] Fix sign comparison error in lightmap_raycaster.cpp
2021-02-18 21:09:29 +01:00
Pedro J. Estébanez 4485b43a57 Modernize atomics
- Based on C++11's `atomic`
- Reworked `SafeRefCount` (based on the rewrite by @hpvb)
- Replaced free atomic functions by the new `SafeNumeric<T>`
- Replaced wrong cases of `volatile` by the new `SafeFlag`
- Platform-specific implementations no longer needed

Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
2021-02-18 12:23:25 +01:00
Pedro J. Estébanez 6d89f675b1 Modernize Thread
- Based on C++11's `thread` and `thread_local`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed (except for the few cases of non-portable functions)
- Simpler for `NO_THREADS`
- Thread ids are now the same across platforms (main is 1; others follow)
2021-02-18 11:58:08 +01:00
Pedro J. Estébanez 8f6a636ae7 Modernize Semaphore
- Based on C++11's `mutex` and `condition_variable`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
2021-02-18 11:58:08 +01:00
Pedro J. Estébanez 4ddcdc031b Modernize Mutex
- Based on C++11's `mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
- `BinaryMutex` added for special cases as the non-recursive version
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
2021-02-18 11:58:08 +01:00
JFonS 71d4e47452 Fix missing include in MacOS builds 2021-02-17 11:19:28 +01:00
Ellen Poe fc0419d84a
Fix mono->stereo conversion for oggs (see #40630)
(cherry picked from commit f993d2eeee)
2021-02-16 14:27:40 +01:00
Ellen Poe 5db83defcd
Fail mp3 loading when attempting to load invalid mp3s
This also adds a warning for unspecified MP3 loading error codes

(cherry picked from commit 936767deca)
2021-02-16 14:27:40 +01:00
Rafał Mikrut 54b6a7b8b7
Fix memory leak in Xatlas module
(cherry picked from commit e57b8d79ec)
2021-02-16 14:27:38 +01:00
Bastiaan Olij 8aa022f99c
Only unload the library when no NativeScript objects exist if the reloadable flag is true. If it is false it is likely the library does other things and can't be unloaded
(cherry picked from commit ae7675065a)
2021-02-16 14:27:38 +01:00
JFonS 56bf256d76 Add options to reduce lightmaps disk usage.
Added BakedLightmap.use_hdr and BakedLightmap.use_color properties
that can reduce the flie size of lightmap texture at the expense of quality.

Changed the denoiser to work in a single buffer, reducing RAM
usage. Also added the `-mstackrealign` flag in the denoiser compilation
for MinGW builds. This flag helped fix a bug in Embree, so I want to see
if it will help fix GH #45296.
2021-02-16 13:20:27 +01:00
JFonS 7241139356 Backport EXR compression support from master 2021-02-15 12:51:55 +01:00
Meriipu 347a9df0a1
GDScript: Clarified/fixed inaccuracies in the built-in function docs.
The input to smoothstep is not actually a weight, and the decscription
of smoothstep was pretty hard to understand and easy to misinterpret.

Clarified what it means to be approximately equal.

nearest_po2 does not do what the descriptions says it does. For one,
it returns the same power if the input is a power of 2. Second, it
returns 0 if the input is negative or 0, while the smallest possible
integral power of 2 actually is 1 (2^0 = 1). Due to the implementation
and how it is used in a lot of places, it does not seem wise to change
such a core function however, and I decided it is better to alter the
description of the built-in.

Added a few examples/clarifications/edge-cases.

(cherry picked from commit 7f9bfee0ac)
2021-02-11 13:12:06 +01:00
Gordon MacPherson 53aee600d3 fixed bug in vertex duplication breaking meshes 2021-02-09 16:33:46 +00:00
Kanabenki 3abe6ae281
Snap VisualScript comment to grid when resizing
(cherry picked from commit 07fb7f9888)
2021-02-08 22:36:36 +01:00
Rémi Verschelde f36c529ad0
Merge pull request #45752 from JFonS/cpu_lightmapper_fixes
Assorted CPU lightmapper fixes
2021-02-06 11:44:52 +01:00
JFonS 27c1e65969 Assorted CPU lightmapper fixes
- Fix crash when a ray hits a texel with a UV2 coordinate exactly
  equal to 1.0.
- Take BakedLightmap extents into account.
- Clear capture data between bakes.
- Fix minor issues with seam correction.
2021-02-05 19:18:19 +01:00
Hugo Locurcio 4a74f6f3b7 Document that GridMap doesn't support visual layers or cull masks
See #40245.

(cherry picked from commit 95fda7e881)
2021-02-05 10:26:03 +01:00
bruvzg 9e4cecc8ea [Mono] Use the same search logic for both MSBuild and dotnet, add custom search paths on macOS.
(cherry picked from commit e304f716c7)
2021-02-05 09:29:29 +01:00
Rémi Verschelde f42f6ed01c
Merge pull request #45702 from hpvb/fix-tga-crash-32
[3.2] Fix a crash in the TGA loader with malformed input
2021-02-04 14:47:37 +01:00
Hein-Pieter van Braam-Stewart 113b5ab1c4 Fix a crash in the TGA loader with malformed input 2021-02-04 13:10:03 +01:00
zaevi f94dffd2de
Fix C# string.Hash()
(cherry picked from commit baac70c27e)
2021-02-02 13:30:54 +01:00
David Snopek 0eb6dfa04a
Remove reference to CanvasLayer in WebXR example, because it can cause rendering issues in AR.
(cherry picked from commit f6e8da3661)
2021-02-02 13:02:46 +01:00
Ivan Shakhov 7ecc2561cd
Fix off by one error navigating to line number in Rider
Fixes https://github.com/JetBrains/godot-support/issues/61

(cherry picked from commit deef9a73a5)
2021-02-02 13:02:46 +01:00
Rémi Verschelde 07f169af72
Merge pull request #45353 from asmaloney/fix-lightmapper_cpu-compile-error
[3.2] Fix undeclared identifier error (rand) in lightmapper_cpu
2021-02-02 12:35:42 +01:00
Hugo Locurcio 351efc334e
Fix WebXRInterface code sample in the class reference
This also fixes the code sample's indentation to look correct in the
editor help.
2021-01-31 00:00:25 +01:00
Aaron Franke 226528097e
[3.2] Backport hex_to_int/bin_to_int zero check and C# changes 2021-01-28 09:24:44 -05:00
David Snopek 5625dc502c Prevent fatal error in WebXR when 'immersize-ar' loses and regains tracking 2021-01-27 20:22:40 -06:00
Rémi Verschelde 9ba95970ad
Merge pull request #45445 from dsnopek/webxr-mono
[3.2] Support mono devices in WebXR
2021-01-27 21:11:56 +01:00
geekrelief 311ca0c6f2
Removes the gdnative library when no script (gdns) references it any longer. This enables hot reload for gdnative.
(cherry picked from commit cc5d8bb5ad)
2021-01-26 22:10:29 +01:00
Ignacio Etcheverry 44d8669364
C#: Fix System.Collections.Generic.List marshalling
(cherry picked from commit da90364adf)
2021-01-26 17:00:17 +01:00
Rémi Verschelde 9f2c24e8ce
Cleanup: Remove executable bit from files which don't need it
Drop unused xpmfix.sh script.

(cherry picked from commit 76c6007aa6)
2021-01-26 17:00:15 +01:00
Rémi Verschelde 21746ce714
Merge pull request #45347 from lucasvanmol/patch-1
[3.2] Fix highlight color for class attributes that are also keywords
2021-01-26 15:56:29 +01:00
Rémi Verschelde 061f87e064
Merge pull request #45336 from naithar/feature/plugins-migration-3.2
[3.2] [iOS] iOS Plugins Migration
2021-01-26 15:06:46 +01:00
Yuri Sizov a9552cefa2 Fix minimap capturing events and improve its theme
Add an editor setting for minimap opacity in visual editors
2021-01-25 21:49:34 +03:00
David Snopek dca9f09386 Support mono devices in WebXR 2021-01-25 08:36:29 -06:00
Andy Maloney 95cc19d320 Fix sign comparison error in lightmap_raycaster.cpp
Compiling with latest clang on macOS produces this error:

comparison of integers of different signs: 'uint32_t' (aka 'unsigned int') and 'int' [-Werror,-Wsign-compare]

This file is not present in 4.0/master.
2021-01-21 16:07:25 -05:00
Andy Maloney 85377e96d2 Fix undeclared identifier error in lightmapper_cpu.cpp
Compiling with latest clang on macOS produced this error: use of undeclared identifier 'rand'.

Fixes godotengine/godot#45342

This file is not present in 4.0/master.
2021-01-21 13:07:30 -05:00
Andy Maloney 77f045db99 Fix const warnings in FBX (build failure on macOS)
Fixes several instances of error: 'const' type qualifier on return type has no effect [-Werror,-Wignored-qualifiers]

This looks like it was fixed in 6607fc7da9
when FBX was merged into the 4.0 master branch:

"- fixed const correctness with C++/C version change"
2021-01-21 11:18:44 -05:00
lucasvanmol 6742f6894e
Fix highlight color for class attributes that are also keywords
Fixes #45338. 
This PR also makes any word after a "." not highlight as a keyword, i.e. the cos
in Color.cos will highlight the same as any other class constant. Additionally,
trying to do things like ".print()" will not highlight print as a keyword but as
a class function.
2021-01-21 11:46:32 +00:00
Rafał Mikrut d025194602 Remove thread after use to prevent memory leak 2021-01-20 09:37:25 +01:00
Rémi Verschelde 2fa93d8514
Merge pull request #45279 from magian1127/3.2
[3.2] Mono: Fix support for Unicode identifiers
2021-01-19 15:15:02 +01:00
Rémi Verschelde 544f0bfff1
Merge pull request #45291 from RandomShaper/fix_lightmapper_mingw_3.2
Fix crash in lightmapper under MinGW-GCC Windows (3.2)
2021-01-18 19:40:20 +01:00
Pedro J. Estébanez 89237c8952 Fix crash in lightmapper under MinGW-GCC Windows 2021-01-18 18:28:11 +01:00
Lyuma 2c2f70c444 embree: cross compile fixes.
Fix typos in #if; add missing _MSC_VER; avoid warning in random generator.
2021-01-18 06:20:24 -08:00
magian1127 cb679dc434 C # mono supports Unicode code 2021-01-18 16:34:10 +08:00
Sergey Minakov d4096285b6 [iOS] Remove plugins from modules. 2021-01-17 14:46:03 +03:00
Hugo Locurcio dc2e568352
Mention that NetworkedMultiplayerENet uses UDP only
This is important to clarify for those doing port forwarding.

(cherry picked from commit 7b33498995)
2021-01-15 16:49:46 +01:00
Rémi Verschelde 0f5d475100
Merge pull request #41340 from naithar/feature/pluggable-ios-modules-3.2
[iOS] [3.2] iOS Plugins
2021-01-15 16:13:45 +01:00
Rémi Verschelde 497653ab53
Merge pull request #44628 from JFonS/new_cpu_lightmapper_3.2
[3.2] New CPU lightmapper
2021-01-15 13:25:46 +01:00
JFonS b1ca82c43a CPU lightmapper fixes.
- Fix Embree runtime when using MinGW (patch by @RandomShaper).
- Fix baking of lightmaps on GridMaps.
- Fix some GLSL errors.
- Fix overflow in the number of shader variants (GLES2).
2021-01-15 12:32:54 +01:00
Rémi Verschelde d298949513
Merge pull request #42882 from madmiraal/fix-39767-3.2
[3.2] Set Bullet collision shape index to zero when using a single shape or ConcavePolygonShape
2021-01-14 20:46:06 +01:00
Rémi Verschelde 152415a006
Merge pull request #43924 from madmiraal/fix-43588-3.2
[3.2] Fix cast_motion sometimes failing
2021-01-14 20:44:40 +01:00
JFonS 7d7d7ef16d CPU lightmapper formatting and minor fixes. 2021-01-14 18:08:33 +01:00
JFonS 112b416056 Implement new CPU lightmapper
Completely re-write the lightmap generation code:
- Follow the general lightmapper code structure from 4.0.
- Use proper path tracing to compute the global illumination.
- Use atlassing to merge all lightmaps into a single texture (done by @RandomShaper)
- Use OpenImageDenoiser to improve the generated lightmaps.
- Take into account alpha transparency in material textures.
- Allow baking environment lighting.
- Add bicubic lightmap filtering.

There is some minor compatibility breakage in some properties and methods
in BakedLightmap, but lightmaps generated in previous engine versions
should work fine out of the box.

The scene importer has been changed to generate `.unwrap_cache` files
next to the imported scene files. These files *SHOULD* be added to any
version control system as they guarantee there won't be differences when
re-importing the scene from other OSes or engine versions.

This work started as a Google Summer of Code project; Was later funded by IMVU for a good amount of progress;
Was then finished and polished by me on my free time.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2021-01-14 18:05:56 +01:00