Compare commits

...

1525 Commits
master ... 3.2

Author SHA1 Message Date
Rémi Verschelde 2407df9870
The 3.2 branch is now unmaintained, superseded by 3.3 and 3.x 2021-04-19 15:03:05 +02:00
Rémi Verschelde 67b2f3ed25
CI: Backport GitHub Actions from 3.x branch
Ensures that we have a configuration that is currently usable.

Some changes for the `3.2` branch as it's unmaintained:
- No cache
- No artifacts upload
- Uses clang-format 10
- No JavaScript linting
2021-04-19 15:02:58 +02:00
Rémi Verschelde 31d0f8ad8d
Bump version to 3.2.3-stable
A fairly big new release fixing many issues all around the engine,
as well as bringing many improvements for C# users.

Thanks to all contributors! <3
2020-09-16 17:12:35 +02:00
Rémi Verschelde f5d6424648
Add changelogs for 3.2.x releases 2020-09-16 17:11:34 +02:00
Hugo Locurcio 97251c70ec
Mention compatibility-breaking Camera2D offset change in the changelog
See https://github.com/godotengine/godot/issues/42088.

(cherry picked from commit dc1e79589a)
2020-09-16 16:23:22 +02:00
Hugo Locurcio 939de03db7
Cross-reference AABB getter methods in the documentation
This also clarifies that `get_aabb()` returns the AABB in local space.

See https://github.com/godotengine/godot/issues/42095.

(cherry picked from commit 9712f8fd2d)
2020-09-16 16:22:39 +02:00
Rémi Verschelde ee5971a185
Donors: Add Gamblify, remove Interblock from splash screen
(cherry picked from commit 92d1964d1a)
2020-09-16 16:14:31 +02:00
Rémi Verschelde 2179c852da
Merge pull request #42113 from Calinou/deprecate-interpolatedcamera
Mark InterpolatedCamera as deprecated
2020-09-16 16:13:28 +02:00
Hugo Locurcio 369e5a7f35
Mark InterpolatedCamera as deprecated
InterpolatedCamera has already been removed from the `master` branch.
This adds a deprecation notice to inform people about the upcoming removal
in Godot 4.0.

Its functionality could be replicated in a GDScript add-on with relative
ease.
2020-09-16 15:36:40 +02:00
Rémi Verschelde 16eb7b95be
Merge pull request #42102 from Calinou/doc-animationtreeplayer-deprecation
Mention the AnimationTreePlayer deprecation in the class reference
2020-09-16 08:13:27 +02:00
Hugo Locurcio 868776949b
Mention the AnimationTreePlayer deprecation in the class reference
There's a node configuration warning already, but you can only
see it after adding the node to your scene.
2020-09-16 00:19:32 +02:00
Fabio Alessandrelli f1b2a7d1b4
Fix certificate generation with mbedtls 2.16.8 .
When generating certificates with
`Crypto.generate_self_signed_certificate` we generate the PEM in a
buffer via `mbedtls_x509write_crt_pem`.

Since version 2.16.8, mbedtls adds spurious data at the end of the
buffer due to internal optimizations, this breaks our logic when we try
to immediately parse it and return a proper `X509Certificate` object.

This commit updates the code to find the actual PEM length to parse
using `strlen`, takes extra caution always adding the terminator to the
buffer, and slightly improve error messages.

(cherry picked from commit 60687ce778)
2020-09-15 19:27:48 +02:00
Rémi Verschelde 3170ebc0e2
makerst: Add missing newline at EOF
(cherry picked from commit d435537f7e)
2020-09-15 19:26:44 +02:00
Hugo Locurcio 34a0af8343
Clarify that 2D cell sizes are defined in pixels
See https://github.com/godotengine/godot/issues/40577#issuecomment-662329021.

(cherry picked from commit f83249f224)
2020-09-15 19:26:43 +02:00
Danil Alexeev 06f3cd8bd8
Several documentation improvements
(cherry picked from commit a4c5790350)
2020-09-15 19:26:40 +02:00
Rémi Verschelde 576bd0565c
Merge pull request #42091 from clayjohn/Sprite3d-bug
Fix axis bug regression in Sprite3D
2020-09-15 17:15:26 +02:00
clayjohn a4f2fea2ae Fix axis bug regression in Sprite3D 2020-09-15 08:02:19 -07:00
Rémi Verschelde e1856aaa92
Merge pull request #42062 from madmiraal/fix-41743-3.2
[3.2] Fix Bullet prioritised list of Areas a RigidBody is a member of element shift.
2020-09-15 10:19:15 +02:00
Marcel Admiraal edc4820430 Fix RigidBodyBullet areasWhereIam element shift. 2020-09-14 18:26:19 +01:00
Hugo Locurcio 738f6ea221
Document how to remove metadata from an Object
This closes https://github.com/godotengine/godot-docs/issues/4010.

(cherry picked from commit cba4d73b71)
2020-09-14 14:24:14 +02:00
Tom Daffin 46b4e82f92
Add mono log message to error for fatal errors
(cherry picked from commit c15fb42d45)
2020-09-14 12:07:12 +02:00
Ebrahim Ebrahim 508dde662a
Clarify get_data Image method
(cherry picked from commit b9764b6109)
2020-09-14 11:00:50 +02:00
skyace65 de9a5b6229
Improve AudioEffectDistortion and AudioEffectFilter documentation
(cherry picked from commit 959f2287f6)
2020-09-14 11:00:49 +02:00
hoontee b626f16212
Fix "Create Trimesh Collision Sibling" transform
(cherry picked from commit 3cbd626328)
2020-09-14 11:00:47 +02:00
Rémi Verschelde df2a907ba6
Merge pull request #42045 from awkwardpolygons/fix-3.2-texarr-importer-options
Fix #42043, mismatched compress options in ResourceImporterLayeredTex…
2020-09-14 10:33:11 +02:00
Adrien e90467ef66 Fix #42043, mismatched compress options in ResourceImporterLayeredTexture 2020-09-14 15:36:46 +08:00
Ignacio Etcheverry cdc9fe154f
C#: Fix csproj not synced on file move/removal from FS dock
When NormalizePath was called with an absolute
path (with drive letter) on Windows, it would
prepend a file path separator to the path, e.g.:
'\C:\Program Files\'.
Apparently this was still accepted as a valid
path by DotNetGlob and it stopped working when
we switched to MSBuildGlob.

(cherry picked from commit 1db0395950)
2020-09-13 12:35:34 +02:00
Rémi Verschelde cd62be1845
Merge pull request #41996 from Rubonnek/disconnect-item-rect-changed-3.2
[3.2] Disconnect item_rect_changed removing a child of GraphEdit
2020-09-12 15:27:03 +02:00
Wilson E. Alvarez 2b7c9d9070
Disconnect item_rect_changed when removing a child of GraphEdit 2020-09-11 17:36:55 -04:00
PouleyKetchoupp 819765130d
Fix RichTextLabel alignment for clickable regions
Fixes #41006 (regression from #39164).

The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.

(cherry picked from commit b783fa1416)
2020-09-11 11:15:40 +02:00
Martin Capitanio d38eb29f2e
git: Ignore clangd cache folder
(cherry picked from commit 0b34607bb8)
2020-09-10 13:11:04 +02:00
Rémi Verschelde 36fa6369fc
stb_vorbis: Increase max alloc buffer size for big Vorbis comments
The previous max worked OK for audio data, but stb_vorbis recently gained support
for Vorbis comments, which can embed up to 2^32-1 bytes of data (e.g. cover art
encoded as base64).

We use 2^30 as max which should be sufficient for most files.

Fixes #41913.

(cherry picked from commit d16f5a57c1)
2020-09-10 12:04:19 +02:00
Hugo Locurcio 74952764f3
Improve documentation related to Array error handling
This closes https://github.com/godotengine/godot-docs/issues/3834.

(cherry picked from commit 263f620421)
2020-09-10 12:04:07 +02:00
Haz 935edf9323
Fix tilemap tiles on horizontal/vertical flips
(cherry picked from commit 3f5413693c)
2020-09-10 12:03:45 +02:00
Rémi Verschelde 49b3750b36
Merge pull request #41893 from Calinou/doc-batching-gles2-only
Document that batching is only effective when using the GLES2 renderer
2020-09-09 08:16:21 +02:00
Hugo Locurcio 2bc6298bce
Document that batching is only effective when using the GLES2 renderer 2020-09-09 00:58:25 +02:00
Ignacio Etcheverry 8c5ed68847
C#: Use BOM when creating a solution
At least on Windows there seems to be issues if
the solution has no BOM and contains a project
with cyrillic chars.

(cherry picked from commit 1c74fa4242)
2020-09-08 22:02:24 +02:00
Rémi Verschelde 93c15c2e97
Merge pull request #41887 from neikeq/3.2-issue-40001
[3.2] C#: Fix endless reload loop if project has unicode chars
2020-09-08 20:21:40 +02:00
Ignacio Etcheverry e72ee23c43 [3.2] C#: Fix endless reload loop if project has unicode chars
The assembly modified time wasn't picked properly
as the path was treated as latin-1, so the file
watcher was constantly firing the event.
2020-09-08 19:47:47 +02:00
Rémi Verschelde 0eda951512
Update AUTHORS and DONORS list
New contributor added to AUTHORS:
@EricEzaM

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit 9d209bfc3d)
2020-09-08 17:23:16 +02:00
Marcel Admiraal 3697cc479d
Initialise Basis elements with a default Basis in the declaration.
Ensures a valid Basis is created with all constructors.

(cherry picked from commit 9149fb760c)
2020-09-08 15:04:54 +02:00
Rémi Verschelde 4a9264271d
doc: Sync classref with current source 2020-09-08 14:20:53 +02:00
Rémi Verschelde c5f6d2097b
i18n: Sync translations with Weblate
Add translators comment for the two 'Project Manager' strings,
and fix some of the translations.
2020-09-08 14:05:53 +02:00
Marcel Admiraal f26131fca5
Check if old mouse column is still available.
(cherry picked from commit 79802b31a9)
2020-09-08 13:39:32 +02:00
PouleyKetchoupp 43b49607bb
Fix TURN server example in WebRTC documentation
WebRTC GDNative plugin uses `credential` and not `credentials`.
74f2c78db5/src/WebRTCLibPeerConnection.cpp (L35-L37)

(cherry picked from commit 280496a2c3)
2020-09-08 13:39:18 +02:00
PouleyKetchoupp c21d14fe69
Fix LineEdit not consuming enter events
LineEdit should not return early when processing KEY_ENTER, so it can
consume the event properly.

Regression introduced by mistake while fixing enter events for Android
(PR #40487 - c0b394572f)

(cherry picked from commit 5c63dec36e)
2020-09-08 13:38:58 +02:00
Rémi Verschelde 3f276033c1
Merge pull request #41536 from Chaosus/vs_fix_specular_3.2
[3.2] Fix specular render_mode for visual shaders
2020-09-08 09:46:12 +02:00
Rémi Verschelde 8af31c64de
Merge pull request #41869 from akien-mga/3.2-ok-but-who-wouldnt-want-gdscript
Fix build with GDScript support disabled
2020-09-08 09:29:29 +02:00
Rémi Verschelde 8ae2a84fb6
Fix build with GDScript support disabled
Fixes #41710.
2020-09-08 09:14:25 +02:00
Fabio Alessandrelli 48de626949
Update mbedTLS to version 2.16.8 (+ patch).
(cherry picked from commit a905764e3d)
2020-09-08 08:56:33 +02:00
Hugo Locurcio 77a6766b3e
Clarify the required child node type in the GridContainer documentation
This closes #41822.

(cherry picked from commit 40b5331d79)
2020-09-08 08:56:13 +02:00
Marcel Admiraal 5f1dd48496
Replace calls to gmtime with gmtime_r and localtime with localtime_r.
(cherry picked from commit 4b3aec50c0)
2020-09-08 08:55:26 +02:00
Rémi Verschelde c6ee088431
Merge pull request #41859 from SkyLucilfer/TranslatorComment32
Backport translator comment PR to 3.2
2020-09-07 21:14:06 +02:00
Rémi Verschelde a30d8e231d
Merge pull request #41860 from akien-mga/3.2-scons-fixup-py2
SCons: Fix regression in Python 2 support
2020-09-07 21:12:54 +02:00
SkyJJ 1ba5917da9 Backport translator comment PR to 3.2 2020-09-07 21:03:25 +02:00
Rémi Verschelde 217dbdc9e7
SCons: Fix regression in Python 2 support
Introduced in 7e1312055b by not using
the compat method.

Fixes #41858.
2020-09-07 20:29:21 +02:00
Rémi Verschelde 784e854e58
Merge pull request #41837 from m4gr3d/fix_custom_defines_update_logic
Fix the update logic for user-added custom defines.
2020-09-07 08:29:29 +02:00
Fredia Huya-Kouadio 0af5cded1e Fix the update logic for user-added custom defines.
The previous logic was causing the (unintentional) removal of custom defines automatically added by the engine.
2020-09-06 21:31:09 -07:00
Rémi Verschelde 13e2e487a2
Merge pull request #41800 from alexdlm/fix-csproj-read-3.2
[3.2] Handle csproj "Remove" globs
2020-09-06 08:42:51 +02:00
Alex de la Mare 6474e036ac [3.2] Handle csproj "Remove" globs
MSBuild Item returns empty strings if an attribute isn't set (which
 caused an IndexOutOfRangeException in NormalizePath).

 We were treating Excludes incorrectly, Remove directives provide the
 intended behaviour in the auto-including csproj format.
2020-09-06 12:10:54 +10:00
Rémi Verschelde 41b9e1d7ea i18n: Sync translations with Weblate 2020-09-04 08:53:53 +02:00
Hugo Locurcio c040e8f93a Document missing character behavior when drawing text with fonts
See #40405.

(cherry picked from commit 7735d8d0ce)
2020-09-04 08:50:32 +02:00
Rafał Mikrut 9caa35532a Fixes leak with creating editor settings
(cherry picked from commit 599ccbb7d4)
2020-09-04 08:49:58 +02:00
Marcel Admiraal c6cccdf0c6 Ensure header guards enclose entire header.
(cherry picked from commit f6ad1954f7)
2020-09-04 08:48:35 +02:00
Hugo Locurcio ee97e45a69 Improve the resource loading error message to mention the need to import
This is a common pitfall when setting up projects in a headless
environment.

(cherry picked from commit 58ed3037c0)
2020-09-04 08:48:17 +02:00
Andrii Doroshenko (Xrayez) 6122a504ee Build the engine with custom modules in Visual Studio
First, compile the engine normally with:
```
scons custom_modules="path/to/your/modules" vsproj=yes
```
Then run the Visual Studio project. You can now rebuild the engine if
you need to make changes to custom modules directly within IDE.

(cherry picked from commit 6eb4b89eef)
2020-09-04 08:46:54 +02:00
Ignacio Etcheverry 9699e83e1e Fix parsing of C# files with spaces in the path
(cherry picked from commit 9e8a5e4b5a)
2020-09-04 08:24:17 +02:00
Rémi Verschelde 9efd555c58
Merge pull request #41754 from neikeq/3.2-csharp-hide-build-button-if-no-proj
[3.2] C#: Hide Build button if there's no solution to build
2020-09-04 08:20:06 +02:00
Rémi Verschelde 93eb9b554e
Merge pull request #41752 from neikeq/fix-invalidopexception-csproj-migration
[3.2] Fix InvalidOperationException when migrating from 3.2.1 or older csproj
2020-09-04 08:19:18 +02:00
Rémi Verschelde 1edd6aa404
Merge pull request #41751 from neikeq/3.2-issue-41745
[3.2] C#: Fix Godot failing to find class namespace
2020-09-04 08:16:30 +02:00
Rémi Verschelde fba07e75e6
Merge pull request #41749 from neikeq/3.2-issue-41712
[3.2] Fix 'Parameter "assembly" is null' error
2020-09-04 08:14:16 +02:00
Ignacio Etcheverry 2bb251f628 [3.2] C#: Hide Build button if there's no solution to build
Same as we do with the bottom panel. Mainly to
avoid bothering if the project is not using C#.
2020-09-04 02:18:42 +02:00
Ignacio Etcheverry f8e3a74f9e Fix InvalidOperationException when migrating from 3.2.1 or older csproj 2020-09-04 01:49:32 +02:00
Ignacio Etcheverry b3762622be [3.2] C#: Fix Godot failing to find class namespace
Also avoid searching C# files recursively twice.
2020-09-04 01:31:38 +02:00
Ignacio Etcheverry bd18b2ff6a [3.2] Fix 'Parameter "assembly" is null' error
This error was normally being printed when
trying to open the project assembly while
the project was not yet built.
The error should not be printed. It's the job
of this method's caller to decide whether to
print an error or not if loading failed.
2020-09-04 01:09:35 +02:00
Ignacio Etcheverry 939ed5dd5b C#: Fix Windows detection for copying MSBuild stub
Previous condition checked only the host
platform. This was a problem as our official
builds are from Linux.

(cherry picked from commit 206501a45e)
2020-09-03 09:35:41 +02:00
Rémi Verschelde f0cfbf2415
Merge pull request #41713 from Yetizone/3.2
Mention Viewport.render_target_clear_mode property is intended for 2D usage
2020-09-03 07:35:27 +02:00
Yetizone e882d535a7 Mention Viewport.render_target_clear_mode property is intended for 2D usage 2020-09-03 07:57:01 +03:00
Rémi Verschelde 67b1bf33fa
Merge pull request #41717 from Wavesonics/fix-headles-server-lightmap-error
dummy_rasterizer now returns correct instance type: VS::INSTANCE_LIGHTMAP_CAPTURE
2020-09-02 21:49:31 +02:00
Adam Brown a16bedd2d9 dummy_rasterizer now returns lightmap type
Previously VS::INSTANCE_NONE was returned for Lightmap data, this caused `visual_server_scene.cpp` to assert in `instance_set_use_lightmap()`

Now `dummy_rasterizer.h` returns `VS::INSTANCE_LIGHTMAP_CAPTURE` for lightmap capture data thus satisfying `visual_server_scene`
2020-09-02 11:50:36 -07:00
Hugo Locurcio d773de6d24
Document how renaming the project affects the user data path
(cherry picked from commit 386f86cddf)
2020-09-01 21:02:19 +02:00
Hugo Locurcio be126bfd55
Document RigidBodies in character mode never sleeping automatically
See #7996.

(cherry picked from commit 5fbf709ca2)
2020-09-01 21:01:58 +02:00
umarcor b0a6439df9
doc/FileDialog: warn about access limitations in sandboxed apps
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 1ddb0e56ac)
2020-09-01 21:01:32 +02:00
Hugo Locurcio ef7675a053
Document support for normal and specular maps in AnimatedSprite2D
This closes #38509.

(cherry picked from commit 8d0099f5fc)
2020-09-01 21:00:58 +02:00
Rémi Verschelde 138eba1561
Fix invalid CSV in SDL2 controller mappings DB
Follow-up to a61cae1469.

(cherry picked from commit 1e49a86884)
2020-09-01 20:54:32 +02:00
Rémi Verschelde 8a66ea7cb0
Revert "Updated LineEdit to address #41278"
This reverts commit 1b6d116dfb.
2020-09-01 14:01:50 +02:00
Rémi Verschelde 9be924c454
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@d148c6ce49.

(cherry picked from commit a61cae1469)
2020-09-01 10:24:04 +02:00
Rémi Verschelde fad1feb3ad
Merge pull request #41649 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 7th batch
2020-08-31 16:22:25 +02:00
Hugo Locurcio cc3b69cf7b
Reference the online documentation in collision layer/mask properties
See https://github.com/godotengine/godot-docs/pull/3863.

(cherry picked from commit c73c327bab)
2020-08-31 15:55:11 +02:00
Tony-Goat 1b6d116dfb
Updated LineEdit to address #41278
Updated set_max_length() function to actually pull a substring of the current text so it's not all thrown away when the new max length is shorter than the current length.

(cherry picked from commit 71febfd6e2)
2020-08-31 15:53:56 +02:00
Yakov Borevich 63b2f69c7f
[funexpected] clear missed remaps on deinitialization, fixes godotengine/godot#34221
(cherry picked from commit 604bd75438)
2020-08-31 15:29:46 +02:00
Andreas Gustafsson 727bce727b
OptionButton.xml word order fix
Change word order of 'Emitted the when...' into 'Emitted when the...'

(cherry picked from commit 8f082d63c6)
2020-08-31 15:29:44 +02:00
Tomasz Chabora 57810f851c
Explain editor usage of current_animation
(cherry picked from commit 70ce86ad29)
2020-08-31 15:29:43 +02:00
Maganty Rushyendra fdb5561e55
Updated cursor positioning description for File open()
Added more details about the cursor offsets for the different ModeFlags
in the `File` class.

(cherry picked from commit 5e77eea216)
2020-08-31 15:29:43 +02:00
Hugo Locurcio 1f7f28a1eb
Document HTTPRequest not supporting request data with GET method
This also improves the HTTPClient class documentation to be easier
to read and more informative.

This closes #40564.

(cherry picked from commit 2f577facc9)
2020-08-31 15:29:43 +02:00
Hugo Locurcio 6eee52e49b
Improve the documentation related to overriding GUI theme items
Overriding theme items is a common point of confusion.
Hopefully, these code samples should clear things up.

(cherry picked from commit 2a8bbda2a7)
2020-08-31 15:29:43 +02:00
skyace65 92a1c168ea
Clarify get_data texture method
(cherry picked from commit 635c9761a0)
2020-08-31 15:29:43 +02:00
Andrii Doroshenko (Xrayez) 7493bc5530
Make `AnimatedTexture.MAX_FRAMES` public
The constant is already exposed in GDScript, but not in C++.
This information is useful for implementing animated texture
resource importers via modules.

(cherry picked from commit 528056a3c5)
2020-08-31 15:29:43 +02:00
Hugo Locurcio dd057d36dc
Document the GDScript debugger not supporting Thread yet
See https://github.com/godotengine/godot/issues/2446.

(cherry picked from commit dec20883c1)
2020-08-31 15:29:42 +02:00
Hugo Locurcio a23c0aca87
Clarify that `KEY_BACK` is unrelated to the Back button on Android
This closes #19325.

(cherry picked from commit 359c95156a)
2020-08-31 15:29:42 +02:00
Hugo Locurcio afef89014b
Cross-reference GDScript built-in rounding methods to ease discovery
This closes #19315.

(cherry picked from commit 20d0f5bbd7)
2020-08-31 15:29:42 +02:00
skyace65 dea530d5ca
Add information to get thread id
(cherry picked from commit aa08023115)
2020-08-31 15:29:42 +02:00
skyace65 14e1c83350
Improve touch screen button description
(cherry picked from commit 416cac96fa)
2020-08-31 15:29:42 +02:00
skyace65 45e596e02f
Document where the center of mass is for RigidBody nodes
(cherry picked from commit 555f4f3e17)
2020-08-31 15:29:42 +02:00
Hugo Locurcio d0b0dc6333
Remove community health files from this repository
They've been moved to the @godotengine organization's .github
repository, which works as a fallback for all repositories in the
organization. This way, the Sponsor button is automatically displayed
on all repositories.

This closes #40972.

(cherry picked from commit f516dc1198)
2020-08-31 15:29:42 +02:00
Lunatoid 636fe1bab9
Gives the theme editor a horizontal scrollbar
Fixes #34509 where the theme editor would push away the inspector
if something like "hseperation" is really high.
Now `set_enable_h_scroll` is true which fixes this.

(cherry picked from commit d602be077d)
2020-08-31 15:29:41 +02:00
Hugo Locurcio 96ad9dc4c6
Document supported platforms for `Input.get_accelerometer()` and related
This closes #41303.

(cherry picked from commit eee704e6f6)
2020-08-31 15:29:41 +02:00
skyace65 8466f9147b
Mention listener node in AudioStreamPlayer3D description
(cherry picked from commit 51367c1bcf)
2020-08-31 15:29:41 +02:00
Michael Alexsander d7065106ef
State how 'MOUSE_MODE_CAPTURED' actually works in the 'Input' docs
(cherry picked from commit 4f13a7f47f)
2020-08-31 15:29:41 +02:00
Thaina Yu cadd39d415
Mono: Improve MSBuildFinder logic on Windows
Support detecting both 32-bit and 64-bit installations of `vswhere.exe`.

(cherry picked from commit 5dc3900727)
2020-08-31 15:29:41 +02:00
skyace65 2e1e1af1d2
Add defaults to tilemap set_cell function example
(cherry picked from commit 43ab91ca02)
2020-08-31 15:29:41 +02:00
Hugo Locurcio b76aa91402
Mention performance caveats about `find_node()` and `find_parent()`
See https://github.com/godotengine/godot-proposals/issues/1303.

(cherry picked from commit ab2f41f598)
2020-08-31 15:29:31 +02:00
Rémi Verschelde a068f40535
Merge pull request #41603 from Calinou/scons-linuxbsd-x11-alias
Alias the "linuxbsd" platform to "x11" for forward compatibility
2020-08-31 14:18:49 +02:00
Rémi Verschelde 7d825e2c05
Merge pull request #41046 from Calinou/doc-windowdialog-exclusive
Mention caveats for `popup_exclusive` in the WindowDialog documentation
2020-08-31 13:24:09 +02:00
Rémi Verschelde b71f8dbd78
Merge pull request #41615 from hhsdev/3.2-issue-40828
Documentation: specify how WindowDialog's default title bar is made
2020-08-31 12:57:21 +02:00
hhsdev 90ba819e7b Documentation: specify how WindowDialog's default title bar is made 2020-08-31 16:17:53 +06:30
Rémi Verschelde 18fc857b9f
Merge pull request #41612 from neikeq/3.2-issue-41444
[3.2] C#: Fix crash on export when incorrectly freeing MonoAssemblyName
2020-08-30 12:03:11 +02:00
Ignacio Etcheverry 789d7fac8a C#: Fix crash on export when incorrectly freeing MonoAssemblyName 2020-08-30 02:01:38 +02:00
Hugo Locurcio 9790168b48
Alias the "linuxbsd" platform to "x11" for forward compatibility
This makes it possible to follow documentation designed for the
`master` branch while building the `3.2` branch.
2020-08-29 18:09:48 +02:00
Yuri Roubinsky 7facd00ace [3.2] Fix specular render_mode for visual shaders 2020-08-28 13:06:55 +03:00
Rémi Verschelde 6b5102cf90
Merge pull request #41504 from naithar/fix/analyzer-3.2
[3.2] [iOS] Leaks and deprecations fix
2020-08-25 18:37:02 +02:00
Sergey Minakov f81c6c52fc iOS: fix deprecations and leaks
Fixes some deprecations and leaks reported by Xcode Analyzer
2020-08-25 17:17:17 +03:00
Ignacio Etcheverry a8e1a0f0bc
C#: Fix 'Parameter toolsPath cannot be null' error
(cherry picked from commit 2bd6252e92)
2020-08-25 14:36:40 +02:00
Hugo Locurcio 30c4b1b67e
GitHub Actions: Prepend emoji to platform names for easy visual grepping
(cherry picked from commit 82b30f36cb)
2020-08-25 14:36:22 +02:00
Rémi Verschelde 5a96c24243
Revert "Check if global class file still exists before registering it"
And revert follow-up regression fix "Remap script path when registering class."

After the regression fix, the original issue is valid again so it's better
to go back to the previous state.

This reverts commits e264ae20d2 and
fceb64827e.

(cherry picked from commit f13207254c)
2020-08-25 14:33:46 +02:00
Rémi Verschelde 2d42625184
Revert "bug with Tween.is_active, fixes #39760"
This reverts commit 8ef40b9306.
2020-08-25 12:58:40 +02:00
Hugo Locurcio 3b080845a8
Link to 2D Sprite animation tutorial in relevant class documentations
(cherry picked from commit 6d62e8b917)
2020-08-25 12:58:31 +02:00
Tomasz Chabora e880956943
Mention that body_set_state is deferred
(cherry picked from commit 255129a5d9)
2020-08-25 12:58:24 +02:00
Rémi Verschelde c5abc57f8a
Merge pull request #41451 from ThakeeNathees/autocompletion-in-comment-bug
autocompletion inside comments bug fixed
2020-08-24 01:09:48 +02:00
Thakee Nathees d04d329a1f autocompletion inside comments bug fixed
Fix: #41438
2020-08-23 23:01:54 +05:30
Rémi Verschelde dbb0ad3b59
doc: Sync classref with current source 2020-08-21 02:33:44 +02:00
skyace65 5954f82e44
Update CollisionShape2D doc
(cherry picked from commit fe8d998858)
2020-08-21 02:28:28 +02:00
PouleyKetchoupp d82cc621e1
Fix 2D Particle velocity with directed emission mask
Changed CPU velocity calculation for EMISSION_SHAPE_DIRECTED_POINTS
to follow the same logic as in the GPU version:
mat2 rotm;
rotm[0] = texelFetch(emission_texture_normal, emission_tex_ofs, 0).xy;
rotm[1] = rotm[0].yx * vec2(1.0, -1.0);
VELOCITY.xy = rotm * VELOCITY.xy;

Now both CPUParticles2D & CPUParticles3D (z disabled) show the same results
as their GPU counterparts and take the initial velocity settings into account.

(cherry picked from commit 1c231cacb3)
2020-08-21 02:28:19 +02:00
Ignacio Etcheverry f3ed06cfd7
Mono/C#: Fix editor using wrong project assembly path in rare cases
We were removing invalid path characters from the
name in C++ code, but the C# editor code wasn't.

(cherry picked from commit 8bb48ae57a)
2020-08-21 02:28:18 +02:00
Ignacio Etcheverry eb30c04c4d
C#: Save newly created csproj files without BOM
(cherry picked from commit b5f6285f34)
2020-08-21 02:28:18 +02:00
Ignacio Etcheverry a7bd28760e
C#: Fix null exception in our MSBuild logger
(cherry picked from commit 7eed8c5a0c)
2020-08-21 02:28:18 +02:00
skyace65 cd2da16d63
Clarify points in Line2D doc
(cherry picked from commit 3c9c541c59)
2020-08-21 02:28:18 +02:00
Hazar a430f68364
fix GDScript UTI
changed from public.data to public.script

(cherry picked from commit 5e5100afca)
2020-08-21 02:28:18 +02:00
Hugo Locurcio 13175b6387
Document limitations related to centering text with RichTextLabel
This is a relatively common question on various community channels.

(cherry picked from commit 95c2e43095)
2020-08-21 02:28:18 +02:00
Ignacio Etcheverry c8845291c3
C#: Fix editor unable to play game after IDE PlayRequest
The editor wasn't clearing the debugger agent
settings properly after a processing a play
request from an IDE. This caused consequent play
attempts to fail if not launched from the IDE,
as the game would still attempt and fail to
connect to the debugger.

The concrete cause: Forgetting to clear the
`GODOT_MONO_DEBUGGER_AGENT` environment variable.

(cherry picked from commit 6e7da72648)
2020-08-21 02:28:18 +02:00
Hugo Locurcio f90931c47a
Add more error explanations in the BMP image loader
This closes #32166 and closes #30629.

(cherry picked from commit 40485e2479)
2020-08-21 02:28:17 +02:00
Hugo Locurcio a6f0810d51
Make the lack of AtlasTexture support in AnimatedTexture more prominent
See https://github.com/godotengine/godot/issues/33855.

(cherry picked from commit a7ad7ce3bd)
2020-08-21 02:28:17 +02:00
Hugo Locurcio 336bc03d66
Add an editor setting to invert 3D pan/orbit on the X axis
This also makes the invert Y axis option apply to 3D panning.

This closes #28082.

(cherry picked from commit 2c9d4ef961)
2020-08-21 02:28:17 +02:00
Rémi Verschelde 42dca43c50
Merge pull request #41029 from masi456/fix/40888
Make sure that Image is not locked before creation
2020-08-21 02:27:22 +02:00
Rémi Verschelde 2a692f41a3
Merge pull request #41364 from m4gr3d/fix_textedit_movement_bug_3_2
Fix issue causing the textedit to move upward
2020-08-21 02:25:25 +02:00
Rémi Verschelde 4d51c16b28
Merge pull request #41394 from Yetizone/3.2
Viewport Usage enumeration documentation
2020-08-21 02:05:14 +02:00
Rémi Verschelde 20e411545c
Merge pull request #41408 from neikeq/senkyu
3.2 New csproj style with backport of Godot.NET.Sdk
2020-08-21 01:57:54 +02:00
Ignacio Etcheverry c3954441f3 3.2 New csproj style with backport of Godot.NET.Sdk
This is a cherry-pick of
ced77b1e9b
with several 3.2 specific alterations.

There are a lot of build issues coming from
old style projects. At this point fixing every
single one of those would require adding patch
after patch to the project file, which is a
considerable amount work and makes the csproj
even more bloated than it already is.

As such I decided this effort would be better
spent back-porting the Sdk style support that's
already available in 4.0-dev to the 3.2 branch.

This will prevent many issues, but it will also
introduce other benefits, among them:

- While target framework stays as .NET Framework
  v4.7.2, it can be changed to .NET Standard 2.0
  or greater if desired.
- It makes it much easier to add future patches.
  They are added to Godot.NET.Sdk and the only
  change required in Godot code is to update the
  Sdk version to use.
- Default Godot define constants are also
  backported, which fixes IDE issues with the
  preprocessor.

There are a few differences in the changes
applied during patching of the csproj compared
to 4.0 with the purpose of preventing breaking
builds:

- 'TargetFramework' stays net472 both for new
  projects and when importing old ones. It can
  be manually changed to netstandard 2.0+ if
  desired though.

The following features are enabled by default for
new projects. Enabling them in imported projects
may result in errors that must be fixed manually:

- 'EnableDefaultCompileItems' is disabled as it
  can result in undesired C# source files being
  included. Existing include items are kept.
  As long as 'EnableDefaultCompileItems' remains
  disabled, Godot will continue taking care of
  adding and removing C# files to the csproj.
- 'GenerateAssemblyInfo' is disabled as it
  guarantees a build error because of conflicts
  between the existing 'AssemblyInfo.cs' and the
  auto-generated one.
- 'Deterministic' is disabled because it doesn't
  like wildcards in the assembly version (1.0.*)
  that was in the old 'AssemblyInfo.cs'.

Of importance:

This is a breaking change. A great effort was
put in avoiding build errors after upgrading a
project, but there may still be exceptions.

This also breaks forward compatibility. Projects
opened with Godot 3.2.3 won't work out of the box
with older Godot versions. This was already the
case with changes introduced in 3.2.2.

Albeit C# support in 3.2.x was still labeled as
alpha, we've been trying to treat it as stable
for some time. Still the amount of problems this
change solves justifies it, but no more changes
that break project compatibility are to be
introduced from now on (at least for 3.x).
2020-08-20 21:48:59 +02:00
Ignacio Etcheverry 4d7b7d9b73 3.2 C#: Upgrade GodotTools to nuget Microsoft.Build
This upgrade is needed in order to support
reading and editing project files that use Sdks
as well as other new features. A common example
in 3.2 is having to specify a PackageReference
version with a child element rather than the
attribute. This is no longer the case now.

Partial cherry-pick of f3bcd5f8dd
Most of the other changes from that commit were already partially
cherry-picked in 3928fe200f.
2020-08-20 21:45:34 +02:00
Ignacio Etcheverry e1f17a0b35 3.2 C#/Mono: Check assembly version when loading
Not sure if we should check revision too, but this is good enough for what we want.
This will be needed to load the correct Microsoft.Build when we switch to the nuget version.

Manual cherry-pick of af4acb5b11 (relevant parts)
2020-08-20 21:38:33 +02:00
Yetizone 5bc06c7014 Viewport Usage enumeration
Mention that 3D effects are not available when using USAGE_2D
2020-08-20 17:54:14 +03:00
Rémi Verschelde 9bf5a0b791
Merge pull request #41081 from naithar/feature/ios-framework-import-3.2
[iOS] [3.2] Export: Add a method to embed a framework
2020-08-19 14:11:27 +02:00
Sergey Minakov 910c554a1a iOS Export: Add a method to embed a framework
By default 'add_ios_framework' would not embed a framework to save previous behavior.
New 'add_ios_embedded_framework' would embed framework on export.
2020-08-19 14:54:59 +03:00
Rémi Verschelde a43bb5927d
Merge pull request #41346 from lawnjelly/kessel_useless_transform_bug
GLES2 batching - Fix redundant transform synchronization in batches
2020-08-19 10:26:32 +02:00
Fredia Huya-Kouadio a8240f7351 Fix issue causing the textedit to move upward 2020-08-18 17:05:23 -07:00
Rémi Verschelde 5a3096a1cd
Merge pull request #41088 from clayjohn/DOCS-32-Sprite3D
Update Sprite3D docs to reflect recent changes
2020-08-18 23:38:58 +02:00
lawnjelly 2961d905bb GLES2 batching - Fix redundant transform synchronization in batches
In rare circumstances an item would issue multiple transform commands before a (non rect) draw command. The command syncronization would incorrectly start from first transform, instead of the current transform in these circumstances, which could have the result of missing drawing some commands from the end of the batch.

This had been shown in the wild occuring in debug collision polys. It was a benign error (sometimes visual elements would be lost), but did not cause any serious problems.

This PR fixes this synchronization error.
2020-08-18 08:37:07 +01:00
Rémi Verschelde 212744e7a5
Merge pull request #41318 from ThakeeNathees/autocompletion-enhanced-for-class-level
Auto completion enhanced for extends and class level identifier
2020-08-17 14:54:44 +02:00
Rémi Verschelde 2e7129c248
Merge pull request #41327 from bruvzg/win_tablet_modifiers3
[Windows] Fix modifier keys when using tablet input.
2020-08-17 14:38:15 +02:00
bruvzg 2b996cca67
[Windows] Fix modifier keys when using tablet input. 2020-08-17 14:43:23 +03:00
Rémi Verschelde a6ef6b10b2 Revert "Fixes the get_visible_line_count() of rich text label"
This reverts commit dc7e9d46e6.
2020-08-17 11:21:36 +02:00
Gordon MacPherson c1a5e9f513 fixed linker being slow on OSX
(cherry picked from commit 788c521ce8)
2020-08-17 11:05:53 +02:00
Michael Alexsander 8adfeda6f8 Make the editor's 'CheckButton' icon be smaller
(cherry picked from commit 0c182ce8e8)
2020-08-17 11:05:27 +02:00
Hugo Locurcio 62256e0b3a Reference Range signals in the Slider class documentations
See https://github.com/godotengine/godot-docs/issues/3837.

(cherry picked from commit eaa52cbb36)
2020-08-17 11:05:04 +02:00
Cheeseness e70b165c61 Skip indentation of empty lines when indenting a selection.
(cherry picked from commit 1f159306ed)
2020-08-17 11:04:36 +02:00
Hugo Locurcio d4740ee643 Document the lack of kerning support in DynamicFont
(cherry picked from commit e506479fce)
2020-08-17 11:04:32 +02:00
Thakee Nathees d53f5b55ec Auto completion enhanced for extends and class level identifier 2020-08-17 12:54:01 +05:30
Rémi Verschelde a10ae31c0f
Merge pull request #41315 from clayjohn/Polygon2D-crash
Check arrays before generating Polygon2D AABBs
2020-08-17 08:46:50 +02:00
Rémi Verschelde 5acc78ac81
Merge pull request #41314 from clayjohn/Sprite3D-uvs
Check for uncompressed uvs in Sprite3D
2020-08-17 08:44:51 +02:00
clayjohn 8571f7b041 Check arrays before generating Polygon2D AABBs 2020-08-16 21:08:52 -07:00
clayjohn d33a9aaacb Check for uncompressed uvs in Sprite3D 2020-08-16 19:19:14 -07:00
Rémi Verschelde 72d12289bb
Merge pull request #41286 from bruvzg/macos_on_top_3
[macOS] Fix "on top" not set on init, and resetting on window update.
2020-08-15 17:59:12 +02:00
bruvzg 2b1cfad591
[macOS] Fix "on top" not set on init, and reseting on window update. 2020-08-15 18:05:59 +03:00
Rémi Verschelde 13a615bd9c
Merge pull request #41235 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 6th batch
2020-08-14 00:42:25 +02:00
Rémi Verschelde e283d4b5c8 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@hinlopen, @naithar, @rrcore, @SkyLucilfer, @TwistedTwigleg

Thanks to all contributors and donors for making Godot possible!

---

Also changes to relevant code that parses the DONORS.md to match
the new tiers.

(cherry picked from commit d2d4c1c957)
2020-08-14 00:32:05 +02:00
Tomasz Chabora 7ce476c425 Expose NOTIFICATION_POST_ENTER_TREE
(cherry picked from commit 677796a2c3)
2020-08-14 00:32:05 +02:00
Umang Kalra 330afdd6cb Fix RichTextLabel center alignment bug
Fixes #40207.

(cherry picked from commit cec21ab82c)
2020-08-14 00:32:05 +02:00
Thakee Nathees b62872d5bc Documentation: clarify the indent parameter of JSON.print
(cherry picked from commit 3609351788)
2020-08-14 00:32:05 +02:00
Tomasz Chabora f592600ee8 Mention that Array.front/back throw error if empty
(cherry picked from commit 4ff1a34171)
2020-08-14 00:32:05 +02:00
Hazar 58a30199b4 grow_mask() description added
Description;
> Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied.

(cherry picked from commit 1c61c8ab55)
2020-08-14 00:32:05 +02:00
Gordon MacPherson 5db6095bde update to use scons compile db tool
(cherry picked from commit 974a4cde9d)
2020-08-14 00:32:05 +02:00
Maganty Rushyendra 69dc9c9417 Fix tile placement preview for rotated, skewed or scaled TileMaps
Ensures that the editor preview when placing a tile on a TileMap takes
into account the transformation of the TileMap. Previously, only the
origin of the Tile was transformed, but not its orientation or
scaling.

(cherry picked from commit cf04aabef1)
2020-08-14 00:32:05 +02:00
Antoine Félix 3211a51be8 Modify the scene only when color changed
Editor now changes a color in the inspector only when it is different
from the current one.

Solves fake unsaved changes in editor after using the ColorPicker.

Resolves: #40879
(cherry picked from commit f3626364fc)
2020-08-14 00:32:05 +02:00
Tomasz Chabora cea16907bb Properly disambiguate unsaved scripts
(cherry picked from commit 3082def404)
2020-08-14 00:32:05 +02:00
Andreas Haas abdcb7d299 DirectInput: use correct joypad id
Previously `joypad_count` was used as the index into the d_joypads array when initializing a new gamepad.
This caused the accidental override of an already connected device when a gamepad with a lower id was disconnected and connected again.

fixes #17566

(cherry picked from commit 802a0316c5)
2020-08-14 00:32:05 +02:00
Christopher Davis f19bab5165 platform: Update metadata for export platforms
Updates the logos of for macOS, Android, and iOS.

Addresses https://github.com/godotengine/godot-proposals/issues/1161

(cherry picked from commit 41d8c0c818)
2020-08-14 00:32:05 +02:00
Tomasz Chabora 5433b8470c Improve Vector2.angle() description
(cherry picked from commit a09078e64b)
2020-08-14 00:32:05 +02:00
Hugo Locurcio 0429779835 Improve the project README
- Use the SVG version of the logo.
- Mention console support in the first paragraph.
- Point contributors to the `#godotengine-devel` IRC channel.
- Improve formatting for better readability.
- Add more links when needed.
- Fix warnings reported by markdownlint.

(cherry picked from commit b0713e9e6c)
2020-08-14 00:32:04 +02:00
Hugo Locurcio c2d7d81ac8 Fix inconsistent indentation in the FreeDesktop MIME type XML
(cherry picked from commit 4dc6efc08e)
2020-08-14 00:32:04 +02:00
bruvzg b0aabf2c03 [macOS] Fix crash on failed `fork`.
(cherry picked from commit d6e3a8a137)
2020-08-14 00:32:04 +02:00
Rémi Verschelde 5972495d99 Revert "Virtual keyboard size adjustment fixes"
Also reverts "[3.2] Move PopupWindow logic to GodotEditText on Android".

This reverts commits 69db38742f and.
ff0ada164b.
2020-08-14 00:32:04 +02:00
Fabio Alessandrelli a97b84378c Remap script path when registering class.
Was causing `class_name`-defined scripts to not being loaded in exported
games due to the remap from `*.gd` to `*.gdc`/`*.gde`.

(cherry picked from commit fceb64827e)
2020-08-14 00:32:04 +02:00
Rémi Verschelde f732cea0ff
Merge pull request #41231 from lawnjelly/force_inlines_are_evil
Removes some superfluous FORCE_INLINES
2020-08-13 23:07:34 +02:00
lawnjelly e126b941be Removes some superfluous FORCE_INLINES
Compiler is usually in the best position to decide whether to inline functions. Great care must be taken using FORCE_INLINE because it can have unforeseen consequences with recursion, loops and bloat to the executable.

Here some FORCE_INLINES are removed in order to allow the compiler to make best choice and remove a compilation warning where unable to inline during a recursive function.

Fixes #41226
2020-08-13 17:58:47 +01:00
Rémi Verschelde abf019d810
Merge pull request #41187 from bruvzg/fix_repeat_null_termination
Add missing NULL termination to the String::repeat function.
2020-08-11 16:37:01 +02:00
bruvzg 8dab067c01
Add missing NULL termination to the String::repeat function. 2020-08-11 17:23:44 +03:00
Rémi Verschelde 900949b316 i18n: Sync translations with Weblate 2020-08-11 16:07:11 +02:00
Rémi Verschelde 6477481e68
Merge pull request #41131 from totlmstr/3.2-missing-svg
[3.2] Add missing #ifdef SVG_ENABLED
2020-08-11 11:52:05 +02:00
Rémi Verschelde 702a16ffc4
Merge pull request #41146 from capnm/capnm-32x-pr41139
[3.2] Add option to disable virtual keyboard for TextEdit
2020-08-11 11:48:54 +02:00
Rémi Verschelde efbeafd08c
Merge pull request #41041 from qarmin/leak_bullet_shape
[3.2] Fixes leak when creating bullet shape
2020-08-10 19:47:08 +02:00
Rémi Verschelde bbb4999292
Merge pull request #41126 from Razoric480/fix-enum-line-number
Fix line num of enums reported as the line before
2020-08-10 19:25:01 +02:00
Martin Capitanio 71bad8dba6 Add option to disable virtual keyboard for TextEdit
Adding support for disabling virtual keyboard on mobile platforms, in
order to make it consistent with LineEdit.

It allows implementing a custom virtual keyboard.

See: https://github.com/godotengine/godot/pull/41139
2020-08-09 18:22:11 +02:00
totlmstr f550af9da7 Add missing #ifdef SVG_ENABLED 2020-08-08 14:03:14 -07:00
Francois Belair e3f16a83dc Fix line num of enums reported as the line before 2020-08-08 11:52:25 -04:00
clayjohn 8fdbf61df8 Update Sprite3D docs to reflect recent changes 2020-08-06 13:10:39 -07:00
Marcel Schneider c62ce03679 Make sure that a new image can only be created when the buffer is not currently locked 2020-08-05 20:55:31 +02:00
Hugo Locurcio 793694fc40
Mention caveats for `popup_exclusive` in the WindowDialog documentation
This closes #41045.
2020-08-05 12:01:31 +02:00
Rafał Mikrut 808615ec3e Fixes leak when creating bullet shape 2020-08-05 10:08:05 +02:00
Rémi Verschelde 23b553ba06
Merge pull request #40914 from akien-mga/3.2-ci-emscripten-1.39.20
CI: Pin Emscripten version to 1.39.20 to fix regression
2020-07-31 14:29:22 +02:00
Rémi Verschelde 1244986f98 CI: Pin Emscripten version to 1.39.20 temporarily
1.40.0 introduced a regression for us:
https://github.com/emscripten-core/emscripten/issues/11771

This is not necessary in the master branch, presumably because
it doesn't build any WebGL code (yet).
2020-07-31 14:09:33 +02:00
Hugo Locurcio fc7451204e Improve JSON-related documentation
This closes https://github.com/godotengine/godot-docs/issues/3848.

(cherry picked from commit 930e10ffff)
2020-07-31 13:09:21 +02:00
codetorex 3869b82bc1 Added missing information about File.open_encrypted function to docs.
(cherry picked from commit 3f6a7c74e3)
2020-07-31 13:08:59 +02:00
TheDuriel 7e9b7b0462 Clarify TreeItem return values
(cherry picked from commit 0ff1ca4655)
2020-07-31 13:08:40 +02:00
Hugo Locurcio 7c728f0ee4 Add an example for creating a button in the Button class documentation
This closes https://github.com/godotengine/godot-docs/issues/3798.

(cherry picked from commit 8836c7203b)
2020-07-31 13:08:24 +02:00
Rémi Verschelde c49be9bf84
Merge pull request #40791 from nekomatata/android-keyboard-cleaning-3.2
[3.2] Move PopupWindow logic to GodotEditText on Android
2020-07-31 13:00:50 +02:00
Rémi Verschelde f4d6830949
Merge pull request #40869 from clayjohn/3.2-polygon-aabb
Properly calculate polygon2D AABB with skeleton
2020-07-31 12:55:47 +02:00
clayjohn 32928c2112 Properly calculate polygon2D AABB with skeleton 2020-07-30 16:40:05 -07:00
Hugo Locurcio 78a6a57884 makerst: Add descriptions to method qualifiers
This closes https://github.com/godotengine/godot-docs/issues/1753.

(cherry picked from commit c162a39c7b)
2020-07-30 22:46:16 +02:00
Marcel Admiraal c8d8134288 Ensure CSG parent's _make_dirty() is called when entering a tree.
(cherry picked from commit 9be7b30f35)
2020-07-30 22:45:17 +02:00
Hugo Locurcio 2987fb3b45 Improve the `EditorInterface.get_editor_viewport()` description
This closes https://github.com/godotengine/godot-docs/issues/1109.

(cherry picked from commit 60d40d8430)
2020-07-30 16:27:11 +02:00
Hugo Locurcio 2494224f96 Link to Thread-safe APIs in the Thread class documentation
This closes https://github.com/godotengine/godot-docs/issues/2276.

(cherry picked from commit f50a4b8a3b)
2020-07-30 16:26:55 +02:00
Rémi Verschelde 6d2f8dd827 doc: Sync classref with current source 2020-07-30 16:26:45 +02:00
Rémi Verschelde 19802f7dc0
Merge pull request #33646 from NeoSpark314/gles2_highp
Added option to enable high precision float in GLES2
2020-07-30 07:52:29 +02:00
Holger Dammertz efe6b50f17 Added option to enable high precision float in GLES2
An additional project setting under rendering/gles2/compatibility with the name
enable_high_float.Android is introduced that enables #define USE_HIGHP_PRECISION
in GLES2 shader on Android when it is supported by the shader compiler.
This fixes #33633 and #32813 and also https://github.com/GodotVR/godot_oculus_mobile/issues/60
and https://github.com/GodotVR/godot_oculus_mobile/issues/68 on devices that
support the highp (high precision) modifier.
2020-07-30 05:40:15 +02:00
Fabio Alessandrelli e36c100365 Fix crash in ENet changing refuse_new_connections
When the host is not started.

(cherry picked from commit e5f3159a23)
2020-07-29 18:24:12 +02:00
Hugo Locurcio 4a0568b609 Document how to perform advanced string splitting using RegEx
This closes https://github.com/godotengine/godot-docs/issues/3607.

(cherry picked from commit 5f2b6bd476)
2020-07-29 18:24:00 +02:00
Hugo Locurcio bd76fcd43b Add an example to the `CanvasItem.draw_string()` documentation
This closes https://github.com/godotengine/godot-docs/issues/3374.

(cherry picked from commit 0c7735be5b)
2020-07-29 18:23:45 +02:00
Hugo Locurcio b3effe5faa Fix incorrect key name in the Animation documentation code sample
This closes https://github.com/godotengine/godot-docs/issues/3841.

(cherry picked from commit 4257aa5c5c)
2020-07-29 18:23:31 +02:00
Wilson E. Alvarez 4f9ca00294 Check if global class file still exists before registering it
(cherry picked from commit e264ae20d2)
2020-07-29 18:23:03 +02:00
Rémi Verschelde 36b746d903
Merge pull request #40822 from Calinou/doc-canvasitem-draw_multiline_colors-antialiased
Document `CanvasItem.draw_multiline_colors()` not supporting width and AA
2020-07-29 12:45:17 +02:00
Hugo Locurcio 39ec3ad2e5 Document `CanvasItem.draw_multiline_colors()` not supporting width and AA 2020-07-29 11:45:49 +02:00
PouleyKetchoupp ff0ada164b [3.2] Move PopupWindow logic to GodotEditText on Android 2020-07-28 21:03:55 +02:00
Rémi Verschelde fe4aa393f0
Merge pull request #40803 from aaronfranke/3.2_revert-dir
[3.2] Revert "Fix Directory" PRs
2020-07-28 20:48:34 +02:00
Nathan Franke b9e1db7e03
Revert "Fix Directory Open Check"
This reverts commit 3f898f5207.
2020-07-28 13:54:13 -04:00
Nathan Franke 9de0439a45
Revert "Follow-Up Fix Directory Open"
This reverts commit ec787f0134.
2020-07-28 13:53:57 -04:00
Nathan Franke 4c100a593f
Revert "Fix Directory make_dir and make_dir_recursive"
This reverts commit 9b36357544.
2020-07-28 13:53:30 -04:00
Rémi Verschelde ac2e7d87d1
Merge pull request #40786 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 5th batch
2020-07-28 13:06:31 +02:00
Rémi Verschelde ed20772c09 i18n: Sync translations with Weblate 2020-07-28 12:07:45 +02:00
Rémi Verschelde e82e9588fd doc: Sync classref with current source 2020-07-28 11:50:39 +02:00
Rémi Verschelde 10544f1cf7 Revert "Move Bullet physics query flush from Bullet space pre-tick callback to"
This reverts commit e7d8464f87.

Fixes #40508 regression.

This will be re-applied and the regression fixed for a future 3.2.x release.
2020-07-28 11:42:04 +02:00
ConorLPBoyle ba3f0fa971 Fixed reload_goal not being called when SkeletonIK3D::start is invoked with p_one_time = true
(cherry picked from commit fa4d9c9446)
2020-07-28 11:28:34 +02:00
Aaron Franke 40d118ce4a Fix incorrect comments in file formatting script
(cherry picked from commit 05a418f9e6)
2020-07-28 11:27:27 +02:00
Nhiqill 8d5dab5a05 Pop from front to avoid infinite loop with nested classes
(cherry picked from commit 42d1b4f389)
2020-07-28 00:57:27 +02:00
Yuri Sizov 44ff9cdea5 Fix errors saving a 2D scene preview when the 2D editor was never opened
(cherry picked from commit e2b85b74a2)
2020-07-28 00:56:20 +02:00
Fabio Alessandrelli 31c21b9750 Implement HTML5 cancel/ok button swap on Windows.
Platform is detected on init via the `navigator.platform` string.

(cherry picked from commit 0b286a287c)
2020-07-28 00:55:46 +02:00
Hugo Locurcio 451648c34d Improve visibility documentation for CanvasItem and Node3D
This closes https://github.com/godotengine/godot-docs/issues/3840.

(cherry picked from commit 27b09dfc44)
2020-07-28 00:53:16 +02:00
Marcel Admiraal cdb3712992 Clarify the difference between contacts and collisions.
(cherry picked from commit 6f1c99e5b4)
2020-07-28 00:52:07 +02:00
Hugo Locurcio b717a61903 Improve the Object, Reference and Resource class documentations
(cherry picked from commit 4275e6aad5)
2020-07-28 00:48:33 +02:00
Rémi Verschelde 518f109927 Script editor: Don't open dominant script in external editor
Fixes #13429.

(cherry picked from commits b5f110c77e,
6b3f013a82, and
e016859c3b)
2020-07-28 00:47:24 +02:00
bruvzg a2f034d3ab [macOS] Refocus last key window after `DisplayServer::alert` is closed.
(cherry picked from commit a05776e20d)
2020-07-28 00:45:06 +02:00
Tomasz Chabora cd01cda143 Fix ultra long node names
(cherry picked from commit d3f2062d86)
2020-07-28 00:43:37 +02:00
Marcel Admiraal 5692bb4c81 Ensure Bullet HeightMapShape3D data width and depth are at least 2.
(cherry picked from commit 236857c92a)
2020-07-28 00:42:32 +02:00
Rémi Verschelde 4b9bb50176 Style: Fix code format scripts compat with non-GNU Unices
It's too hard to get compatibility between GNU and BSD sed,
so let's just use perl oneliners.

And improve it to also remove trailing tabs, not just spaces.

(cherry picked from commit c71e189efd)
2020-07-28 00:41:52 +02:00
Andrii Doroshenko (Xrayez) 6abaf4d0eb Skip internal scripts for breakpoints without printing an error
This removes:
```
ERROR: get_breakpoints: Condition ' base.begins_with("local://")
```
while running a project with blank scripts caused by deleting
or moving, or built-in scripts which are not yet saved within a scene
on running a project.

(cherry picked from commit 1c70a33d9c)
2020-07-28 00:40:20 +02:00
Wilson E. Alvarez 993a421333 Show errors on Object.call_deferred
(cherry picked from commit 1cd02ef600)
2020-07-28 00:40:07 +02:00
Hugo Locurcio 508388a9fd Document an example dictionary returned by `TileSet.tile_get_shapes()`
(cherry picked from commit 60bb80505f)
2020-07-28 00:39:49 +02:00
Daniel Ting 6f71bc2a06 Evenly distribute stretched Nodes in BoxContainer
Add any leftover fractional pixels to an error accumulator. When the
accumulator is greater or equal to one, add one pixel to the current
Node's size and subtract one from the accumulator.

Closes #36522

(cherry picked from commit 04ea6ec88d)
2020-07-28 00:39:21 +02:00
Rémi Verschelde 400a780050 Revert "Allow Area2D and 3D mouse events without a collision layer"
This reverts commit 15850687a8.
2020-07-27 22:46:04 +02:00
Rémi Verschelde 37bac7d75d
Merge pull request #40672 from nekomatata/virtual-keyboard-height-fix-3.2
[3.2] Virtual keyboard size adjustment fixes
2020-07-27 08:57:52 +02:00
Rémi Verschelde a2edf04fd2
Merge pull request #40469 from nekomatata/virtual-keyboard-enter-fixes-3.2
[3.2] Fix Return key events in LineEdit & TextEdit on Android
2020-07-26 20:26:02 +02:00
Rémi Verschelde 77bb081123
Merge pull request #40727 from akien-mga/3.2-ci-ios-github-actions
CI: Replace Travis iOS build by GitHub Actions
2020-07-26 16:48:51 +02:00
Rémi Verschelde 8fdb21f454 CI: Replace Travis iOS build by GitHub Actions
Last step of the migration from Travis/AppVeyor to GitHub Actions.

`werror=yes` should be enabled once outstanding warnings have been fixed.
2020-07-26 16:31:19 +02:00
Rémi Verschelde db6d7499c0
Merge pull request #40723 from naithar/fix/ios-touch-events-master-3.2
[3.2] Fix for iOS touch recognition
2020-07-26 15:42:59 +02:00
Sergey Minakov 16f9ff5866 iOS: added delay gesture recognizer
This gesture recognizer will prevent GLView from processing unwanted gestures.
Emulates UIScrollView behavior
Fires delayed touches on significant movement
2020-07-26 15:49:09 +03:00
Rémi Verschelde b3d46d4809
Merge pull request #40675 from Calinou/doc-texturerect-viewporttexture
Document ViewportTexture flipping in TextureRect
2020-07-24 23:32:46 +02:00
Hugo Locurcio 5589529cf3
Document ViewportTexture flipping in TextureRect 2020-07-24 22:30:58 +02:00
PouleyKetchoupp 69db38742f Virtual keyboard size adjustment fixes
1. Disable virtual keyboard focus adjustment on Android
The default adjustment setting was causing the view to pan down in order
to adjust the focus on the text content.
We don't need any focus adjustment since we're using a fixed size window
for our application.
Documentation:
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING

2. Fix virtual keyboard height regression
Disabling virtual keyboard focus adjustement caused get_keyboard_height
to always return 0 because it was calculated when the view is resized.
In order to fix it, a PopupWindow is now created on top of the main view
and is set for focus adjustments so the keyboard size can be calculated
based on this popup without affecting the main view.
2020-07-24 18:26:20 +02:00
Rémi Verschelde a24e30abd7 Bump version to 3.2.3-rc 2020-07-24 14:10:13 +02:00
Rémi Verschelde 8b8364cc9e
Merge pull request #40653 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 4th batch
2020-07-24 11:13:42 +02:00
Rémi Verschelde b40f3f9740 Style: Sync other changes from new fix_style.sh and clang_format.sh 2020-07-24 10:39:18 +02:00
Rémi Verschelde eda03831d6 Style: Add missing newlines to SVGs 2020-07-24 10:39:18 +02:00
Rémi Verschelde 4567eee79e CI: Backport GitHub Actions setup from `master`
Removes AppVeyor and all Travis jobs but the iOS one, which hasn't been ported
to GitHub Actions yet (should be done soon).

Backports new style scripts from `master` branch too to do the same checks.
2020-07-24 10:39:17 +02:00
Tomasz Chabora 307bac0757 Keep transition value when replacing key
(cherry picked from commit e1a1bb0a6e)
2020-07-24 10:31:57 +02:00
Tomasz Chabora 7e1312055b Fix emoji branch compilation error
(cherry picked from commit 2407562366)
2020-07-24 10:31:57 +02:00
Tomasz Chabora 2bcb9d2a04 Fix run project when current scene was never saved
(cherry picked from commit 9c84e34fd4)
2020-07-24 10:31:57 +02:00
Andy Maloney cc8c6180c3 [macOS] Fix Maya navigation with ALT + mouse scroll
Methods were being called with InputEventMouseMotion instead of InputEventPanGesture, and they were null.

Fixes godotengine/godot#16181 on the master branch

(cherry picked from commit 394a7826be)
2020-07-24 10:31:57 +02:00
Rémi Verschelde 3d420c94c9 gitignore: Ignore binutils linker temp stXXXXXX objects
Fixes #40607.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit 5e8b188365)
2020-07-24 10:31:57 +02:00
Rémi Verschelde f1cdb91f34 SCons: Remove unused DEBUG_MEMORY_ENABLED define
Its last use was removed in Godot 3.0, so it no longer makes sense to define.

Also removed `D3D_DEBUG_INFO` for Windows as it's likely a left over from a
long time ago pre-opensourcing when Godot had some form of Direct3D 9 support?

(cherry picked from commit dcf902df85)
2020-07-24 10:31:57 +02:00
mega-bit 93f297e1d5 Fix typos in GodotSharp code docs
(cherry picked from commit 0ca96ae2c1)
2020-07-24 10:31:57 +02:00
Adam Bates b35970b9a5 issue-40396 - Added missing error strings to JSON parsing when array or object is never closed.
(cherry picked from commit 8f84dfa91d)
2020-07-24 10:31:57 +02:00
QbieShay 53a3476fc2 fixed documentation for get_hit_length of spring arm 3D
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit d1bff73611)
2020-07-24 10:31:57 +02:00
follower 0fdfa47929 Fix presumed copy/paste error: "Returns" -> "Sets"
I might be going out on a limb here... :D

(cherry picked from commit e38b63400c)
2020-07-24 10:31:57 +02:00
Ignacio Etcheverry accc30e5e0 C#: Fix restore not called when building game projects
(cherry picked from commit 4a30289eee)
2020-07-24 10:31:57 +02:00
Hugo Locurcio ad18e16389 Document polling rate limitations in InputEventMouseMotion
This closes #40579.

(cherry picked from commit 924b7ea2f5)
2020-07-24 10:31:57 +02:00
PouleyKetchoupp 930c880fa6 Add option to disable virtual keyboard for LineEdit
Co-authored-by: Alexander Holland <alexander.holland@live.de>
(cherry picked from commit 0aa56e3ab8)
2020-07-24 10:31:57 +02:00
Rémi Verschelde 925371d08f TileSet Editor: Check polygon size before indexing
Fixes #39722.

(cherry picked from commit 6f428f2494)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 7078d33fa1 Document HTML5 CORS restrictions in HTTPClient and HTTPRequest
See https://github.com/godotengine/godot/issues/40247.

(cherry picked from commit 90db42d9db)
2020-07-24 10:31:57 +02:00
Rémi Verschelde f922452e90 stb_vorbis: Update to upstream version 1.20
Upstreams our crash fixes from #38422 and #40174.

(cherry picked from commit 8dffca4196)
2020-07-24 10:31:57 +02:00
Nathan Franke 9b36357544 Fix Directory make_dir and make_dir_recursive
(cherry picked from commit 210ccb3a75)
2020-07-24 10:31:57 +02:00
Tomasz Chabora e511e0f16a Prevent infinite loop in Tree incremental search
(cherry picked from commit c0479496fa)
2020-07-24 10:31:57 +02:00
Andrii Doroshenko (Xrayez) 6416df8e34 Document the process of parsing command-line arguments
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit df80e259cd)
2020-07-24 10:31:57 +02:00
Tomasz Chabora 5984febde2 Prevent multiple Controls moving inside container
(cherry picked from commit e44c9101da)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 606d4270c6 Document several editor-related classes to 100% completion
(cherry picked from commit fb2e4d77eb)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 0e44834cd3 Improve the VisibilityNotifier and VisibilityEnabler class descriptions
(cherry picked from commit ce57cc43dd)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 52a33a8066 Complete the EditorSettings class documentation
EditorSettings is now 100% documented.

(cherry picked from commit 708a0a43fb)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 7e9a51cdd5 Mention `toggled` signal for pressed state in BaseButton documentation
This closes #40455.

(cherry picked from commit 43dae28e9d)
2020-07-24 10:31:57 +02:00
Paulb23 ca4fe82a7f Fix crash when closing a TextFile
(cherry picked from commit 54bca425b2)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 753ff1fad2 Mention the Data paths documentation in the File class
This closes https://github.com/godotengine/godot-docs/issues/3799.

(cherry picked from commit d4085d6bfb)
2020-07-24 10:31:57 +02:00
Ryan Roden-Corrent c77492408a Clarify how to convert PrimitiveMesh to ArrayMesh.
It took me a bit to figure this out, as I was initially doing something
more complicated like this before I realized I just had to pass
get_mesh_arrays directly to add_surface_from_arrays.

```
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(ArrayMesh.ARRAY_MAX)
arrays[ArrayMesh.ARRAY_VERTEX] = c.get_mesh_arrays()
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
```

(cherry picked from commit 933bf96523)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 5c7802a061 Document which escape sequences are supported by `String.c_unescape()`
See https://github.com/godotengine/godot/issues/38716.

(cherry picked from commit 04b25108ac)
2020-07-24 10:31:57 +02:00
Hugo Locurcio 11bceb3d62 Document caveats related to Control scaling
This is a common topic of confusion. Clarifying its intended scope
should make things easier to understand.

(cherry picked from commit a36912b3cb)
2020-07-24 10:31:56 +02:00
Umang Kalra dc7e9d46e6 Fixes the get_visible_line_count() of rich text label
(cherry picked from commit bd32c273ff)
2020-07-24 10:31:56 +02:00
Stijn Hinlopen b7b8f8645f Open scene selected from Quick Open dialog.
(cherry picked from commit 1ce3a77a42)
2020-07-24 10:31:56 +02:00
Chistpohe LY 8ef40b9306 bug with Tween.is_active, fixes #39760
(cherry picked from commit d60617de10)
2020-07-24 10:31:56 +02:00
rileylyman 582b4318f8 implement generic filename disambiguation
A static function is added to EditorNode which allows for filename
disambiguation given a list of filenames and the corresponding list of
absolute paths for those files. This function is then used to
disambiguate scene and script tabs in the editor.

(cherry picked from commit 4285211f40)
2020-07-24 10:31:56 +02:00
K. S. Ernest (iFire) Lee f189d0e1f3 Allow gltf2 morph targets with no default values. Changes for bug 38751
(cherry picked from commit 71ae0ff46d)
2020-07-24 09:37:43 +02:00
Hugo Locurcio 3bdb39bec4 Add a margin to EditorSpinSlider to visually line up the edited number
This means clicking on an EditorSpinSlider to edit its value will
no longer cause the number to be visually offset while it's
being edited.

(cherry picked from commit cc615fee5f)
2020-07-24 09:34:58 +02:00
Rémi Verschelde bdd1e74869
Merge pull request #40581 from aaronfranke/3.2_docs
[3.2] Backport documentation for math types (core and C#)
2020-07-22 09:29:18 +02:00
Aaron Franke e10a1e078f
[3.2] Add C# XML documentation to core C# math types 2020-07-21 21:22:54 -04:00
Aaron Franke 3ab5183ffa
[3.2] Backport core documentation changes to 3.2
Also add AABB.abs()
2020-07-21 21:22:54 -04:00
Rémi Verschelde af35d0d3c8
Merge pull request #40558 from clayjohn/GLES3-sky-texture
Fix OpenGL error when generating radiance
2020-07-21 20:10:25 +02:00
Rémi Verschelde be30437e07
Merge pull request #40573 from asmaloney/3.2-no-override
Remove override keyword from csharp_script.h to fix build errors
2020-07-21 20:09:54 +02:00
clayjohn 2534e28918 Fix OpenGL error when generating radiance 2020-07-21 10:40:49 -07:00
Andy Maloney 502a3d580f Remove override keyword from csharp_script.h to fix build errors
Fixes godotengine/godot#40572
2020-07-21 13:17:58 -04:00
Rémi Verschelde 7b4b83e9dc
Merge pull request #39817 from yrk06/ExposeInertiaTensor
Added Rigid Body Method "get_inverse_inertia_tensor"
2020-07-21 16:50:56 +02:00
Rémi Verschelde b3520ecd1c
Merge pull request #40534 from zaevi/fix_clipboard_crlf_3.2
[3.2] fix crlf for clipboard
2020-07-21 16:06:53 +02:00
Rémi Verschelde 470bbee74a
Merge pull request #40559 from clayjohn/3.2-Sprite3D-AABB
Pass Sprite3D AABBs to VisualServer
2020-07-21 07:09:09 +02:00
clayjohn fb4e55bb7a Pass Sprite3D AABBs to VisualServer 2020-07-20 20:22:12 -07:00
Rémi Verschelde c79ec3951b
Merge pull request #40492 from RandomShaper/font_avail_chars_3.2
Add DynamicFont::get_available_chars() (3.2)
2020-07-20 19:19:22 +02:00
Pedro J. Estébanez 06904ac215 Add DynamicFont::get_available_chars() 2020-07-20 17:45:04 +02:00
Rémi Verschelde 7f62c6a81e
Merge pull request #40490 from madmiraal/fix-40381-3.2
[3.2] Use difference in position to check whether motion in Bullet is too close to zero.
2020-07-20 14:53:11 +02:00
Rémi Verschelde d8aaf0a620
Merge pull request #40523 from clayjohn/3.2-mipmap-nearest
Allow nearest neighbor lookup when using mipmaps
2020-07-20 14:47:27 +02:00
Zae 6f2be6b05c [3.2] fix crlf for clipboard 2020-07-20 15:42:32 +08:00
clayjohn e5cc4d4f87 Allow nearest neighbor lookup when using mipmaps 2020-07-19 14:44:42 -07:00
Yerik d09b16512b Added Method get_inverse_inertia_tensor 2020-07-19 13:51:32 -03:00
Marcel Admiraal 98aabe111f Use difference in position to check whether motion in Bullet is too close
to zero.
2020-07-18 13:20:19 +01:00
PouleyKetchoupp c0b394572f Fix Return key events in LineEdit & TextEdit on Android
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.

Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.

Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.

Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
2020-07-17 18:25:40 +02:00
Rémi Verschelde 89f57ae122
Merge pull request #40432 from Faless/js/fix_setenv
Fix setenv not defined in older emscripten verions.
2020-07-16 10:10:36 +02:00
Fabio Alessandrelli e7099ed2ea Fix setenv not defined in older emscripten verions. 2020-07-15 22:21:47 +02:00
Rémi Verschelde 4abebfa476
Merge pull request #40413 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 3rd batch
2020-07-15 15:18:29 +02:00
Rémi Verschelde 2244841729 doc: Sync classref with current source 2020-07-15 12:56:16 +02:00
Hugo Locurcio e41ab634c6 Mention C# gotchas in Object's dynamic call/set/connect methods
This closes #34015.

(cherry picked from commit 878f03d8e3)
2020-07-15 12:48:18 +02:00
Emmanuel Leblond f031e72395 Add missing has_default_value field for signals in api.json
(cherry picked from commit 37de4982ca)
2020-07-15 12:48:18 +02:00
Emmanuel Leblond 8bc44c868e Correct is_reference attribute in api.json for Reference class
(cherry picked from commit b5c80088ce)
2020-07-15 12:48:18 +02:00
Hugo Locurcio f7021e57d7 Document VehicleBody3D and VehicleWheel3D limitations
These classes have dozens of open bugs and missing features
which may not be fixed anytime soon.

It's probably better to document it upfront at this point.

(cherry picked from commit 0493e7c106)
2020-07-15 12:48:18 +02:00
Juan Linietsky ceeb690476 Properly pass safe margin on initialization.
Fixes jitter.

(cherry picked from commit 13e0385702)
2020-07-15 12:48:18 +02:00
Fabio Alessandrelli 67313c681d Reorganize ENet pactches.
(cherry picked from commit 32fbe37ab4)
2020-07-15 12:48:18 +02:00
Fabio Alessandrelli 18eddfc98d Funnel refuse_new_connections to Godot ENet.
(cherry picked from commit 7ec5c917d1)
2020-07-15 12:48:18 +02:00
Fabio Alessandrelli 91b2d020a8 Document updated UDPServer interface.
(cherry picked from commit 839c7b1ba3)
2020-07-15 12:48:18 +02:00
Fabio Alessandrelli 468a1c0271 UDPServer handles PacketPeerUDP-client association
UDPServer now uses a single socket which is shared with the
PacketPeerUDP it creates and has a new `poll` function to read incoming
packets on that socket and delivers them to the appropriate peer.
PacketPeerUDP created this way never reads from the socket, but are
allowed to write on it using sendto.

This is needed because Windows (unlike Linux/BSD) does not support
packet routing when multiple sockets are bound on the same address/port.

(cherry picked from commit 147bbe2155)
2020-07-15 12:48:18 +02:00
Rémi Verschelde a06ee5e763 PO loader: Fix unclosed files and error messages
Fixes #40324.

(cherry picked from commit 47cc202972)

Also removes empty `p_path` as done in 4857648a16.
2020-07-15 12:48:18 +02:00
Ryan Roden-Corrent 4677502d7c Include gdscript warning name in LSP message.
My initial attempt changed this in the gdscript code, which resulted in
a duplicate warning name in the builtin editor. We should just append
the warning name in the LSP instead.

This uses parens to match what is shown in the builtin editor.

(cherry picked from commit 8dcc39ec91)
2020-07-15 12:15:16 +02:00
Ryan Roden-Corrent f7b994aef8 Revert "Include gdscript warning name in the warning message."
This reverts commit de3ad3b30e.

(cherry picked from commit d92fa3b547)
2020-07-15 12:15:12 +02:00
Hugo Locurcio a8188265c2 Disable file logging for the project manager
Due to `user://` returning the current working directory when no
project is open, this caused logs to be written to `$HOME`
most of the time.

This closes #40305.

(cherry picked from commit b89dc6ae00)
2020-07-15 12:14:51 +02:00
volzhs cfda32add0 Fix overlappingObjects vector crash
use clear_overlaps() instead of clearing overlappingObjects directly

(cherry picked from commit 4e987f5ab9)
2020-07-15 12:11:31 +02:00
Patrick Dawson 8218170b3c Avoid overflow when calculating visible_cells
(cherry picked from commit 9e28df22a0)
2020-07-15 12:11:31 +02:00
Jitesh f6479786c0 change minimum horizontal size from 200 to 240
(cherry picked from commit a8905b2a4e)
2020-07-15 12:11:31 +02:00
Michael Alexsander e7e022b3ee Prefer the highlight version of the "GuiTabIcon" icon for buttons, and make their width/height equal
(cherry picked from commit 26381265b8)
2020-07-15 12:11:31 +02:00
Rémi Verschelde 1f7911e019
Merge pull request #40410 from lawnjelly/kessel_force_repeat
GLES2 Batching - Fix FORCE_REPEAT not being set properly on npot hardware
2020-07-15 12:11:19 +02:00
lawnjelly 2f983c82c8 GLES2 Batching - Fix FORCE_REPEAT not being set properly on npot hardware
On platforms that don't report support for GL_REPEAT for non power of two textures, the FORCE_REPEAT conditional is used instead. However for rect batches, the conditional was being set AFTER binding the shader, which meant it wasn't being activated.

This PR simply shifts setting the conditional to before the shader bind.
2020-07-15 09:28:16 +01:00
Rémi Verschelde d2be483e96
Merge pull request #40406 from Chaosus/fix_shader_3.2
[3.2] Fix some incorrect conversions which lead to crash in shaders
2020-07-15 09:13:41 +02:00
Rémi Verschelde e452c67476
Merge pull request #40382 from bruvzg/macos_11_window_size_3
[macOS, 3.2] Fix window size on macOS Big Sur, use top-left corner as resize origin.
2020-07-15 08:28:05 +02:00
Yuri Roubinsky ecd54630ef [3.2] Fix some incorrect conversions which lead to crash in shaders 2020-07-15 06:36:24 +03:00
bruvzg 26a825aac3
[macOS, 3.2] Fix window size on macOS Big Sur (title bar height is no longer same as menu height), use top-left corner as resize origin instead of bottom-left. 2020-07-14 17:38:16 +03:00
Rémi Verschelde 3de89f78e5
Merge pull request #40265 from Calinou/doc-node-clarify-add-child-below-node
Clarify the node parameters in `Node.add_child_below_node()` docs
2020-07-14 09:41:57 +02:00
Rémi Verschelde 37100384c3
Merge pull request #40300 from 0xafbf/fix-parent-check
Fix parent check for add_child_below_node
2020-07-14 09:14:28 +02:00
Rémi Verschelde 717d4cbb73
Merge pull request #40309 from madmiraal/fix-40283-3.2
[3.2] Set isScratchedSpaceOverrideModificator to false when removing a RigidBodyBullet from a space.
2020-07-13 18:00:12 +02:00
Rémi Verschelde d0372edd6b
Merge pull request #40343 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 2nd batch
2020-07-13 17:31:55 +02:00
Gordon MacPherson 13da2cc91f Use GitHub Actions instead of AppVeyor for Windows platform
This was based on quarmin's initial configuration, we had compile issues with AppVeyor being super slow and GitHub actions will take less time and also manage a full rebuild in 30 minutes.

This adds cache handling and will work with MSVC and scons 4.0, it will build for every PR submitted to the Godot Engine, and also for the branches specified. I have tested the caching and it seems to be working.

I left the 'publish artefacts' disabled until we can request more storage from Microsoft, 5 GB is far to low for us and we would eat this limit very fast. (it is tested and works fine)

Co-authored-by: Rafał Mikrut <mikrutrafal54@gmail.com>
(cherry picked from commit 04592af5a4)
2020-07-13 15:16:38 +02:00
Andrii Doroshenko (Xrayez) 813fab55d8 Fix overriding compression related settings
(cherry picked from commit 1f73469b50)
2020-07-13 15:15:40 +02:00
Hugo Locurcio c88696cdb8 Improve the ENet channels documentation in NetworkedMultiplayerENet
This closes https://github.com/godotengine/godot-docs/issues/3598.

(cherry picked from commit c9b6833d00)
2020-07-13 15:15:09 +02:00
Aaron Franke 8cd317b551 Disable "misleading indentation" warning on GCC
(cherry picked from commit 611fd8cb72)
2020-07-13 15:13:48 +02:00
Andrii Doroshenko (Xrayez) 670205a22f Expand env vars for `custom_modules` build option
The order of conversion is also changed to ensure that the resulting
path can be properly validated later on.

(cherry picked from commit 80249e7190)
2020-07-13 15:13:14 +02:00
Maganty Rushyendra e76a9a51df Emit signals for GraphEdit multi-node selection and unselection
Emit `node_selected` and `node_deselected` signals where appropriate
when selecting or unselecting multiple GraphEdit nodes at once.

(cherry picked from commit c1d5c7727c)
2020-07-13 15:12:50 +02:00
Zae ac3ff49ae5 fix item_edited behavior on Asset Installer.
(cherry picked from commit b0fbde6abd)
2020-07-13 15:11:33 +02:00
Rémi Verschelde e798cf81c5
Merge pull request #40280 from madmiraal/PR40193-3.2
[3.2] Allow Area2D and 3D mouse events without a collision layer.
2020-07-13 15:10:28 +02:00
Marcel Admiraal a3246a5ebe Set isScratchedSpaceOverrideModificator to false when removing a
RigidBodyBullet from a space.
2020-07-12 07:53:32 +01:00
Andrés Botero 6b05f8f602 Fix parent check for add_child_below_node 2020-07-11 15:57:17 -05:00
Hugo Locurcio fb736018c5
Clarify the node parameters in `Node.add_child_below_node()` docs
This closes https://github.com/godotengine/godot-docs/issues/3769.
2020-07-11 12:23:41 +02:00
Tomasz Chabora 15850687a8 Allow Area2D and 3D mouse events without a collision layer
Co-authored-by:    Tomasz Chabora <kobewi4e@gmail.com>
2020-07-11 11:14:12 +01:00
Hugo Locurcio c2a4ce9380 Enable file logging by default on desktops to help with troubleshooting
- Use the `.log` file extension (recognized on Windows out of the box)
  to better hint that generated files are logs. Some editors provide
  dedicated syntax highlighting for those files.
- Use an underscore to separate the basename from the date and
  the date from the time in log filenames. This makes the filename
  easier to read.
- Keep only 5 log files by default to decrease disk usage in case
  messages are spammed.

(cherry picked from commit 20af28ec06)
2020-07-10 11:03:32 +02:00
coldragon a0f0aa1741 Fix crash on editor without a feature profile
(cherry picked from commit f2a01b0c6b)
2020-07-10 11:01:31 +02:00
Chistpohe LY 130ad08d47 auto re-import atlas, fixes #40047
(cherry picked from commit f34f00bccc)
2020-07-10 11:00:10 +02:00
Maganty Rushyendra 76a43c93cd Fix repeated updates of PathFollow3D Transform
Add optional parameter to specify whether applying rotation to the
PathFollow3D's Transform is necessary, preventing erroneous updates.

(cherry picked from commit be3a1769fe)
2020-07-10 10:59:24 +02:00
Daniel Ting c55e68d311 Do not try to save internal scripts
Fixes #40175

(cherry picked from commit d6c979d91b)
2020-07-10 10:37:33 +02:00
Nathan Franke ec787f0134 Follow-Up Fix Directory Open
(cherry picked from commit 6952458538)
2020-07-10 10:21:39 +02:00
Hugo Locurcio 4a0fe1adb3 Add a POST request example to the HTTPRequest class documentation
(cherry picked from commit 54db59be67)
2020-07-10 10:09:01 +02:00
Bob Gardner 8f0d50c3ec Update Resource.xml to explain behavior of duplicate when subresources is true and a subresource contains further nested resources.
Updated documentation for duplicate() on Resource to better explain the behavior. As per #30385.

(cherry picked from commit 660a780c3b)
2020-07-10 09:00:02 +02:00
Johan Rastén 4c2d0d38fd Handle 16 bit PNG files in sRGB format
(cherry picked from commit e7e632cbed)
2020-07-10 08:51:21 +02:00
Hugo Locurcio 6eb1a2eacb Document how to instance a PackedScene and add it as a child
This information was already present in `@GDScript.preload()`,
but it's not easy to find.

This closes https://github.com/godotengine/godot-docs/issues/3338.

(cherry picked from commit 23d929d540)
2020-07-10 08:51:21 +02:00
Hugo Locurcio 81f448aa5d Mention `SceneTree.create_timer()` in the Timer class documentation
This closes https://github.com/godotengine/godot-docs/issues/2349
(as the linked method already contains an example).

(cherry picked from commit 1261f47c35)
2020-07-10 08:51:21 +02:00
PouleyKetchoupp fe0adc4f77 Keep debug & verbose options after loading project from project manager
(cherry picked from commit b2d27214aa)
2020-07-10 08:51:21 +02:00
Rémi Verschelde 0246a1a276 Revert "Enable the ability to use Godot as a subview within an Android app"
This reverts commit 920639511d.

The changes are good, this revert is only done for release management reasons
as we want this feature to get more testing before making it in a stable build,
but a 3.2.3 release is imminent to handle some regressions in 3.2.2.

This will be re-committed in a 3.2-based feature branch, and we'll merge it
again once we're confident about it (probably for 3.2.4).
2020-07-10 08:51:21 +02:00
PouleyKetchoupp 5854bf4696 Fixed mesh data access errors in GLES2
1. Removed errors in mesh_surface_get_array as it's supported now
2. More accurate errors in mesh_surface_get_blend_shapes

(cherry picked from commit e19a3df98f)
2020-07-10 08:51:21 +02:00
Rémi Verschelde 2cf52076fd
Merge pull request #40185 from madmiraal/fix-37702-3.2
[3.2] Move Bullet physics query flush from Bullet space pre-tick callback to Bullet physics flush_queries()
2020-07-10 08:49:02 +02:00
Rémi Verschelde 6fd712c874
Merge pull request #40173 from naithar/feature/ios-storyboard-usage
[3.2] [iOS] Option to use storyboards for launch screens.
2020-07-09 08:36:07 +02:00
Marcel Admiraal e7d8464f87 Move Bullet physics query flush from Bullet space pre-tick callback to
Bullet physics flush_queries() as is done in Godot physics, and remove
the pre-tick callback.
2020-07-08 11:42:29 +01:00
Sergey Minakov a4028b99ec iOS Export: use relative path for res:// files
(cherry picked from commit 7b64f2df50)
2020-07-08 09:01:58 +02:00
Rémi Verschelde 9c68989cf2 stb_vorbis: Add missing error checks in comment reading mallocs
Backported from https://github.com/nothings/stb/pull/989.

Fixes #40164.

(cherry picked from commit 24a01c0d39)
2020-07-08 09:01:57 +02:00
Nathan Franke 3f898f5207 Fix Directory Open Check
(cherry picked from commit 09aeb7706b)
2020-07-08 09:01:57 +02:00
Yuri Sizov 3f57cb12b4 Improve null check in FindReplaceBar
(cherry picked from commit e94b8a6acc)
2020-07-08 09:01:57 +02:00
Yuri Sizov bd90f236d3 Improve scene preview generation for empty scenes and disabled features
(cherry picked from commit 6c8a9b7690)
2020-07-08 09:01:57 +02:00
Rémi Verschelde 2eb65b5c7e
Merge pull request #40169 from azagaya/3.2
Fixed white image in margins when using same image in scene
2020-07-08 08:59:08 +02:00
Rémi Verschelde b1ec15bc5b
Merge pull request #40201 from bruvzg/macos_seamless_scaling_3
[macOS, 3.2] Implement seamless display scaling.
2020-07-08 08:42:00 +02:00
bruvzg e9ab41b71d
[macOS, 3.2] Implement seamless display scaling. 2020-07-07 22:54:33 +03:00
Sergey Minakov 6264c5146c iOS Export: Storyboard custom values 2020-07-07 02:12:50 +03:00
Rémi Verschelde 07b24de868
Merge pull request #38724 from madmiraal/fix-8368-3.2
[3.2] Support SDL2 half axes and inverted axes mappings.
2020-07-06 23:10:47 +02:00
Sergey Minakov 46c6383c8d iOS Export: add option to use storyboard for launch screen 2020-07-07 00:01:35 +03:00
azagaya d539627be2 Fixed white image in margins when using same image in scene 2020-07-06 15:54:45 -03:00
Marcel Admiraal d0fb6d6971 Clear a Bullet Area's overlappingObjects vector when removing an area
from a space.

(cherry picked from commit a615d359e8)
2020-07-06 19:17:11 +02:00
Yuri Sizov 2b4773f0cf Expose methods to play scene from plugin code
(cherry picked from commit 49f6dc5004)
2020-07-06 19:00:56 +02:00
Ryan Roden-Corrent a8d4ca0e1b Include gdscript warning name in the warning message.
Occasionally you want to ignore a warning with a `warning-ignore`
comment, and you have to go into the settings to look up what the
actual name of the warning is. This patch appends the warning name to
the end of the warning so you know what string to use to ignore it,
similar to other linters like pylint.

For example

```
"The signal 'blah' is declared but never emitted.";
```

is now

```
"The signal 'blah' is declared but never emitted. (UNUSED_SIGNAL)";
```

(cherry picked from commit de3ad3b30e)
2020-07-06 16:51:17 +02:00
Thakee Nathees 9ce1fe59ea Fix: editor crash on super constructor called
Fix: #39909
(cherry picked from commit 023b3f2786)
2020-07-06 16:47:44 +02:00
Rémi Verschelde 1f886d1f31
Merge pull request #39867 from clayjohn/Sprite3D-mesh
Use mesh instead of immediate for drawing Sprite3D
2020-07-06 16:36:27 +02:00
Rémi Verschelde 3a916152d8
Merge pull request #39803 from TwistedTwigleg/3.2.skeleton_ik_scale_fix
[3.2] Fixed SkeletonIK not working with scaled skeletons
2020-07-06 16:16:57 +02:00
Rémi Verschelde fcce1ca8c4 doc: Sync classref with current source 2020-07-06 14:32:13 +02:00
Daniel Ting 3f5f58b9d8 Fix opening URLS with special characters in macOS
The Online Tutorials section of InputMap in the editor's built-in
documentation viewer contains this link:

docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap

The macOS implementation for opening a link percent-encodes it before
sending it to the browser, resulting in a 404. This is to fix #13422
where filenames with special characters could not be opened in Finder.
However, this breaks URLS so I added a check to see if the resource
scheme is file:// and if so, only then is it escaped. This allows other
schemes like `http`, `ftp`, and `mailto` to be used.

(cherry picked from commit b8e6ff9a7f)
2020-07-06 14:18:18 +02:00
Hugo Locurcio d4f4e0d7dc Fix `String.capitalize()` description to follow camelCase changes
This closes #40093.

(cherry picked from commit 887099680a)
2020-07-06 14:16:49 +02:00
Andrii Doroshenko (Xrayez) 41f99c8f53 Provide warning when using polygon shapes in `CollisionShape2D` node
`ConvexPolygonShape2D` and `ConcavePolygonShape2D` are only meant to be
used directly in code and not in the editor for physics-based use cases
specifically.

Developers are advised to use `CollisionPolygon2D` instead, which does
generate those shapes under the hood, handling polygon convexivity,
proper orientation etc.

(cherry picked from commit dc446203be)
2020-07-06 14:16:28 +02:00
Slooth d4d57476ad Add documentation for minimap_draw and minimap_width
(cherry picked from commit df8f0e6215)
2020-07-06 14:14:23 +02:00
Maganty Rushyendra 68526da5f2 Fix undo/redo for bone painting in Polygon2D UV Editor
Fix to ensure that undo/redo works when painting bones in the Polygon2D
UV editor. Previously, bone painting would continue silently in the
background, because a mouse click signalling the end of an edit would
not be appropriately dealt with.

(cherry picked from commit 6e60aa3876)
2020-07-06 14:13:58 +02:00
Rémi Verschelde 9890189155
Merge pull request #40149 from mrushyendra/ustring_overflow
[3.2] Fix overflow and underflow checks for string conversion to int
2020-07-06 08:13:54 +02:00
Maganty Rushyendra 7670e1fc79 Fix errors in overflow checks for String conversion to int
Current error checks for to_int and to_int64 do not issue overflow error
messages for INT64_MAX + 1, INT64_MAX + 2, and others close to the
limits. Likewise, error checks for hex_to_int, hex_to_int64 and bin_to_int64
issue false positive error messages for INT64_MIN or INT32_MIN. This commit
fixes these error checks.
2020-07-06 08:44:18 +08:00
Rémi Verschelde 1ebfe84458
Merge pull request #40114 from madmiraal/fix-40090-3.2
[3.2] Remove elements from monitored_bodies and monitored_areas as they are processed
2020-07-04 13:08:39 +02:00
Marcel Admiraal ccdfaf2491 Remove elements from monitored_bodies and monitored_areas as they are
processed before calling the callback, instead of after they have all
been processed, because the callbacks may readd them.
2020-07-04 10:08:33 +01:00
Rémi Verschelde 037571d08e
Merge pull request #40087 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.3) - 1st batch
2020-07-04 01:37:52 +02:00
clayjohn 6c0ff26f35 Use mesh instead of immediate for drawing Sprite3D 2020-07-03 12:19:26 -06:00
Rémi Verschelde c9a9c6513f
Merge pull request #40088 from akien-mga/3.2-environment-glow-hdr-bleed-scale
Environment: Fix glow hdr bleed scale being unused
2020-07-03 17:36:30 +02:00
Rémi Verschelde a91c21c628 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@mrushyendra, @mbrlabs, @MCrafterzz

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit 49feec7dc0)
2020-07-03 16:10:09 +02:00
endlesstravel 13d4813ddf fix crash when pass null in print array in GD.print
fix crash when pass null in print array in GD.print 2

fix crash when pass null in print array in GD.print 3

fix space

(cherry picked from commit d2461bad63)
2020-07-03 15:38:07 +02:00
Slooth c29da0e2fe Update TextEdit select and select_all methods
(cherry picked from commit b2471edf45)
2020-07-03 15:37:58 +02:00
Slooth 62677d7da1 Add documentation for selecting_enabled
(cherry picked from commit bc1ea1cbad)
2020-07-03 15:37:58 +02:00
Rémi Verschelde 8e6dd3191f Image: Improve error messages for invalid creation size
(cherry picked from commit b5488def47)
2020-07-03 15:34:30 +02:00
Riley Lyman 157e810b2e Make Resource properties accept SE plugin scripts
(cherry picked from commit ab0fe13efb)
2020-07-03 15:34:30 +02:00
Slooth a8d499723f Add documentation for center_viewport_to_cursor method
(cherry picked from commit 654d33866b)
2020-07-03 15:34:30 +02:00
lrgilbert c0db0749f7 Fixed separation of ports on GraphNode
Fixes #32474.

(cherry picked from commit 47c929c972)
2020-07-03 15:34:30 +02:00
Cevantime 6206f4439d fix laxist collision detection on one way shapes
(cherry picked from commit 23f7d2c29d)
2020-07-03 15:34:30 +02:00
PouleyKetchoupp d6b23306c8 Fix RichTextLabel fill alignment regression
Fixes #40068 (regression from #39164) by not applying the line offset
change in the case of fill alignment mode.

(cherry picked from commit 44f88999c7)
2020-07-03 15:34:30 +02:00
Slooth aacbdebda3 Add documentation for shortcut_keys_enabled
(cherry picked from commit d838282191)
2020-07-03 15:34:30 +02:00
Aaron Franke 3fd7c33f39 Fix incorrect documentation for Vector2.angle()
(cherry picked from commit 299c3ec1c1)
2020-07-03 15:34:30 +02:00
Michael Alexsander 0924a3ac55 Fix timeline cursor not updating on zoom change in the Bezier editor
(cherry picked from commit eee9d053a3)
2020-07-03 15:34:30 +02:00
Pedro J. Estébanez a235bab96c Ignore blend times for inexistent animations
(cherry picked from commit fdf1977e8f)
2020-07-03 15:34:30 +02:00
Fabio Alessandrelli 45b1234a82 Update to wslay 1.1.1 .
A minor fix, but let's stay in sync.

(cherry picked from commit d988b0d1a3)
2020-07-03 15:34:30 +02:00
Fabio Alessandrelli 9d25668339 Update to mbedtls 2.16.7
(cherry picked from commit 8ddf9fe4b0)
2020-07-03 15:34:30 +02:00
Rémi Verschelde b4f710c6d8 thirdparty: List release years in README.md
And expand commit hashes to full hashes instead of shortened ones.

(cherry picked from commit 959ffd5979)
2020-07-03 15:34:30 +02:00
Michael Alexsander a9ef40b388 Remove oversized margins in the AnimationTree editor
(cherry picked from commit 4f00ac7003)
2020-07-03 15:34:30 +02:00
Michael Alexsander f2fe197398 Make timeline cursor in the Bezier editor just as thick as the Animation editor
(cherry picked from commit 20c1196bb0)
2020-07-03 15:34:30 +02:00
Rémi Verschelde d004188348 Environment: Fix glow hdr bleed scale being unused
The glow hdr bleed threshold was passed in its stead.

Fixed in master too with #40016.
2020-07-03 14:27:42 +02:00
Daniel Ting 35523a46c0 Make "Close and save changes?" actually save
This fixes issue #39844, where the confirmation dialog when a user
attempts to close an unsaved script did not actually save it even after
clicking "Save."

(cherry picked from commit d2a5b92e9b)
2020-07-03 13:17:57 +02:00
Michael Alexsander 32c154d297 Fix Tree's 'scroll_to_item()' not working correctly on some cases
(cherry picked from commit 144a4cc39f)
2020-07-03 13:17:57 +02:00
follower 9388237e2d Revert "Adds fuzzy search for help search dialog"
This reverts commit 481dbceed0.

Current fuzzy search implementation results in too many
non-useful results.

Could be re-added after result sort/filter/score functionality
is added. See #30072 for example existing implementation.

Fixes: #39128

Reverts: #32043

Fixed format style conflicts:
	editor/editor_help_search.cpp

(cherry picked from commit 55d706c352)
2020-07-03 13:17:57 +02:00
Hugo Locurcio 89421c58cd Write "Aces" tonemapping in uppercase as it's an acronym
(cherry picked from commit a31fc59ff3)
2020-07-03 13:17:57 +02:00
Stijn Hinlopen cdb9b51ed1 Add Control to preferred types
(cherry picked from commit ec86d32684)

Fix crash by calculating wrong size of array.

(cherry picked from commit 81b6000812)
2020-07-03 13:17:57 +02:00
bruvzg 14b8124074 [macOS export] Set correct external file attributes (Unix mode), and creation time.
(cherry picked from commit accae11fe3)
2020-07-03 13:17:57 +02:00
lordkettune c68ef4d754 Fix issues with custom tracks on reimport
(cherry picked from commit 4313a7bdc8)
2020-07-03 13:17:57 +02:00
Stijn Hinlopen 4c54f39dbe Deleting multiple nodes displays correct message.
(cherry picked from commit 8b046ed477)
2020-07-03 13:17:57 +02:00
Mark Kuo 46590fa3b0 VideoPlayer: fix possible race condition
In set_stream() we write to 'playback' while accessing the same object
in _mix_audio() in audio thread. Protect the 'write' part in
set_stream() to avoid possible crash in _mix_audio() function.

(cherry picked from commit e435d57758)
2020-07-03 13:17:57 +02:00
Paul Herman 850f07a4d9 Expose loading TGA images in Image.
(cherry picked from commit 7d4b3e6587)
2020-07-03 13:17:57 +02:00
Andrii Doroshenko (Xrayez) f50c88ba7b Clarify `Geometry.offset_polygon_2d` regarding vertices translation
The method is used to either inflate or deflate a polygon.
For translating/transforming a polygon, use `Transform2D.xform`.

(cherry picked from commit 19b72da35d)
2020-07-03 13:17:57 +02:00
Thakee Nathees 3a08658881 animation autocomplete bug fixed
(cherry picked from commit b07e788ad9)
2020-07-03 13:17:57 +02:00
Haoyu Qiu 38509f1a89 Prevent dragging from SceneTree buttons
(cherry picked from commit 45d0799b5b)
2020-07-03 13:17:57 +02:00
Marcel Admiraal 50d69a5a3d Call CRASH_COND_MSG if key not found in HashMap get function.
(cherry picked from commit 1b05f449f0)
2020-07-03 13:17:57 +02:00
Rémi Verschelde 22863363a7
Merge pull request #37475 from azagaya/3.2
Fixed images in black margins
2020-07-03 13:09:22 +02:00
Rémi Verschelde 0bc2705ff2
Merge pull request #33998 from nekomatata/printerr-remote-debugger
[3.2] Format remote printerr properly in script debugger output
2020-07-03 07:53:01 +02:00
Rémi Verschelde 24f527b561
Merge pull request #39996 from naithar/feature/ios-gdnative
[3.2] Add support of iOS's dynamic libraries to GDNative
2020-07-03 07:48:45 +02:00
Rémi Verschelde a3e525ba0f
Merge pull request #40054 from bruvzg/macos_confined_mouse_mode_3
[macOS, 3.2] Implement confined mouse mode.
2020-07-03 00:11:27 +02:00
Rémi Verschelde 2759fe85dc
Merge pull request #40052 from Faless/js/more_improvements_3.2
[3.2]  HTML5 fixes, audio fallback, fixed FPS.
2020-07-02 20:24:44 +02:00
Rémi Verschelde 3ec3b5f1e9
Merge pull request #40051 from Faless/iteration/os_delay_3.2
[3.2] Move frame delaying functions from Main to OS.
2020-07-02 20:24:24 +02:00
PouleyKetchoupp 83e376e731 Format remote printerr properly in script debugger output
Fixes #33324
2020-07-02 17:43:37 +02:00
bruvzg b233cb640d
[macOS, 3.2] Implement confined mouse mode. 2020-07-02 17:12:16 +03:00
Fabio Alessandrelli d06ad40757 Add default 50ms output_latency web override.
Hopefully a good tradeoff between latency and performance on most
browsers.
2020-07-02 14:30:23 +02:00
Fabio Alessandrelli 357e99a31e Use dummy driver when JS AudioContext is unavailable. 2020-07-02 14:30:23 +02:00
Fabio Alessandrelli 399e2c1db0 Limit FPS in JS by skipping iterations. 2020-07-02 14:30:23 +02:00
Fabio Alessandrelli c7d2767ab9 [JS] Check canvas size each loop, force redraw.
Remove ResizeObserver, fix compatibility issues, achieve smoother
resizing.
2020-07-02 14:30:23 +02:00
Fabio Alessandrelli 093c463ebf [HTML5] Early FS initialization.
So that "/userfs" is created and mounted before `setup`.
2020-07-02 14:30:12 +02:00
Fabio Alessandrelli dc8b7b3b17 Move frame delaying functions from Main to OS.
Will allow specific platforms to override it and avoid blocking on the
main/GUI thread.

(cherry picked from commit 1b6e3458b2)
2020-07-02 13:52:02 +02:00
Rémi Verschelde 44a516986d
Merge pull request #39084 from madmiraal/backport-37314
[3.2] Better damping implementation for Bullet rigid bodies
2020-07-02 13:26:03 +02:00
Sergey Minakov 0e2bc779ed GDNative export: do not add fake lookup table if static lib is not used 2020-07-02 12:47:58 +03:00
Sergey Minakov 8fff25df09 GDNative Editor: Support selecting frameworks for iOS 2020-07-02 12:47:20 +03:00
Sergey Minakov e2a45fe840 iOS Export: Updated Info.plist. Framework embedding. Fixes for search paths 2020-07-02 12:46:57 +03:00
Sergey Minakov 519024829a iOS Export: turn .dylib into .framework on export 2020-07-02 12:45:14 +03:00
Sergey Minakov 6001e10054 GDNative: support dynamic loading of iOS frameworks 2020-07-02 12:38:51 +03:00
TwistedTwigleg 3dc466b244 Fixed issue where the SkeletonIK node would incorrectly scale bones in the IK chain 2020-07-01 11:16:25 -04:00
Rémi Verschelde 3247ac4b0e
Merge pull request #39981 from madmiraal/fix-39919-3.2
[3.2] Fix CSG Visual Bug.
2020-07-01 08:48:09 +02:00
Rémi Verschelde 63fd0d37ed
Merge pull request #39895 from madmiraal/fix-39768-3.2
[3.2] Trigger broadphase update when changing collision layer/mask.
2020-06-29 21:34:56 +02:00
Marcel Admiraal 22ff17793c Use is_equal_approx() instead of vertex_snap when checking if ray is
colliding with equiplanar CSG faces.
2020-06-29 19:48:47 +01:00
Marcel Admiraal 8e120230a1 Create degenerate triangles when inserting an edge into a CSG face.
They will be deleted when the faces are merged, but their edges are
needed for merging faces.
2020-06-29 16:40:53 +01:00
Rémi Verschelde b833296cbb
Merge pull request #39943 from bruvzg/macos_apple_silicon_3
[macOS, 3.2] Add support for the Apple Silicon (ARM64) build target.
2020-06-29 15:30:03 +02:00
Rémi Verschelde e88dc5da68
Merge pull request #39941 from akien-mga/3.2-x11-XGetWindowProperty-memleak
X11: Ensure XGetWindowProperty data gets freed
2020-06-29 13:57:57 +02:00
bruvzg 43888ebfaf
[macOS, 3.2] Add support for the Apple Silicon (ARM64) build target. 2020-06-29 14:43:29 +03:00
Rémi Verschelde 08ee1de535 X11: Ensure XGetWindowProperty data gets freed
Fixes a small memory leak reported by lsan:
```
Direct leak of 73 byte(s) in 1 object(s) allocated from:
    #0 0x7f29825f3e70 in malloc (/lib64/liblsan.so.0+0xee70)
    #1 0x7f29824a5729 in XGetWindowProperty (/lib64/libX11.so.6+0x29729)
```
2020-06-29 13:05:24 +02:00
Maganty Rushyendra 6bd7fd0a00 Fix accidental duplication of Polygon2D start point
Ensures that closure of Polygon2D in the editor takes into account
Grid Snap if enabled. Does this by comparing the polygon start with
grid snap applied to mouse click location. Note: transformation is
applied in order to deal with different editor zoom levels.

(cherry picked from commit b8d55b244a)
2020-06-29 10:59:04 +02:00
Maganty Rushyendra cd3a3eb3eb Fix weekday calculation in get_datetime_from_unix_time for negative times
Fix calculation for negative times to ensure Sundays are wrapped around to '0'
instead of '7', making it consistent with the output for positive times.

(cherry picked from commit aae5f246ff)
2020-06-29 10:58:41 +02:00
Tomasz Chabora 5b7eb3fd3f Improve the preload and load descriptions
(cherry picked from commit 13298ed873)
2020-06-29 10:58:25 +02:00
Mark Kuo cb9bc18102 VideoStreamGDNative: close file in cleanup
We should close the file handle when we are done.

(cherry picked from commit 3b05d2c989)
2020-06-29 10:57:59 +02:00
Tomasz Chabora 7bd101b5c5 Generate inspector preview for Image resources
(cherry picked from commit eb6a367cb7)
2020-06-29 10:57:00 +02:00
Stijn Hinlopen c029a03bc3 Remove directory search results
(cherry picked from commit c33707e9b4)
2020-06-29 10:56:32 +02:00
Adam Reichold f06fc1fdf4 Call Spatial::get_global_transform and Vector3::dot only once within Camera::is_position_behind to avoid redundant work.
(cherry picked from commit b2a204799a)
2020-06-29 10:48:45 +02:00
Rémi Verschelde 636b1e4518 CanvasItemEditor: Fix losing position for drag'n'dropped scenes
Fixes #26549.
Supersedes #36309.

(cherry picked from commit a403131a25)
2020-06-29 10:48:07 +02:00
Stijn Hinlopen 65155c2855 No longer scroll vertically when scrollbars are unavailable
(cherry picked from commit 5f7499beac)
2020-06-29 10:47:43 +02:00
Hugo Locurcio 8cc3d4bda6 Keep the bottom panel visible when enabling the distraction-free mode
- Document the `EditorInterface.distraction_free_mode` property.

This closes https://github.com/godotengine/godot-proposals/issues/951.

(cherry picked from commit e6352d1daa)
2020-06-29 10:46:05 +02:00
Rémi Verschelde 94eaeb5e84
Merge pull request #39903 from RandomShaper/fix_object_rc_leak
Fix leaked ObjectRCs on object Variant reassignment
2020-06-28 09:53:32 +02:00
Rémi Verschelde 9b48c81f47
Merge pull request #39905 from m4gr3d/fix_focus_aware_option
Fix the logic to enable focus awareness
2020-06-28 09:10:52 +02:00
Rémi Verschelde 429f4830fe
Merge pull request #39906 from RandomShaper/fix_dangling_key_dbg_error
Fix debugger error when Dictionary key is a freed Object
2020-06-28 09:02:41 +02:00
Pedro J. Estébanez b02e0b0c4b Fix debugger error when Dictionary key is a freed Object 2020-06-28 02:36:13 +02:00
Fredia Huya-Kouadio 623a1ae5b3 Fix the logic to enable focus awareness 2020-06-27 16:40:22 -07:00
Pedro J. Estébanez dca653cc3a Fix leaked ObjectRCs on object Variant reassignment
Bonus:
- Add some (un)likely magic
- Use memdelete() instead of memfree() (not strictly needed, but more correct)
2020-06-28 01:31:00 +02:00
Marcel Admiraal de284ea5d2 Trigger broadphase update when changing collision layer/mask, and
check for collision layer/mask changes in 2D hash grid broadphase update.
2020-06-27 18:11:21 +01:00
Rémi Verschelde dafadfe6db
Merge pull request #39870 from Chaosus/shader_fix_return_3.2
[3.2] Prevents usage of return in main shader functions
2020-06-27 17:14:35 +02:00
Yuri Roubinsky 891b84a833 [3.2] Prevents usage of return in main shader functions 2020-06-27 17:38:22 +03:00
Rémi Verschelde 3e3972db7a
Merge pull request #39865 from clayjohn/alpha-prepass-fix
force depth prepass when using alpha prepass
2020-06-27 09:51:08 +02:00
clayjohn 95f93b5f0f force depth prepass when using alpha prepass 2020-06-26 15:16:20 -07:00
Rémi Verschelde 28c0088d86
Merge pull request #39558 from m4gr3d/godot_fragment_3_2
[3.2] Enable the ability to use Godot as a subview within an Android app
2020-06-26 22:07:43 +02:00
Rémi Verschelde 34c5133e6a
Merge pull request #39604 from Faless/js/3months_backport
[HTML5 - 3.2] Backport most changes/improvement in master.
2020-06-26 20:50:58 +02:00
Rémi Verschelde d6ff55f30b
Merge pull request #39784 from neikeq/3.2-visualstudio-support
[3.2] C#: Add Visual Studio support
2020-06-26 20:49:35 +02:00
Rémi Verschelde 11bb4ef4c3 Bump version to 3.2.3-beta 2020-06-26 20:48:27 +02:00
Rémi Verschelde 6a9fbafcbb Bump version to 3.2.2-stable
This release includes many bugfixes, UX enhancements but also a number
of new features such as C# support on iOS, 2D batching for GLES2, a new
plugin system for Android, and DTLS support!

Thanks to all contributors! <3
2020-06-26 08:17:54 +02:00
Andrii Doroshenko (Xrayez) 63523e56e1 Don't use arbitrary theme editor icons for scripts with the same name
The existing theme editor icon could be unintentionally set for any
global class with matching name (`Group` icon, `Group` class_name etc),
which would only show up in the "Create Dialog" context, but not the
scene tree dock.

This change prevents this behavior, and ensures that the icon can be
actually overidden by explicit icon path in `class_name`, if there's any
custom icon to begin with.

The correct built-in type's icon is fetched for child classes if there
are no custom icons detected throughout base classes as well, so it
isn't left empty for those cases.

(cherry picked from commit c177308f80)
2020-06-26 08:10:24 +02:00
Ignacio Etcheverry c682410379 Mono/C#: Fix unhandled exception not being printed
For some reason `mono_unhandled_exception` is not
printing the exception as its comment claims.
Use `mono_print_unhandled_exception` instead.

(cherry picked from commit f87ae395ee)
2020-06-26 08:10:24 +02:00
Rémi Verschelde c8586d3837
Merge pull request #39840 from neikeq/3.2-use-/restore-instead-of-/t-restore
[3.2] Mono/C#: Use /restore instead of /t:restore when building
2020-06-26 08:08:40 +02:00
Rémi Verschelde 705b1695af
Merge pull request #39818 from Wavesonics/server-memory-leak
Fix memory leaks in RasterizerStorageDummy::free
2020-06-26 08:05:13 +02:00
Marcel Admiraal ebff150680 Support SDL2 half axes and inverted axes mappings. 2020-06-26 06:28:56 +01:00
Fredia Huya-Kouadio 920639511d Enable the ability to use Godot as a subview within an Android app 2020-06-25 19:57:03 -07:00
Ignacio Etcheverry abc453f9b6 [3.2] Mono/C#: Use /restore instead of /t:restore when building
Documentation recommends not to use /t:restore
together with other targets (like /t:build),
as it messes with the environment.
2020-06-25 23:57:44 +02:00
Wavesonics 23d44223e6 Fix memory leaks in RasterizerStorageDummy::free
Lightmap capture data is now freed as well
free() now also properly returns true or false based on if something was actually freed.
2020-06-25 12:22:00 -07:00
Ignacio Etcheverry 7af6a4cc50 [3.2] Fix DebugPlay request handler ignoring BuildBeforePlaying
This must have been missed when backporting the new protocol to 3.2.
2020-06-25 21:20:44 +02:00
Rémi Verschelde 5079bea660
Merge pull request #39820 from Chaosus/shader_fix_const_crash_3.2
[3.2] Fix shader crash if pass const argument to 'out/inout' parameter
2020-06-25 11:36:37 +02:00
Rémi Verschelde 76fa1724b3
Merge pull request #39395 from asmaloney/fix-macos-scrollwheel-zoom
[3.2][macOS] Control key + scroll wheel should zoom not pan
2020-06-25 11:22:24 +02:00
Rémi Verschelde a84f081160 i18n: Sync translations with Weblate 2020-06-25 10:42:19 +02:00
Yuri Roubinsky 474b178534 [3.2] Fix shader crash if pass const argument to 'out/inout' parameter 2020-06-25 10:27:37 +03:00
Hugo Locurcio 087a83fd54 Improve the low processor mode sleep precision
The Low Processor Usage Mode Sleep Usec setting is now used as a
FPS limiter rather than a constant sleep duration.

This will increase CPU/GPU usage slightly due to the higher
effective FPS, but the increase in overall smoothness is worth it.

If both Force Fps and Low Processor Usage Mode settings are enabled
in the project settings, only the setting that causes the highest
sleep duration will be retained.

This closes #11030.

(cherry picked from commit 1c28b269d8)
2020-06-24 23:15:53 +02:00
Rémi Verschelde 530307e7ec Main::cleanup: Move MessageQueue deletion further down where it's safer
Partial revert of #15702 which triggered the issue.

Fixes #39786.

(cherry picked from commit 6480efba45)
2020-06-24 22:52:05 +02:00
Andrii Doroshenko (Xrayez) 6dee6477dd Optimize class icon loading
`get_global_class_name` for `GDScriptLanguage` is slow because
it forces to parse an entire script each time. This patch ensures
that the icon is actually fetched from the EditorData where they
are loaded beforehand.

This change also makes the behavior consistent with the existing
`get_object_icon` method in EditorNode.

(cherry picked from commit 4a86e2bb76)
2020-06-24 22:52:05 +02:00
Bill d4a1bc475a Fix overlapping hotkey designations for save all scenes and save all scripts
(cherry picked from commit acdcda9033)
2020-06-24 22:52:05 +02:00
Andreas Gustafsson 68c273fb09 Tween.xml word order fix
Change the word order of '...the where...' into '...where the...'.

(cherry picked from commit 5181daaf9e)
2020-06-24 22:52:05 +02:00
Meriipu d2347bc4ec Clarify what a string being empty means
Should close https://github.com/godotengine/godot-docs/issues/2432

(cherry picked from commit 2643b8fa5e)
2020-06-24 22:52:05 +02:00
Yuri Roubinsky 5be4e10f4e Fix error label clicking in status bar for shader editor
(cherry picked from commit 25cb5a42e0)
2020-06-24 22:52:05 +02:00
Maganty Rushyendra 0f30fa8fbd Enable finer grained control when creating polygon with UV Editor
Modifies polygon auto-completion based on UV editor scale, in order
to enable finer grained control for the user. Enables selection of
points closer than the current threshold of 8 pixels.

(cherry picked from commit 69d0d89214)
2020-06-24 22:52:05 +02:00
Fredia Huya-Kouadio 944210923f Follow up cleanup for the godotpayment project module
(cherry picked from commit 206cbd960b)
2020-06-24 22:52:05 +02:00
Hugo Locurcio 0867fc2c4c Draw horizontal lines and labels in the editor performance monitors
This partially addresses
https://github.com/godotengine/godot-proposals/issues/1014.

(cherry picked from commit a593786d09)
2020-06-24 22:52:05 +02:00
Maganty Rushyendra afac2514f8 Fix upscaling image with bilinear interpolation option specified
Fix error in calculation of 4 nearest points in source image when
resizing image with bilinear interpolation.

(cherry picked from commit f24ec3878e)
2020-06-24 22:52:05 +02:00
Rémi Verschelde 8f28e0861f
Merge pull request #39762 from naithar/feature/ios-modules
Enable iOS modules and fix missing symbols errors (3.2)
2020-06-24 22:50:05 +02:00
Rémi Verschelde 8b210f8732
Merge pull request #39806 from RandomShaper/fix_gone_popup_crash_3.2
Handle gone TabContainer popup nicely (3.2)
2020-06-24 20:22:14 +02:00
Pedro J. Estébanez 0f0360702b Handle gone TabContainer popup nicely 2020-06-24 19:31:26 +02:00
Rémi Verschelde 1575820207
Merge pull request #39791 from PoqXert/ios
[iOS] Replace purchase receipt
2020-06-24 15:15:40 +02:00
Poq Xert bd71925726 Updated purchase receipt suitable for sending to apple verification server 2020-06-24 17:34:20 +10:00
Rémi Verschelde c7bbe262dd
Merge pull request #39333 from Aroweeri/environment
Environment doc update regarding Viewport usage.
2020-06-24 08:19:19 +02:00
Ignacio Etcheverry d0f365fe0f [3.2] C#: Fix completion request with case insensitive resource path
Sometimes Visual Studio documents have the root path all in upper case.
Since Godot doesn't support loading resource files with a case insensitive path,
this makes script resource loading to fail when the Godot editor gets code
completion requests from Visual Studio.
This fix allows the resource path part of the path to be case insensitive. It
still doesn't support cases where the rest of the path is also case insensitive.
For that we would need a proper API for comparing paths. However, this fix
should be enough for our current cases.
2020-06-23 21:04:08 +02:00
Ignacio Etcheverry d8af79140e [3.2] C#: Add VisualStudio support 2020-06-23 21:01:54 +02:00
Rémi Verschelde 7ec072f7e7
Merge pull request #39774 from lawnjelly/kessel_tex_wrapping_fix
GLES2 Batching - Fix texture wrapping state bug.
2020-06-23 10:17:52 +02:00
lawnjelly 491059ca82 GLES2 Batching - Fix texture wrapping state bug.
For textures that were imported as wrapping, the legacy renderer relied on GL repeat state being set as a once off during load, and didn't alter the GL wrapping state at runtime.

Batching was setting wrapping according to the CANVAS_RECT_TILE flag on rects, however this reset GL wrapping to clamp after use, which was conflicting with later drawcalls that relied on the default wrapping being preserved.

In this PR we only set the wrapping in GL if the texture has not been imported with wrapping. This duplicates the logic in the legacy renderer and solves the state bug.
2020-06-23 08:34:17 +01:00
Dylan 198bd4cb0f Environment doc update regarding Viewport usage. 2020-06-22 17:59:44 -04:00
Sergey Minakov 45a6628b15 SCons: Enable iOS modules for ARKit and Camera 2020-06-22 23:23:03 +03:00
Sergey Minakov e564ca0c1b Export: Fix iOS enabling push notifications capability 2020-06-22 23:16:22 +03:00
Sergey Minakov bc6a75786c Export: Remove system frameworks from xcode template 2020-06-22 23:16:22 +03:00
Sergey Minakov a678ceaeae SCons: Enable modules for iOS 2020-06-22 23:15:52 +03:00
bruvzg a662b853dd Fix use uninitialized `ofs` variable introduced in 39701.
(cherry picked from commit 439c97e0ff)
2020-06-22 15:41:36 +02:00
Rémi Verschelde 8fd861ab11 doc: Sync classref with current source 2020-06-22 13:24:11 +02:00
bruvzg 1468c0b4d4 [Windows] Prevent overwriting old cursor handle on multiple mouse_mode changes, ensure mouse_mode is set before `cursor_set_shape` is called to restore cursor.
(cherry picked from commit fc1d1c3557)
2020-06-22 13:08:53 +02:00
Rémi Verschelde f2f11bc752
Merge pull request #39744 from timoschwarzer/remove-godot-payment-plugin
Remove GodotPayment android plugin (3.2)
2020-06-22 12:15:36 +02:00
Aaron Franke 44c3908c7b Avoid errors when the editor camera is inside the focused object
Prevent the gizmo distance from being zero by MAX-ing it with CMP_EPSILON

(cherry picked from commit ed2bbdbbef)
2020-06-22 12:04:52 +02:00
bruvzg e2675e9462 macOS, prevent multiple CGDisplayHideCursor calls unpaired with CGDisplayShowCursor.
(cherry picked from commit 7a250b579f)
2020-06-22 12:04:31 +02:00
PouleyKetchoupp d2aa3031dc Fix crashes with invalid shapes in BulletPhysicsDirectSpaceState queries
(cherry picked from commit 8b0232bf29)
2020-06-22 12:03:21 +02:00
Timo Schwarzer 5053ab684a
Remove GodotPayment android plugin
This is now available in a separate repository
at https://github.com/godotengine/godot-google-play-billing
2020-06-22 11:11:41 +02:00
Rémi Verschelde 571a0c60c0 Revert "Implement Skew in Node2D"
This reverts commit 7f61710183.

See #38868, in its current implementation a small skew value might end up
serialized to scene files due to floating point precision errors, which is
detrimental to VCS.

This can be cherry-picked anew once a fix for #38868 has been found.
2020-06-22 10:26:06 +02:00
Rémi Verschelde 75791358c6
Merge pull request #39736 from naithar/fix/deleted-object-stringify
Fix for a crash on printing freed object
2020-06-22 10:02:30 +02:00
Sergey Minakov af1788baf3 Variant: Fix potential crash when stringifying deleted Object
Fixes #38597.
2020-06-22 08:53:47 +02:00
Rémi Verschelde 000db65d40 i18n: Sync translations with Weblate 2020-06-22 08:43:14 +02:00
skyace65 0b1d9f9d88 Fix Joint2D doc
(cherry picked from commit a94ba7be59)
2020-06-22 08:37:57 +02:00
Rémi Verschelde 327479472e Revert "return boxed long when marshalling a godot int to mono runtime in dynamic contexts"
This reverts commit 42a31501a8.

It breaks compat as is and needs some further work before it can be
cherry-picked for 3.2.x.
2020-06-22 08:35:21 +02:00
Vorblen 4c638f98ab Fix "Fully Axis-Locked" Freelook Navigation Scheme
Co-authored-by: Aaron Franke <arnfranke@yahoo.com>
(cherry picked from commit 29e901c342)
2020-06-21 21:48:12 +02:00
Hugo Locurcio 9889641bae Document how Vector2, Vector3 and Color behave in a boolean context
See #39731.

(cherry picked from commit 227f12478d)
2020-06-21 21:44:02 +02:00
Aaron Franke d9beab34c5 Update bool documentation to be more clear
(cherry picked from commit 08577fab14)
2020-06-21 21:42:56 +02:00
Rémi Verschelde 8ac13e50cf Move Haiku platform port to external repository
The Haiku port now resides at:
https://github.com/godotengine/godot-haiku-platform

While we're happy to support as many Free and Open Source platforms as we can,
we need to put the main focus on the platforms that we can reasonably maintain,
and for Haiku we have been lacking maintainers ever since the port was first
merged in 2015.

The Haiku code has not been compiling and much less working at least since the
release of Godot 3.0, and while some attempts have been made at fixing things,
it's still not functional today in the `3.2` branch (and much less in `master`,
understandably).

Having it in an external repository should hopefully enable Haiku contributors
to fix issues in their own time, and possibly tag versions compatible with
past Godot releases once they are ready.

(cherry picked from commit efcc508ee5)
2020-06-21 21:42:26 +02:00
Maganty Rushyendra 7e3d7417e3 Fix overwrite of manual changes in export_presets.cfg when export dialog is opened
Ensures that behavior when export_presets.cfg file is edited manually
while editor is running remains identical to before commit 44094b0.

(cherry picked from commit 4a7c19e719)
2020-06-21 21:41:39 +02:00
Bastiaan Olij 70fb79efa0 Fix missing slider joystick handling on Windows
(cherry picked from commit aa01b327d6)
2020-06-21 21:41:14 +02:00
PouleyKetchoupp cdbbc75e90 Set proper file type attribute for OSX zip export
The missing file type in file attributes was causing the file to lose
executable permissions when unzipped with some softwares.

(cherry picked from commit 4501771fd8)
2020-06-21 21:40:57 +02:00
Hugo Locurcio 371f1e951e Replace the AssetLib tab icon with a less confusing design
This closes https://github.com/godotengine/godot-proposals/issues/818.

(cherry picked from commit ebabedc615)
2020-06-21 21:40:39 +02:00
Hugo Locurcio c5d70fc6a6 Scroll horizontally when holding Shift with Scroll to Pan enabled
This closes https://github.com/godotengine/godot-proposals/issues/1077.

(cherry picked from commit 84e1c5e4c3)
2020-06-21 21:40:10 +02:00
Rémi Verschelde f99cbb94cc Export: Rename 'Windows Universal' to 'UWP'
It's otherwise too easy to be confused between 'Windows Desktop' (Win32)
and 'Windows Universal' (UWP).

(cherry picked from commit 08ef0aab16)
2020-06-21 21:39:44 +02:00
Sl3dge78 6e835a4820 Autofilled path gets set properly on animation subresources
(cherry picked from commit d731f43794)
2020-06-21 21:39:23 +02:00
Dominik 'dreamsComeTrue' Jasiński af43748dd5 Prevent having spaces in signal's method in Connect Dialog
Fixes: #39647
(cherry picked from commit 79f46da1a3)
2020-06-21 21:38:17 +02:00
Sl3dge78 d99f6c4d5c Fix #20467. The "Anim imported" warning gets displayed properly when working on imported anims.
(cherry picked from commit 95cd74fc4b)
2020-06-21 21:36:12 +02:00
unknown d080c0de51 adding check for syskeydown on control and alt
(cherry picked from commit d191a8b9f8)
2020-06-21 21:34:50 +02:00
Tomasz Chabora 8f3eec930b Add unique icon to Polygon2D
(cherry picked from commit 225622e5e3)
2020-06-21 21:33:23 +02:00
Rémi Verschelde 804b53bdbb
Merge pull request #37500 from madmiraal/check-motion-before-bullet-sweep-3.2
[3.2] Check for motion in cast_motion() before doing Bullet convexSweepTest().
2020-06-21 18:31:52 +02:00
Rémi Verschelde 6cf8709808
Merge pull request #39729 from madmiraal/fix-39718-3.2
[3.2] Fix creation of duplicate faces in CSG merge faces.
2020-06-21 17:58:40 +02:00
Marcel Admiraal b006f5402d Check for motion in cast_motion() before doing Bullet convexSweepTest().
Also ensure that default closest_safe and closest_unsafe values are
defined in cast_motion() and before cast_motion() is called.
2020-06-21 16:28:01 +01:00
Marcel Admiraal fa0ee28826 Check if point's index exists before adding it to the list of points
that need to split faces when avoiding creating degenerate faces
while merging CSG faces.
2020-06-21 14:41:05 +01:00
Rémi Verschelde bd16fd9d19
Merge pull request #39683 from asmaloney/3.2-FileAccessBuffered-init
[3.2] Ensure FileAccessBuffered structs are properly initialized
2020-06-19 23:44:17 +02:00
Andy Maloney 7f18163ea6 [3.2] Ensure FileAccessBuffered structs are properly initialized 2020-06-19 11:32:53 -04:00
Michael Belousov 42a31501a8 return boxed long when marshalling a godot int to mono runtime in dynamic contexts
(cherry picked from commit 60fcefba69)
2020-06-19 16:17:27 +02:00
PouleyKetchoupp b3af0b2a39 Option in RichTextLabel for height to fit content
(cherry picked from commit ad8081216c)
2020-06-19 16:17:27 +02:00
Rémi Verschelde 307a9551ae
Merge pull request #39658 from asmaloney/3.2-macos-command-backspace
[3.2][macOS] Command-backspace in line edit
2020-06-19 13:19:51 +02:00
Rémi Verschelde 6c6a203e26
Merge pull request #39644 from Ev1lbl0w/feature/disable-rendering
Expose disable_render_loop property to GDScript
2020-06-19 12:54:04 +02:00
Rémi Verschelde 388a194afc
Merge pull request #39669 from lawnjelly/kessel_vertex_write_fix
GLES2 Batching - prevent baking on VERTEX use in a shader
2020-06-19 11:09:32 +02:00
lawnjelly a4bd66f854 GLES2 Batching - prevent baking on VERTEX use in a shader
Using the operator += in a shader is classified as an 'assign', and so is classified as a write rather than a read. This means that we need to prevent vertex baking on either a write or read (i.e. on usage), rather than just on reads.
2020-06-19 09:42:04 +01:00
Andy Maloney 5bbb15418f [3.2][macOS] Command-backspace in line edit
Make command-backspace in line edit work like other macOS applications.

If there is a selection, command-backspace deletes the selection.

If there isn't a selection, command-backspace deletes from the cursor to the beginning of the line edit.

This addresses part of godotengine/godot#23548
2020-06-18 17:42:51 -04:00
Ev1lbl0w 17c87d2ec1
Expose disable_render_loop property to GDScript 2020-06-18 11:59:29 +01:00
Maganty Rushyendra ae59e22cdd Fix editor texture preview for certain specific dimensions
Ensures no error is issued when attempting to preview a resource that
may be scaled down to <1 pixel when resizing to fit the thumbnail.

(cherry picked from commit c7a8dc7bb9)
2020-06-18 12:00:05 +02:00
Hugo Locurcio 88c22cb648 Document Mono-specific classes
This fully documents all Mono-specific classes.

(cherry picked from commit 24a8d43272)
2020-06-18 11:33:18 +02:00
Bojidar Marinov 1c801dd044 Fix a random crash in the TileSet editor
Occurred when selecting polygon collision mode, then drawing a single point, then selecting rectangle mode, and finally trying to select a rectangle.

(cherry picked from commit 7850d0316f)
2020-06-18 11:29:28 +02:00
Hugo Locurcio d4dd80afe7 Restore previous mouse position when leaving the editor freelook mode
- Remove the crosshair as it no longer serves a purpose (the cursor will
  now appear where the user "expects" it to).

This closes https://github.com/godotengine/godot-proposals/issues/1076.

(cherry picked from commit 4a542e0007)
2020-06-18 11:29:28 +02:00
Rémi Verschelde bf913d6917 DocData: Skip language-specific ClassDoc without methods/constants
Removes the useless `@C#`, `@NativeScript` and `@VisualScript` entries.

(cherry picked from commit ba0db95909)
2020-06-18 11:29:28 +02:00
Stijn Hinlopen dc7f555783 Search result highlights follow font size
(cherry picked from commit a86521d0bd)
2020-06-18 11:29:28 +02:00
Aaron Franke 6e3a1074ce Simplify Transform2D get_rotation
(cherry picked from commit 0fa478a050)
2020-06-18 11:29:28 +02:00
Maganty Rushyendra 3b52ea4b43 Fix code editor Replace tool to work with 'Selection Only' option
Ensures that when the `Selection Only` option is selected, the Replace
tool replaces occurrences of the search phrase only within the selected
region, and in order of occurrence.

(cherry picked from commit 2be3a33cc3)
2020-06-18 11:29:28 +02:00
Marcel Admiraal 7971b20ebe Add Code::Blocks files to .gitignore.
(cherry picked from commit 990ecf8fc4)
2020-06-18 11:29:28 +02:00
Rémi Verschelde d8b543c991 DDS: Fix loading files without DDSD_CAPS or DDSD_PIXELFORMAT
MSDN says:

> When you write .dds files, you should set the DDSD_CAPS and
> DDSD_PIXELFORMAT flags, and for mipmapped textures you should also
> set the DDSD_MIPMAPCOUNT flag. However, when you read a .dds file,
> you should not rely on the DDSD_CAPS, DDSD_PIXELFORMAT, and
> DDSD_MIPMAPCOUNT flags being set because some writers of such a file
> might not set these flags.

https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dds-header

¯\_(ツ)_/¯

Fixes #39516.

(cherry picked from commit 0f21249a2d)
2020-06-18 11:29:28 +02:00
Ev1lbl0w 4d7ac36e84 Allow Godot to kill it's own PID
(cherry picked from commit 75ce45440a)
2020-06-18 11:29:28 +02:00
Vorblen f46624030c Add description for "absorbent" and "rough"
(cherry picked from commit 8acdbaa4f2)
2020-06-18 11:29:28 +02:00
Hugo Locurcio 5200ff03d2 Display freelook speed and zoom in units in the 3D editor viewport
Now that the 3D editor grid is infinite and adjusts its step automatically,
this helps people get a better sense of scale when moving around in the
3D viewport.

This also fixes the indicator bar drawing on hiDPI displays.

(cherry picked from commit eaae50fe4a)
2020-06-18 11:29:28 +02:00
Andrea Catania 74d10e766e - Added more euler rotation orders support.
- Fixed floating point issue on the old one.
- Fixed the equation on the get_euler_yxz function.
- Added unit tests.

This work has been kindly sponsored by IMVU.

(cherry picked from commit 2331300989)
2020-06-18 11:29:28 +02:00
Thakee Nathees 438f1a8238 Fix: Ctrl + Click not working for subclasses
(cherry picked from commit 95b0a00d2c)
2020-06-18 11:29:28 +02:00
Thakee Nathees fc92f83c30 Debugger stepping to incorrect line fix
Fix: #39296
(cherry picked from commit fc89c5c76d)
2020-06-18 11:29:28 +02:00
Tomasz Chabora d46ab53b41 Allow duplicating files when holding Control
(cherry picked from commit b426d11d86)
2020-06-18 11:29:27 +02:00
Thakee Nathees 931a927a40 shodowed var warning for `for` loop counter
Fix: #39268
(cherry picked from commit 54835a5302)
2020-06-18 10:51:45 +02:00
Tomasz Chabora 202ca3ce7f Link exposed set/getters in property descriptions
(cherry picked from commit ea07acb877)
2020-06-18 10:51:45 +02:00
Thakee Nathees bf9df88a7c GDScript debugger incorrect error line fixed
if the first line of an else or an elif throws a runtime error the
debugger shows incorrect line number.

(cherry picked from commit 9325671faa)
2020-06-18 10:51:45 +02:00
Andrii Doroshenko (Xrayez) 5084043373 Bind Shape2D draw method
(cherry picked from commit 430d1fd795)
2020-06-18 10:51:44 +02:00
Hugo Locurcio a6a29f97fe Add a suffix to the window title when running from a debug build
Since projects started from the editor or exported in debug mode
run slower than those exported in release mode, this should be
clearly presented to the user.

This partially addresses #20219.

(cherry picked from commit a9c60007a9)
2020-06-18 10:46:01 +02:00
Fabio Alessandrelli b146bf2528 Canvas resize callback, to update buffer size. 2020-06-18 09:21:14 +02:00
Fabio Alessandrelli 806b23208f Fix modules with closure compiler. 2020-06-18 09:21:14 +02:00
Fabio Alessandrelli 21c9f37757 [HTML5] Refactor JS, threads support, closures.
- Refactored the Engine code, splitted across files.
- Use MODULARIZE option to build emscripten code into it's own closure.
- Optional closure compiler run for JS and generated code.
- Enable lto support (saves ~2MiB in release).
- Can now build with tools=yes (not much to see yet).
- Dropped some deprecated code for older toolchains.
- Add onExit, and onExecute JS function.
- Add files drag and drop support.
- Add support for low precessor usage mode (via offscreen render, swap).
2020-06-18 09:21:14 +02:00
Rémi Verschelde 7f6767470d
Merge pull request #39580 from m4gr3d/provide_activity_to_godot_plugin_constructor_3_2
Clean up the GodotPlugin public API.
2020-06-16 20:45:49 +02:00
Fredia Huya-Kouadio 61aa477e1c Clean up the `GodotPlugin` public API. 2020-06-16 09:24:41 -07:00
Rémi Verschelde 1cf8652945
Merge pull request #39263 from ThakeeNathees/is-operation-fail
[3.2] Fix `is` operation fail on get_script()
2020-06-16 16:28:43 +02:00
Rémi Verschelde 893cf84278
Merge pull request #39590 from madmiraal/fix-35744-3.2
[3.2] Normalise p_up_direction vector in move_and_slide()
2020-06-16 12:45:07 +02:00
Marcel Admiraal ea4ee986b5 Normalise p_up_direction vector in move_and_slide() and
move_and_slide_with_snap() and fix tolerance in
move_and_slide_with_snap() max floor angle.
2020-06-16 10:11:54 +01:00
Rémi Verschelde 2e8480d56a
Merge pull request #39571 from Chaosus/fix_vs
[3.2] Use path instead classname to prevent errors for exported visual shaders
2020-06-16 09:33:15 +02:00
Rémi Verschelde af094253a6
Merge pull request #39568 from Ranoller/patch-2
(3.2) Fix bad position in Camera2D offset and camera rotation if smot…
2020-06-15 23:36:32 +02:00
Yuri Roubinsky 87ebc29d8e Use path instead classname to prevent errors for exported visual shaders 2020-06-15 21:33:32 +03:00
Rémi Verschelde e50e834197
Merge pull request #39559 from RandomShaper/fix_half_float_textures_3.2
Fix wrong internal format for half-float textures
2020-06-15 19:36:49 +02:00
Ranoller 616fb219db
(3.2) Fix bad position in Camera2D offset and camera rotation if smothing enabled
Fix https://github.com/godotengine/godot/issues/16323 in 3.2 branch. Apply same solution of https://github.com/godotengine/godot/issues/2074 in rotation and offset.
2020-06-15 16:34:03 +02:00
Andy Maloney f4640af9c1 [3.2][macOS] Control key + scroll wheel should zoom not pan
Fixes godotengine/godot#32520
2020-06-15 10:23:11 -04:00
Rémi Verschelde 93e20a4cd4 GDScript LSP: Fix wrong error checks added in #39385
Reverts `latest_client_id` back to 0, as I misunderstood how the client
IDs are assigned and, without further testing and debugging, I can't
say if this was a bug or a valid default value.
Similarly, a `latest_client_id` of -1 is no longer raising an error.

Fixes #39548.

(cherry picked from commit 786f4ada35)
2020-06-15 14:34:35 +02:00
Rémi Verschelde 35a5ebb44d i18n: Sync translations with Weblate
Remove 'de_CH' translation (4% complete) to default to the 100%
complete 'de' one.

Fixes #32625.
2020-06-15 14:34:35 +02:00
dominiks ff185f715a Add note about automatic window title to FileDialog documentation.
(cherry picked from commit d2250a2320)
2020-06-15 14:34:35 +02:00
Hugo Locurcio 4c289058ed Clarify Node virtual methdods not being called if node is orphan
This closes #39489.

(cherry picked from commit b2ba78ff0f)
2020-06-15 14:34:35 +02:00
Umang Kalra 1d0c39e395 Fixes the stopping of animation effects in bbcode after appending
(cherry picked from commit 88b30a29bf)
2020-06-15 14:34:35 +02:00
31 1b58f94296 Fix Image.create_from_data use_mipmaps doc
The Image.create_from_data doc describes the "use_mipmaps" argument as a
way to generate mipmaps, but this method only allocates and loads data.
This can cause confusion, where this function reads more or less data
than expected. Update the doc to be more specific that create_from_data
is loading the mipmaps from the raw data.

(cherry picked from commit 09b324b5b6)
2020-06-15 14:34:35 +02:00
Lisandro Lorea cb119e349a Fix TabContainer emitting spurious tab_selected signals when a theme is changed
- The repaint code was moved outside of set_current_tab() and to a "_repaint()" private function
- _on_theme_changed() will now only call _repaint() and update()
This means _on_theme_changed() will do only what it needs (repainting the TabContainer to account for the new theme)

fixes #39498

(cherry picked from commit 5123006f06)
2020-06-15 14:34:35 +02:00
Maganty Rushyendra ffb423bc76 Fix match count for whole word search in editor
Check if a match borders a new line char when incrementing match counts.

(cherry picked from commit 91bdc77d47)
2020-06-15 14:34:35 +02:00
Maganty Rushyendra 87f999274b Fix RegEx example in class doc and correct typo
Fix minor errors to do with `search_all` example in RegEx and
typo in RegExMatch class docs.

(cherry picked from commit e5d93f7a66)
2020-06-15 14:34:35 +02:00
Tomasz Chabora 157c89aa2d Delete bus effect with Delete key
(cherry picked from commit 05656f2b29)
2020-06-15 14:34:35 +02:00
Hugo Locurcio 469c1b5f5e Document how to resize a SubViewportContainer to avoid stretching
This closes #27534.

(cherry picked from commit f818a99d0b)
2020-06-15 14:34:35 +02:00
Ricardo Prins d42f332fc7 Add description to TileSet.is_tile_bound() method
(cherry picked from commit 00398abf77)
2020-06-15 14:34:35 +02:00
Tomasz Chabora 2f04896b0e Re-enable scroll follow on RichTextLabel clear
(cherry picked from commit 46fd51056a)
2020-06-15 14:34:35 +02:00
31 42312d7d4d Fix Material.render_priority doc: no opaque sort
Opaque objects are rendered using the depth buffer, so the end result
appears sorted, but the opaque objects themselves are not sorted.

(cherry picked from commit 608bc8f3dc)
2020-06-15 14:34:35 +02:00
skyace65 b181b97b6c Fix label percent visible doc description
(cherry picked from commit a09aeefa1d)
2020-06-15 14:34:35 +02:00
Maganty Rushyendra be0eba0f75 Fix whole word search slowdown in editor
Reduce repeated iteration through the full text
when counting the number of occurrences of whole
words while searching a file in the editor.

(cherry picked from commit 2433287871)
2020-06-15 14:34:35 +02:00
Aaron Franke 01061c6fbb Simplify some code in platform/uwp/export
(cherry picked from commit 068054002d)
2020-06-15 14:34:35 +02:00
Tomasz Chabora 355868a5db Fix custom types in node list search
(cherry picked from commit 22f0de8a83)
2020-06-15 14:34:34 +02:00
Hugo Locurcio 5a1f94ba47 Document the `in` operator in String, Array and Dictionary classes
This also clarifies the `in` operator behavior in Object.

(cherry picked from commit 7f01f68226)
2020-06-15 14:34:34 +02:00
Pedro J. Estébanez c15e5af60e Fix wrong internal format for half-float textures 2020-06-15 13:03:13 +02:00
Rémi Verschelde 50c4834548
Merge pull request #39502 from bruvzg/kbd_layouts_3
[3.2] Add keyboard layout enumeration / set / get functions.
2020-06-15 11:11:08 +02:00
Rémi Verschelde ba47cdf815
Merge pull request #39501 from hilfazer/favourite-project-button
Fixed 'Favourite' button in Project Manager
2020-06-15 09:28:43 +02:00
Rémi Verschelde fac9f8f82d
Merge pull request #39538 from Faless/js/2phase
[3.2] Use 2-phase setup in JavaScript.
2020-06-14 22:57:56 +02:00
Fabio Alessandrelli 1c0abd6393 Use 2-phase setup in JavaScript.
Make the first iteration as soon as the canvas is setup, avoiding a
black screen before the next animation frame is requested.
Also create OS and do setup before syncing FS to avoid crash when IDBFS
access is denied.
2020-06-14 15:43:18 +02:00
Rémi Verschelde 6efab27a41
Merge pull request #39531 from lawnjelly/kessel_light_join_next
GLES2 Batching - Fix try_join_item logic for lights
2020-06-14 10:39:27 +02:00
lawnjelly 94d127ccc3 GLES2 Batching - Fix try_join_item logic for lights
The old logic was incorrect, the first item with lights would prevent joining the next item in case it didn't have lights. Now the check is deferred so that items without lights check to see if the previous item had lights, and if so they prevent a join.
2020-06-14 08:22:41 +01:00
Rémi Verschelde 879014c3ff
Merge pull request #39504 from madmiraal/fix-39500-3.2
[3.2] Ensure pair callback data is set to null when it's null.
2020-06-13 16:33:06 +02:00
Marcel Admiraal a48e13101d Ensure pair callback data is set to null when it's null. 2020-06-13 14:37:40 +01:00
hilfazer 14fcd20e86 Fixed "Favourite Project" button in Project Manager 2020-06-13 11:38:29 +02:00
bruvzg 2256946f79
[3.2] Add keyboard layout enumeration / set / get functions (macOS, Windows, Linux/X11). 2020-06-13 11:01:49 +03:00
Rémi Verschelde 6c9b7c27d5
Merge pull request #39428 from fire/gltf-lights
[3.2] Add GLTF light import
2020-06-11 22:40:47 +02:00
Rémi Verschelde 5ee9553591
Merge pull request #39463 from akien-mga/3.2-scons-py2-fixup
[3.2] SCons: Fix python2 compatibility after #37198 and #37248
2020-06-11 22:35:17 +02:00
Rémi Verschelde c87b4f9d71 SCons: Fix python2 compatibility after #37198 and #37248 2020-06-11 20:15:48 +02:00
Rémi Verschelde 362193db6a String: Use ABS macro in padding code
Follow-up to #39261.

(cherry picked from commit cbcc0eacd5)
2020-06-11 11:44:06 +02:00
Rémi Verschelde e241dae44d Set version to 3.2.2-rc once again 2020-06-11 10:00:52 +02:00
Rémi Verschelde d68e631566 i18n: Sync translations with Weblate 2020-06-11 10:00:07 +02:00
Rémi Verschelde c80ab247b7 doc: Sync classref with current source
(cherry picked from commit fef49bff0b)
2020-06-11 10:00:07 +02:00
Maganty Rushyendra 158e8ee051 Enable Unicode support for RegEx class
Build PCRE2 thirdparty library with unicode support. RegEx objects
in Godot can now be used to recognize unicode strings.

(cherry picked from commit 9f10f6779c)
2020-06-11 10:00:06 +02:00
Victoria Fisher aa448a2a07 Adds full description for AudioEffectRecord.xml
(cherry picked from commit 718221a2ff)
2020-06-11 10:00:06 +02:00
Maganty Rushyendra 0efa59bfdc Account for file deletion and renaming in Export Presets
Ensure that presets are updated with the latest files when
starting up or opening the Project Export dialog. Fixes the
error where Godot would attempt to export deleted files that
were previously selected.

(cherry picked from commit 44094b082d)
2020-06-11 10:00:06 +02:00
Hugo Locurcio c87128fa06 Improve the 3D light documentations
See https://github.com/godotengine/godot-docs/issues/3670.

(cherry picked from commit f7e21d8e88)
2020-06-11 10:00:06 +02:00
SaviHex fda49b74a1 Added a "title" attribute for the link tag in the docs xml
(cherry picked from commit 18c08f65d6)
2020-06-11 09:44:14 +02:00
Thibault Truffert 24b3bf0637 Make text deletion methods public for LineEdit
(cherry picked from commit 2bb44ea5bd)
2020-06-11 09:42:23 +02:00
Maganty Rushyendra 6344b75453 Enable zero padding with float specifier for format strings
Godot currently supports zero padding for integers, octals and
hexadecimals when using format strings, but not for floats.

This commit adds support for zero padding for floats, thus ensuring
consistent behavior for all types, and making Godot's format specifiers'
behavior closer to c's `printf()`.

Before: `print("<%07.2f>" % -0.2345)` prints `<  -0.23>`.
Now: `print("<%07.2f>" % -0.2345)` prints `<-000.23>`.
     `print("<%7.2f>" % -0.2345)` prints `<  -0.23>`.
(cherry picked from commit b7d835d9ca)
2020-06-11 09:41:37 +02:00
ntfs.hard a822d1f133 Fix for Expression class: inner string can be single quoted
(cherry picked from commit ec164b2301)
2020-06-11 09:41:13 +02:00
lawnjelly b330766c30 Fix overflow condition with QueryPerformanceCounter
The previous code for OS_Windows::get_ticks_usec() multiplied the tick count by 1000000 before dividing by ticks_per_second. The ticks is counted in a 64 bit integer and is susceptible to overflow when a machine has been running for a long period of time (days) with a high frequency timer.

This PR separates the overall calculation into one for seconds and one for the remainder, removing the possibility of overflow due to the multiplier.

(cherry picked from commit db9fa88160)
2020-06-11 09:40:04 +02:00
Rémi Verschelde 0eaefa73a1
Merge pull request #39448 from mrushyendra/duplicate_signals
[3.2] Fix signal duplication bug when duplicating node with instanced children
2020-06-11 09:29:20 +02:00
Aaron Franke e3cf64a7d8
[3.2] Add GLTF light import
Co-authored-by: K.S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2020-06-10 23:51:34 -04:00
Maganty Rushyendra 0df5d74e6e Fix signal duplication bug when duplicating node with instanced children
Change error checking in `duplicate_signals()` to check for path to
`p_original`, thus adhering to the method used in `duplicate`, instead
of checking for ownership.
2020-06-11 09:37:47 +08:00
Rémi Verschelde 1df2e81d3e
Merge pull request #38507 from RandomShaper/fix_cleanup_info_3.2
Fix potential crash when listing leaked objects (3.2)
2020-06-10 21:49:33 +02:00
Pedro J. Estébanez f09046a9ab Fix potential crash when listing leaked objects
Note:
Casting to the C++ classes and calling the methods there would work as well,
but would require including he header files for the specific object types handled
here, which wouldn't be OK either.
2020-06-10 20:16:10 +02:00
Rémi Verschelde 3fb9c776ff
Merge pull request #39437 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 8th batch
2020-06-10 17:33:50 +02:00
Rémi Verschelde 3c7e03510c
Merge pull request #39256 from lawnjelly/tilemap_pixel2
GLES2 batching - Add UV precision adjustment for tilemaps
2020-06-10 15:52:00 +02:00
bruvzg f99ead735c Git Hooks: Suppress "which" error messages.
(cherry picked from commit 05f041127d)
2020-06-10 15:33:27 +02:00
bruvzg 320ae61090 Git Hooks: Add support for GUI git clients.
[ci skip]

(cherry picked from commit fdad0e3bd1)
2020-06-10 15:33:23 +02:00
PouleyKetchoupp ff11fdd017 Pre-commit hook instructions on Windows
(cherry picked from commit 7b6e664178)
2020-06-10 15:32:18 +02:00
Andrii Doroshenko (Xrayez) 23ef1e0f70 SCons: Dump construction environment to a file
A new `methods.dump(env)` is added to dump the construction environment
used by SCons to build Godot to a `.scons_env.json`. The file can be used
for debugging purposes and any external tool.

(cherry picked from commit 42bee75e86)
2020-06-10 15:30:52 +02:00
Andrii Doroshenko (Xrayez) bc21cd8592 Moved to methods.py as a `show_progress` method.
Some required changes are made:
- locally imported SCons-specific packages within the method;
- `global` variables converted to `nonlocal` (used in nested functions).

(cherry picked from commit d753a7630a)
2020-06-10 15:30:52 +02:00
Rémi Verschelde efdeba3326 Travis: Add static check for Python black formatting
Also install and use pygmentize to visualize clang-format and black
diffs.

(cherry picked from commit 3644036fd3)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 243377ffac Hooks: Use pygmentize if available to visualize diff
(cherry picked from commit 4d52761da6)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 1ec7a73d1c Hooks: Add pre-commit hook for psf/black formatting
(cherry picked from commit 164826a39b)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 7bf9787921 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.

(cherry picked from commit cd4e46ee65)
2020-06-10 15:30:52 +02:00
Hugo Locurcio c3d04167a4 Document the requirement to update the class reference when contributing
Documenting new additions has been an informal requirement for
a few months now. This makes it official.

(cherry picked from commit 6d0e8f9fb7)
2020-06-10 15:30:52 +02:00
Hugo Locurcio c39c3e3237 Improve `CONTRIBUTING.md` and update it to follow recent changes
- Improve the bug reporting guidelines for readability.
  - Make some guidelines more strictly applied in the interest of
    bug report quality.
- Mention that feature proposals should now be opened on the
  Godot Proposals repository.
- Update the Git commit message guide to be easier to follow.
- Fix warnings reported by markdownlint.

(cherry picked from commit 7b5c502ba5)
2020-06-10 15:30:52 +02:00
Hugo Locurcio 8e8861ed06 Mention ordering caveats for `Dictionary.hash()`
See https://github.com/godotengine/godot/issues/27615.

(cherry picked from commit 77b89263dd)
2020-06-10 15:30:52 +02:00
Michael Alexsander 5495bbdd47 Fix scene tree showing up when the root selection is present
(cherry picked from commit f30e4dbf54)
2020-06-10 15:30:52 +02:00
Phischermen 12786bcbdb Fix crash when creating new text file with no name
(cherry picked from commit cdb29447b4)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 3202df9b5c doc: Make File store/get integer methods clearer
Add an example on how to store signed integers on less than 64 bits,
using one bit for the signedness.

(cherry picked from commit cd25d184a5)
2020-06-10 15:30:52 +02:00
Marcel Admiraal 7200a0eac5 Update Rigidbody 2D and 3D sleep documentation.
(cherry picked from commit 1b738a77c1)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 51de6732c9 AStar: Make get_closest_point() deterministic for equidistant points
Closes godotengine/godot-docs#3667.
Supersedes #39405.

(cherry picked from commit 187ba4c5a8)
2020-06-10 15:30:52 +02:00
Hugo Locurcio 317c9b5fe9 Tweak the invalid preset error message to mention `export_presets.cfg`
(cherry picked from commit a7b2f3d41a)
2020-06-10 15:30:52 +02:00
Rémi Verschelde ebb30ac45a Core: Add hints to run with --verbose when leaking nodes/resources at exit
(cherry picked from commit 2b5545270a)
2020-06-10 15:30:52 +02:00
Michael Alexsander 2652a2d184 Add generic file icon and its modulation to the 'FileDialog'
(cherry picked from commit 637927f803)
2020-06-10 15:30:52 +02:00
Rémi Verschelde f3fcdfbdd0 PackedScene: Prevent crash when root node has `parent` attribute
The crash happens further down when setting an invalid owner in
`Node::_set_owner_nocheck` but I couldn't figure out how to fix it.

But here the proper fix is to catch the invalid scene file early on
and fail loading it.

Part of #17372.

(cherry picked from commit c080ec5da2)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 1a1c30702d VariantParser: Fix crash on malformed vectors
Each time `r_err_str` is set, we should return a parse error.

Removed redundant `return OK;` which were already handled after the big
`if`/`else if`/`else` for `TK_IDENTIFIER`.

Part of #17372.

(cherry picked from commit e7ebda975a)
2020-06-10 15:30:52 +02:00
Rémi Verschelde 3edae035d5 GDScript LSP: Fix crash in notify_client
`latest_client_id` now defaults to `-1` (invalid ID) instead of `0`.

Also fix typo in notification `gdscrip_client/changeWorkspace`,
and fix argument names in method binds.

Fixes #39375.

(cherry picked from commit e34f33711b)
2020-06-10 15:30:52 +02:00
Aaron Franke 0b6a410890 Change the default editor camera rotation to position it in +X +Y +Z
(cherry picked from commit 6c2df6792b)
2020-06-10 15:30:52 +02:00
Hugo Locurcio eb6c7ec09c Add an editor tooltip to document gizmo visibility options
See discussion in
https://github.com/godotengine/godot-proposals/issues/716.

(cherry picked from commit 138a4eecb3)
2020-06-10 15:30:52 +02:00
unknown 56da70f2e8 Removed variables and #include in EditorSceneImporterAssimp::import_scene that became unused after the recent commit ec1bf96(#39363).
(cherry picked from commit 365c35f30e)
2020-06-10 15:30:52 +02:00
Marcus Elg f1ca218ce7 Fix fbx import assimp error
(cherry picked from commit 29abbccc5f)
2020-06-10 15:30:52 +02:00
Giuliano Barberi 221051d523 Tree: Calling update in _gui_input less frequently
(cherry picked from commit d443a13244)
2020-06-10 15:30:51 +02:00
Fabio Alessandrelli b2c7f94ae2 Crypto as a custom instance class.
(cherry picked from commit 87cc283b8b)
2020-06-10 15:30:51 +02:00
Fabio Alessandrelli 402a7e0094 Fix editor crash when mbedtls is disabled.
(cherry picked from commit 054f52364f)
2020-06-10 15:30:51 +02:00
Tomasz Chabora e94aab7936 Restore capture caches when missing
(cherry picked from commit 642d91381a)
2020-06-10 15:30:51 +02:00
azagaya a6d8773d0b Fixing wrong blending rect methods
Using Color.blend function instead of custom code

Fixed clang_format

Removed unnecessary help

(cherry picked from commit b211a86ebe)
2020-06-10 15:30:51 +02:00
PouleyKetchoupp c63c902c74 Fix dialog spam when inspecting MeshInstance from model file
Avoid load_scene for built-in resources to make sure we don't
open a scene tab and prompt for model file editing.

Load scene as regular resource instead and store the reference to keep
the dependency until the remote inspector cache is cleared.

(cherry picked from commit 01802074a0)
2020-06-10 15:30:51 +02:00
Hugo Locurcio 6e8b5aff66 Add visual feedback when hovering layer checkboxes in the Inspector
This also changes how checkboxes are selected, which makes it possible
to click in the small area between two checkboxes and
still toggle a value successfully (which is arguably less frustrating).

(cherry picked from commit bbc435624f)
2020-06-10 15:30:51 +02:00
Rémi Verschelde c9a8309e73
Merge pull request #39169 from lawnjelly/light2d_layer_fix
3.2 Make Light2D respect CanvasLayer layer_min and layer_max
2020-06-10 13:35:37 +02:00
Rémi Verschelde 4f02fd7eca
Merge pull request #39426 from Rubonnek/unmatched-half-float
Fixed mismatched disable half float property string
2020-06-10 10:34:24 +02:00
Wilson E. Alvarez 782173f0dc
Fixed mismatched disable half float property string 2020-06-09 23:02:28 -04:00
Rémi Verschelde 9901eac9f5
Merge pull request #39400 from madmiraal/fix-39374-3.2
[3.2] Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D.
2020-06-09 13:38:11 +02:00
Marcel Admiraal 5794a4e11e Test collision mask before creating constraint pair in Godot physics
broadphase 2D and 3D.
2020-06-08 17:43:41 +01:00
Rémi Verschelde e891fae52b
Merge pull request #39134 from abustin/fbx_mesh_compression_fix
Respect 'mesh compression' editor import option in Assimp and glTF importers
2020-06-08 13:16:39 +02:00
Rémi Verschelde 3d48a87ecf
Merge pull request #39369 from mbrlabs/basis-fix
[3.2] Re-apply basis of newly added node (via drag-n-drop) in editor viewport
2020-06-08 08:23:57 +02:00
Rémi Verschelde 021d671889
Merge pull request #39376 from Calinou/doc-particles-shadows-aabb
Document enlarging Particles visibility AABB when they cast shadows
2020-06-08 08:17:07 +02:00
lawnjelly 1b5c4bc5b7 Make Light2D respect CanvasLayer layer_min and layer_max
As the masked light list takes no account of layer_min and layer_max, the canvas_layed_id is passed to the _light_mask_canvas_items function where it can be used to reject lights outside the layer range.
2020-06-08 05:41:18 +01:00
Hugo Locurcio 0832ecc4a3
Document enlarging Particles visibility AABB when they cast shadows
This closes https://github.com/godotengine/godot/issues/17267.
2020-06-07 21:35:40 +02:00
Marcus Brummer f8463df11a Re-apply basis of newly added node (via drag-n-drop) in editor viewport 2020-06-07 19:34:17 +02:00
lawnjelly 275183ef15 GLES2 batching - Add UV precision adjustment for tilemaps
Scaling tilemaps can cause border artifacts around the edges of tiles. This has been traced to precision issues in the GPU. This PR adds an adjustment to allow a minor contraction of the UVs of rects in order to compensate for the incorrect classification of texels across the UV border.
2020-06-07 16:29:40 +01:00
Rémi Verschelde 6e1af78df4
Merge pull request #39068 from lawnjelly/kessel_settings_rename
Rename batching project settings in preparation for GLES3
2020-06-07 14:25:50 +02:00
Rémi Verschelde 776eb76018
Merge pull request #38995 from RandomShaper/shader_time_scale_3.2
Add shader time scaling (3.2)
2020-06-07 10:39:13 +02:00
Pedro J. Estébanez 1ff7b0a0a9 Add shader time scaling
Shaders' `TIME` will be affected by the new shader time scale, that is set via the also new `VisualServer::set_time_scale()`.
2020-06-06 23:59:48 +02:00
Rémi Verschelde 9f4a14ba97
Merge pull request #39319 from KoBeWi/this_should_do
Make sure built-in script warning fits in dialog
2020-06-05 14:56:08 +02:00
Tomasz Chabora 24872bffce Make sure built-in script warning fits in dialog 2020-06-05 14:40:08 +02:00
Hugo Locurcio aeb5513bab Tweak the GDScript error message about passed argument type mismatch
This makes it less confusing.

This closes https://github.com/godotengine/godot-proposals/issues/670.

(cherry picked from commit 30053de182)
2020-06-05 12:50:55 +02:00
Fabio Alessandrelli 8b321354d8 Swtich HTML5 key detection from keyCode to code.
The value of this, does not include the layout.
The code has extra logic to map the unicode value to our keylist,
supporting ASCII and Latin-1.

(cherry picked from commit 0a35b97b62
with help of https://github.com/Faless/godot/tree/js/keyCode)
2020-06-05 12:49:50 +02:00
Fabio Alessandrelli 0db5315f8a Fix WebRTCPeerConnection set_local_description doc
ice_candidate_created should be emitted after set_local_description no
matter the type of the description (assuming no error is returned of
course).

(cherry picked from commit 39bcbf5690)
2020-06-05 12:47:16 +02:00
Marcus Brummer ae67ec3ece Set "shader_param/" prefix in Shader::has_param()
(cherry picked from commit ffbb211bbe)
2020-06-05 12:47:01 +02:00
Rémi Verschelde 15b4192ec6 Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@6191f6333b.

(cherry picked from commit 938334cc9e)
2020-06-05 12:46:28 +02:00
Marcus Brummer 6ef0de3f23 Enable text selection in execute output of EditorNode
(cherry picked from commit 85175c67b8)
2020-06-05 12:46:16 +02:00
Marcus Brummer a6e9001579 Check if the specified Android release keystore exists
(cherry picked from commit 21263a65a9)
2020-06-05 12:45:46 +02:00
Thakee Nathees 837cba7567 predefined var check for `for` loop counter
(cherry picked from commit e153772de2)
2020-06-05 12:45:12 +02:00
johan 48a4f7e3a7 2D Editor: modified zoom increment to the twelveth root of two
- properly visit power of 2 factors (50%, 100%, 200%...)
- index based zoom values to prevent floating point issues
- Fix 2d editor not able to reach min and max zoom values

(cherry picked from commit fea6ca20c9)
2020-06-05 12:44:45 +02:00
Rémi Verschelde d80b27f5a6
Merge pull request #39305 from m4gr3d/enable_focus_awareness_3_2
[3.2] Add support for focus awareness
2020-06-05 12:42:26 +02:00
Fredia Huya-Kouadio d1e4cede90 Add support for focus awareness 2020-06-04 15:51:51 -07:00
Rémi Verschelde ed1fc50bb9
Merge pull request #39280 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 7th batch
2020-06-04 13:29:52 +02:00
Michael Alexsander 2ba67d94e8 Add fallback icons and make custom ones appear in the recent/favorites list in the "Create New" dialog
(cherry picked from commit 84d7492b2d)
2020-06-04 12:16:40 +02:00
Swarnim Arun 83c15ff469 Fix crashing of VisualScript due to...
Attempting to move the function node to another function whose data connection is a dependency of the node the specific node being moved to a different function during changes to sequence connections.
By skipping, if the from_node is a function_node during the data connection dependencies scan.
Should fix #37991

(cherry picked from commit 5c48631509)
2020-06-04 12:16:40 +02:00
Hugo Locurcio b0fe8cab14 Tweak the import compression property hint for clarity
(cherry picked from commit 1439447071)
2020-06-04 12:16:39 +02:00
Pedro J. Estébanez b2a64b144f Fix excessive bottom cropping in atlas generation
(cherry picked from commit fb7ae73045)
2020-06-04 12:16:39 +02:00
Aaron Franke 7021991cd9 Change OK text in snap dialog to OK
(cherry picked from commit 8f85858224)
2020-06-04 12:16:39 +02:00
Maganty Rushyendra b4ca613138 Clarify usage of AnimationPlayer with AnimationTree and fill in empty method descriptions
Add clarification to docs to explain that when an `AnimationPlayer`
object is paired with an `AnimationTree`, several properties and
methods exposed by the `AnimationPlayer` class may not work as expected.
The issues occur because an `AnimationTree` runs independently, and
uses its member `AnimationPlayer* player` primarily for its
`Map<StringName, AnimationData> animation_set`.

Added descriptions for `root_motion_track` and `get_root_motion_transform`.

(cherry picked from commit 0451248ff1)
2020-06-04 12:16:39 +02:00
PouleyKetchoupp aa935c262a Fix inconsistent error messages with Android custom export templates
(cherry picked from commit be22a1f9bc)
2020-06-04 12:16:39 +02:00
Eric M f911ebc328 Improved warning shown when autoload cannot be added.
(cherry picked from commit 58caa2c453)
2020-06-04 12:16:39 +02:00
Hugo Locurcio 61da4882aa Add performance hints to the DirectionalLight shadow mode property hint
This also clarifies some parts in the DirectionalLight documentation.

(cherry picked from commit b46756c723)
2020-06-04 12:16:39 +02:00
Hugo Locurcio 9e01a0cd28 Add a getter and property for the editor distraction-free mode
(cherry picked from commit cc1859efed)
2020-06-04 12:16:39 +02:00
Andrii Doroshenko (Xrayez) 3649c61e46 Prevent crash attaching a script with no languages registered
(cherry picked from commit 52f3cfca6f)
2020-06-04 12:09:40 +02:00
Hugo Locurcio 424d1b5fab Print errors when calling MIDI input methods on unsupported platforms
This partially addresses #32065.

(cherry picked from commit 9c0d214776)
2020-06-04 12:09:40 +02:00
Marcel Admiraal eef442f32d Update Windows GUID to SDL uid conversion.
(cherry picked from commit a833db80d9)
2020-06-04 12:09:40 +02:00
Marcel Admiraal 5dfd4fc84d Update OSX GUID to SDL uid conversion.
Co-authored-by: John Wakley <johncwakley@users.noreply.github.com>
(cherry picked from commit d04cbbd76b)
2020-06-04 12:09:40 +02:00
Hugo Locurcio 6ea9ca14f0 Allow mouse zooming without hovering the texture in the TileSet editor
This partially addresses
https://github.com/godotengine/godot-proposals/issues/968.

(cherry picked from commit d10a5b2928)
2020-06-04 12:09:40 +02:00
Hugo Locurcio 6bbfed6400 Implement zooming using Ctrl + Mouse wheel in the TileMap editor
This was previously implemented in the GridMap editor. This makes
the same feature available in the TileMap editor.

(cherry picked from commit def2059d67)
2020-06-04 12:09:40 +02:00
Umang Kalra c1f6854ada Fixes the right and center alignment bug of rich text label
(cherry picked from commit b2a32d007d)
2020-06-04 12:09:40 +02:00
NutmegStudio 96a3b91eee Fixes building mono release templates
(cherry picked from commit a77f633161)
2020-06-04 12:09:40 +02:00
Dominik 'dreamsComeTrue' Jasiński fdf64b1898 Preserving "Sync Scene Changes' and "Sync Script Changes" with Project Settings
Fixes: #38739
(cherry picked from commit 72501ae104)
2020-06-04 12:09:40 +02:00
Dominik 'dreamsComeTrue' Jasiński 982ab51f2f Grabbing focus on ProjectList after clicking an item.
Fixes: #39012
(cherry picked from commit 1ec8f59397)
2020-06-04 12:09:40 +02:00
Andrii Doroshenko (Xrayez) 9753181956 SCons: Allow to read `custom_modules` option via a file
The `custom_modules` option was only read via the command line
by fetching `ARGUMENTS` dictionary directly.

Instead, the option's value can now be read via any existing
configuration files (`custom.py`) as well as command line, while also
updating the environment.

(cherry picked from commit 6304d16915)
2020-06-04 12:09:40 +02:00
Hugo Locurcio d56b9d5ebf Disable antialiasing on the DynamicFont outline as well when requested
This partially addresses
https://github.com/godotengine/godot-proposals/issues/943.

(cherry picked from commit 2919fc7317)
2020-06-04 12:09:40 +02:00
Marcel Admiraal 91590b0cf0 Add dinput nullptr checks.
(cherry picked from commit bc49d34123)
2020-06-04 12:09:39 +02:00
Marcel Admiraal 6c9c6885a2 Do not probe joypads if DirectInput cannot be initialized.
(cherry picked from commit 97a529b1d8)
2020-06-04 12:09:39 +02:00
Hugo Locurcio d814352d92 Tweak the DirectInput initialization failure message
This closes #36662.

(cherry picked from commit fe09b4d2b3)
2020-06-04 12:09:39 +02:00
Nathan Franke 219717fc21 fix(Directory): remove erasing print
Fixes #39106

(cherry picked from commit e48fb01d59)
2020-06-04 12:09:39 +02:00
Hugo Locurcio a3bd201cc7 makerst: Print status messages to make the CI output clearer
This also removes an unused method.

(cherry picked from commit 9065b7ed4e)
2020-06-04 12:09:39 +02:00
Maganty Rushyendra 25af738762 Expose `get_char_size()` from Font instead of BitmapFont
`get_char_size()` is a public virtual function defined in the `Font`
class. Implementations exist for both `BitmapFont` and `Dynamic Font`.
However, it was only exposed to the GDScript API through the Bitmap
Font, and not for Dynamic Font.

This commit exposes the function through `Font` instead.

Fixes #23967

(cherry picked from commit a4413710f9)
2020-06-04 12:09:39 +02:00
George Marques a8332e30f0 GDScript: Fix assert message when no custom message is set
(cherry picked from commit f29a2e2606)
2020-06-04 12:09:39 +02:00
bruvzg 1642c4163d Ignore invalid tablet driver name, when non are available.
(cherry picked from commit ef1a305e50)
2020-06-04 12:09:39 +02:00
Andrii Doroshenko (Xrayez) d201163557 Do not rely on the existence of `config.py` while detecting modules
The existence of `SCsub` is checked instead. This file is required for
all modules, and prevents the build system to leave modules without
`config.py` undetected, leading to silently ignoring the module during
compilation.

(cherry picked from commit 12389b3736)
2020-06-04 12:09:39 +02:00
Rémi Verschelde fa0cf25e19 Add shortcut for Pan Mode (G)
And change TileMap Bucket Fill shortcut to (B).

Fixes #8582.

(cherry picked from commit 28b33718b0)
2020-06-04 12:09:39 +02:00
Maganty Rushyendra e34929feaa Update Mono C# warning to reflect latest list of platforms supported
Simple fix for #38627. iOS (#20268) and HTML5 (#20270) removed from list of exceptions
for platforms supported in warning message.

(cherry picked from commit 3d03be7a56)
2020-06-04 12:09:39 +02:00
Fredia Huya-Kouadio bea913a874 Stop ignoring hidden files and directories in the `assets` directory
(cherry picked from commit bf76d2afcf)
2020-06-04 12:09:39 +02:00
Dominik 'dreamsComeTrue' Jasiński d15e9c2126 Allow scroll_to_line when scroll_active is 'false'
Fix #36134

(cherry picked from commit 8f11a91917)
2020-06-04 12:09:39 +02:00
Gustav 26c617654e Fix ProjectSettings.save_custom documentation
(cherry picked from commit 728c0c1e14)
2020-06-04 12:09:39 +02:00
Hugo Locurcio e226947e21 Improve the text appearance in the script editor warnings panel
- Make the Ignore button's position identical across all warnings
  by moving it to the left.
- Change the Ignore button's text and color to make it more obvious
  that it can be clicked.
- Use the editor font instead of the default project font to match
  the rest of the editor.

(cherry picked from commit 0c0ee427d2)
2020-06-04 12:09:38 +02:00
Marcus Brummer b6c536317b Perform a clean Gradle build if android plugins changed
Fixes #38986

(cherry picked from commit abd66c1bb0)
2020-06-04 11:17:11 +02:00
Rémi Verschelde 1bd51883c0 xatlas: Sync with upstream 470576d
(cherry picked from commit 59780fd046)
2020-06-04 11:15:06 +02:00
Thakee Nathees 25ed0d4366 colorpicker margin bug fixed
(cherry picked from commit 9d224ac429)
2020-06-04 11:14:16 +02:00
Rémi Verschelde e0a7b2ec97 Update AUTHORS and DONORS list
New contributor added to AUTHORS:
@jbuck3

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit 910ddd2817)
2020-06-04 11:08:14 +02:00
Rémi Verschelde 77aa8c0095 Improve documentation of ProjectSettings::setup
Subsequent PRs adding and fixing support for bundled PCKs
did not update the documentation /o\

(cherry picked from commit 0183bfbb0f)
2020-06-04 11:07:54 +02:00
azagaya 3305783bac Fixed images in black margins 2020-06-03 18:33:33 -03:00
Rémi Verschelde 8d287b051a
Merge pull request #39265 from Chaosus/fix_length_3.2
[3.2] Fix shader's length() function parsing in expressions
2020-06-03 22:28:56 +02:00
Yuri Roubinsky 371d48aea1 [3.2] Fix shader's length() function parsing in expressions 2020-06-03 19:43:47 +03:00
Rémi Verschelde a29318a5bc
Merge pull request #39260 from vnen/get_script_is_type
Allow get_script() to be considered a type
2020-06-03 17:37:18 +02:00
Thakee Nathees 8f795cb38e Fix `is` operation fail on get_script()
Fix: #39244
2020-06-03 21:04:48 +05:30
George Marques a0983637cf
GDScript: Allow get_script() to be considered a type 2020-06-03 10:48:43 -03:00
Rémi Verschelde 519fbbfdd4
Merge pull request #39243 from bruvzg/mac_menu_3
[3.2] Fix macOS global menu removal and preserve order.
2020-06-03 10:49:13 +02:00
bruvzg c994eb1daf
[3.2] Fix macOS global menu removal and preserve order. 2020-06-02 16:37:19 +03:00
Rémi Verschelde 5c6d4edc88
Merge pull request #39162 from lawnjelly/light_shadow_mask
3.2 Light2D shadow mask construction fix
2020-06-02 10:35:48 +02:00
lawnjelly bf54fa5a62 Light2D shadow mask construction fix
When using the default setting (layer 1 set only) nothing is stored in the tscn file for a Light2D, hence it relies on the value in the constructor.

The problem is the constructed value is 1 in Light2D, and -1 in RasterizerCanvas::Light. -1 results in all bits being set so all occluders are shown, rather than just those in layer 1.

This PR changes Rasterizer::Canvas constructor to set to 1. An alternative is to have -1 as the value for layer 1 throughout.
2020-05-30 09:29:38 +01:00
Rémi Verschelde f108037cbf
Merge pull request #39086 from madmiraal/fix-39059-3.2
[3.2] Correct Bullet's default Area angular damp value.
2020-05-29 12:10:54 +02:00
Rémi Verschelde b400a02272
Merge pull request #39032 from mrushyendra/issue-38702
Fix usage req. in Viewport so that ViewportTexture can be sampled as HDR
2020-05-29 09:32:21 +02:00
Maganty Rushyendra e51767b3c0 Document usage requirement for Viewport to sample ViewportTexture as HDR
Modified class documentation to specify that `USAGE_3D` or
`USAGE_3D_NO_EFFECTS` is required in order to use HDR in a ViewPort.

Fixes #38702
2020-05-29 08:05:35 +08:00
Alex Bustin 8a024ca294 Respect 'mesh compression' editor import option in Assimp (ie. FBX) and glTF importers 2020-05-28 15:28:47 -07:00
Rémi Verschelde fc65b0c10d
Merge pull request #39121 from Xrayez/py-modules-order
[3.2] SCons: use `OrderedDict` to ensure insertion order of modules
2020-05-28 17:26:51 +02:00
Andrii Doroshenko (Xrayez) 0138ba59ac SCons: use `OrderedDict` to ensure insertion order of modules
The insertion order for dictionaries is only a language feature for
Python 3.6/3.7+ implementations, and not prior to that.

This ensures that the engine won't be rebuilt if the order of detected
modules changes in any way, as the `OrderedDict` should guarantee
inerstion order.
2020-05-28 17:13:50 +03:00
Rémi Verschelde 807f1f511b
Merge pull request #39110 from volzhs/godotpayment-consume
Add missing consumePurchase plugin method for GodotPayment
2020-05-28 15:59:50 +02:00
volzhs c86ddd6b61 Add missing consumePurchase plugin method for GodotPayment 2020-05-28 11:51:14 +09:00
Rémi Verschelde f03bc21e09
Merge pull request #39103 from m4gr3d/enable_legacy_external_storage
Enable legacy external storage for Android 10
2020-05-27 22:57:24 +02:00
Rémi Verschelde 2d9132a463
Merge pull request #39098 from m4gr3d/validate_plugins_build_config_3_2
[3.2] Validate that `Use Custom Build` is enabled when `Plugins` are selected
2020-05-27 22:55:14 +02:00
Fredia Huya-Kouadio 2e7e3dcfe4 Enable legacy external storage for Android 10 2020-05-27 13:34:40 -07:00
Fredia Huya-Kouadio 0181e89e43 Validate that `Use Custom Build` is enabled when `Plugins` are selected
Remove `GodotPayment` from the default build template
2020-05-27 12:04:31 -07:00
Marcel Admiraal 5d8b0649be Apply old method for linear & angular damping in Bullet, in order to
make it easier to tweak and consistent with Godot Physics.

Include patch applied to Bullet master to enable dampings greater than 1.
2020-05-27 17:53:43 +01:00
Marcel Admiraal 8f0f2bf4ef Better damping implementation for Bullet rigid bodies 2020-05-27 17:50:24 +01:00
Marcel Admiraal 08fa7cd8d9 Correct Bullet's default Area angular damp value. 2020-05-27 11:53:41 +01:00
Rémi Verschelde 9aeb9ea826
Merge pull request #39081 from m4gr3d/fix_emit_signal_3_2
[3.2] Fix parameters passing when emitting signal
2020-05-27 12:53:35 +02:00
Fredia Huya-Kouadio 3c0b26e29c Fix parameters passing when emitting signal
The issue was caused because we were using variables local to the `for` loop block.
Address [feedback](https://github.com/godotengine/godot/pull/39047#issuecomment-634545849) by @pouleyKetchoupp regarding the use of arrays on stack with dynamic size.
2020-05-27 03:38:38 -07:00
Rémi Verschelde 6abe73f5b8
Merge pull request #39078 from m4gr3d/override_command_line_args_3_2
[3.2] Provide the ability to override the command line arguments
2020-05-27 12:02:26 +02:00
Fredia Huya-Kouadio 06b7f611f8 Provide the ability for clients of the Godot library to add their own command line arguments 2020-05-27 02:12:54 -07:00
lawnjelly c7d18dec70 Rename batching project settings in preparation for GLES3
As it now seems like we will soon have GLES3 batching working using the same intermediate layer as GLES2, it makes more sense to reuse the same batching settings for both renderers rather than duplicate project settings for GLES2 and GLES3.
2020-05-26 18:15:35 +01:00
Rémi Verschelde 757d8b5672
Merge pull request #39034 from timoschwarzer/google-play-billing-3.2
Re-implement GodotPayment Android plugin using the Google Play Billing library
2020-05-25 22:17:11 +02:00
Timo Schwarzer 8373c0792a
Re-implement GodotPayment Android plugin using the Google Play Billing library 2020-05-25 21:09:45 +02:00
Rémi Verschelde 7c332d9386
Merge pull request #39040 from Xrayez/modules-search-path-3.2
[3.2] Add `custom_modules` build option to compile external user modules
2020-05-25 17:02:27 +02:00
Rémi Verschelde acb83db1d1 doc: Sync classref with current source 2020-05-25 17:00:22 +02:00
Tomasz Chabora 800dceee52 Reverse mouse wheel in animation track editor
(cherry picked from commit f4c6bb568e)
2020-05-25 16:38:02 +02:00
PouleyKetchoupp f4f4b77d23 Use long instead of int for object id in Android java wrapper
Using int for 64-bit values might cause issues with objects not found
in ObjectDB when the id is truncated.

(cherry picked from commit 39f59786fa)
2020-05-25 16:36:34 +02:00
Ignacio Etcheverry f0bc3482d4 Mono/C#: Don't try to load project assembly in project manager
This was causing an error message when launching the manager,
because there is no project assembly to load.

(cherry picked from commit d7e21ecd63)
2020-05-25 16:34:15 +02:00
Dominik 'dreamsComeTrue' Jasiński cf311f3e79 Fix moving 2D node with mouse after using arrow keys
Fixes: #38894
(cherry picked from commit 03b54f8a35)
2020-05-25 16:33:58 +02:00
CJ DiMaggio ad3d643bc2 Delete DummyMesh when RasterizerStorageDummy is freed
(cherry picked from commit 66a294d459)
2020-05-25 16:32:48 +02:00
bruvzg c4e652a6a3 Docs: Fix order of variant constants.
(cherry picked from commit 409562558a)
2020-05-25 16:32:25 +02:00
Paul Joannon 66e00a2670 check the params section exist before erasing it in import_dock
related #38864

(cherry picked from commit b7a6946790)
2020-05-25 16:32:05 +02:00
Tan Wang Leng 48a2fd7a3d gdscript_parser: Fix "unreachable code" false positive for loops
Depending on the conditional statements of the 'for' and 'while' loops,
their body may not even execute once. For example:

    func a():
        var arr = []
        for i in arr:
            return i
        # can be reached, but analysis says cannot
        return -1

    func b():
        var should_loop = false
        while should_loop:
           return 1
        # can be reached, but analysis says cannot
        return 0

The parser will complain that the statements after the comment cannot
be reached, but it is clearly possible for our scenario. This is
because the parser falsely assumes that the loop body will always
execute at least once.

Fix the code to remove this assumption for both of those loops.

(cherry picked from commit 7b1423a61e)
2020-05-25 16:31:07 +02:00
James Buck 9347a6ad6a Trigger an error when trying to define a preexisting signal in GDScript
A class can't have multiple signals with the same name, but previously users
would not be alerted to a conflict while editing the script where it occurred.
Now a helpful error will appear in the editor during script parsing.

(cherry picked from commit 9e44739324)
2020-05-25 16:29:20 +02:00
Andrii Doroshenko (Xrayez) 133997654c Add `custom_modules` build option to compile external user modules
This patch adds ability to include external, user-defined C++ modules
to be compiled as part of Godot via `custom_modules` build option
which can be passed to `scons`.

```
scons platform=x11 tools=yes custom_modules="../project/modules"
```

Features:

- detects all available modules under `custom_modules` directory the
same way as it does for built-in modules (not recursive);
- works with both relative and absolute paths on the filesystem;
- multiple search paths can be specified as a comma-separated list.

Module custom documentation and editor icons collection and generation
process is adapted to work with absolute paths needed by such modules.
Also fixed doctool bug mixing absolute and relative paths respectively.

Implementation details:

- `env.module_list` is a dictionary now, which holds both module name as
  key and either a relative or absolute path to a module as a value.
- `methods.detect_modules` is run twice: once for built-in modules, and
  second for external modules, all combined later.
- `methods.detect_modules` was not doing what it says on the tin. It is
  split into `detect_modules` which collects a list of available modules
  and `write_modules` which generates `register_types` sources for each.
- whether a module is built-in or external is distinguished by relative
  or absolute paths respectively. `custom_modules` scons converter
  ensures that the path is absolute even if relative path is supplied,
  including expanding user paths and symbolic links.
- treats the parent directory as if it was Godot's base directory, so
  that there's no need to change include paths in cases where custom
  modules are included as dependencies in other modules.

(cherry picked from commit a96f0e98d7)
2020-05-25 17:08:38 +03:00
Thakee Nathees d611bd970d regression: dictionary key no autocomplete fix
Fix: #38998
(cherry picked from commit 13c372b522)
2020-05-25 15:58:25 +02:00
Fabio Alessandrelli d0613a2243 Fix JS audioContext parameters.
Were not passed along correctly.
`latencyHint` is supposed to be in seconds, not milliseconds.

(cherry picked from commit 57bdb4cc35)
2020-05-25 15:53:18 +02:00
PouleyKetchoupp 719369c71b Fix resource preview in remote inspector
The specific case for object reference seems unnecessary, as `RES res = var`
already does the work. The case where REF is invalid is never hit in the case
of already freed objects.

The assignment `res = *r` was causing the resource to be always invalidated
on the 3.2 branch.

(cherry picked from commit 12685df423)
2020-05-25 11:46:51 +02:00
Rémi Verschelde 2cf6624965 FastLZ: Update to upstream version 0.5.0
Upstream development restarted after 13 years. Changes:

2020-02-02: Version 0.5.0

    Minor speed improvement on the decompressor.
    Prevent memory violation when decompressing corrupted input.

2020-01-10: Version 0.4.0

    Only code & infrastructure clean-up, no new functionality.

(cherry picked from commit 5167c9186a)
2020-05-25 11:46:03 +02:00
Ignacio Etcheverry 0da84b50c0 Mono/C#: Fix values not updated in remote inspector
(cherry picked from commit 51e1614d28)
2020-05-25 11:46:03 +02:00
Rémi Verschelde 11d6c0f20d
Merge pull request #38984 from Calinou/bakedlightmap-configuration-warning
Document known bugs in BakedLightmap
2020-05-25 11:28:16 +02:00
Hugo Locurcio 5fb5fb135a
Document known bugs in BakedLightmap
See #30929.
2020-05-24 21:29:12 +02:00
Rémi Verschelde 7ccb146a55
Merge pull request #38979 from lawnjelly/kessel_unshaded_bug
GLES2 Batching - Builtins prevent baking in unshaded shaders
2020-05-23 13:58:12 +02:00
lawnjelly b95add2bfd GLES2 Batching - Builtins prevent baking in unshaded shaders
Builtins that should prevent baking colors and vertex positions were incorrectly only active in shaders that were not unshaded. This was a terminology misunderstanding - unshaded materials can still use shaders so should have the same test to prevent baking.
2020-05-23 11:35:33 +01:00
Rémi Verschelde 73b97e8f05
Merge pull request #38963 from neikeq/scons-option-build-cil
[3.2] Add SCons option to not build C# solutions
2020-05-22 18:29:52 +02:00
Rémi Verschelde d5e380117f
Merge pull request #38952 from bruvzg/win_ink_block_mm_3
[3.2] Block WM_MOUSEMOVE during Windows Ink pen handling.
2020-05-22 14:34:29 +02:00
bruvzg 28aabf4f73
[3.2] Block WM_MOUSEMOVE during Windows Ink pen handling. 2020-05-22 14:05:53 +03:00
Rémi Verschelde fa9c44bf65
Merge pull request #38890 from Xrayez/save-png-buffer-3.2
[3.2] Add `Image.save_png_to_buffer` method
2020-05-22 09:48:50 +02:00
Ignacio Etcheverry ce09d0c5e1 Add SCons option to not build C# solutions 2020-05-22 03:12:54 +02:00
Rémi Verschelde 8cf450c16b
Merge pull request #38916 from madmiraal/appveyor-test
[3.2] Enable Appveyor error on warnings.
2020-05-21 14:27:04 +02:00
Marcel Admiraal aeb1181add Enable Appveyor error on warnings. 2020-05-21 11:28:01 +01:00
Marcel Admiraal dac3504cc3 Fix C4724: potential mod by 0 warnings. 2020-05-21 11:28:01 +01:00
Andrii Doroshenko (Xrayez) a3cad44f44 Add `Image.save_png_to_buffer` method
Backported from da0457fa29.

This commit additionally exposes the method to scripting (4.0).
2020-05-20 15:38:20 +03:00
Rémi Verschelde b6c551e864
Merge pull request #38875 from bruvzg/tab_drv_sel_32
[Windows, 3.2] Add tablet driver selection.
2020-05-20 13:58:26 +02:00
Rémi Verschelde c5bb283ede
Merge pull request #38832 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 6th batch
2020-05-20 13:58:08 +02:00
Hugo Locurcio a785641196 Allow `.res` and `.tres` extensions in the scene CLI positional argument
This closes #35709.

(cherry picked from commit 653334cc8d)
2020-05-20 12:07:08 +02:00
SkyJJ 2197ef0566 Fix Android LineEdit editing bugs
(cherry picked from commit cc473b948f)
2020-05-20 12:07:08 +02:00
Michael Alexsander 3d8cc49ec5 Keep "lock" metadata when changing a Node's type, if applicable
(cherry picked from commit d015e4d6fc)
2020-05-20 11:43:49 +02:00
Ignacio Etcheverry 6dfd80673a Mono/C#: Remove script load error about not a Godot.Object
Any C# file can be loaded as script and at load
time we don't yet know if it's actually meant to
be used as a script. As such, such an check can
result in a lot of false errors.

If the file is really meant to be used as a
script, an error would be printed later when
attempting to instantiate it any way.

(cherry picked from commit 38cd2152e6)
2020-05-20 11:41:01 +02:00
Pedro J. Estébanez 8f90d423b9 Fix too eager GDScriptFunctionState stack cleanup
(cherry picked from commit 1f0548efd4)
2020-05-20 11:40:45 +02:00
bruvzg e3be0520a1 [Windows] Add quotes only to the command line arguments with special characters.
(cherry picked from commit cac399a829)
2020-05-20 11:39:55 +02:00
Fredia Huya-Kouadio 2c81a82d53 Update the permission string for the Oculus hand tracking to match the latest api update
(cherry picked from commit 6e2988f26a)
2020-05-20 11:37:24 +02:00
Andrea Catania b0ba122443 Removed const from OAHashMap iterator value
to allows to mutate the value while iterating over it.

(cherry picked from commit 97f9bbcfa3)
2020-05-20 11:35:28 +02:00
bruvzg 9669c437ef macOS signing improvements: allow signed app exporting as ZIP, sign DMG after exporting.
(cherry picked from commit 4bec713b8c)
2020-05-20 11:33:57 +02:00
Marcel Admiraal a520e03730 Update .appveyor.yml.
- Set options to be the same as travis builds,
  except use warnings=all instead of warnings=extra.
- Fail on warnings as per travis builds.

(cherry picked from commit 106221a733)

Edited to set `werror=no` until we've fixed all warnings.
2020-05-20 11:30:43 +02:00
bruvzg 71b2abbfa3
[Windows, 3.2] Add tablet driver selection. 2020-05-20 09:36:56 +03:00
Rémi Verschelde f390749439 Fix Visual Studio C4724 warning (potential mod by 0) 2020-05-19 11:09:28 +02:00
Rémi Verschelde e6a3499bef Fix Visual Studio C4334 warning 2020-05-19 10:19:52 +02:00
Eric Rybicki c2eea4bde0 Fix certain characters being recognized as special keys in Windows when using the us international layout
(cherry picked from commit e460456e60)
2020-05-19 10:19:52 +02:00
Pedro J. Estébanez 75f6d2ef32 Remove no longer needed patches to jpgd.cpp
(cherry picked from commit abe03ff1f0)
2020-05-19 10:19:52 +02:00
Rémi Verschelde dcb68e0106 SCons: Improve registration of compilation_db tool, check version
There's a builtin `toolpath` option we can use for that, so no need to hack
around a custom `scons_site` path.

The script requires SCons 3.1.1 or later, so we enable it conditionally.

Follow-up to #32848.

(cherry picked from commit 22c718ab17)
2020-05-18 16:40:33 +02:00
RevoluPowered 9aa4648579 Added compilation database support for clang and gcc
This tool is originally from mongodb.

- Updated CPPSUFFIXES to use scons suffixes
- objective-c files will also be loaded into the compilation database where the compiler / tooling is available to compile the files.

Known limitations:

- This will not work with msvc as your compiler.

(cherry picked from commit 5a6f275b74)
2020-05-18 16:40:33 +02:00
Andrii Doroshenko (Xrayez) 35d95918ae Add `custom.py` to .gitignore
The default `custom.py` can be created at the root of the Godot
repository to initialize any SCons build options via file which are
specific to user.

(cherry picked from commit a712e14038)
2020-05-18 16:40:33 +02:00
Hugo Locurcio 8ebcdeb3d7 Document that Dictionary is always passed as reference
See #38792.

(cherry picked from commit 675fea1648)
2020-05-18 16:40:33 +02:00
Marcus Brummer 4779d289d5 Fixed text editor drawing if smooth scrolling is disabled.
Fixes #38778

(cherry picked from commit b048eb05ad)
2020-05-18 16:40:33 +02:00
smartin015 8cab02ec06 Remove get_local_mouse_position() hack in GraphEdit
(cherry picked from commit 00457c68bc)
2020-05-18 16:40:33 +02:00
Eduardo Nunes Pereira 05cd3ff8ba Using command + comma on macOS as default shortcut for editor settings
(cherry picked from commit 75f77f751e)
2020-05-18 16:40:33 +02:00
Fabio Alessandrelli 92031098bf Move mixrate and latency definition to AudioServer
Each driver used to define the (same) project settings value, but the
setting names are not driver specific. Ovverriding is still possible via
platform tags.

(cherry picked from commit 90c7102b51)
2020-05-18 16:40:33 +02:00
Fabio Alessandrelli 6d1ddf7eb1 AudioDriverJavaScript now compute buffer size.
Based on mix rate and expected latency.

(cherry picked from commit 245c179bd3)
2020-05-18 16:40:33 +02:00
Rémi Verschelde 8e91d2746d
Merge pull request #38828 from RandomShaper/fix_oa_hash_map_3.2
Fix leaks and crashes in OAHashMap (3.2)
2020-05-18 15:04:31 +02:00
Pedro J. Estébanez 8349635ffc Fix leaks and crashes in OAHashMap
This changes the way the lifespan of items is managed to be consistent.

Bonus: Simplify cases of destroy-then-emplace.
2020-05-18 14:02:49 +02:00
Rémi Verschelde 154e2ff234
Merge pull request #38824 from m4gr3d/hide_custom_defines_from_editor
Remove the `custom_defines` section from the editor
2020-05-18 11:50:53 +02:00
Fredia Huya-Kouadio 4db8ade565 Remove the `custom_defines` section from the editor 2020-05-18 01:07:38 -07:00
Rémi Verschelde 43bf8e27b6
Merge pull request #38799 from bruvzg/gdnative_size_fix_3
[3.2] Fix GDNative Variant type size, add size checks.
2020-05-18 10:02:08 +02:00
Max Hilbrunner ebc63dac30
Merge pull request #38784 from remram44/patch-1
[DOC] Update description of Object.free() method
2020-05-17 20:33:57 +02:00
bruvzg d255cc9e4d
Fix GDNative Variant type size on 32-bit platforms, add size checking static asserts. [3.2] 2020-05-17 16:11:49 +03:00
Rémi Verschelde a2f32c970d
Merge pull request #38175 from m4gr3d/improve_android_plugin_config
[3.2] Implementation of the Godot Android Plugin configuration file
2020-05-17 11:07:19 +02:00
Fredia Huya-Kouadio a71a338c59 Implementation of the Godot Android Plugin configuration file 2020-05-16 23:09:45 -07:00
Rémi Verschelde 21180675c9
Merge pull request #38774 from pepegadeveloper123/mono_inherited_scene_bug_3.2
Mono inherited scene bug 3.2
2020-05-16 18:49:35 +02:00
Remi Rampin ccf5703568
Update description of Object.free() method
Clarify that variables pointing to an object don't become `null` when that object is freed, it just makes them invalid.
2020-05-16 12:32:41 -04:00
pepegadeveloper123 23d51ac325 Fix inherited C# scene not inheriting parent's fields (3.2)
When a child scene inherits a parent scene with a C# root node, the
parent scene's export variables appear to assume values set in the
parent scene, in the child scene's Inspector. However, when the child
scene is played, the parent scene's export variables assume default
values.
When a node is created, it inherits its parent C# script's fields from
the map CSharpScriptInstance::script->member_info. However this map was
not initialized outside the editor, and this commit ensured it is. This
fixes issues #36480 and #37581.
This is a manual backport of PR #38638 for 3.2.
2020-05-16 11:18:58 +02:00
Rémi Verschelde d784cb23ec
Merge pull request #37929 from thebestnom/migrate-to-androidX-3.2
Android: Migrate deprecated support library to AndroidX [3.2]
2020-05-16 09:03:44 +02:00
Dominik 'dreamsComeTrue' Jasiński 51a1a27457 Hide editor_spin_slider grabber when closing Editor's windows
Fixes: #38740
(cherry picked from commit 095167dcc3)
2020-05-16 00:08:37 +02:00
Thakee Nathees 9ee77179b5 break, continue outside of a loop, match statement handled
(cherry picked from commit c076a2b7e9)
2020-05-16 00:08:37 +02:00
Rémi Verschelde 000899647a
Merge pull request #38767 from ofrank123/bug/lsp-save-error
[3.2.2] Fix incorrect initialize notification in language server
2020-05-15 23:55:07 +02:00
Oliver Frank 2173d041af Fix incorrect capabilities notification in LSP 2020-05-15 16:43:48 -04:00
Oliver Frank dac8b7b6f4 Improve jsonrpc error reporting 2020-05-15 16:42:24 -04:00
Rémi Verschelde 0556a48bf9
Merge pull request #38752 from Calinou/rename-error-warning-icon
Rename the ErrorWarning icon file to match the 3.2 naming scheme
2020-05-15 18:03:05 +02:00
Rémi Verschelde c7c608166d
Merge pull request #38749 from akien-mga/3.2-android-modules-GodotPaymentV3
Android: Check for use of deprecated GodotPaymentV3 module, direct to new plugin
2020-05-15 18:02:39 +02:00
Hugo Locurcio fa279d02f7 Rename the ErrorWarning icon file to match the 3.2 naming scheme 2020-05-15 14:16:46 +02:00
Rémi Verschelde d45b96d2b1 Android: Check for deprecated GodotPaymentV3 module, direct to new plugin
Fixes #38581.
2020-05-15 13:32:30 +02:00
Thakee Nathees d13f46bc41 shadowed var warning in nested block bug fix
Fix: #38552
(cherry picked from commit 79eee93b9a)
2020-05-14 22:01:45 +02:00
Thakee Nathees 40c43da96f set parser error when infer type is null
(cherry picked from commit 687b1941b4)
2020-05-14 22:01:26 +02:00
Rémi Verschelde f5a3d34593
Merge pull request #38734 from lawnjelly/polyline_bug
GLES2 polyline drawn as GL_LINE_STRIP to match GLES3
2020-05-14 20:25:19 +02:00
lawnjelly 8005175ea5 GLES2 polyline drawn as GL_LINE_STRIP to match GLES3
The behaviour of TYPE_POLYLINE appeared incorrect in GLES2, and inconsistent with GLES3 and the docs, which state that draw_polyline 'Draws interconnected line segments'. Also when drawing with triangles GLES2 draws interconnected segments.

This PR simply changes the primitive from GL_LINES to GL_LINE_STRIP as in GLES3.
2020-05-14 10:38:12 +01:00
Thakee Nathees e42318e41c regression: var declaration type info parser bug fix
(cherry picked from commit e5d735851d)
2020-05-13 16:14:22 +02:00
Thakee Nathees 6d7fb3d322 regression: static func can't access const fix
(cherry picked from commit e7f056dfac)
2020-05-13 16:14:08 +02:00
Marcel Admiraal dd7f9b1c08 Make it clear that PhysicsDirectSpaceState is only available from
within _physics_process().

(cherry picked from commit bb9c104695)
2020-05-13 16:13:47 +02:00
Marcel Admiraal 253d211102 Silence EQ::Band::c1, c2 and c3 may be used uninitialized warnings.
(cherry picked from commit d02143905f)
2020-05-13 16:12:37 +02:00
Hugo Locurcio e22cff8ccf Update the editor icons README to remove outdated information
This closes #38684.

(cherry picked from commit c6afb9f6ea)
2020-05-13 16:12:22 +02:00
Hugo Locurcio 6692681618 Tweak the error message displayd when a post-import script fails
See #38662.

(cherry picked from commit 0d7b627936)
2020-05-13 16:12:03 +02:00
Ashesh3 40d8ed023c Better file naming for AppVeyor artifacts
This builds upon https://github.com/godotengine/godot/pull/38625 and improves the file name format as mentioned in https://github.com/godotengine/godot/pull/38189#issuecomment-626585363

The resulting file stored has the name `godot.windows.opt.tools.64-$(VERSION_HASH).zip` where `VERSION_HASH` is obtained from `it rev-parse --short=9 HEAD` , the zip file contains the built exe file.

(cherry picked from commit 4f055c93a5)
2020-05-13 16:11:30 +02:00
etienne.frank 46327d48a2 Fix minimap selection offset
The minimap selection was shifted of 1 line too late.

(cherry picked from commit 72ab355945)
2020-05-13 16:10:12 +02:00
Hugo Locurcio 0b6bcf90f5 Rename the editor action "Revert Scene" to "Reload Saved Scene"
This option can be used to workaround various issues with stuff
not reloading properly when changes are made.
The option was renamed to clarify the fact that it actually
reloads the scene saved on the filesystem.

(cherry picked from commit 2962819d1c)
2020-05-13 16:09:38 +02:00
Thakee Nathees 72aa9ce7fc range() with non-numeric const argument crash fix
(cherry picked from commit 3e10392d48)
2020-05-13 16:08:33 +02:00
Rémi Verschelde ee7bde231c
Merge pull request #38706 from nathanfranke/fix-rename-sizing
Fix rename dialog size in 3.2
2020-05-13 07:19:34 +02:00
Rémi Verschelde b7ce9ad1bf
Merge pull request #38694 from lawnjelly/kessel_builtins
GLES2 Batching - Prevent baking colors with COLOR writes
2020-05-13 07:12:38 +02:00
nathanwfranke 814f72c524
Fix rename dialog size in 3.2 2020-05-12 18:34:00 -05:00
Author Lawnjelly 94ed206bfc GLES2 Batching - Prevent baking colors with COLOR writes
Writing to COLOR in a custom shader can result in incorrect results if colors are baked (vertex color and modulate). This PR prevents baking with COLOR output, except under the special circumstances that final modulate is (1, 1, 1, 1), in which case the result will be correct. This should still allow color baking in many scenarios with custom shaders.
2020-05-12 14:04:53 +01:00
Rémi Verschelde 8cb67bb359
Merge pull request #38692 from Calinou/doc-projectsettings-ssl-certificates
Clarify that the SSL certificate setting overrides the default bundle
2020-05-12 12:55:19 +02:00
Hugo Locurcio 47d003fbb8 Clarify that the SSL certificate setting overrides the default bundle
See https://github.com/godotengine/godot-docs/issues/2531.
2020-05-12 11:52:57 +02:00
Rémi Verschelde d999e1519c
Merge pull request #38686 from Calinou/doc-tilemap-used-cells-by-index
Clarify the `id` parameter in `TileMap.get_used_cells_by_id()`
2020-05-12 09:45:36 +02:00
Hugo Locurcio e77313b3ed Clarify the `id` parameter in `TileMap.get_used_cells_by_id()` 2020-05-12 09:26:38 +02:00
Rémi Verschelde 44c1c5840c
Merge pull request #38674 from madmiraal/fix-physicsw-warning-3.2
[3.2] Fix 'physicsw' may be used uninitialized warning in csg_shape.cpp
2020-05-11 21:19:34 +02:00
Rémi Verschelde 499e945da9
Merge pull request #38651 from neikeq/3.2-dotnet-cli-support
[3.2] C#: Support for building with the dotnet CLI
2020-05-11 21:17:56 +02:00
Ignacio Etcheverry 3928fe200f [3.2] C#: Support for building with the dotnet CLI
By adding a reference to the 'Microsoft.NETFramework.ReferenceAssemblies' nuget
package, we can build projects targeting .NET Framework with the dotnet CLI.
By referencing this package we also don't need to install Mono on Linux/macOS
or .NET Framework on Windows, as the assemblies are taken from the package.
2020-05-11 19:48:50 +02:00
Rémi Verschelde 4b91111acb
Merge pull request #38669 from lawnjelly/kessel_vertex_read
GLES2 Batching - Fix custom shaders reading VERTEX
2020-05-11 19:32:37 +02:00
lawnjelly 57c70d8e9c GLES2 Batching - Prevent VERTEX baking within items in custom shaders
In addition to prevent item joins when VERTEX reads are present in a custom shader, it is also necessary to prevent baking extra matrices (extra transforms) WITHIN items, because these can also report incorrect results.
2020-05-11 17:18:57 +01:00
lawnjelly d096ce1644 GLES2 Batching - Fix custom shaders reading VERTEX
In situations where custom canvas shaders read VERTEX values, they could read incorrect global positions rather than local positions where batching had baked item transforms. This PR prevents joining items that read VERTEX built in in shaders, and thus prevents this situation arising (as unjoined items will not bake transforms).
2020-05-11 15:54:15 +01:00
Marcel Admiraal b4302d0d04 Fix 'physicsw' may be used uninitialized warning in csg_shape.cpp 2020-05-11 13:33:20 +01:00
Rémi Verschelde a9bcd8ba26
Merge pull request #38659 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 5th batch
2020-05-11 12:55:46 +02:00
Rémi Verschelde 8056bdf605
Merge pull request #38658 from bruvzg/wintab_32
WinTab: Make movement smoother and handle pressure/tilt changes when cursor is not moving [3.2].
2020-05-11 12:39:45 +02:00
Hugo Locurcio c1cf8a5068 Tweak the editor log selection color to match the current editor theme
This overrides the default blue color.

(cherry picked from commit 411af2c750)
2020-05-11 11:39:35 +02:00
Hugo Locurcio b1455c68eb Rename the Clear Script editor action to Detach Script
This makes it more obvious that the script won't be modified
in any way.

See comments in #27813.

(cherry picked from commit 7fc0e38e92)
2020-05-11 11:38:22 +02:00
Hugo Locurcio d7f1a43d1a Use a different icon for the debugger tab with both warnings and errors
This makes it possible to see if both errors and warnings were
pushed without having to open the tab.

(cherry picked from commit 564f8ccc13)
2020-05-11 11:35:07 +02:00
bruvzg bd5413e05f
WinTab: Make movement smoother and handle pressure/tilt changes when cursor is not moving [3.2]. 2020-05-11 12:32:15 +03:00
Ashesh df87ae6eb8 Store build as artifact in appveyor
7z is already available in path in appveyor
zip the build .exe files and store them ( appveyor retains for ~6 months)

(cherry picked from commit 7ae70625f3)
2020-05-11 11:25:24 +02:00
Rémi Verschelde a5a7b1d462 Input: Readd 'Default Android Gamepad' magic binding
Removed by mistake in #38292 like the Windows `__XINPUT_DEVICE__`,
this magic binding is referenced directly in our code.

(cherry picked from commit 1c61b31109)
2020-05-11 11:22:21 +02:00
Eduardo Nunes Pereira 55ab98233a Using the common behaviour when use command+shift on text line for osx
* On press left+command+shift or right+command+shift it should behave like shift+home or shift+end and select the text
* Using home and end events as reference

(cherry picked from commit d8f8a3c606)
2020-05-11 11:13:22 +02:00
Rémi Verschelde 938a9c95d0 freetype: Update to upstream version 2.10.2
(cherry picked from commit 9c1b20eab6)
2020-05-11 11:12:39 +02:00
hoontee 8d0a925419 Re-add __XINPUT_DEVICE__
Required for `JoypadWindows::probe_joypads`.
Partially reverts 510e83498e. Fixes #38554.

(cherry picked from commit 9aa29b85a8)
2020-05-11 11:04:21 +02:00
Eric M 77ef3bb416 Added mapping for KEY_MENU to VK_APPS (0x5d) so context menu's triggered by the keyboard menu button work
(cherry picked from commit 97e77bcd19)
2020-05-11 11:04:04 +02:00
Thakee Nathees 7bc293b081 Fix: printing empty string does nothing in editor output pannel
Fix: #38490
(cherry picked from commit 5640cad1e1)
2020-05-11 11:02:53 +02:00
JFonS 9828c6bc86 Keep mouse inside 3D viewport rotation widget
Hide and keep the mouse in place when the user oribts the scene via the 3D
rotation widget.

(cherry picked from commit 051f02a3a0)
2020-05-11 11:01:13 +02:00
Ignacio Etcheverry 683e19306e Mono: Use msbuild instead of nuget.exe for restoring
- Make GodotTools output directly to the SCons output directory.
- Removed xbuild_fallback from the build system.

(cherry picked from commit b61ffef0ab)
2020-05-11 11:01:13 +02:00
Ignacio Etcheverry 34132d2f67 Mono: Fix hot-reloading of nested classes
(cherry picked from commit e0a001549e)
2020-05-11 11:01:13 +02:00
Thakee Nathees 7cfbde19c9 Fix: can't convert Transform -> Transform2D
Fix: #38528
(cherry picked from commit e32cdbe568)
2020-05-11 11:01:13 +02:00
Thakee Nathees 55b4e0c44a parser error for static func access non-static variables
Fix: #38408
(cherry picked from commit ce978517e0)
2020-05-11 11:01:13 +02:00
Marcel Admiraal 4c9ccffad2 Prevent CapsuleShape2D height from being less than zero.
(cherry picked from commit 68eaaa6d6b)
2020-05-11 11:01:13 +02:00
Chris Bradfield 752f61d4fe [DOCS] minor description changes
(cherry picked from commit 975ed93794)
2020-05-11 11:01:13 +02:00
Thakee Nathees 7d931bad58 rotation gizmo visible = false; when camera preview
(cherry picked from commit 60d67f13da)
2020-05-11 11:01:13 +02:00
bruvzg c4e00f3d57 Remove WinTab error message.
(cherry picked from commit ba85db5a79)
2020-05-11 11:01:13 +02:00
Tomasz Chabora 79f3725bdd Add documentation for the VisualShader nodes
(cherry picked from commit fecf79f287)
2020-05-11 11:01:13 +02:00
Thakee Nathees e417528f67 fix: dict2inst crash when constructor has arguments
(cherry picked from commit 9f6b20936e)
2020-05-11 11:01:12 +02:00
Thakee Nathees a446e8671d autocompleting with indexing for native types added
Fix: #37768
(cherry picked from commit 3c45377c6e)
2020-05-11 10:50:46 +02:00
Thakee Nathees 22053ed75f GDScript class var type resolve bug fixed
Fix: #37545
(cherry picked from commit e67eb5ca36)
2020-05-11 10:50:46 +02:00
Thakee Nathees 6b0cfc87af more clearer unexpected statement end error messages
(cherry picked from commit 5758d87f09)
2020-05-11 10:50:46 +02:00
Thakee Nathees 7111aa0688 pass keyword inside a class implemented
(cherry picked from commit 63ce1fc438)
2020-05-11 10:50:46 +02:00
Thakee Nathees f3149817ff fixed: saving gdscript with cyclic inheritance crash the editor
Fix: #9609
(cherry picked from commit c2ab35bdde)
2020-05-11 10:50:45 +02:00
Tomasz Chabora 0200db15cc Fix VisibilityEnabler2D behavior on start
(cherry picked from commit d0c5d91032)
2020-05-11 10:33:38 +02:00
Rémi Verschelde 5d26836c78
Merge pull request #38629 from Technohacker/windows-dwm-ppt-3.2
Use DwmEnableBlurBehindWindow for Windows Per Pixel Transparency
2020-05-11 10:23:44 +02:00
Rémi Verschelde 56a513d70d
Merge pull request #38639 from neikeq/3.2-godottools-new-messaging-protocol
[3.2] C#: Rewrite GodotTools messaging protocol
2020-05-11 07:55:29 +02:00
Rémi Verschelde dc89c1b7e6
Merge pull request #38649 from Janglee123/ctrl-click-3.2
Improved go-to definition (Ctrl + Click) for 3.2
2020-05-11 07:54:30 +02:00
janglee d16abbdee4 Improved go-to definition (Ctrl + Click)
Co-Authored-By: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
(cherry picked from commit be7a353c70)
2020-05-11 09:33:21 +05:30
Ignacio Etcheverry fb2e00a854 [3.2] C#: Rewrite GodotTools messaging protocol 2020-05-10 21:05:00 +02:00
thebestnom 30680a4afe Android: Migrate deprecated support library to AndroidX 2020-05-10 19:08:27 +03:00
Technohacker 0456311be3
Don't force borderless mode when using per-pixel transparency 2020-05-10 21:05:37 +05:30
Technohacker 9584f24be5
Use DWMEnableBlurBehindWindow instead of WS_EX_LAYERED
Affects per-pixel transparency

The current method renders to the screen by copying the GLES output to a
DIB for transparency using the CPU instead of rendering directly to the
window via the GPU. This is slower and also forces the window to be borderless
as WS_EX_LAYERED affects the non-client region as well.

This change uses DWMEnableBlurBehindWindow which allows using the standard
glClearColor() background alpha and is also performed through the GPU,
eliminating CPU bottlenecks
2020-05-10 21:05:37 +05:30
Rémi Verschelde aa57bb0473
Merge pull request #38482 from RandomShaper/improve_yield_3.2
Fix object leaks caused by unfulfilled yields (3.2)
2020-05-09 22:03:00 +02:00
Rémi Verschelde d038a7e42d
Merge pull request #38517 from lawnjelly/gles3_nvidia_workaround
Add Nvidia Workaround for GLES3
2020-05-08 10:52:31 +02:00
Rémi Verschelde 22ed24334a
Merge pull request #38542 from kuruk-mm/center-touchscreen
GUI: Touch screen button click area now is synced with its draw
2020-05-07 18:06:54 +02:00
Rémi Verschelde 5516942110
Merge pull request #38538 from avril-gh/fix-mistyped-setting-path
fix mistyped setting path
2020-05-07 18:00:34 +02:00
Mateo Kuruk Miccino 1cba7fb180 GUI: Touch screen button click area now is synced with its draw 2020-05-07 11:04:59 -03:00
lawnjelly dcb19ed735 Add Nvidia Workaround for GLES3
Ported GLES2 workaround code to GLES3.
2020-05-07 14:54:14 +01:00
Avril 5e320816f6 fix mistyped setting path 2020-05-07 15:48:43 +02:00
Rémi Verschelde 786e55738e
Merge pull request #38527 from lawnjelly/gles3_drawcall_stats
GLES3 - add counts for 2d drawcall and 2d items to performance monitor
2020-05-07 13:47:37 +02:00
Rémi Verschelde 4daba9bfc5 doc: Sync classref with current source 2020-05-07 13:47:06 +02:00
Thakee Nathees 1a39b4ea22 method bind TextEdit::set_line() added
(cherry picked from commit b9acf1cedf)
2020-05-07 13:43:43 +02:00
Marcel Admiraal 87de81258d Make 2D and 3D KinematicBody stop_on_slope documentation the same.
(cherry picked from commit da13b74cc8)
2020-05-07 13:37:19 +02:00
hoontee 159992f663 Fix bug with AudioStreamPlayer3D audio position
Applies 0c78a58b64 to `AudioStreamPlayer3D::play`.

(cherry picked from commit 330bd686ab)
2020-05-07 13:37:06 +02:00
nobuyuki_nyuu 12386a2d80 PopupMenu.get_current_index() bound to ClassDB
(cherry picked from commit 35f30086de)
2020-05-07 13:36:53 +02:00
Rémi Verschelde e637fe9dd3 clang-format: Add JavaImportGroups for Java code
(cherry picked from commit 6038325470)
2020-05-07 13:36:27 +02:00
Rémi Verschelde d09036992c jpgd: Fix detection of SSE2 support with MSVC
The previous code would always use SSE2 intrinsics, which is not valid
on UWP ARM platforms (and likely not on some x86 platforms either).

The patch has been submitted upstream too:
https://github.com/richgel999/jpeg-compressor/pull/13

(cherry picked from commit 3806efbaa7)
2020-05-07 13:33:39 +02:00
lawnjelly 17bb7af425 GLES3 - add counts for 2d drawcall and 2d items to performance monitor
This had already been implemented for GLES2 but not GLES3.
2020-05-07 11:31:43 +01:00
Hugo Locurcio bab595393c Request the dedicated GPU when starting Godot from the `.desktop` file
See <https://www.hadess.net/2020/05/dual-gpu-support-launch-on-discrete-gpu.html>
for more information on this newly added `.desktop` entry property.

(cherry picked from commit b896ca8722)
2020-05-06 23:31:33 +02:00
Marcel Admiraal f8b06c8a5c Fix scale calculation in VHACD Volume::Voxelize().
(cherry picked from commit 75553c4f90)
2020-05-06 23:31:18 +02:00
Stanislav Labzyuk e3712cf689 Bind set_suffix/get_suffix in Tree
(cherry picked from commit ac8814624d)
2020-05-06 23:31:02 +02:00
follower 90f9f01a2f Fix suffix property doc typo: "prefix" -> "suffix"
(cherry picked from commit ae067413a5)
2020-05-06 23:30:45 +02:00
Eric M b7fbdf4bed Updated editor spin slider to have better behaviour and adjusted control's size_flags_stretch_ratio value range
(cherry picked from commit 915ab50673)
2020-05-06 23:30:28 +02:00
Thakee Nathees a5a28239a6 Fix: Tween always return true for _get(), _set()
(cherry picked from commit 2811268231)
2020-05-06 23:29:45 +02:00
Fredia Huya-Kouadio 918f5dee23 Address `OS.request_permissions()` bug when non-platform permission(s) is included
(cherry picked from commit ef62506e5c)
2020-05-06 23:29:29 +02:00
Eric M d744f4a678 Stopped trying to revert to default values when script implementation of property_can_revert exists
(cherry picked from commit 27ada5c114)
2020-05-06 23:29:08 +02:00
Marcel Admiraal 23d473f488 Fix array slicing.
(cherry picked from commit 4409f3cc68)
2020-05-06 23:28:44 +02:00
Rémi Verschelde 7b56111c29
Merge pull request #38503 from lawnjelly/kessel_reorder_bug
GLES2 Batching - fix item reordering bug
2020-05-06 14:37:09 +02:00
lawnjelly bda20edb76 GLES2 Batching - fix item reordering bug
There was a bug in the initial logic for item reordering, whereby it would check for overlaps between the mover (item being moved back) and sandwiched items, but there was no check for overlaps between the movee (item moved forward) and the sandwich items. This extra check is now done.

Also a minor addition to the diagnose frame info (godot texture ID).
2020-05-06 12:55:18 +01:00
Pedro J. Estébanez 64344e6d1d Fix object leaks caused by unfulfilled yields
Now the stack saved in a `GDScriptFunctionState` is cleared as soon as the `yield()` operation is known not to be resumed because either the script, the instance or both are deleted.

This clears problems like leaked objects by eliminating cases of circular references between `GDScriptFunctionState`s preventing them and the objects they refer to in their saved stacks from being released. As an example, this makes using `SceneTreeTimer` safer.

Furthermore, with this change it's now possible to print early warnings about `yield()`s to released script/instances, as now we know they won't be successfully resumed as the condition for that happens. However, this PR doesn't add such messages, to keep the observed behavior the same for the time being.

Also, now a backup of the function name in `GDScriptFunctionState` is used, since the script may not be valid by the time the function name is needed for the resume-after-yield error messages.
2020-05-05 17:53:47 +02:00
Rémi Verschelde 4d2c8ba922
Merge pull request #38484 from bruvzg/wintab_32
Add support for the WinTab API for pen input. (3.2)
2020-05-05 17:08:46 +02:00
Rémi Verschelde 6d39af42a0
Merge pull request #38477 from Chaosus/vs_canvas_input_fixes
(3.2) Some fixes for canvas item visual shader inputs
2020-05-05 16:38:50 +02:00
Rémi Verschelde d9ea1af85d Update DONORS list
(cherry picked from commit 28e9a78859)
2020-05-05 16:25:18 +02:00
Rémi Verschelde 00b5663782 i18n: Sync translations with Weblate 2020-05-05 16:05:12 +02:00
bruvzg 78266c09c4
Add support for the WinTab API for pen input. (3.2) 2020-05-05 14:56:02 +03:00
simpuid 92964c5889 Changed default for p_validate_certs to true.
Fixes #37084

(cherry picked from commit 2584eb9c69)
2020-05-05 13:41:40 +02:00
HaSa1002 caadd761f2 Priorize Embedded PCKs on loading
If existing, embedded PCKs are loaded before the pcks the engine might
find next to it.

Fixes #37568

(cherry picked from commit fba98950c7)
2020-05-05 13:41:29 +02:00
bruvzg da2ca9e22a [Linux/Windows] Set pressure to 1.0f when primary button is pressed and device is not pressure sensitive.
(cherry picked from commit 0128947894)
2020-05-05 13:41:29 +02:00
Marcel Admiraal a286edb821 Fix X11 pressure and tilt values.
(cherry picked from commit a2ad0878ed)
2020-05-05 13:41:29 +02:00
Hugo Locurcio 2293cf61c6 Document the expected normal map coordinate system where relevant
(cherry picked from commit d8808fba85)
2020-05-05 13:41:29 +02:00
Marcel Admiraal fa11b5d754 Check for empty vectors before trying to access a pointer to the first
element in Octree<T, use_pairs, AL>::cull_convex().

(cherry picked from commit 54c36adbec)
2020-05-05 13:41:29 +02:00
Rémi Verschelde ef715f37d5
Merge pull request #35091 from Faless/dtls/enet
[3.2] DTLS support + optional ENet encryption
2020-05-05 13:40:59 +02:00
Rémi Verschelde 3c82031a99
Merge pull request #38476 from lawnjelly/half_float_docs
Added 'disable_half_float' project setting to the class reference.
2020-05-05 12:03:21 +02:00
Yuri Roubinsky 1f89c3bfeb (3.2) Some fixes for canvas item visual shader inputs 2020-05-05 12:21:25 +03:00
lawnjelly 53f6dafdde Added 'disable_half_float' project setting to the class reference.
Just forgot to do this in the original PR.
2020-05-05 09:31:10 +01:00
Rémi Verschelde d20485039c
Merge pull request #38453 from lawnjelly/ios_halffloat_hacky
GLES2 disable half-float project setting
2020-05-04 16:29:27 +02:00
Rémi Verschelde e363b65b99 doc: Sync classref with current source 2020-05-04 16:10:57 +02:00
Rémi Verschelde f629df647d Revert "Emit signal when animation ends by seek"
This reverts commit bf1cc116e1.

This needs more discussion to avoid breaking some users' expectations.
See #38086 for arguments.

(cherry picked from commit 69f36cea8c)
2020-05-04 16:10:32 +02:00
Juan Linietsky 7f61710183 Implement Skew in Node2D
Skew is x-axis only, because it must be bidirectionally convertible to a 2x3 matrix, but you can subtract it  to the rotation to get the effect on y-axis

(cherry picked from commit efb1f7d76b)
2020-05-04 16:10:22 +02:00
Pedro J. Estébanez 97ffd1f8ae Fix crash in stb_vorbis.c
(cherry picked from commit d259094c3a)
2020-05-04 16:10:22 +02:00
Thomas Riedmair 7e669123f9 Fix performance issue in update_bitmask_region fallback
(cherry picked from commit e0f084b924)
2020-05-04 16:10:22 +02:00
Bastiaan Olij 02b1a5de47 Added missing spring enums for generic_6dof_joint
(cherry picked from commit 45d1f41837)
2020-05-04 16:10:22 +02:00
Hugo Locurcio 23ee40deff Tweak Tween cheatsheet link formatting to avoid rST conversion bug
reStructuredText doesn't allow embedding links in bold/italic text.

(cherry picked from commit e8a2fa6b7d)
2020-05-04 16:10:22 +02:00
Dominik 'dreamsComeTrue' Jasiński 2524ed4242 Proper naming and ordering when Duplicate nodes
Fixes: #38162
(cherry picked from commit 278259b433)
2020-05-04 16:10:22 +02:00
Steven Schoen 40125c7cce Mention offending function name in "Indented block expected" error
(cherry picked from commit e6e5ba32cd)
2020-05-04 16:10:22 +02:00
jitspoe e0be022b1e Fix custom w component being uninitialized on CPU particles.
(cherry picked from commit 38085f2f6982c491935a434bb45e358dbebe1714)
(cherry picked from commit b9c280b73ff6a13ea490d2da0f2728bcef3038dc)
(cherry picked from commit 895ed2aed7)
2020-05-04 16:10:22 +02:00
Christoph Schröder d70cb49eef Move mouse wheel handler from window to canvas element in HTML
Similar to https://github.com/godotengine/godot/pull/36557

At least in chrome, the following error is printed for each mouse wheel
rotation:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312

This PR moves the handler to the canvas and thereby fixes the error.

Tested on: Chrome and Firefox (MacOS), Firefox, Chrome(Android), Safari (IPad + MacOS)

(cherry picked from commit b1e8ac7b08)
2020-05-04 16:10:22 +02:00
Rémi Verschelde 41b836cb3d
Merge pull request #38450 from lawnjelly/shaper_modulate
GLES2 batching - prevent color baking with MODULATE or COLOR
2020-05-04 15:13:35 +02:00
Rémi Verschelde 43f640e498
Merge pull request #38432 from RandomShaper/canvas_modulate_3.2
Add MODULATE builtin to canvas item shaders (3.2)
2020-05-04 15:12:03 +02:00
lawnjelly 30a3f16e34 GLES2 disable half-float project setting
It seems that particles (and some other features) do not work correctly on iOS in GLES2 because either many of the devices do not support half float compression, or the GL constant used to reference it from Godot is incorrect.

This PR adds a project setting in rendering/gles2/ to disable half-float compression on iOS.
2020-05-04 13:11:23 +01:00
lawnjelly b08ad9ef64 GLES2 batching - prevent color baking with MODULATE or COLOR
Adding the ability to access MODULATE in the shader breaks when final_modulate is baked into vertex colors (this is a technique used to batch together different colored items). This PR prevents baking vertex colors when MODULATE is detected in the shader.

It also prevents baking when COLOR is read in canvas shaders, which could currently produce the wrong result in the shader if colors were baked. It does not prevent baking if COLOR is only written, which happens in most shaders, and will operate correctly without baking.
2020-05-04 11:19:55 +01:00
Pedro J. Estébanez d8be5a9986 Add MODULATE builtin to canvas item shaders 2020-05-04 00:10:24 +02:00
Rémi Verschelde 8426ed2650
Merge pull request #38378 from lawnjelly/kessel_ios_particle
Fix uninitialized memory in CPUParticles2D
2020-05-01 15:17:06 +02:00
Rémi Verschelde 01a085d05f
Merge pull request #38320 from lawnjelly/kessel_pr_light_join
GLES2 2D batching - item reordering, light joining and light modulate fix
2020-05-01 15:03:03 +02:00
lawnjelly 9af4c09d1b Fix uninitialized memory in CPUParticles2D
Calls to set_amount can increase the size of the particle array, but do not zero the memory, they only set the active flag to false. This uninitialized memory can be sent to the GPU, possibly as NaNs.
2020-05-01 13:49:53 +01:00
Rémi Verschelde 607d688d45 tinyexr: Enable C++11 threaded loading
(cherry picked from commit 2175397210)
2020-05-01 11:10:16 +02:00
Rémi Verschelde e3d913c79a tinyexr: Sync with upstream 4dbd05a
(cherry picked from commit 3a80fce8be)
2020-05-01 11:02:50 +02:00
Rémi Verschelde 8d394f6c01 Recast: Update to upstream commit 57610fa (2019)
(cherry picked from commit 6ba546f98b)
2020-05-01 11:02:29 +02:00
Rémi Verschelde 8730722a74 pcre2: Update to upstream version 10.34
Changelog: https://vcs.pcre.org/pcre2/code/tags/pcre2-10.34/ChangeLog?view=markup
(cherry picked from commit 824736d271)
2020-05-01 11:01:57 +02:00
Rémi Verschelde f43bbc0f4b stb_vorbis: Update to upstream version 1.19
1.19 - 2020-02-05 - warnings
1.18 - 2020-02-02 - fix seek bugs; parse header comments; misc
                    warnings etc.

(cherry picked from commit 8ce7dce511)
2020-05-01 11:01:47 +02:00
Rémi Verschelde 6893282c41 Drop now unused curl_hostcheck.c
One less thirdparty library to document \o/

(cherry picked from commit 05cf8b7c63)
2020-05-01 11:01:29 +02:00
Revan Ji 6a7d50403a Add set_frame, pause, and oneshot to AnimatedTexture
Add API documentation for said changes.

(cherry picked from commit f5029e18ca)
2020-05-01 11:00:10 +02:00
MrRevington fcb6bd7611 Add AtlasTexture support in SpriteFrames Editor - Add Frames from a Sprite Sheet
(cherry picked from commit 13770ac08d)
2020-05-01 10:57:28 +02:00
Darenn 3c26de316e Fixed bbcode parsing for built-in RichTextEffects in RichTextLabel
RichTextEffect can now have a bbcode string starting like one of the built-in.
It was impossible before as the built-in would take precedence over the custom effect that has the same bbcode start.

Example : [fade] would take precedence over [fade_in]
(cherry picked from commit b4e3042cba)
2020-05-01 10:57:00 +02:00
Rémi Verschelde 0573c8bf62 enet: Update to upstream version 1.3.15
(cherry picked from commit ebe38044fd)
2020-05-01 10:56:58 +02:00
Hugo Locurcio be56ec9e65 Document the formats supported by `Image.load()`
This partially addresses #32166.

(cherry picked from commit a26649de42)
2020-05-01 10:56:58 +02:00
Nannaquin 9e4de37e88 Fix growMargin() not returning modified Rect2/Rect2i
(cherry picked from commit 0ac6f4c40b)
2020-05-01 10:56:58 +02:00
Hugo Locurcio cfd6bc7267 Don't focus the selection after using Align Transform With View
It made minor adjustments difficult as the camera moved every time
Align Transform With View was used.

This closes #36738.

(cherry picked from commit a636631e33)
2020-05-01 10:56:58 +02:00
Sam 68b968ff6c Resets global pose of IK chain bones being solved, rather than the whole skeleton. Resolves #38026
(cherry picked from commit e321d38c0e)
2020-05-01 10:56:58 +02:00
Hugo Locurcio 6fb6107e6a Warn when trying to open `res://` or `user://` with `OS.shell_open()`
`OS.shell_open()` will pass on the path directly to the OS' shell
handler (which can handle file paths or URLs). It can't handle
Godot-specific paths, so these need to be converted with
`ProjectSettings.globalize_path()` first.

(cherry picked from commit d46e411b44)
2020-05-01 10:56:58 +02:00
Rémi Verschelde 9b636a2ccd Input: Drop obsolete versions of SDL gamecontrollerdb
The 204 and 205 are the older, SDL 2.0.4 and 2.0.5 compatible mappings,
but since all new mappings have only been added to the main
gamecontrollerdb.txt which overrides the older entries, it doesn't make
much sense for us to keep the old databases.

We do not support the SDL2 half axes and inverted axes features from
gamecontrollerdb.txt, but this only impacts the specific controllers
which can use those features, the rest are parsed and used properly.

As for godotcontrollerdb.txt, it doesn't make sense for us to maintain
our own custom mappings instead of submitting them upstream. The only
exception is the Javascript and UWP platforms for which no bindings are
available upstream, so we keep those entries.

(cherry picked from commit 510e83498e)
2020-05-01 10:56:58 +02:00
Bojidar Marinov 4b58d453d4 Expose the cell_size affecting VisibilityNotifier2D precision
Refs: #4803
(cherry picked from commit d49ff7aff7)
2020-05-01 10:56:58 +02:00
Tom Evans 2859ceec6f Fix for marking assert lines as safe bug
Calling _reduce_node_type from GDScriptParser::_parse_block for assert
was using a current class with a scope that didn't include all
functions. Now calling in GDScriptParser::_check_block_types uses the
right class type. We also now check the assert node message. The assert
line was added to the set_errors associated with assert, since before
the error would be reported on the next line

(cherry picked from commit bd081df519)
2020-05-01 10:56:58 +02:00
Hugo Locurcio 782d9536f3 Improve the compression project settings documentation
(cherry picked from commit b2b8db7897)
2020-05-01 10:56:58 +02:00
Tom Evans 1f970670b7 Fixed shuffling editor help tabs
The indexes for the ScriptEditorItemData entries were not getting
updated after sorting. This would cause a page to be open but with a
different tab selected. Whenever _update_script_names was called next,
it would correct this indexing. Now we correct it immediately following
the tab sort.

(cherry picked from commit fe53c1b0bd)
2020-05-01 10:56:58 +02:00
Tomasz Chabora 6bb87d7d23 Mention how to remove TreeItem from a Tree
(cherry picked from commit f6aec99d27)
2020-05-01 10:56:58 +02:00
punto- cc08101d50 Input: make VibrationInfo protected to allow implementors to use it
(cherry picked from commit 41a7d07095)
2020-05-01 10:56:58 +02:00
John Wigg ee8b3bef2d Limit undo stack size
The stack size of the undo history of a TextEdit was not limited leading
to potential memory leaks when doing lots of operations on a TextEdit.

This commit adds the option gui/common/text_edit_undo_stack_max_size
to the project settings. The first element of the undo stack is popped
if the stack's size exceeds this value ensuring limited memory usage.

The default stack size setting is 1024.

Fixes #37838.

(cherry picked from commit 4a82390aaf)
2020-05-01 10:56:58 +02:00
Markus Sauermann e88cde0415 Clarify Transform scaled Method description.
(cherry picked from commit 19c8b0be45)
2020-05-01 10:56:58 +02:00
Rémi Verschelde 5f5ef98832 glTF: Fix tangent generation for non-blend shapes
PR #30877 was bogus as it made a blend shape-specific code block apply
to everything but blend shapes (as it seemed not to work properly *for*
blend shapes).

The proper fix should thus be to simply remove the problematic
block (and thus cleanup unnecessary logic).

Fixes #32712.

(cherry picked from commit 0034c88c57)
2020-05-01 10:56:58 +02:00
Marcel Admiraal 48bc3fd297 Fix Android export throwing Unicode errors.
(cherry picked from commit e74f8aaaf1)
2020-05-01 10:56:58 +02:00
Marcel Admiraal 966139ca4c Fix CSG vertex normal calculation.
(cherry picked from commit 9bd305bfe2)
2020-05-01 10:56:58 +02:00
Thakee Nathees 1a4530e84c export var type reduce() implemented
(cherry picked from commit cd487201c6)
2020-05-01 10:56:58 +02:00
Avantir-Chaosfire fd6424aa04 doc: Improve Node2D to_local/to_global description
(cherry picked from commit 5c6f824e71)
2020-05-01 10:56:57 +02:00
Andrea Catania b7dace75c7 Make softbody completelly stiff to attachment point
(cherry picked from commit ca7ee56759)
2020-05-01 10:56:57 +02:00
Shivansh Anand 5f21a5b9e3 Make Quick Open substring match more specific.
When finding a substring, the rating is biased towards substrings
at the end of the path.

Fixes #33504.

(cherry picked from commit 8c66d80099)
2020-05-01 10:56:57 +02:00
lawnjelly 451c3fc0fb GLES2 2D batching - item reordering, light joining and light modulate fix
Although 2D draws in painters order with strict ordering, in certain circumstances items can be reordered to increase batching / decrease state changes, without affecting the end result. This can be determined by an overlap test.

In situation with item:
A-B-A
providing the third item does not overlap the second, they can be reordered:
A-A-B

Items already contain an AABB which can be used for this overlap test.

1)
To utilise this, I have implemented item reordering (only for single rects for now), with the lookahead adjustable in project settings. This can increase performance in situations where items may not be grouped in the scene tree by texture. It can also be switched off (by setting lookahead to 0).

2)
This same trick can be used to help join items that are lit. Lit items previously would prevent joining completely, thus missing out on performance gains other than multi-command items such as tilemaps.

In this PR, lights are assigned as bits in a bitfield (up to 64, the optimization is disabled above this), and on each try_item (for joining), the bitfield for lights and shadows is constructed and compared with the previous items. If these match the 2 items can potentially be joined. However, this can only be done without changing the rendered result if an overlap test is successful.

This overlap test can be adjusted to join items up to a specific number of item references, selectable in project settings, or turned off.

3)
The legacy uniform single rect drawing routine seems to have been identified as the source of flicker, particularly on nvidia. However, it can also be up to 2x as fast. Because of the speed the batching contains a fallback where it can use the legacy single rect method, but I have now added a project setting to make this switchable. In most cases with batching it should not be necessary (as single rects are drawn less frequently) and thus the flickering can be totally avoided.

4)
This PR also fixes a color modulate bug when drawing light passes, in certain situations (particularly custom _draw routines with multiple rects).

5)
This PR also fixes #38291, a bug in the legacy renderer where light passes could draw rects in wrong position.
2020-05-01 07:47:33 +01:00
Rémi Verschelde 510406af28
Merge pull request #38350 from RandomShaper/fix_variant_to_rid
Fix errors in Variant to RID conversion
2020-04-30 16:25:29 +02:00
Pedro J. Estébanez ee301bceb5 Fix errors in Variant to RID conversion 2020-04-30 10:23:30 +02:00
Rémi Verschelde da68cece7f
Merge pull request #38338 from RandomShaper/time_rollback_3.2
Improve shader time roll over (3.2)
2020-04-30 09:07:34 +02:00
Rémi Verschelde 8d93303483
Merge pull request #37863 from ExpiredPopsicle/culling5
Fixed false positives in the culling system.
2020-04-30 08:05:11 +02:00
Pedro J. Estébanez 7cc0f181c9 Improve shader time roll over
- Resurrect it for GL ES 2
- Apply roll over with `fmod()` instead of resetting it to 0
- Expose the setting from the `VisualServer`, since it does not belong in any specific rasterizer
2020-04-29 22:33:03 +02:00
Rémi Verschelde c8ea779848
Merge pull request #38322 from RandomShaper/imvu/fix_not_freed_gdsfuncstate_3.2
Fix leaked objects when game ends with yields in progress (3.2)
2020-04-29 17:30:39 +02:00
Pedro J. Estébanez 68cca6e619 Fix leaked objects when game ends with yields in progress 2020-04-29 14:13:36 +02:00
Rémi Verschelde f2150d1766
Merge pull request #37462 from Chaosus/shader_fix_const_order
[3.2] Fix shader constant sorting
2020-04-29 09:41:49 +02:00
Rémi Verschelde fc5dad44ad
Merge pull request #38299 from m4gr3d/update_external_texture_documentation
Update the ExternalTexture documentation
2020-04-29 09:15:13 +02:00
Kiri Jolly bac44ee19f Fixed false positives in the culling system.
This fixes numerous false positives coming out of the culling system.

AABB checks are now a full separating-axis check against the frustum, with the points of the frustum being compared to the planes of the box just as the points of the box were being compared to the planes of the frustum. This fixes large objects behind the camera not being culled correctly.

Some systems that used frustums that were (sometimes mistakenly?) unbounded on one or more side have been modified to be fully enclosed.
2020-04-28 17:14:06 -07:00
Kiri Jolly 2c6e859c2d Fixed unbounded dual-paraboloid shadow map culling.
Dual paraboloid shadowmaps were ending up with infinitely large volumes of area behind the hemisphere un-culled.

This change just adds a back plane to the convex shape used for the culling volume.
2020-04-28 17:13:36 -07:00
Fredia Huya-Kouadio 9b9f70bd20 Update the documentation for `ExternalTexture` to match the restriction on Android platforms 2020-04-28 08:04:41 -07:00
Rémi Verschelde 60609ff0ed
Merge pull request #38244 from m4gr3d/resolve_gl_invalid_enum_error
[3.2] Restrict `GL_TEXTURE_EXTERNAL_OES` to Android platforms
2020-04-28 11:20:11 +02:00
Fredia Huya-Kouadio 7c559afe29 Restrict `GL_TEXTURE_EXTERNAL_OES` to Android platform 2020-04-27 10:18:31 -07:00
Rémi Verschelde 78f0cf40cb
Merge pull request #38257 from RandomShaper/imvu/fix_variantrc_gdnative
Fix GDNative compat breakage due to dangling Variants fix
2020-04-27 18:43:10 +02:00
Rémi Verschelde 4dda00461f
Merge pull request #38011 from madmiraal/fix-csg-3.2
[3.2] Fix multiple issues with CSG module.
2020-04-27 17:05:47 +02:00
Pedro J. Estébanez 3bdc0913a5 Make wording of all Variant warnings consistent 2020-04-27 13:15:52 +02:00
Pedro J. Estébanez ac8b4708a3 Fix GDNative compat breakage due to dangling Variants fix
This moves the instance id member from Variant to the ObjectRC so that Variant is still the same size as before the fix (and also regardless if debug or release build).
2020-04-27 13:07:52 +02:00
Rémi Verschelde 9015138e3e
Merge pull request #38254 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 4th batch
2020-04-27 12:23:06 +02:00
Rémi Verschelde ae958b89ab i18n: Sync translations with Weblate 2020-04-27 10:32:51 +02:00
Hugo Locurcio 9b6df1ed00 Set the `title` tag in the HTML5 export immediately
This makes the project title display without having to wait for
the project to finish loading.

(cherry picked from commit eecce139ea)
2020-04-27 10:19:33 +02:00
Rémi Verschelde aecba58e92 Windows: Appease capricious MSVC versions with moody headers
Fixes #37799.
Fixes #37986.

(cherry picked from commit 4d3a18d9ff)
2020-04-27 10:19:08 +02:00
Hugo Locurcio ae0bc06eba Improve `pitch_scale` descriptions in AudioStreamPlayer documentation
This closes #29439.

Co-authored-by: Cheeseness <contact@jbushproductions.com>
(cherry picked from commit 4751dee7f4)
2020-04-27 10:18:41 +02:00
Hugo Locurcio 93ba25cfcb Improve path search behavior discoverability in the project manager
This closes #38185.

(cherry picked from commit 72da1667e0)
2020-04-27 10:17:08 +02:00
Tobias Mansfield-Williams 8b33b08c29 Add const to InputEventMouseButton::get_factor
(cherry picked from commit 982efb1864)
2020-04-27 10:16:21 +02:00
Fredia Huya-Kouadio 2d9725b89d Fix detection logic for the Android sdk path
The previous logic used the 'tools' directory within the Android sdk to validate it. That directory was recently deprecated and removed from the Android sdk folder (https://developer.android.com/studio/releases/sdk-tools)

(cherry picked from commit 328354f878)
2020-04-27 10:15:56 +02:00
Michael Alexsander de4c75af10 Fix crash when changing time value of multiple animation keys at once via inspector
(cherry picked from commit b081e954cc)
2020-04-27 10:15:39 +02:00
Ignacio Etcheverry 8cdcb410e0 Mono/C#: Fix load hook not called for some assemblies on domain reload
(cherry picked from commit f5510262bc)
2020-04-27 10:15:24 +02:00
Ignacio Etcheverry a98d44f654 C#: Fix always saving copy of csproj even with no changes
This was a regression from 93d7ec8836 (#38110).
Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to
always return true.
This workaround can be reverted once we switch to official Microsoft.Build.

(cherry picked from commit 81f13f6171)
2020-04-27 10:15:07 +02:00
Hugo Locurcio 24265c498b Improve the procedural geometry class documentations
This references Godot's winding order at the top of every
procedural geometry class, as well as referencing other classes
within a given geometry class.

A warning about ImmediateGeometry3D performance was also added.

(cherry picked from commit ed7347d73d)
2020-04-27 10:14:42 +02:00
Hugo Locurcio 93555d9ccc Add editor freelook navigation scheme settings
Depending on what one is trying to achieve, a different freelook mode
may be more desirable.

This closes #34034.

(cherry picked from commit 8a48fb3517)
2020-04-27 10:12:55 +02:00
Hugo Locurcio bbd381c987 Add an easing/transition type cheatsheet to the Tween documentation
Related to https://github.com/godotengine/godot-docs/pull/3403.

(cherry picked from commit 5972a9138e)
2020-04-27 10:12:11 +02:00
Hugo Locurcio f3cd7e3808 Document how some editor classes should be accessed as singletons only
This closes #37687.

(cherry picked from commit a225265b0a)
2020-04-27 10:11:53 +02:00
Tom Evans 3bd5fc2e5e Mark assert lines as safe in gdscript
Now calling _reduce_node_type with debugging enabled to determine
if assert line is safe. Part of doing this required the assert line
to be stored away. Now the AssertNode line is being correctly set.
Newlines are now marked safe always

(cherry picked from commit 8dc8833782)
2020-04-27 10:10:20 +02:00
Umang Kalra 94d0f34f70 Fixed the bool _static logic
(cherry picked from commit b192c7d1ac)
2020-04-27 10:09:49 +02:00
Hugo Locurcio 708184c402 Add more extensions to the dummy texture loader
This should make headless exporting work in projects using textures
in any format.

Error messages should no longer appear when running a project
that used image formats that were previously not present in the list.

(cherry picked from commit 3007c7e2a3)
2020-04-27 10:09:17 +02:00
Rémi Verschelde 0233b7e51f
Merge pull request #38251 from clayjohn/GLES2-shader-defines
Avoid duplicating shader defines in GLES2
2020-04-27 08:47:46 +02:00
clayjohn 782fd5fab6 Avoid duplicating shader defines in GLES2 2020-04-26 23:28:24 -07:00
Rémi Verschelde be5a47e75d
Merge pull request #38200 from lawnjelly/kessel_screen_read
GLES2 Batching fix canvas texscreen (SCREEN_TEXTURE)
2020-04-25 16:10:53 +02:00
lawnjelly a75c1ed1df GLES2 Batching fix canvas texscreen (SCREEN_TEXTURE)
When reading SCREEN_TEXTURE in a shader, this previously only worked succesfully for the first read of the screen, because state.canvas_texscreen_used was never getting reset. This PR resets state.canvas_texscreen_used at the beginning of each joined item, so that further screen reads can happen.
2020-04-25 13:40:43 +01:00
Rémi Verschelde a9def52225
Merge pull request #38156 from Calinou/tweak-ssao-property-hints-3.2
Tweak SSAO property hints to allow setting more precise values (3.2)
2020-04-25 12:55:33 +02:00
Rémi Verschelde 4f32d545f1
Merge pull request #37108 from RandomShaper/imvu/export_vmem_3.2
Add ability to export debugger's VRAM usage report (3.2)
2020-04-25 00:32:51 +02:00
Rémi Verschelde 5d5848d2b1
Merge pull request #38119 from RandomShaper/imvu/new_dangling_variant_fix
Fix dangling Variants (3.2)
2020-04-24 17:59:52 +02:00
Rémi Verschelde b04f092643
Merge pull request #38141 from neikeq/3.2-fix-collections-marshalling-by-interface
C#: Revert marshalling of IDictionary/IEnumerable implementing types
2020-04-24 17:56:25 +02:00
Rémi Verschelde e408c61497
Merge pull request #38137 from lawnjelly/kessel_z_lightfix
Fix batching z_indices with z ranged lights
2020-04-24 17:31:55 +02:00
Pedro J. Estébanez 5cb2cfe655 Add ability to export VRAM usage as CSV 2020-04-24 09:22:36 +02:00
Hugo Locurcio 464fe67e96
Tweak SSAO property hints to allow setting more precise values
This was requested by an user on Twitter who was working on a game with a very small-scale world.
2020-04-23 21:59:53 +02:00
Ignacio Etcheverry 6aca932659 C#: Revert marshalling of IDictionary/IEnumerable implementing types
Added marshalling for `System.Collections.Generic.List<T>` and
`System.Collections.Generic.Dictionary<TKey, TValue>`.
2020-04-23 15:36:01 +02:00
Pedro J. Estébanez d904d05e65 Fix dangling and reassigned Variants
This commit addresses multiple issues with `Variant`s that point to an `Object`
which is later released, when it's tried to be accessed again.

Formerly, **while running on the debugger the system would check if the instance id was
still valid** to print warnings or return special values. Some cases weren't being
warned about whatsoever.

Also, a newly allocated `Object` could happen to be allocated at the same memory
address of an old one, making cases of use hard to find and having **`Variant`s pointing
to the old one magically reassigned to the new**.

This commit makes the engine realize all these situations **under debugging**
so you can detect and fix them. Running without a debugger attached will still
behave as it always did.

Also the warning messages have been extended and made clearer.

All that said, in the name of performance there's still one possible case of undefined
behavior: in multithreaded scripts there would be a race condition between a thread freeing
an `Object` and another one trying to operate on it. The latter may not realize the
`Object` has been freed soon enough. But that's a case of bad scripting that was never
supported anyway.
2020-04-23 13:51:02 +02:00
lawnjelly b954a8c099 Fix batching z_indices with z ranged lights
Joining items across z_indices can interfere with light culling for lights which only affect certain z ranges. This PR disables joining across z_indices when lights are present, except specifically for lights with both z_min set to the global minimum (-4096) and z_max set to the global maximum (4096).

In addition, the z_index is now stored on the joined_item for accurate light culling. The z_index is also displayed in frame diagnostics.
2020-04-23 11:58:06 +01:00
Pedro J. Estébanez 07c4dc1b30 Avoid invocation to Object's copy constructor
Needed for the next commit. That's the only place in all the Godot code base
where that's attempted and it's not needed because Objects are not meant to
be copied that way.
2020-04-23 12:44:47 +02:00
Rémi Verschelde ed27b7e6b9
Merge pull request #38131 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 3rd batch
2020-04-23 12:43:10 +02:00
Ignacio Etcheverry dfdb7bdc87 Mono/C#: Fix assemblies being reloaded a second time unnecesarily
(cherry picked from commit c9882e61e2)
2020-04-23 11:34:42 +02:00
Ignacio Etcheverry cf729f2111 Mono/C#: Allow exporting System.Array of type Godot.Object
(cherry picked from commit 0fec3cb5ed)
2020-04-23 11:17:23 +02:00
Ignacio Etcheverry 317d8decad Mono/C#: Allow debugging exported games
- Include PDB files in exported games.
- Release export templates also allow debugging now.

Right now the only way to enable debugging in exported games is with the  environment variables, which may be cumbersome or not even possible on some platforms.

(cherry picked from commit 71fc87e101)
2020-04-23 11:15:35 +02:00
Ignacio Etcheverry 08f41f474b C#: Save copy of sln and csproj before applying fixes
(cherry picked from commit 93d7ec8836)
2020-04-23 11:14:57 +02:00
dankan1890 a5bbd13794 Fixed output prints " Signal 'node_removed' is already connected " when the editor settings window is closed.
Close #38012

(cherry picked from commit ef08e64afb)
2020-04-23 11:13:33 +02:00
volzhs f670f6e351 Emit signal when animation ends by seek
(cherry picked from commit bf1cc116e1)
2020-04-23 11:11:13 +02:00
Thakee Nathees 95f6bdfa78 GDScript class name existance check enhanced
(cherry picked from commit 62280c3d47)
2020-04-23 11:10:51 +02:00
Thakee Nathees 12c776dba3 line unsafe for indexing with known base type & unkown identifier
(cherry picked from commit 0780ad2800)
2020-04-23 11:10:28 +02:00
Stoofin 243711e77f Pattern bind counts as assignment
Fixes #34697

(cherry picked from commit 44281f233d)
2020-04-23 11:10:06 +02:00
Fredia Huya-Kouadio 17ad99c206 Fix Android templates size regression
The issue was caused by PR #36906 which changes prevented the generated shared libraries from being stripped.
Since the change is only needed for development (debugging) purposes, it's commented out by default.

(cherry picked from commit 2f38cfd9ab)
2020-04-23 11:08:46 +02:00
jfons add8d1b9df Update Joint gizmos automatically
(cherry picked from commit 3e77b6d49d)
2020-04-23 11:07:32 +02:00
Pedro J. Estébanez 97a787aa71 Fix compilation of jpgd.cpp on MSVC 2017
(cherry picked from commit 1e5a93a416)
2020-04-23 10:36:06 +02:00
Rémi Verschelde 3b44f34166
Merge pull request #38114 from lawnjelly/kessel_rulerfix
Fix batch translate to colored synchronization error
2020-04-22 21:42:00 +02:00
lawnjelly 54cd6d3077 Fix batch translate to colored synchronization error
In rare circumstances default batches were being joined incorrectly, causing visual regressions. This logic has been fixed.

In addition slightly more output information has been added to frame diagnosis mode.
2020-04-22 18:52:42 +01:00
Rémi Verschelde ade57c4bf0
Merge pull request #38099 from clayjohn/GLES2-skeleton-rebind
Rebind material when skeleton changes in GLES2
2020-04-22 08:23:43 +02:00
clayjohn 6f322af3fb Rebind material when skeleton changes in GLES2 2020-04-21 17:46:40 -07:00
Rémi Verschelde c7ad8f539b jpgd: Upgrade to upstream 2.00, fuzzed with zzuf and afl
(cherry picked from commit c842ddcf76)
2020-04-21 14:16:28 +02:00
Rémi Verschelde 4b33388e5c mbedtls: Update to upstream version 2.16.6
Fixes https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2020-04

(cherry picked from commit 6b00357d53)
2020-04-21 14:16:03 +02:00
clayjohn 7fc2cba47d Use proper depth buffer format for rgba shadows
(cherry picked from commit 123dd390e4)
2020-04-21 14:15:49 +02:00
Rémi Verschelde 253fc093b8 DocData: Skip unexposed classes
Properly expose classes that we actually want accessible.

(cherry picked from commit 0ef8bcac4d)
2020-04-21 14:15:34 +02:00
Vasiliy Makarov 982dee67f0 Fix square image resize
Fixes #37980

(cherry picked from commit d45e8734d1)
2020-04-21 14:11:43 +02:00
Hugo Locurcio 469f398e70 Document how to workaround UI anchor issues when using BackBufferCopy
This closes #6880.

(cherry picked from commit f8a413bb1f)
2020-04-21 14:11:29 +02:00
Hugo Locurcio e8ead37725 Check for errors when saving in the ResourceSaver example documentation
This also replaces a non-breaking space that was accidentally added in
the EditorFeatureProfile documentation.

This closes #31393.

(cherry picked from commit 2f46f1e7b1)
2020-04-21 14:11:15 +02:00
Hugo Locurcio 3a2cdf7d5b Improve the VisibilityEnabler and VisibilityNotifier documentations
This closes #4803.

(cherry picked from commit 7f2d602106)
2020-04-21 14:10:50 +02:00
Rémi Verschelde faf858fe41 Revert "Made possible to specify where to dump the contents when loading a ".pck" file"
This reverts commit ffcfd9c8ea.

This was not so useful as is due to the way dependency paths are stored
in scenes and resources.
2020-04-20 13:48:02 +02:00
Dominik 'dreamsComeTrue' Jasiński ac0a55ce75 Update TextEdit docs - explaining 'override_selected_font_color' role
(cherry picked from commit 6a0e6c2852)
2020-04-20 11:55:47 +02:00
Marcel Admiraal 339c10889d Correct the addition of a key and the duplication of a variable name
in Dictionary class documentation.

(cherry picked from commit 4d41535fa3)
2020-04-20 11:55:31 +02:00
Hugo Locurcio 4e73fcc959 Document DynamicFont limitations and a possible workaround
This closes #30014.

(cherry picked from commit 46b8e108e2)
2020-04-20 11:55:04 +02:00
Hugo Locurcio 4f7296a869 Document image size limits
This closes #30238.

(cherry picked from commit 5497cec7a1)
2020-04-20 11:54:47 +02:00
Hugo Locurcio bb753aaf17 Clarify that angles must be specified as radians in the documentation
This closes #36356.

(cherry picked from commit cae5260dab)
2020-04-20 11:53:40 +02:00
Andrea Catania 4a6f2b8af6 Activate Physics Process in SpringArm3D.
(cherry picked from commit 152303bf51)
2020-04-20 11:51:30 +02:00
Rémi Verschelde 2a10e30119
Merge pull request #38019 from lawnjelly/kessel_zindex_batchbreak
Fixes incorrectly joining batch items from earlier z_index layers
2020-04-19 21:38:33 +02:00
lawnjelly a9ae0fac86 Fixes incorrectly joining batch items from earlier z_index layers
Batching across z_index layers was not preserving the batch_break flag, which determines whether to not join the previous item. This is fixed by storing the flag in RenderItemState and preserving it across canvas_render_items calls.
2020-04-19 19:32:14 +01:00
Marcel Admiraal 11b7f050df Fix multiple issues with CSG module.
- Replaces BuildPoly with Build2DFaces, which creates faces as each
  pair of face intersections are processed, instead of trying to create
  them after all the intersections are processed. Ensures that faces are
  merged when possible, and removes degenerate triangles.

- Treats the child as inside the parent when faces are coplanar.

- General clean up of csg.h and csg.cpp.
2020-04-19 14:32:45 +01:00
Rémi Verschelde cb1366f006 Mono: Fix include for Android support
This was a typo in #37153.

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
(cherry picked from commit 408fab8442)
2020-04-18 22:02:07 +02:00
Rémi Verschelde 50582446ad Sync classref with current source 2020-04-17 13:43:43 +02:00
Rémi Verschelde a54a7542c9 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@dreamsComeTrue, @kuruk-mm, @lawnjelly, @ThakeeNathees

Thanks to all contributors and donors for making Godot possible!

(cherry picked from commit 74d60328f8)
2020-04-17 13:41:43 +02:00
Michael Alexsander ffcfd9c8ea Made possible to specify where to dump the contents when loading a ".pck" file
(cherry picked from commit 3c261e0dfa)
2020-04-17 13:00:52 +02:00
Rémi Verschelde 008e0748c1
Merge pull request #37349 from lawnjelly/kessel32_1
GLES2 2d Batch rendering (across items)
2020-04-17 12:55:33 +02:00
Rémi Verschelde 1ef94ad445
Merge pull request #37948 from m4gr3d/fix_compilation_issue
Fix 3.2 compilation issue
2020-04-17 12:51:21 +02:00
lawnjelly 72adefa5cf Add frame diagnostics for GLES2 Batch renderer
Added project setting to enable / disable print frame diagnostics every 10 seconds. This prints out a list of batches and info, which is useful to optimize games and identify performance problems.
2020-04-17 08:54:33 +01:00
Fredia Huya-Kouadio b7fa9cf8ff Fix compilation issue by updating a call to `runOnGLThread` that was missed by PR #37175 2020-04-16 16:16:24 -07:00
Rémi Verschelde 529daebe07
Merge pull request #37775 from asheraryam/node-unselected-3.2
Add "node_unselected" signal for GraphEdit **[3.2]**
2020-04-17 00:10:21 +02:00
Rémi Verschelde c4a849588b
Merge pull request #37175 from m4gr3d/make_godot_plugin_callbacks_generic_3.2
[3.2] Update the naming scheme for the GodotPlugin's methods
2020-04-17 00:08:27 +02:00
asheraryam 93f7e8d8fc Add "node_unselected" signal for GraphEdit 2020-04-16 16:56:58 +03:00
Rémi Verschelde 3060a848ba
Merge pull request #37933 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 2nd batch
2020-04-16 15:14:39 +02:00
Rémi Verschelde 471a5abbf3 i18n: Sync translations with Weblate 2020-04-16 13:05:22 +02:00
Rémi Verschelde 07aa524a42 doc: Sync classref with current source 2020-04-16 13:02:36 +02:00
Hugo Locurcio 25b353fd32 Tweak the error message when trying to run an invalid script from CLI
(cherry picked from commit 2ab9515b07)
2020-04-16 12:57:22 +02:00
Hugo Locurcio 679474c576 Tweak the built-in script naming for resources with custom names
This makes the script name appear before the scene file name,
which ensures it's always visible even if the list of scripts is too
narrow to display the full name.

This only impacts built-in scripts with custom resource names.
Unnamed resources will still use `<scene_file>::<id>` naming
in the list of scripts.

(cherry picked from commit e90beade15)
2020-04-16 12:57:22 +02:00
Michael Alexsander b4429c325a Fix incorrect TabContainer documentation for 'get_tab_control()'
(cherry picked from commit 8f925b1970)
2020-04-16 12:57:22 +02:00
Hugo Locurcio 26614a37b8 Mention `keep_pressed_outside` caveat in the BaseButton documentation
This closes #37790.

(cherry picked from commit e799dc954e)
2020-04-16 12:57:22 +02:00
Hugo Locurcio 6c4a0ec75a Improve the Dictionary class documentation
This closes https://github.com/godotengine/godot-docs/issues/3376.

(cherry picked from commit 88da90f2bf)
2020-04-16 12:57:22 +02:00
PouleyKetchoupp eab7342321 More details in Rigid Body add_force documentation
(cherry picked from commit 219c5712f0)
2020-04-16 12:57:22 +02:00
Tomasz Chabora edd5d9c78e Improve Camera2D documentation
(cherry picked from commit 630096fa74)
2020-04-16 12:57:22 +02:00
Dominik 'dreamsComeTrue' Jasiński 5fdecebee1 Calculate strike-through position correctly
Fixes: #37637
(cherry picked from commit 06a79f260c)
2020-04-16 12:57:22 +02:00
Hugo Locurcio ab4ea9379c Improve the AudioStreamSample class documentation
This closes #37915.

(cherry picked from commit 52786b54ef)
2020-04-16 12:57:22 +02:00
Marcel Admiraal 103278d84b Run SpringArm3D's process within physics.
(cherry picked from commit 188bb6f867)
2020-04-16 12:57:22 +02:00
Eric M e2c9cbb79f Added selection outline to locked nodes.
(cherry picked from commit 7f5fb73146)
2020-04-16 12:57:22 +02:00
Marcel Admiraal e869da9665 Remove unnecessary check for zero determinant in Basis::orthonormalize().
(cherry picked from commit 8e6e91f2cd)
2020-04-16 12:57:22 +02:00
Marcel Admiraal 3e71992eda Assign zero to range when ConvexPolygonShape2D is empty.
(cherry picked from commit 88d307df14)
2020-04-16 12:57:22 +02:00
Nico Mitchell 616d106247 Change round return type to float
(cherry picked from commits c2ffaf5b2b
and f7cc2b090c)
2020-04-16 12:57:21 +02:00
lawnjelly b6d652367b Items and draw calls added to IDE Monitor in '2d' section
This adds 2 new values (items and draw calls) to the performance monitor in a '2d' section, rather than reusing the 3d values in the 'raster' section.

This makes it far easier to optimize games to minimize drawcalls.
2020-04-16 11:52:22 +01:00
Thakee Nathees 3d69fe95e5 autocomplete for disconnect, is_connected implemented
(cherry picked from commit efe90fce01)
2020-04-16 12:47:19 +02:00
Marcel Admiraal b4ab045444 Fix loss of precision in X11 device info.
(cherry picked from commit 9369b37f1f)
2020-04-16 12:47:19 +02:00
Marcel Admiraal 5bd603a542 Fix Engine get_target_fps() returning float instead of int.
(cherry picked from commit 0b9e95cac5)
2020-04-16 12:47:19 +02:00
bruvzg acfd8b67bd Ignore process serial number (`-psn_...`) command line argument passed by macOS Gatekeeper.
(cherry picked from commit e92a14ac5f)
2020-04-16 12:47:19 +02:00
Markus Sauermann 7607fafda1 Clarify documentation and indicate that rect_clip_content affects only CanvasItem based nodes.
Resolves #37683

(cherry picked from commit 3f19b5e0b3)
2020-04-16 12:47:18 +02:00
theludovyc 58fcbc2b06 Remove unused ofs variable
(cherry picked from commit 875c994109)
2020-04-16 12:47:18 +02:00
lupoDharkael c0047023e6 NoiseTexture: prevent race condition because of Ref::unref()
(cherry picked from commit 1f0f0b8cea)
2020-04-16 12:47:18 +02:00
Guilherme Felipe ddde3819d6 Fix TextureRect::flip_* when used with atlas texture
Fix #37526

(cherry picked from commit fb2d2dd5d0)
2020-04-16 12:47:18 +02:00
Yuri Sizov ad1c7a53d9 Added missing LinkButton colors in Editor Theme
(cherry picked from commit 0671d7b276)
2020-04-16 12:47:18 +02:00
janglee f10d2affb0 Reversed timeline zoom slider
Fixes #37409

(cherry picked from commit 3f23e1d600)
2020-04-16 12:47:18 +02:00
Michael Alexsander 5e45717be7 Remove unnecessary Panel in "Features" section in the Export dialog
(cherry picked from commit a1a096eb09)
2020-04-16 12:47:18 +02:00
Nannaquin 27989ae8f8 Add reference of Color8 function to Color class documentation
(cherry picked from commit 06aeff3044)
2020-04-16 12:47:18 +02:00
lucaslcode cd10966652 clarify autotile_coord in docs
I had no idea what 'coordinate' meant in the context of autotiles, so just adding some clarification for future people who have the same problem.

(cherry picked from commit cbe73766e3)
2020-04-16 12:47:18 +02:00
Hugo Locurcio 0ce6ac0bbb Warn about built-in script limitations in the script creation dialog
This partially addresses #31758.

(cherry picked from commit ac210e196c)
2020-04-16 12:47:18 +02:00
PouleyKetchoupp 18c5ef5473 Add style for highlighted Slider grab area
(cherry picked from commit 4c8173af0f)
2020-04-16 12:47:17 +02:00
Zak Grumbles 6fa871027c Make dict erase node sequenced godotengine#37477
* Updated macro call to make the visual Dictionary Erase node sequenced.

(cherry picked from commit d648f77119)
2020-04-16 12:04:10 +02:00
Vasiliy cf135e3723 Add "preview_on_sphere" setting of material editor plugin
(cherry picked from commit 48b144afb7)
2020-04-16 12:03:02 +02:00
Rémi Verschelde a8bdcd3c03 etc2comp: Fix max iterations for RGBA channels
Those checks were *very likely* meant to clamp the max value,
not the min one.

Fixes https://github.com/godotengine/godot/issues/10059#issuecomment-606993001.

(cherry picked from commit dbf52c63cc)
2020-04-16 12:02:34 +02:00
Zak Grumbles 294008015e Clarify Dictionary duplicate params godotengine#37162
* Added additional clarification for the function of the 'deep'
parameter in the Dictionary's `duplicate` method.

(cherry picked from commit 469b7c948f)
2020-04-16 12:02:18 +02:00
SkyJJ 92df8cc83a Fix profiler frame number stops updating when window is minimized
(cherry picked from commit c1ee20a05d)
2020-04-16 12:01:52 +02:00
Thakee Nathees 233997aac5 replace selected text with empty string bug fixed
Fix: #37416
(cherry picked from commit 2144eb05df)
2020-04-16 11:58:57 +02:00
Leleat 8da00fbfc7 fixed PopupMenus letterjumping on any InputEvent
(cherry picked from commit 8a5660f3d1)
2020-04-16 11:58:14 +02:00
Yuri Sizov 22ebdd72d9 Add more verbosity for property overrides in RST documentation
(cherry picked from commit 38821dc6d7)
2020-04-16 11:57:50 +02:00
Tomasz Chabora 472b0e0d34 Properly handle node remove via undo
(cherry picked from commit 37ffb40047)
2020-04-16 11:56:50 +02:00
Thakee Nathees 3658f7127e `:=` fails on some nodes fix: #37357
(cherry picked from commit bdd7048cb5)
2020-04-16 11:46:23 +02:00
Juan Linietsky 94f451e070 Ensure COWData does not reallocate on push back, fixes #22561
(cherry picked from commit 0c24a844ec)
2020-04-16 11:46:00 +02:00
MickeMakaron e3ca6d87ad Handle huge offset values in Path2D and Path3D set_offset
(cherry picked from commit 2edb59ec88)
2020-04-16 11:45:40 +02:00
Zak Grumbles 5d9108c9c6 Fix OptionButton docs godotengine#36803
* item_selected and item_focused docs incorrectly had 'id' as the parameter. Changed to
'index'.
* Fix parameter name in ADD_SIGNAL callin code.

(cherry picked from commit a8de034f78)
2020-04-16 11:45:19 +02:00
Danil Alexeev 2ef1ee9da7 Improve the `File.store_{8,16,32,64}()` documentation
Added information about the intervals of values that the functions
`store_{8,16,32,64}()` can correctly write to the file.

(cherry picked from commit 97e20b2f30)
2020-04-16 11:44:58 +02:00
Thakee Nathees 324213a6db fix project manager don't consume Enter key #17620
(cherry picked from commit b98153886f)
2020-04-16 11:44:44 +02:00
Waridley 219ce2f149 Fix volume interpolation in positional audio nodes
Fixes #22016

(cherry picked from commit ff1fbd2bc5)
2020-04-16 11:43:58 +02:00
janglee e1ca49b4b6 Corrected text selection in color picker
Fixes #35603

(cherry picked from commit 77b70aa79d)
2020-04-16 11:43:35 +02:00
Andrea Catania a51e78528f Fixed IK rotation issue
(cherry picked from commit 277696d6c5)
2020-04-16 11:42:07 +02:00
SkyJJ 96e381ac03 Validate supported architectures when exporting to Android
(cherry picked from commit 7fcd13575e)
2020-04-16 11:41:41 +02:00
fhuya 373db27788 Migrate legacy apache dependency to the GodotPayment plugin
This is the only location in the codebase where it's being used, so no need to make the main lib have a dependency on it.

(cherry picked from commit c591cb8fda)
2020-04-16 11:41:23 +02:00
Rémi Verschelde 88e1264893 Android: Bump build tools to 29.0.3
(cherry picked from commit ca896ddbf0)
2020-04-16 11:41:11 +02:00
fhuya ff7b455478 Delete unused drawable resources.
(cherry picked from commit 73d4e2eefb)
2020-04-16 11:40:56 +02:00
fhuya fd045b8b91 Update Android custom template build configuration.
(cherry picked from commit 9c11076a20)
2020-04-16 11:40:06 +02:00
Yuri Roubinsky 5914fdc067 Implements estimate/compute_cost for AStar2D
(cherry picked from commit bad77bcb52)
2020-04-16 11:35:52 +02:00
Hugo Locurcio b5d41bb517 Remove Request Docs button in the script editor due to various issues
The Request Docs button is partly responsible for layout overflow
issues on narrow displays, such as #31133.

It also tended to attract spam and low-effort issues that were
difficult to act upon. A "Send Docs Feedback" menu option has been added
to replace it.

(cherry picked from commit 2f6f029a75)
2020-04-16 11:16:08 +02:00
Rémi Verschelde 2ec4af6f16 Set version to 3.2.2-beta
The 3.2.2 release will include quite a few new features which warrant
at least one beta build before RC:

- GLES2 2D batching
- Mono/C# support for iOS
- New Android plugin system
2020-04-16 11:07:56 +02:00
lawnjelly a4cd274ca7 Batching with Extra Matrix commands
Defers sending 'transform' commands within a RasterizerCanvas::Item until they are needed for default batches. Instead locally caches the extra matrix and applies it using software transform, preventing unnecessary batch breaks.

The logic is relatively complex, and the whole 'extra matrix' of the legacy renderer in addition to the final_transform is not ideal. However this is required to accelerate some user drawing techniques, and later the lines in the IDE.
2020-04-15 12:48:36 +01:00
Ignacio Etcheverry 0e43565a7c Fix exporting corrupted Xcode pbxproj if project name has spaces 2020-04-14 18:03:10 +02:00
Ignacio Etcheverry 445f1c6e7b Mono/C#: Add iOS support
Right now, games only work on devices when exported with FullAOT+Interpreter.
There are some issues left that need to addressed for FullAOT alone. Right now,
it's giving issues with the Godot.NativeCalls static constructor.
2020-04-14 18:03:10 +02:00
Ignacio Etcheverry 6b38fe691a Mono/C#: Fix MinGW build not supporting `.lib` libraries
MinGW should support both its own format `.a` and MSVC's format `.lib`, but Mono's module was only using the former. With this change it's now possible to build with MinGW and link the official Mono for Windows which is built with MSVC.
2020-04-14 18:03:10 +02:00
Rémi Verschelde 36a30f681f
Merge pull request #37825 from qarmin/leak_with_drives
Fixes leak with drives [3.2]
2020-04-13 00:44:03 +02:00
lawnjelly 93af8e7d1b Batching across z_indices
Extra functions canvas_render_items_begin and canvas_render_items_end are added to RasterizerCanvas, with noop stubs for non-GLES2 renderers. This enables batching to be spready over multiple z_indices, and multiple calls to canvas_render_items.

It does this by only performing item joining within canvas_render_items, and deferring rendering until canvas_render_items_end().
2020-04-12 13:52:25 +01:00
qarmin 57952d562c Fixes leak with drives [3.2] 2020-04-12 14:05:47 +02:00
Rémi Verschelde 4dadec331e
Merge pull request #37815 from clayjohn/reset-sky-flags
Reset texture flags after radiance map generation
2020-04-12 11:35:07 +02:00
clayjohn 193b0bf1e3 Reset texture flags after radiance map generation 2020-04-11 16:10:34 -07:00
lawnjelly 1fb6181ba6 Revert to default Rect drawing code for single rects
Determined that a large reason for the decrease in performance in unbatchable scenes was due to the new routine being analogous to the 'nvidia workaround' code, that is about half the speed. So this simply uses the old routine in the case of single unbatchable rects. Hopefully we will be able to remove the old path at a later stage.
2020-04-11 17:40:30 +01:00
Rémi Verschelde 5698a9ec74
Merge pull request #37305 from m4gr3d/implement_plugin_signals_3.2
[3.2] Add signal support to Godot Android plugin:
2020-04-10 18:42:32 +02:00
Rémi Verschelde 218ae1e7a2
Merge pull request #37595 from ExpiredPopsicle/18809_flickering_ortho_fix
Othographic camera in-editor now uses Z near/far instead of hardcoded value
2020-04-10 17:16:49 +02:00
Rémi Verschelde 02ed72c373
Merge pull request #37667 from clayjohn/GLES2-32-skeleton-rebind
Avoid material rebind when using skeleton
2020-04-07 21:32:35 +02:00
clayjohn 4d32652851 Avoid material rebind when using skeleton 2020-04-07 10:35:58 -07:00
Thakee Nathees df87601c88 Fix for loop range bug: #37358
(cherry picked from commit 0b5bad78c0)
2020-04-06 20:58:21 +02:00
Hugo Locurcio e88cfedf0e Document the EditorFeatureProfile class
(cherry picked from commit 7ab279403d)
2020-04-06 20:58:21 +02:00
Eoin O'Neill c18381119e Correction to RichTextLabel Tabulation
Correct backtrack assignment to prevent excessive tabulation. Worth
noting that tabulation is treated differently in RichTextLabel because
of custom user-asignable tab variable which creates problems with
dynamic fonts specifically.

(cherry picked from commit 2000e110a9)
2020-04-06 18:19:14 +02:00
Hugo Locurcio dd4569f15c Remove syntax highlighting for C# verbatim strings due to bugs
This closes #32336.

(cherry picked from commit 49efd6093e)
2020-04-06 18:18:38 +02:00
Thomas ten Cate c2469d0c6d Add missing docs for assert message in GDScript
Seems like this was overlooked in PR #31142. See also issue #17082.

(cherry picked from commit 4c3c73ef9c)
2020-04-06 18:17:59 +02:00
Zak Grumbles 011602447c Clarify docs for Thread.start() godotengine#36032
* Updated docs for Thread.start() to specify that the method argument
must accept one parameter.

(cherry picked from commit d09644dff3)
2020-04-06 18:17:43 +02:00
dankan1890 657f12edcc TextureRegion: fixed Autoslice not created/updated properly.
(cherry picked from commit 671e97d254)
2020-04-06 18:17:19 +02:00
Michael Alexsander 9dcf9da205 Fix changing the import type of multiple files at once
(cherry picked from commit 6d6af0ea06)
2020-04-06 18:16:58 +02:00
PouleyKetchoupp d4c77e60c0 Fixed errors in makerst pre-commit hook
(cherry picked from commit 619354fb2c)
2020-04-06 18:16:11 +02:00
Ivan.Shakhov 66e4c8be23 fix RiderPathLocator - searching for toolbox on Mac
(cherry picked from commit dc16b8742a)
2020-04-06 18:15:20 +02:00
Ignacio Etcheverry bda993dd79 C#: Fix uses of old Configuration names
(cherry picked from commit 66c0b7ce98)
2020-04-06 18:14:07 +02:00
lawnjelly e7bec77ef3 Bake final_modulate uniform into vertex colors
Where the final_modulate color varies between render_items this can prevent batching. This PR solves this by baking final_modulate into the vertex colors, and setting the uniform 'final_modulate' to white, and allowing the joining of items that have different final_modulate values. The previous batching system can then cope with vertex color changes as normal.
2020-04-06 12:49:47 +01:00
Rémi Verschelde 4f00a2c645
Merge pull request #37601 from BastiaanOlij/fix_hmd_projection
Fix aspect ratio on hmd projection matrix
2020-04-05 12:41:02 +02:00
Rémi Verschelde 0e15770ebf
Merge pull request #37596 from NHodgesVFX/3.2
Make note of 16 probe limit
2020-04-05 12:40:10 +02:00
Nathan 679708aa8f Make note of 16 probe limit
Godot by default has a limit of 16 reflection probes in a scene. this can be increased by increasing atlas subdiv. For 3.2 and possibly 4.0. This also fixes a spelling mistake

Update doc/classes/ReflectionProbe.xml

Fix from clayjohn, Directly link to settings

Co-Authored-By: Clay John <claynjohn@gmail.com>
2020-04-05 04:41:00 -04:00
Bastiaan Olij a7438f0e61 Fix aspect ratio on hmd projection matrix 2020-04-05 16:58:33 +10:00
Kiri Jolly 26912c15e6 Othographic camera in-editor now uses Z near/far settings instead of a hardcoded value
Fixes #18809.

The in-editor ortho camera used a far clipping plane of 8192 units, and was
placed 4096 units away from the camera cursor.

This was far enough to cause culling issues from floating point precision loss
on objects smaller than one unit.

This change modifies the near/far clipping planes of the ortho camera to use
those specified in the editor (and currently used by the perspective camera).
The frustum is still centered around the camera cursor location, as it was
before.
2020-04-04 16:16:11 -07:00
lawnjelly 45b0b8bff8 GLES2 2d Batch rendering (across items)
2d rendering is currently bottlenecked by drawing primitives one at a time, limiting OpenGL efficiency. This PR batches primitives and renders in fewer drawcalls, resulting in significant performance improvements. This also speeds up text rendering.

This PR batches across canvas items as well as within items.

The code dynamically chooses between a vertex format with and without color, depending on the input data for a frame, in order to optimize throughput and maximize batch size. It also adds an option to use glScissor to reduce fillrate in light passes.
2020-04-04 17:13:58 +01:00
Rémi Verschelde 798bf901b8 Android: Downgrade gradle plugin to 3.5.3
With the NDK installed locally, gradle plugin 3.6.0 seems to enforce
a specific older NDK version, and will fail building if you don't have
it installed with:

```
No version of NDK matched the requested version 20.0.5594570.
Versions available locally: 21.0.6113669
```

Upstream issue: https://github.com/gradle/gradle/issues/12440

(cherry picked from commit ba2ec53a26)
2020-04-02 23:34:02 +02:00
Rémi Verschelde 42a3a87e46
Merge pull request #37485 from RandomShaper/fix_trimmed_res_3.2
Fix res:// trimmed to s:// on Windows (3.2)
2020-04-01 15:01:39 +02:00
Pedro J. Estébanez 21703aefee Fix res:// trimmed to s:// on Windows 2020-04-01 10:22:05 +02:00
Yuri Roubinsky ee93c85ef1 Fix shader constant sorting 2020-03-31 14:32:33 +03:00
fhuya b995256bca Update the naming scheme for the GodotPlugin's methods in preparation of the vulkan integration. 2020-03-28 15:42:21 -07:00
Rémi Verschelde e707b712e8
Merge pull request #37345 from m4gr3d/backport_kotlin_support
[3.2] Backport Kotlin support
2020-03-27 22:10:32 +01:00
fhuya 0c782ca2b2 Backport Kotlin support 2020-03-27 10:18:30 -07:00
fhuya f69760b4be Add signal support to Godot Android plugin:
Supports registering and emitting signal from a Godot Android plugin
2020-03-27 01:37:41 -07:00
Rémi Verschelde abb70a6165
Merge pull request #37300 from m4gr3d/android_codebase_misc_cleanup_3.2
[3.2] Miscellaneous cleanup for the Android codebase
2020-03-26 09:18:12 +01:00
fhuya 7135bc3e37 Miscellaneous cleanup for the Android codebase:
- update gradle plugins versions
- cleanup java_godot_lib_jni

Note: logic was mostly moved around and no new logic/functionality was added.
2020-03-25 09:00:37 -07:00
Rémi Verschelde 909e303def
Merge pull request #37289 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.2) - 1st batch
2020-03-25 13:58:14 +01:00
Rémi Verschelde fdd85311c3 Sync classref with current source 2020-03-25 11:42:15 +01:00
Gil Arasa Verge f144ec9e67 Clicking backgrd. dimming of editor popup stops input event propagation
A click on the dimmed background of a popup in the editor should stop the input event from propagating to the background.

This solution reuses the system introduced in commit efc3ffb8, taking advantage of the hide() notifications from the modal where we will set the flag "pass_on_modal_close_click(false)" to stop event handling at the viewport input event handling.
The viewport first hides the modal and after marks the input as handled if the flag mentioned above is set.

Fixes #36341

(cherry picked from commit 35bc88ca34)
2020-03-25 11:38:54 +01:00
Andrea Catania e30a0a30b6 Added new method to replace an already added node to the animation state machine
(cherry picked from commit 422926cfc6)
2020-03-25 11:38:54 +01:00
sumit0190 35c7628074 Read and write exported infs/nans correctly (#35388)
(cherry picked from commit c4dbd8a744)
2020-03-25 11:38:54 +01:00
nathanwfranke b95a2306db Fix tab container too large when tabs are hidden
(cherry picked from commit c0a84f747e)
2020-03-25 11:38:54 +01:00
Rémi Verschelde acd14e645a Remove unused classes and stray headers
Found by reviewing headers with 1 or less matching includes:
```
find -name thirdparty -prune -o -name "*.h" -exec basename {} \; | sort -u > headers
for header in $(cat headers); do echo "$header: "; rg -l "#include \"(.*/)?$header\"" | wc -l; done > list-includes
```

(cherry picked from commit 9d24541597)
2020-03-25 11:38:54 +01:00
Dominik 'dreamsComeTrue' Jasiński e97d9c7bfc Remove unreferenced & undocumented class Space2D
(cherry picked from commit f530c38174)
2020-03-25 11:38:54 +01:00
Rajat Goswami 19e71f94d8 Adding missing include guards to header files identified by LGTM.
This addresses the issue godotengine/godot#37143

(cherry picked from commit 2ecf928ae3)
2020-03-25 11:38:54 +01:00
Rémi Verschelde bdde501594 opus/vorbis: Remove dead code not used since 3.0
Since the new audio system in 3.0 we switched the OGG support to
stb_vorbis, and the Opus stream support was disabled as incompatible
(see #7496).

We still build the libraries as they are needed by the theora and webm
modules, but we don't need any Godot code apart from `register_types`.

Fixes #7496.

(cherry picked from commit 7f6b62cef0)
2020-03-25 11:38:54 +01:00
unknown fcde11222a Removed unused code in android detect.py and SCsub
(cherry picked from commit 90cdacd741)
2020-03-25 11:38:54 +01:00
unknown 6e6db2d9cb Remove the dead function win32_spawn from methods.py.
(cherry picked from commit d78a78bc81)
2020-03-25 11:38:54 +01:00
Rémi Verschelde 86ecefa1a2 Fix potential divisions by 0 reported by MSVC
The `TextEdit` one was indeed a potential bug.
The `PCKPacker` one seems to be a false positive, it's already in a
`for` loop that depends on `files.size()`.

(cherry picked from commit ca4e4506db)
2020-03-25 11:38:54 +01:00
m6c7l dec7014ca8 issue-37239 add relaxation to conditions in the joystick check routine for being identified as joystick
(cherry picked from commit 36293f4256)
2020-03-25 11:38:54 +01:00
Andrii Doroshenko (Xrayez) 8fedcfbed2 Generate command line help text for `mono` module
(cherry picked from commit 94b6c1363c)
2020-03-25 11:38:54 +01:00
Ivan.Shakhov 9d0518cf80 Fix warning: Property not found: mono/editor/editor_path_optional (#36995)
(cherry picked from commit 05946be2f1)
2020-03-25 11:38:54 +01:00
Ivan.Shakhov d06ae167bf for third-party tools - editor_path is stored in project's editor settings
(cherry picked from commit 2f151068b5)
2020-03-25 11:38:54 +01:00
Ignacio Etcheverry d46fcbb16a C#: Replace uses of old Configuration and update old csprojs
(cherry picked from commit 1b634785b5)
2020-03-25 11:38:54 +01:00
Ivan Shakhov b874e84147 reorder solution configurations + migration
(cherry picked from commit ce01b83c4a)
2020-03-25 11:38:54 +01:00
Pedro J. Estébanez f57579ba6c Make stack size on Windows match Linux and MacOS
(cherry picked from commit 29f8530afe)
2020-03-25 11:38:53 +01:00
PouleyKetchoupp 2e4e1e0324 Fix text_entered signal when max_length is used in LineEdit on Android
Fixes #35954

(cherry picked from commit c169367e83)
2020-03-25 11:38:53 +01:00
fhuya 9a035efe62 Complete the implementation of the GodotPayment plugin.
Move the remaining plugin components within the plugin source code.

(cherry picked from commit 99173c5fc4)
2020-03-25 11:38:53 +01:00
fhuya cd2b2bf8bf Enable Android studio debugger.
(cherry picked from commit 41dadb2b2b)
2020-03-25 11:38:53 +01:00
Tomasz Chabora c8318012a8 Make search in RichTextLabel case-insensitive
(cherry picked from commit b3f83ac115)
2020-03-25 11:38:53 +01:00
Hugo Locurcio 6e517f9da3 Tweak the message queue maximum size property hint
The minimum slider value no longer allows decreasing the value below
the default, as this can cause things to break in the editor.

The maximum slider value was also increased to 4096 since it can safely
be increased to that value (some add-ons may require it).

This closes #37052.

(cherry picked from commit 8d8c7a9383)
2020-03-25 11:38:53 +01:00
simpuid a10a21f407 Fixes transform gizmo position when node has default transform
Changes made:
* Added dirty bit for SpatialEditorSelectedItem's last_xform
* SpatialEditorViewport checks that dirt bit too before skipping the selection

(cherry picked from commit 19825436d4)
2020-03-25 11:38:53 +01:00
johan 31fb54742b Editor 2D: Change pixel alignment strategy, fix jittering in high zoom
Alignment of scene pixels on screen pixel ensure a crisp rendering of small features (such as text). Unfortunately, alignment of top left pixel on screen adds a lot of jittering when zooming at high zoom factor.

This change allow to snap the top left scene pixel on the closest screen pixel (not only the top-left most), and we do so only when the scale factor is an integer.

(cherry picked from commit 1c02906a6f)
2020-03-25 11:38:53 +01:00
Umang Kalra d7c6a42cbf Doc edit at InputEventMouseMotion
Doc edit

(cherry picked from commit 052424c76d)
2020-03-25 11:38:53 +01:00
Rasmus Vermeulen 5c64458d9e Add size warning to Viewport Node
(cherry picked from commits 855f4dc193
and 760095e28d)
2020-03-25 11:38:53 +01:00
Tomasz Chabora 8fd7efef84 Fix visibility enabler flag toggling
(cherry picked from commit 2ccd1a7805)
2020-03-25 11:38:53 +01:00
simpuid 223d0abd7e Remove update condition from LineEdit::update_placeholder_width
Placeholder with length greater than `max_length` are allowed, so there is no reason for those update condition.
It fixes the odd alignment of placeholder when it's length is greater than `max_length`

(cherry picked from commit 43b2f75d64)
2020-03-25 11:38:53 +01:00
Darren Kaste 53c8d8a5fb Use LineEdit secret character width everywhere
(cherry picked from commit c7c47410aa)
2020-03-25 11:38:53 +01:00
Darren Kaste f657614760 Calculate LineEdit selection with secret character
(cherry picked from commit 395a038c85)
2020-03-25 11:38:53 +01:00
alvaroHernandez bce2a3a2d2 prevent joypad button input dropdown going out of dialog
(cherry picked from commit e47d5691e4)
2020-03-25 11:38:53 +01:00
Yuri Roubinsky 4dd1eee769 Enables passing out built-in parameter from parent function in shaders
(cherry picked from commit 7a2c6a8c0e)
2020-03-25 11:38:53 +01:00
Ev1lbl0w b9b53966a3 Fix divison by zero issue
(cherry picked from commit 380b8039ec)
2020-03-25 11:38:53 +01:00
Hugo Locurcio b5f1f7dfde Improve the `Input.set_use_accumulated_input()` documentation
(cherry picked from commit 30961c60ab)
2020-03-25 11:38:53 +01:00
Rémi Verschelde ec752f7c9b Linux: Add Mesa 20 "Intel" to prime detection
Diff in `glxinfo` between Mesa 19.3.4 and 20.0.1:
```diff
-OpenGL vendor string: Intel Open Source Technology Center
-OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2)
-OpenGL core profile version string: 4.6 (Core Profile) Mesa 19.3.4
+OpenGL vendor string: Intel
+OpenGL renderer string: Mesa Intel(R) HD Graphics 630 (KBL GT2)
+OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.0.1
```

(cherry picked from commit db28e7ef69)
2020-03-25 11:38:53 +01:00
lupoDharkael 536c2fc0c0 Loop over faces in create_trimesh_shape()
(cherry picked from commit ee0262977e)
2020-03-25 11:38:53 +01:00
JFonS 4d85f70015 Update all editor viewports after settings changes
(cherry picked from commit 55b478afd9)
2020-03-25 11:30:49 +01:00
JFonS 784ff23adc Fix rotation gizmo for empty Spatials
The AABB for an empty Spatial has 0 size, since the stored and
compared Transform was scaled by the AABB size, it would completely
destroy the rotation information. If there is no rotation
information, the gizmo doesn't update when the rotation changes.

(cherry picked from commit a0af3094b4)
2020-03-25 11:30:49 +01:00
Haoyu Qiu d25949dd49 Keeps the filename when marking scene as unsaved
(cherry picked from commit 9ed61a70cc)
2020-03-25 11:30:48 +01:00
volzhs 644d49b156 Update snap setting only with OK
restore previous values with cancel

(cherry picked from commit 667a981d4d)
2020-03-25 11:30:48 +01:00
Thakee Nathees 5798c8135f logic error in gdscript_parser.cpp for-loop-range
there was a logic error in for loop range argument that
check if all of the argument were constants, fixed

(cherry picked from commit bcbcf0f1ea)
2020-03-25 09:45:47 +01:00
Dominik 'dreamsComeTrue' Jasiński e590a33d45 Allow single quotes in comments
Fixes: #36638
(cherry picked from commit ab6456d1bc)
2020-03-25 09:45:08 +01:00
Thakee Nathees 40b53bc29a duplicate arguments in a function handled
(cherry picked from commit 5424b626f9)
2020-03-25 09:44:51 +01:00
Rafael Delboni 5736e43fe4 fix: Return only scenes for script owners on LSP completion
Fix: #36680
(cherry picked from commit 2f08f4ef4e)
2020-03-25 09:44:09 +01:00
Rafael Delboni ecfe9c24a2 Improve LSP completion using scene owner
Fixes: #36473

(cherry picked from commit 06bce137e3)
2020-03-25 09:43:49 +01:00
Oliver Frank 41500249e3 Fix crash after closing a GDScript LSP session
(cherry picked from commit ed482f6167)
2020-03-25 09:43:28 +01:00
of9 511105be67 Migrating language server from Websockets to raw TCP
(cherry picked from commit 24b27043fe)
2020-03-25 09:43:05 +01:00
Hugo Locurcio f3d2c672e9 Document known performance issues with Sprite3D
See https://github.com/godotengine/godot/issues/20855.

(cherry picked from commit 92fa3e076f)
2020-03-25 09:40:09 +01:00
volzhs 5edd669503 Use checkbox for plugin status instead of option list
(cherry picked from commit 09b055bd34)
2020-03-25 09:38:53 +01:00
Tomasz Chabora 843948b69d Show theme property descriptions in the inspector
(cherry picked from commit 7a0e813ffa)
2020-03-25 09:38:18 +01:00
PouleyKetchoupp 82bee3f993 Added has_signal method for Object
(cherry picked from commit 258d91f883)
2020-03-25 09:36:41 +01:00
Rémi Verschelde da4eb7101d Bump macOS Info.plist to 3.2.2 too 2020-03-22 17:26:57 +01:00
Rémi Verschelde eec14d4323
Merge pull request #37149 from neikeq/issue-12917-3.2
[3.2] Sync csproj when files are changed from the Godot FileSystem dock
2020-03-18 20:28:41 +01:00
Ignacio Etcheverry d1a5f8dbf2 [3.2] Sync csproj when files are changed from the Godot FileSystem dock 2020-03-18 17:57:45 +01:00
Ignacio Etcheverry 110523fecc Expose FileSystemDock to the scripting API and fixed signals
Fixed FileSystemDock's `file_removed` and `folder_removed` signals not being
emitted because the emitted was using the wrong signal name.

(cherry picked from commit fe0b783e70)
2020-03-18 17:57:45 +01:00
Rémi Verschelde 69081c000d
Merge pull request #33098 from JFonS/viewport_rotation
Add rotation widget to 3D viewport
2020-03-17 16:29:44 +01:00
Rémi Verschelde cc70b2fa0a
Merge pull request #36342 from m4gr3d/external_texture_support_for_godot_3_2
Add support for opengl external textures
2020-03-17 16:29:14 +01:00
Rémi Verschelde 4a38ec3937
Merge pull request #36336 from m4gr3d/android_plugin_v2_for_godot_3_2
Re-architecture of the Godot Android plugin. [3.2]
2020-03-17 16:27:59 +01:00
Rémi Verschelde c01e840f03
Merge pull request #36639 from RandomShaper/imvu/improve_drives_ux_3.2
Improve UX of drive letters (3.2)
2020-03-17 16:27:33 +01:00
Pedro J. Estébanez 6105dfdac9 Improve UX of drive letters
Namely, move the drive dropdown to just the left of the path text box and don't include the former
in the latter.

This improves the UX on Windows.

In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its
dropdown is kept at the original location.
2020-03-17 14:48:54 +01:00
Rémi Verschelde 0e36b11f9d i18n: Sync translations with Weblate 2020-03-16 10:45:42 +01:00
Rémi Verschelde 809dc1a12a
Merge pull request #37026 from akien-mga/3.2-cherrypicks
Add LOTS of missing docs
2020-03-13 17:57:43 +01:00
Tomasz Chabora 3739f03d98 Add LOTS of missing docs
(cherry picked from commit e103f21a40)
2020-03-13 17:26:30 +01:00
Rémi Verschelde 34dc32aeb8 Bump version to 3.2.2-rc 2020-03-11 14:47:38 +01:00
Rémi Verschelde 1132ee871b Update AUTHORS and DONORS list
New contributor added to AUTHORS:
@muiroc

Thanks to all contributors and donors for making Godot possible!

Sorry for the late March update and missed February update, I made sure
to include patrons for both February and March in this commit.

(cherry picked from commit 5b97db325a)
2020-03-11 14:47:23 +01:00
Rémi Verschelde b0eca5828c Bump version to 3.2.1-stable
Many bugfixes have been cherry-picked since the 3.2-stable release of
late January 2020, including some regressions.

Thanks to all contributors! <3
2020-03-10 09:59:30 +01:00
Rémi Verschelde e5526544a3 Revert "Change LINKFLAGS to FRAMEWORKS which is supported since Scons release 0.96.91"
This reverts commit 2e152b945f.

SCons `FRAMEWORKS` is, according to their latest docs, only supported
"On Mac OS X with gcc". While the "with gcc" part seems bogus, #36795
did introduce a link failure for our osxcross toolchain for compiling
macOS binaries from Linux. SCons probably fails to detect this as a
macOS target and does not use its `FRAMEWORKS` logic properly.

So using `LINKFLAGS` as we used to is the more portable solution.
2020-03-10 09:56:37 +01:00
Rémi Verschelde efc0a5a481 mbedtls: Re-add patch to disable VIA padlock
The comment mentioned a conflict with libwebsockets, but we actually
still get this conflict even now that we don't use libwebsockets.
Not sure what component is clashing but we should basically just keep
this patch.

Follow-up to #36823.

(cherry picked from commit 8189abd64a)
2020-03-10 09:31:15 +01:00
Rémi Verschelde 268cbfbad6 mbedtls: Re-apply upstream PR 1453 after #36823
For some weird reason 'git apply' does not error out when it does nothing,
so I missed that I did not apply the patch properly in #36823...

This broke the UWP 32-bit x86 build.

(cherry picked from commit 9a727714ee)
2020-03-09 19:49:13 +01:00
Rémi Verschelde df2a2ae0fc DocData: Fix serialization of Variant default values
Co-authored-by: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
(cherry picked from commit 788765709d)
2020-03-09 11:36:57 +01:00
Rémi Verschelde 10012f9d49 Revert "assimp: Sync with upstream 0201fc5"
This reverts commit 78b22393a8.

It caused a regression in FBX import leading to crashes.
Fixes #36908.

(cherry picked from commit da1f80c1f2)
2020-03-09 10:43:08 +01:00
fhuya c3660bb4dc Re-architecture of the Godot Android plugin. 2020-03-09 10:30:02 +01:00
Rémi Verschelde 398de05dd6 doc: Sync classref with current source 2020-03-09 10:07:59 +01:00
Rémi Verschelde 18e021b7cd i18n: Sync translations with Weblate 2020-03-09 10:03:42 +01:00
Thakee Nathees 708aab7920 typo in gdscript_workspace.cpp/remove_cache_parser() fixed
(cherry picked from commit 07c99340d1)
2020-03-09 09:51:59 +01:00
jfons 5b4251695a Add rotation widget to 3D viewport 2020-03-09 09:40:10 +01:00
Phischermen 69c1805735 Added parameters to Load()
(cherry picked from commit 1b0819bd59)
2020-03-06 23:55:25 +01:00
Umang Kalra f9dcc30566 Edited the KinematicBody and KinematicBody2D docs
Explained the reason why move_and_slide should be used in _physics_process

(cherry picked from commit b7dbf41aa5)
2020-03-06 23:54:56 +01:00
CodeforEvolution 543ecb0217 miniupnpc: Sync with upstream master (4436632)
(cherry picked from commit 0c37c4021b)
2020-03-06 23:54:24 +01:00
Rémi Verschelde 10f2ab59c1 assimp: Sync with upstream 0201fc5
(cherry picked from commit 78b22393a8)
2020-03-06 23:54:02 +01:00
Rémi Verschelde 98d0bf7d7a assimp: Clean and document buildsystem, prepare for unbundling
- Improve the SCsub to allow unbundling and remove unnecessary code.
- Move files around to match upstream source.
- Re-sync with upstream commit 308db73d0b3c2d1870cd3e465eaa283692a4cf23
  to ensure we don't have local modifications.
- Doesn't actually build against current version 5.0.1 due to the lack
  of the new ArmaturePopulate API that Gordon authored. We'll have to
  wait for a public release with that API (5.1?) to enable unbundling.

(cherry picked from commit 9d8a9ea826)
2020-03-06 23:53:23 +01:00
bruvzg 5bbce634ad Replace IOHIDDeviceRegisterRemovalCallback with IOHIDManagerRegisterDeviceRemovalCallback to fix gamepad disconnection callback on macOS Catalina.
(cherry picked from commit 6b23e36dbc)
2020-03-06 23:51:26 +01:00
Rémi Verschelde 1e457c8e5c mbedtls: Update to upstream version 2.16.5
Fixes https://tls.mbed.org/tech-updates/security-advisories/mbedtls-security-advisory-2020-02

Drop patch to disable VIA padlock since we no longer use libwebsockets,
so there's no conflict anymore.

(cherry picked from commit e435bed847)
2020-03-06 23:51:26 +01:00
Rémi Verschelde d4e6eff2de ConfigFile: Improve error messages and complete docs
(cherry picked from commit f7c87ed3dd)
2020-03-06 23:51:26 +01:00
Michael Alexsander bd2a2a7e40 Turn Rect2's 'intersects_touch()' into an extra argument of 'intersects()'
(cherry picked from commit 8c8c48a7ad)
2020-03-06 23:51:26 +01:00
hungrymonkey 2e152b945f Change LINKFLAGS to FRAMEWORKS which is supported since Scons release 0.96.91
Fixes the link errors below

clang: error: no such file or directory: 'Carbon'
clang: error: no such file or directory: 'AudioUnit'
clang: error: no such file or directory: 'CoreAudio'
clang: error: no such file or directory: 'CoreMIDI'
clang: error: no such file or directory: 'IOKit'
clang: error: no such file or directory: 'ForceFeedback'
clang: error: no such file or directory: 'CoreVideo'
clang: error: no such file or directory: 'AVFoundation'
clang: error: no such file or directory: 'CoreMedia'
clang: error: no such file or directory: 'Metal'
clang: error: no such file or directory: 'QuartzCore'

Tested on
System Version: macOS 10.15.3 (19D76)

SCons by Steven Knight et al.:
script: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
engine: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
engine path: ['/usr/local/Cellar/scons/3.1.2_1/libexec/scons-local/SCons']

Xcode 11.3.1
Build version 11C504

Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0

Closes #36720

(cherry picked from commit c924e83a64)
2020-03-06 23:51:26 +01:00
Pierre Caye 5062d7499f Add a new configuration warning to CollisionShape
In the case where a ConcavePolygonShape is used as a shape for a RigidBody
in another mode than static, a configuration warning will appear in the
editor.

(cherry picked from commit ad227d9a85)
2020-03-06 23:51:26 +01:00
Thakee Nathees 15057c9284 Fix EditorFolding crash when switching scenes
(cherry picked from commit 3275e8488b)
2020-03-06 23:51:26 +01:00
Rémi Verschelde 4c325c0732 Mono: Fix detection of Apple platforms in build script
(cherry picked from commit 5b040ef2e8)
2020-03-06 23:51:26 +01:00
Aaron Franke 41e385cfac Document EditorPlugin get_plugin_icon and get_plugin_name
The return value's type hint is now accurate.

(cherry picked from commit 68d73ecf60)
2020-03-06 23:51:25 +01:00
fhuya 30d738eda7 Add support for opengl external textures as defined by https://www.khronos.org/registry/OpenGL/extensions/OES/OES_EGL_image_external.txt 2020-03-05 13:09:49 -08:00
Rémi Verschelde ea2e976cdd
Merge pull request #36784 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.1) - 3rd batch
2020-03-05 08:24:51 +01:00
Rémi Verschelde 75164169c4 SCons: Fix get_compiler_version() to return ints
Otherwise comparisons would fail for compiler versions above 10.
Also simplified code somewhat to avoid using subprocess too much
needlessly.

(cherry picked from commits c7dc5142b5
and df7ecfc4a7)
2020-03-04 14:40:12 +01:00
Rémi Verschelde c34b351b24 SCons: Explicitly define our C (C11) and C++ (C++14) standards
On GCC and Clang, we use C11 and C++14 with GNU extensions (`std=gnu11`
and `std=gnu++14`). Those are the defaults for current GCC and Clang,
and also match the feature sets we want to use in Godot.

On MSVC, we require C++14 support explicitly with `/std:c++14`, and
make it strict with the use of `/permissive-` (so features of C++17 or
later can't be used).

Moves the definition before querying environment flags and platform
config so that it can be overridden when necessary.

(cherry picked from commit 342f127362)
2020-03-04 14:12:19 +01:00
Pierre Caye 1350c1371e add a precision about the intended use of the ConcavePolygonShape
(cherry picked from commit 222a934e60)
2020-03-04 14:12:19 +01:00
Bastiaan Olij 0ab8889c0d Exposing get_tracker_id for ARVRPositionalTracker to GDScript
(cherry picked from commit f0b1edef8b)
2020-03-04 12:52:47 +01:00
Christoph Schroeder 031aed3bb7 Fixes touch events for HTML
Without this patch, the following exception is thrown when the touch
screen is used: TypeError: e.getBoundingClientRect is not a function.
No touch events arrive in the engine.

From my testing, this PR fixes the issue and behaves as expected.

Tested with godot-demo-projects/misc/multitouch_view/, emscripten 1.39.8
and Firefox mobile emulator as well as FF on Android

(cherry picked from commit 5134317afc)
2020-03-04 12:40:15 +01:00
Dominik 'dreamsComeTrue' Jasiński a2bc4f0b30 Take correct part of extension with File Dialog
Fixes #36697

(cherry picked from commit 319840bad1)
2020-03-04 12:40:15 +01:00
Ivan Shakhov 88f0cd0b27 On Windows find Rider installed for CurrentUser
(cherry picked from commit c95e20a089)
2020-03-04 12:40:15 +01:00
Aaron Franke fa60e77964 Document that SpringArm exclusions only work with PhysicsBody objects
(cherry picked from commit d961663707)
2020-03-04 12:40:15 +01:00
Danil Alexeev 4bf0c52a30 Minor fix in Node class documentation
The name of the property responsible for physics fps is fixed:
this is `Engine.iterations_per_second`, not `Engine.target_fps`.

(cherry picked from commit 6e5cd36b12)
2020-03-04 12:40:15 +01:00
Mateo Dev .59 d6c94fd527 os: execute parse the command output from utf8
(cherry picked from commit 8a88637705)
2020-03-04 12:40:15 +01:00
fhuya 7de67f6c48 Fix android template install validation.
(cherry picked from commit 5b80dc9a2a)
2020-03-04 12:40:15 +01:00
Raul Santos 447acafa97 Fix missing null check in Mono Binding of GD.print
(cherry picked from commit 6b9c22542f)
2020-03-04 12:40:15 +01:00
Yuri Roubinsky cbeb22eb73 Fix InputEventKey::echo type from INT to BOOL
(cherry picked from commit 5e3c64828a)
2020-03-04 12:40:15 +01:00
simpuid 621c20db90 Implement undo-redo feature for Parameter Paste in the Inspector
EditorData::undo_redo.add_do_property and EditorData::undo_redo.add_undo_property is used in EditorData::paste_object_params to implement this feature. It's action name is set to "Paste Params"

Changes made
* Removed the call for clearing the history on paste params case.
* Instead of directly setting the properties value, EditorData::undo_redo is used.

(cherry picked from commit f817ba8379)
2020-03-04 12:40:15 +01:00
Michael Alexsander 867ea694da Fix import changing disabling checking on multiple files
(cherry picked from commit d35386263f)
2020-03-04 12:40:15 +01:00
Hugo Locurcio 1191766609 doc: Mention concatenation using the `+` operator in Array
This closes https://github.com/godotengine/godot-docs/issues/2452.

(cherry picked from commit 8d53562954)
2020-03-04 12:40:15 +01:00
Hugo Locurcio a78bbcf8ce Improve the RegEx class documentation
This closes https://github.com/godotengine/godot-docs/issues/2522.

(cherry picked from commit 5b78f5c464)
2020-03-04 12:40:14 +01:00
Hugo Locurcio 08cb8420f7 Mention the `duration` parameter unit in `UPNP.add_port_mapping()`
(cherry picked from commit 810be27c78)
2020-03-04 12:40:14 +01:00
Richard Menzies 367048030b Fix wrong selection on cloning a line down in the editor
(cherry picked from commit 28f74327be)
2020-03-04 12:40:14 +01:00
Hugo Locurcio d679edfa7f Add a practical example for `@GDScript.linear2db()`
One of its most common applications in games is for volume sliders.

See https://www.dr-lex.be/info-stuff/volumecontrols.html for
more information.

(cherry picked from commit a6fd6b78dd)
2020-03-04 12:40:14 +01:00
Hugo Locurcio 21a45dda7a Improve the `@GDScript.inverse_lerp()` documentation
This closes https://github.com/godotengine/godot-docs/issues/2589.

(cherry picked from commit 6b5573700b)
2020-03-04 12:40:14 +01:00
Hugo Locurcio 4e879ed803 Improve documentation related to fixed physics processing
(cherry picked from commit b89a37269b)
2020-03-04 12:40:14 +01:00
Ivan Shakhov f0b63b47aa use Rider MSBuild on Windows, when Rider is selected as external editor
(cherry picked from commit a9c2ab81cf)
2020-03-04 12:40:14 +01:00
Ivan Shakhov 8337cc5f7d Support toolbox custom "Tools install location", by reading .settings.json
(cherry picked from commit 33af53c1a6)
2020-03-04 12:40:14 +01:00
Hugo Locurcio 6488570251 Fix a typo in the "Create Single Convex Collision Sibling" option
(cherry picked from commit 7348dfb5b7)
2020-03-04 12:40:14 +01:00
Maurizio Petrarota 53b4689979 Fixed TextureAtlas import.
(cherry picked from commit 744c1fafff)
2020-03-04 12:40:14 +01:00
Andrea Catania 30688769f4 Fixed editor crash when the animation player has no root assigned.
(cherry picked from commit c9b86d54bf)
2020-03-04 12:40:14 +01:00
Michael Alexsander 6e4aa5a580 Don't show a copy of the property's name in the inspector's tooltip if there's no description
(cherry picked from commit 28d3f85e64)
2020-03-04 12:40:14 +01:00
Fabio Alessandrelli e92669654a Fix debugger crash inspecting freed object.
This seems to be the correct way to validate a reference.
Why is cast_to failing?

(cherry picked from commit d8ba07ea8f)
2020-03-04 12:40:14 +01:00
Rémi Verschelde 105b7468b1 Expression: Fix parsing integers as 32-bit
(cherry picked from commit ceba2b6761)
2020-03-04 12:40:14 +01:00
Mateo Dev .59 e13324a889 Core: Change _Marshall class inherit from Reference to Object
(cherry picked from commit 9e8e5ebdc7)
2020-03-04 12:40:14 +01:00
Rafał Mikrut d001ca320d Fix suspicious | and + operators
(cherry picked from commit d0621b954b)
2020-03-04 12:40:14 +01:00
Michael Alexsander 6e300a0c49 Remove extra margin in the top of the debugger
(cherry picked from commit 5c5a2b7472)
2020-03-04 12:40:14 +01:00
Juan Linietsky 03c8e12d54 Add support for named binds in Skin.
Helps better reutilization of skeletons from Maya exported files.

(cherry picked from commit 9a34f39d32)
2020-03-04 12:40:14 +01:00
janglee ffea9fc39f Added tween support for Rect2
Fixes #34575

(cherry picked from commit 4bbe87abb7)
2020-03-04 12:40:14 +01:00
Hugo Locurcio 73240f81d0 Decrease the script editor's default split width to 70
This also makes its value change to match the editor scale.

(cherry picked from commit ac3c93077c)
2020-03-04 12:40:14 +01:00
Hugo Locurcio b80190721b Allow using `MeshLibrary.get_item_preview()` in non-editor builds again
This closes #36268.

(cherry picked from commit 64fac9dd5d)
2020-03-04 12:40:13 +01:00
Dominik 'dreamsComeTrue' Jasiński f328ac36d6 Fix: auto brace complete for quoted strings
Fixes #36002

(cherry picked from commit 6a404a88e4)
2020-03-04 09:53:44 +01:00
Yuri Sizov 04b3e208fa Add a button to quickly repeat last search in files
(cherry picked from commit 8c80b602ac)
2020-03-04 09:52:55 +01:00
Phischermen c75459ac95 Enabled concave collision detection with Areas in Bullet.
(cherry picked from commit 2c01cf54f8)
2020-03-04 09:51:15 +01:00
Eevee e70e0d24d9 Fix inverted use of Camera2D.offset_v
The code above for horizontal movement uses the right margin (_positive_ x direction) when the offset is negative, but vertical movement uses the top margin (_negative_ y direction) when the offset is negative.

The resulting problem is easily seen in the editor — set the drag margins to be asymmetrical, turn on drawing the drag margins, and slide the offsets from -1 to 1 and back.  The horizontal offset moves the camera's center between the left and right margins, but the vertical offset gets them backwards and will move the camera outside the margins entirely.

(cherry picked from commit 40816574ac)
2020-03-04 09:50:21 +01:00
Fabio Iotti 45248fb0ec Fix OGG audio loops
(cherry picked from commit 4f8d1c47b8)
2020-03-04 09:50:21 +01:00
Rémi Verschelde 2bae35353d Revert "Fix control node transform animation jitter with pivot offset"
This reverts commit 15315f118c.

It caused a regression: #36087.
2020-03-04 09:50:21 +01:00
Rémi Verschelde 0d5e483a90
Merge pull request #36754 from mbrlabs/newline-fix-32
Improved custom Android template exports for the 3.2 branch
2020-03-04 08:15:05 +01:00
Marcus Brummer 9190f516b1 Improved custom Android template exports
Prevent newlines from beeing appended in AndroidManifest.xml and
build.gradle. Fixes #36708.
2020-03-03 10:49:13 +01:00
Rémi Verschelde 416cd715a3
Merge pull request #36236 from Janglee123/vehicle-random-force-fix
Fixing Vehicle-Wheels getting a random engine_force at start
2020-03-02 16:50:10 +01:00
Rémi Verschelde 685f255f2f
Merge pull request #36694 from clayjohn/ETC-mipmaps
Force mipmaps off when importing RGBA4444 textures
2020-03-01 08:30:12 +01:00
clayjohn 2c0d391c48 Force mipmaps off when importing RGBA4444 textures 2020-02-29 19:23:56 -08:00
Fabio Alessandrelli 3a73c3f260 Add documentation for new DTLS features. 2020-02-25 11:40:17 +01:00
Fabio Alessandrelli 5e721d07a3 NetworkedMultiplayerENet dtls support. 2020-02-25 11:35:47 +01:00
Fabio Alessandrelli aea3c4d93e Custom godot sockets for ENet now support DTLS.
Non-DTLS implementation uses plain NetSocket for performance as before.
2020-02-25 11:35:47 +01:00
Fabio Alessandrelli 35a9f0fe64 New PacketPeerDTLS and DTLSServer classes.
Custom instance implementation via the mbedtls module.
2020-02-25 11:35:47 +01:00
Fabio Alessandrelli dbbd836931 Move mbedlts print func to SSLMbedTLSContext. 2020-02-25 11:35:47 +01:00
Fabio Alessandrelli 2c8340bee9 UDPServer and PacketPeerUDP connect_to_host.
UDP sockets can be "connected" to filter packets from a specific source.
In case of a bound socket (e.g. server), a new socket can be created on
the same address/port that will receive all packets that are not
filtered by a more specific socket (e.g. the previously connect socket).

This way, a UDPServer can listen to new packets, and return a new
PacketPeerUDP when receiving one, knowing that is a "new client".
2020-02-25 11:35:47 +01:00
Fabio Alessandrelli 6b9240aa84 Add peek option to NetSocket recv_from. 2020-02-25 11:26:34 +01:00
Rémi Verschelde f4e3701893
Merge pull request #36470 from SkyLucilfer/3.2
Add abort mechanism when invoking EditorNavigationMeshGenerator::bake…
2020-02-23 09:13:47 +01:00
SkyJJ 0c53718e7b Add abort mechanism when invoking EditorNavigationMeshGenerator::bake in-game 2020-02-23 02:43:17 +01:00
Rémi Verschelde f1a77a7e0a Travis: Force updating homebrew on macOS
Temporary workaround for https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296

(cherry picked from commit 1b01896e90)
2020-02-21 09:43:23 +01:00
Hugo Locurcio 1bc1939c63 Improve the PanoramaSky class documentation
See https://github.com/godotengine/godot/issues/27835.

(cherry picked from commit 72ac757ad5)
2020-02-20 08:01:18 +01:00
Twarit 6d78636163 Remove unused driver/dummy/audio_driver_dummy.h
(cherry picked from commit 04882a481b)
2020-02-20 08:00:34 +01:00
Rémi Verschelde 80dd96c095 Travis: Fix clang-format on non-master branches
`git diff-tree` used to fail on the `3.2` branch (and other non-master
branches) as Travis doesn't actually check that branch from the remote:
```
fatal: ambiguous argument '3.2': unknown revision or path not in the
working tree.
```

The exit code would still be 0 so we'd miss badly formatted commits
targeting stable branches.

We do it manually to ensure that it's going to work as we want it.

(cherry picked from commit e479231b21)
2020-02-20 08:00:15 +01:00
janglee 56437cddeb Make orthogonal view mode persistent in new scene
Fixes #36339.

(cherry picked from commit d3c580f0bc)
2020-02-20 07:59:45 +01:00
Fabio Alessandrelli ec4abf421a Disable NetSocket reuse address on Windows.
It actually means reuse port -.- ...

(cherry picked from commits cae0d8853d
and 19ef28a614)
2020-02-20 07:57:50 +01:00
Rémi Verschelde 0ad54edeae
Merge pull request #36354 from madmiraal/appveyor-3.2-cache
Enable Appveyor cache on 3.2 branch.
2020-02-19 14:41:43 +01:00
Marcel Admiraal 1affc25395 Enable Appveyor cache on 3.2 branch. 2020-02-19 11:53:02 +01:00
Dominik 'dreamsComeTrue' Jasiński eb22bcead7 RichTextLabel: proper handling of internal key events
Fixes #36211

(cherry picked from commit ff030afc93)
2020-02-19 10:09:28 +01:00
Rémi Verschelde 1c9132540f i18n: Sync translations with Weblate 2020-02-19 10:09:14 +01:00
Tomasz Chabora 15162906e4 Allow for continuous deletion/duplication of lines
(cherry picked from commit b23f141ba4)
2020-02-18 14:22:05 +01:00
Hugo Locurcio 884dcdcd20 Add a fish shell completion file for the Godot editor
(cherry picked from commit 4d8dce1606)
2020-02-18 14:21:49 +01:00
Haoyu Qiu dcf158703e Fixes crash when pressing enter in ConnectDialog with nothing selected
(cherry picked from commit cf8eedb2f5)
2020-02-18 14:21:01 +01:00
Fabio Alessandrelli 50763ecac4 Fix EMWSClient::get_connection_status(), try catch
(cherry picked from commit ebeeb67224)
2020-02-18 14:20:34 +01:00
Hugo Locurcio 06344ac10d Increase the width of the "Connections to method" dialog
This closes #36245.

(cherry picked from commit 5c659dd399)
2020-02-18 14:20:18 +01:00
Michael Alexsander 18eba898f8 Fix hiding ColorPicker's presets not fully hiding its controls
(cherry picked from commit 5f5ccfc361)
2020-02-18 14:20:04 +01:00
WARIO-MDMA 707d1a38ec Reduce AudioStreamPlayer's pitch_scale max value
(cherry picked from commit 61d20b1f56)
2020-02-18 14:19:51 +01:00
SkyJJ 9091e8d839 Fix script icon not showing at startup bug
(cherry picked from commit 032b0e5899)
2020-02-18 14:19:25 +01:00
Michael Alexsander f6d2bbdeab Fix multiple issues with the "Import" dock
(cherry picked from commit bdd4d28081)
2020-02-18 14:18:09 +01:00
Hugo Locurcio a083fcc109 Improve error explanations related to NetworkedMultiplayerENet
(cherry picked from commit 61bf5bf73f)
2020-02-18 14:16:53 +01:00
janglee 5948530332 Fixed random force on vehicle wheel 2020-02-15 20:30:17 +05:30
Rémi Verschelde 245ecb6684
Merge pull request #36215 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.1) - 2nd batch
2020-02-14 22:04:19 +01:00
Rémi Verschelde fbaf3c26bf doc: Only encode version branch (x.y) in class header
This avoids a big diff on patch version updates.

(cherry picked from commit dacfdd8f33)
2020-02-14 20:20:12 +01:00
Rémi Verschelde 3dfedc0b4c i18n: Sync translation template with current source 2020-02-14 17:52:59 +01:00
Rémi Verschelde 74738806f3 i18n: Sync translations with Weblate 2020-02-14 17:51:56 +01:00
Haoyu Qiu 762578e7bc Fixes range hint for default_float_step
(cherry picked from commit dfe9825e00)
2020-02-14 16:32:33 +01:00
Hugo Locurcio 30ca4a32a8 Export and reference the icon as favicon when exporting to HTML5
This makes the project icon display immediately as a favicon when
opening the page, without having to wait for the project to finish
loading.

(cherry picked from commit 4492cf856b)
2020-02-14 16:15:40 +01:00
Hugo Locurcio 6edb5ac9e9 Optimize the editor icon generation
Icons are no longer upsampled when using an integer editor scale.
This makes some icons slightly less crisp, but the icons themselves
can be adjusted to mitigate this. When using a non-integer editor
scale setting, upsampling is kept as it improves crispness in a
far more visible manner.

When upsampling is disabled, this speeds up the theme generation
by about 100 ms on average, making the project manager and editor
start slightly faster. This also speeds up switching between themes.

(cherry picked from commit 9e3393a624)
2020-02-14 16:14:56 +01:00
bitstopper 7cb3a20418 Fixes broken CPUParticles2D AtlasTextures usage
(cherry picked from commit 36d9906d6a)
2020-02-14 16:14:13 +01:00
Yuri Roubinsky e10b0c9eaa Added missing '\n' in visual shader expression node code generation
(cherry picked from commit 6e1187ad2f)
2020-02-14 16:13:44 +01:00
Yuri Roubinsky 1930c79364 Added missing '\n' in visual shader fresnel node code generation
(cherry picked from commit c8639a0013)
2020-02-14 16:13:44 +01:00
Yuri Roubinsky 5579eb823b Few extra formatting fixes for visual shader node generation
For 'If' and 'Switch' nodes

(cherry picked from commit b0f166f0c5)
2020-02-14 16:13:44 +01:00
Yuri Roubinsky 1f4885fe49 Added missing '\n' in visual shader custom node code generation
(cherry picked from commit 9d8b59e86a)
2020-02-14 16:13:44 +01:00
Yuri Roubinsky fb56d93163 Better visual shader code generation
(cherry picked from commit bfec48abf1)
2020-02-14 16:13:44 +01:00
Yuri Roubinsky 74f3fbf7ef Fix VisualScriptClassConstant to be updated properly
(cherry picked from commit 386d0fe988)
2020-02-14 16:12:09 +01:00
Yuri Roubinsky 61901bd7cc Fix GlobalConstant/BasicTypeConstant return type in visual scripts
(cherry picked from commit c19933eec4)
2020-02-14 16:11:54 +01:00
Hugo Locurcio b90a5d4c80 Tweak the editor help comment color for better readability
(cherry picked from commit 99bfaa6c60)
2020-02-14 16:11:11 +01:00
Relintai 34a16ae239 Fix startGame's logic in engine.js.
(cherry picked from commit cb29ce8a3b)
2020-02-14 16:10:41 +01:00
Rémi Verschelde 57de8397b2 Fix Mono check for unsafe object references
(cherry picked from commit 09534e2922)
2020-02-14 16:10:06 +01:00
geequlim 57151c5e31 Fix hover symbol content position
(cherry picked from commit 03d2d01082)
2020-02-14 16:08:14 +01:00
Michael Alexsander ba15e5355b Fix problems with concave shapes in the TileSet editor
(cherry picked from commit eeb972faef)
2020-02-14 16:07:58 +01:00
Haoyu Qiu c81241e6c0 Fixes crash when resource file is corrupted
(cherry picked from commit 832a5c860b)
2020-02-14 16:07:41 +01:00
Tomasz Chabora f0c89048d8 Allow to use arrow keys with TOOL_MOVE
(cherry picked from commit 18918b4efa)
2020-02-14 16:07:17 +01:00
muiroc 50727d7b22 Allow per pixel transparency in javascript platform
(cherry picked from commit e51c6a0d28)
2020-02-14 16:07:03 +01:00
Rémi Verschelde 636093784b Travis: Use Python 3 for SCons
(cherry picked from commit 83ec7cc425)
2020-02-14 16:06:49 +01:00
Pedro J. Estébanez 541251dff7 Add ConfigFile::parse()
(cherry picked from commit e5bd3b707f)
2020-02-14 16:06:36 +01:00
Pedro J. Estébanez edb70682d5 Fix VariantParser::StreamString EOF determination
(cherry picked from commit 521da75380)
2020-02-14 16:06:07 +01:00
Pedro J. Estébanez a8ae52e998 Ignore hidden files and directories in find in files
(cherry picked from commit aeff876868)
2020-02-14 16:05:50 +01:00
Pedro J. Estébanez 59b8f9b2da Make file system scan more robust
Previously, a change was missed if it happened while the scan was in progress and already past the affected location.

Also:
- Consider the scan changes thread on termination, in addition to the full scan one
- Add FS-reported hidden to the check for hidden by the editor file system

(cherry picked from commit 3017bdb7ce)
2020-02-14 16:05:36 +01:00
Hugo Locurcio e834e35ea8 Change the Pick Tile and Select default shortcuts in the TileMap editor
The new default keys were chosen to match common graphics editing
software. A modifier is no longer required to use the Select tool,
making it faster to use.

This closes #34170.

(cherry picked from commit 88213b54ba)
2020-02-14 16:04:39 +01:00
Haoyu Qiu c018d02cda Fixes broken scene created via New Resource
(cherry picked from commit 9cff286de1)
2020-02-14 16:04:23 +01:00
zxcvdev 6380943831 Fix GPU Particles
The special case atan(y,0) of the built-in shader function atan(y,x)
returns different results on different devices. So this commit will add
checks when the atan(y,x) function is used in ParticlesMaterial to set
the direction of GPU Particles to make sure the desired values are
returned (act as atan2(y,x)).

(cherry picked from commit 3580ad6005)
2020-02-14 16:04:07 +01:00
Hugo Locurcio 93b99f2c89 Update the zoom percentage when using Frame Selection in the 2D editor
This closes #36019.

(cherry picked from commit 3e95b79b65)
2020-02-14 16:03:49 +01:00
Raul Santos 0fb35401d4 Avoid going out of bounds in IsSubsequenceOf
Closes #35598

(cherry picked from commit 4b79ef5ebe)
2020-02-14 16:03:18 +01:00
Haoyu Qiu be34e45233 Uses split cursor for SplitContainer
(cherry picked from commit 206b9f2d23)
2020-02-14 16:02:56 +01:00
Rémi Verschelde ac63e5d613 Workaround WebM playback bug after AudioServer latency fixes
af9bb0ea15 fixed AudioServer's
`get_output_delay()` (which used to always return 0) while renaming it
to `get_output_latency()`. It now returns the latency from the
AudioDriver, which can be non-0.

While this was a clear bugfix, it broke playback for WebM files without
audio track. It seems like the playback code, even though it queried
the output delay to calculate a time compensation, was designed to work
even though the delay value was actually bogus. Now that it's correct,
it's not working.

As a workaround we comment out uses of the output latency, restoring
the behavior of Godot 3.1.

This code should still be reviewed by someone more versed in video
playback and fixed to properly account for the non-0 driver latency.

Fixes #35760.

(cherry picked from commit da411d1625)
2020-02-14 16:02:34 +01:00
Yuri Roubinsky 3b2490f19c Prevent shader crash if invalid builtin used after array member accessor
(cherry picked from commit 3a70566b15)
2020-02-14 16:02:21 +01:00
Fabio Alessandrelli 388adac947 Fix UPNP on windows after #30205.
The problem could be related to different byte ordering when copying
the interface address over the binding address.

(cherry picked from commit e85330231c)
2020-02-14 16:01:29 +01:00
Yuri Roubinsky 77deae41fb Few enchancements for shader editor
(cherry picked from commit 24368206ca)
2020-02-14 16:00:45 +01:00
Michael Alexsander 1414a18916 Make some QOL improvements to move operations in the FileSystem dock
(cherry picked from commit 07a23e75fc)
2020-02-14 16:00:14 +01:00
muiroc 1b5996c95d pass missing args in AnimationNode script calls
(cherry picked from commit ed3a8cc83d)
2020-02-14 15:59:56 +01:00
Hugo Locurcio 262aff67db Allow existing hidden files/directories when creating a new project
For instance, this lets users initialize a Git repository
and still be able to create a project in the directory afterwards.

This closes https://github.com/godotengine/godot-proposals/issues/291.

(cherry picked from commit 34b747bac0)
2020-02-14 15:59:41 +01:00
dankan1890 7ccfbd61a4 Fixed String::humanize_size crash.
Close #35872

(cherry picked from commit ca0ee767cb)
2020-02-14 15:59:12 +01:00
Michael Alexsander 8030178e48 Fix built-in script creation loading existing scripts by mistake
(cherry picked from commit f7374cef84)
2020-02-14 15:58:53 +01:00
Haoyu Qiu 0a3bf2b627 Fixes add group in Group Editor dialog
Before this fix, new group can't be created if any existing group starts
with the new name.

(cherry picked from commit 421ea09195)
2020-02-14 15:58:36 +01:00
bruvzg a7ff22ea6d Fix pressure / tilt ranges on Linux.
(cherry picked from commit d552f93f8b)
2020-02-14 15:58:15 +01:00
Hugo Locurcio 3eb9780179 Re-add a way to generate a single convex shape from the editor
It was removed after the implementation of VHACD. Generating a single
shape can lead to better performance, so it may still be desired.

This also adds tooltips for several options in the Mesh menu.

This closes #35692.

(cherry picked from commit 90af009f2e)
2020-02-14 15:58:03 +01:00
Eoin O'Neill 0dedc0a1a3 Fix RichTextEffect `visibility` to Account for Skipped Characters.
A picture is easier to describe this issue than words. Basically, rich
text effects allowed for character visibility changes. While doing so
would work properly, the rich text label would render the next `word` in
an offset accounting for the hidden characters (leaving a huge space.)

This patch fixes this issue by keeping track of the amount of
`backtrack` necessary per line.

(cherry picked from commit b3fd4884d7)
2020-02-14 15:57:47 +01:00
Haoyu Qiu 3c7a013d8d Adds pan and zoom gestures to TextureRegion editor
(cherry picked from commit d1b1edba84)
2020-02-14 15:57:18 +01:00
sumit0190 58a940e5aa Update cached_width of the line_edit element when setting it to be secret
(cherry picked from commit 2e08578985)
2020-02-14 15:56:48 +01:00
Alexander Holland 489b3c2949 Fix double tap pressed event regression
(cherry picked from commit d2a5b7367b)
2020-02-14 15:56:26 +01:00
nathanwfranke 2d8289579a Fix bug where Control at origin with 0 size not rendered
Make a new method instead to make the code more elegant


Move Function down a bit


(cherry picked from commit e5cb557b73)
2020-02-14 15:56:12 +01:00
Eric Rybicki 63daa19538 Use a new approach to fix bone pose override not being reset when IK animation is stopped.
This reverts PR #35460 & commit 551c37167b.

(cherry picked from commit bb0358dd8d)
2020-02-14 15:55:47 +01:00
Hugo Locurcio 56336b4e24 Improve the batch rename dialog
- Use the editor-defined error, warning and success colors for
  preview texts.
- Make the "Regular Expressions" option into a CheckButton
  (as it does something as soon as it's toggled) and move it out
  of the Advanced Options submenu.
- Make it clearer that the error message originates from an invalid
  regular expression.
- Clarify what the number means in the regex error message.
- Tweak some strings' casing for consistency.

(cherry picked from commit ff135065f4)
2020-02-14 15:54:22 +01:00
Aaron Franke 9a396a4e07 [Mono] Basis/Transforms Array operator comments and improvements
The behavior for Basis and Transform2D is unchanged, and Transform gets new behavior. All of the behavior is identical to GDScript's behavior. 

(cherry picked from commit 0a39c7b354)
2020-02-14 15:53:59 +01:00
Hugo Locurcio ca6ac71cdf Improve the Video RAM debugger UX
- Refresh tha tab automatically when switching to it.
- Disable the Refresh button if no project is currently being debugged.
- Scale the column widths on hiDPI displays.
- Rename the tab from "Video Mem" to "Video RAM" for consistency.

(cherry picked from commit 8f838f33b7)
2020-02-14 15:53:12 +01:00
Hugo Locurcio 725ff19636 Improve the AutoLoad editor UX
- Convert the default AutoLoad name to PascalCase when selecting a file.
- Disable the "Add" button if the path is empty or the name is invalid.
- Prefix the automatically-chosen name with "Global" if it would
  conflict with a built-in class.
- Replace the FileList icon with the Load icon as it better represents
  the action.

(cherry picked from commit 352be7dbcc)
2020-02-14 15:52:50 +01:00
Hugo Locurcio a45aa3a46f Implement zooming using Ctrl + Mouse wheel in the GridMap editor
The minimum value of the slider was changed to 0.2 as zooming
works in increments of 0.2. This way, the value can go back to 1
after you've reached the slider's minimum value.

(cherry picked from commit 4c1b2171b0)
2020-02-14 15:52:21 +01:00
gururise 68f013317b change step size of animation length EditSpinSlider to match minimum animation length
(cherry picked from commit caab6603d1)
2020-02-14 15:52:01 +01:00
Silvano Cerza e2ac4195b6 Improved search in settings dialogs
Settings search used to work only on properties, so if a searchbox text
was a substring of a category but not of a property the whole category
would be filtered out and no property would be shown.

Now the behaviour is changed so that when the searchbox text is a
substring of a category all its properties are shown too.

The previous behaviour is still present so that in case the searchbox
text is both a substring of a category and a property of another
category, all properties of the first category are shown and only the
property of the second category is shown.

(cherry picked from commit 84410f937e)
2020-02-14 15:51:37 +01:00
clayjohn 31506ebe85 updated description of metallic in SpatialMaterial 2020-02-12 15:05:49 +01:00
Hugo Locurcio f433c3656b Update EditorSceneImporterAssimp description to reflect current status
(cherry picked from commit 95f6be365a)
2020-02-12 15:05:16 +01:00
Haoyu Qiu 7cfcf1824b Completes doc for ItemList and Tree
(cherry picked from commit 7a41c44be2)
2020-02-12 15:05:02 +01:00
seenloitering 20d0034039 Add documentation for Skeleton2D
Signal bone_setup_changed remains undocumented. I took a quick look at
the cpp code, but its purpose remained unclear to me. If anyone can
steer me in the right direction, I'm happy to flesh this out.

(cherry picked from commit 9151992432)
2020-02-12 15:04:49 +01:00
Rémi Verschelde 4657daff05 doc: Add description for EditorInspector
(cherry-picked from #35858)
2020-02-12 15:04:19 +01:00
Hugo Locurcio 23e08b0fad Improve the `doc_status.py` console output
- Duplicate the header when the `-a` flag is enabled. Since lots of
  items are displayed in this case, this helps the user remember
  which column is which without having to scroll back to the top.
- Bolden the overall percentages for easier visual grepping.

(cherry picked from commit 7c3f6b2870)
2020-02-12 14:59:21 +01:00
Rémi Verschelde 8a0f94a688
Merge pull request #35949 from akien-mga/3.2-cherrypicks
Cherry-picks for the 3.2 branch (future 3.2.1)
2020-02-06 15:56:02 +01:00
Haoyu Qiu 341740c0bf Centers icon vertically in project list
(cherry picked from commit c1011178c0)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 9a8455f5a7 Remove per-file progress reporting when exporting to Android
Calling `step()` on EditorProgress too often will slow down the
rest of the editor, so it's best avoided. This is also more consistent
with other exporters, as most of them don't report per-file progress
either.

Exporting a 2D project with ~1,100 files to Android now takes
about 10 seconds from a debug editor build instead of 65 seconds.

This closes #30850.

(cherry picked from commit 2dd3a01d11)
2020-02-06 13:02:08 +01:00
Rémi Verschelde bc61439306 Changelog: Mention 3.2 changes to TileMap features
Cf. #28896, #29519, #30231.

(cherry picked from commit 989b48badc)
2020-02-06 13:02:08 +01:00
Haoyu Qiu 012f8ffb36 Shortens minimum height of script editor windows
(cherry picked from commit 6785e199bb)
2020-02-06 13:02:08 +01:00
clayjohn 453babc60d Finish documenting BakedLightmap and TextureLayered
(cherry picked from commit 5643bc71f7)
2020-02-06 13:02:08 +01:00
Haoyu Qiu 11f012d2db Completes doc for button classes
(cherry picked from commit db42d5ddff)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 47368f2b7c doc: Add an example for `Array.sort()`
This may help people understand the difference between alphabetical
and natural order more quickly.

(cherry picked from commit 1de9118c5f)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 3410dd3a9e doc: Add a short AnimationPlayer versus Tween comparison
Many newcomers are confused about which one to choose for animating
properties. This should help clarify the situation with regards
to AnimationPlayer versus Tween.

(cherry picked from commit 810b1341ce)
2020-02-06 13:02:08 +01:00
Haoyu Qiu 0d8b3efeb7 Adds extra cursors for macOS
Before, plain arrow cursor or unsuitable ones were used.

(cherry picked from commit 8f881847c0)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 1898240af8 Increase the maximum number of octaves in OpenSimplexNoise to 9
An error message is now printed when trying to set the number of octaves
above the maximum allowed value.

The magic constant was also replaced with a define that can be
easily changed.

This closes #28714.

(cherry picked from commit 13622d40fc)
2020-02-06 13:02:08 +01:00
Hugo Locurcio cbd4784d14 Improve the CheckBox and CheckButton class documentations
This makes the CheckBox and CheckButton classes 100% documented.

(cherry picked from commit c9946bc87e)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 7487a2d11a Use the editor background color for the profiler graph
This leads to a better appearance compared to using pure black.

(cherry picked from commit fa2fda3244)
2020-02-06 13:02:08 +01:00
Haoyu Qiu 3388b7f4c7 Adds sanitizer options for macOS
(cherry picked from commit df4ea84e03)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 74bf8b2d50 Allow saving anywhere when exporting CSV measures from the profiler
Previously, the CSV file could only be saved in `res://`. Since this is
an editor tool, it makes sense to allow saving anywhere on
the filesystem.

(cherry picked from commit 81f33df84b)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 6e56d04616 Display times as milliseconds in the profiler and performance monitors
Small values are easier to read as milliseconds compared to seconds.

(cherry picked from commit f1d9dbfb08)
2020-02-06 13:02:08 +01:00
Hugo Locurcio 611cc11536 Only emit the JavaScript support code for Web when building for HTML5
Excluding other unused environments like Node.js makes the support code
about 4 KB smaller.

(cherry picked from commit e818b51f32)
2020-02-06 13:02:08 +01:00
Michael Alexsander 98b4ef274b Make ScriptCreateDialog's script valid message a bit more clearer
(cherry picked from commit 14e36c72b0)
2020-02-06 13:02:08 +01:00
Michael Alexsander 621821bf87 Make the replaced results appear in the matches counter
(cherry picked from commit 1c5cfb9bfd)
2020-02-06 13:02:07 +01:00
Georg Wacker 15315f118c Fix control node transform animation jitter with pivot offset
The workaround for moving the pivot is not needed anymore, in fact it causes all transforms applied to control nodes to jitter while animating (if a pivot offset is set).

This can be observed via AnimationPlayer and Tween.

The fix is to remove the obsolete workaround that causes this bug.

Fixes #28804

(cherry picked from commit dfb7d46a2a)
2020-02-06 13:02:07 +01:00
Fabio Iotti 5765154ff2 Fix empty audio infinite loop
(cherry picked from commit 5ed4ad81c3)
2020-02-06 13:02:07 +01:00
Michael Alexsander a779774c86 Hide TileSet's properties from the inspector
(cherry picked from commit 5452028d55)
2020-02-06 13:02:07 +01:00
D00T24 3317f7640e fixed godot not recognising 150x150 icon for uwp export
(cherry picked from commit 88bd3227ac)
2020-02-06 13:02:07 +01:00
Yuri Roubinsky e8474435e5 Restores correct window position after fullscreen toggling off on Linux
(cherry picked from commit 90f00c0813)
2020-02-06 13:02:07 +01:00
Yuri Roubinsky 8c689f7d4a Fix restoring window from fullscreen to normal on Linux
(cherry picked from commit 8737269275)
2020-02-06 13:02:07 +01:00
Haoyu Qiu dc20acd4fc Updates Path2D in debugging if navigation is visible
(cherry picked from commit 00d578ba3e)
2020-02-06 13:02:07 +01:00
Yuri Roubinsky 0995696e08 Prevent shader crash when name conflict with "dus" and "__" occured
(cherry picked from commit 2c4367441c)
2020-02-06 13:02:07 +01:00
Yuri Roubinsky 72f7e4efe0 Fix canvas_item light alpha output in visual shaders
(cherry picked from commit b822da00f8)
2020-02-06 13:02:07 +01:00
PouleyKetchoupp b2ac2b6201 Fixed LineEdit virtual keyboard inputs on Android
Changed the condition to add a length filter to make it consistent with the documentation (0 means no character limit). Otherwise the default value in LineEdit causes the virtual keyboard to be non-fonctional on Android.

(cherry picked from commit 196860508a)
2020-02-06 13:02:07 +01:00
Yuri Roubinsky 786b1cc7ff Fix shader crash if using multiple underscores in identifier names
(cherry picked from commit 15358b808b)
2020-02-06 13:02:07 +01:00
Fabián L 04cfcb3ba0 Fixed GetNodeOrNull<T>
GetNodeOrNull<T> was using GetNode instead of GetNodeOrNull

(cherry picked from commit f595486076)
2020-02-06 13:02:07 +01:00
Michael Alexsander 6cb4ec2289 Clip warning text in the remote dock
(cherry picked from commit 0faadcae8f)
2020-02-06 13:02:07 +01:00
Haoyu Qiu 808a0bac33 Fixes OptionButton min size
(cherry picked from commit ddc397d9ff)
2020-02-06 13:02:07 +01:00
Rémi Verschelde 2af79844aa Bump version to 3.2.1-rc 2020-02-06 13:01:30 +01:00
2802 changed files with 108179 additions and 82118 deletions

View File

@ -1,32 +0,0 @@
image: Visual Studio 2019
platform: x64
environment:
HOME: "%HOMEDRIVE%%HOMEPATH%"
PYTHON: C:\Python38
SCONS_CACHE_ROOT: "%HOME%\\scons_cache"
SCONS_CACHE_LIMIT: 1024
matrix:
- GD_PLATFORM: windows
TOOLS: yes
TARGET: release_debug
init:
- ps: if ($env:APPVEYOR_REPO_BRANCH -ne "master") { $env:APPVEYOR_CACHE_SKIP_SAVE = "true" }
cache:
- "%SCONS_CACHE_ROOT%"
install:
- SET "PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- pip install scons==3.1.2
before_build:
- echo %GD_PLATFORM%
- python --version
- scons --version
- set "SCONS_CACHE=%SCONS_CACHE_ROOT%\%APPVEYOR_REPO_BRANCH%"
build_script:
- scons platform=%GD_PLATFORM% target=%TARGET% tools=%TOOLS% debug_symbols=no verbose=yes progress=no gdnative_wrapper=yes

View File

@ -124,4 +124,5 @@ ObjCBlockIndentWidth: 4
### Java specific config ###
Language: Java
# BreakAfterJavaFieldAnnotations: false
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
...

View File

@ -9,6 +9,10 @@ insert_final_newline = true
[*.{cpp,hpp,c,h,mm}]
trim_trailing_whitespace = true
[{*.gradle,AndroidManifest.xml}]
indent_style = space
indent_size = 4
[{*.{py,cs},SConstruct,SCsub}]
indent_style = space
indent_size = 4
@ -16,3 +20,7 @@ indent_size = 4
[.travis.yml]
indent_style = space
indent_size = 2
[*.{csproj,props,targets,nuspec}]
indent_style = space
indent_size = 2

197
.github/CODEOWNERS vendored
View File

@ -2,48 +2,173 @@
# Each line is a file pattern followed by one or more owners.
# Owners can be @users, @org/teams or emails
/doc/ @godotengine/documentation
doc_classes/* @godotengine/documentation
# Buildsystem
# Rendering
/drivers/gl_context/ @reduz
/drivers/gles2/ @reduz
/drivers/gles3/ @reduz
.* @godotengine/buildsystem
.github/ @godotengine/buildsystem
*.py @godotengine/buildsystem
SConstruct @godotengine/buildsystem
SCsub @godotengine/buildsystem
# Audio
/drivers/alsa/ @marcelofg55
/drivers/alsamidi/ @marcelofg55
/drivers/coreaudio/ @marcelofg55
/drivers/coremidi/ @marcelofg55
/drivers/pulseaudio/ @marcelofg55
/drivers/wasapi/ @marcelofg55
/drivers/winmidi/ @marcelofg55
/drivers/xaudio2/ @marcelofg55
# Core
/drivers/unix/ @hpvb
/drivers/windows/ @hpvb
/core/ @godotengine/core
/core/crypto/ @godotengine/network
/core/input*.* @godotengine/input
/editor/icons/ @djrm
# Doc
/misc/ @akien-mga
/doc/ @godotengine/documentation
doc_classes/* @godotengine/documentation
/modules/bullet/ @AndreaCatania
/modules/csg/ @BastiaanOlij
/modules/enet/ @godotengine/network
/modules/gdnative/*arvr/ @BastiaanOlij
/modules/gdscript/ @vnen @bojidar-bg
/modules/mbedtls/ @godotengine/network
/modules/mobile_vr/ @BastiaanOlij
/modules/mono/ @neikeq
/modules/opensimplex/ @JFonS
/modules/regex/ @LeeZH
/modules/upnp/ @godotengine/network
/modules/websocket/ @godotengine/network
# Drivers
/platform/javascript/ @eska014
/platform/uwp/ @vnen
## Audio
/drivers/alsa/ @godotengine/audio
/drivers/alsamidi/ @godotengine/audio
/drivers/coreaudio/ @godotengine/audio
/drivers/coremidi/ @godotengine/audio
/drivers/pulseaudio/ @godotengine/audio
/drivers/wasapi/ @godotengine/audio
/drivers/winmidi/ @godotengine/audio
/drivers/xaudio2/ @godotengine/audio
/server/physics*/ @reduz @AndreaCatania
/server/visual*/ @reduz
## Rendering
/drivers/dummy/ @godotengine/rendering
/drivers/gl_context/ @godotengine/rendering
/drivers/gles2/ @godotengine/rendering
/drivers/gles3/ @godotengine/rendering
/drivers/gles_common/ @godotengine/rendering
/thirdparty/ @akien-mga
## OS
/drivers/unix/ @godotengine/_platforms
/drivers/windows/ @godotengine/windows
## Misc
/drivers/png/ @godotengine/import
# Editor
/editor/*debugger* @godotengine/debugger
/editor/icons/ @godotengine/usability
/editor/import/ @godotengine/import
/editor/plugins/*2d_*.* @godotengine/2d-editor
/editor/plugins/script_*.* @godotengine/script-editor
/editor/plugins/*shader*.* @godotengine/shaders
/editor/code_editor.* @godotengine/script-editor
/editor/*dock*.* @godotengine/docks
# Main
/main/ @godotengine/core
/main/tests/ @godotengine/tests
# Misc
/misc/ @godotengine/buildsystem
# Modules
## Audio (+ video)
/modules/minimp3/ @godotengine/audio
/modules/ogg/ @godotengine/audio
/modules/opus/ @godotengine/audio
/modules/stb_vorbis/ @godotengine/audio
/modules/theora/ @godotengine/audio
/modules/vorbis/ @godotengine/audio
/modules/webm/ @godotengine/audio
## Import
/modules/basis_universal/ @godotengine/import
/modules/bmp/ @godotengine/import
/modules/cvtt/ @godotengine/import
/modules/dds/ @godotengine/import
/modules/etc/ @godotengine/import
/modules/fbx/ @godotengine/import
/modules/gltf/ @godotengine/import
/modules/hdr/ @godotengine/import
/modules/jpg/ @godotengine/import
/modules/pvr/ @godotengine/import
/modules/squish/ @godotengine/import
/modules/svg/ @godotengine/import
/modules/tga/ @godotengine/import
/modules/tinyexr/ @godotengine/import
/modules/webp/ @godotengine/import
## Network
/modules/enet/ @godotengine/network
/modules/mbedtls/ @godotengine/network
/modules/upnp/ @godotengine/network
/modules/webrtc/ @godotengine/network
/modules/websocket/ @godotengine/network
## Rendering
/modules/denoise/ @godotengine/rendering
/modules/glslang/ @godotengine/rendering
/modules/lightmapper_cpu/ @godotengine/rendering
/modules/meshoptimizer/ @godotengine/rendering
/modules/raycast/ @godotengine/rendering
/modules/vhacd/ @godotengine/rendering
/modules/xatlas_unwrap/ @godotengine/rendering
## Scripting
/modules/gdnative/ @godotengine/gdnative
/modules/gdscript/ @godotengine/gdscript
/modules/jsonrpc/ @godotengine/gdscript
/modules/mono/ @godotengine/mono
/modules/visual_script/ @godotengine/visualscript
## Text
/modules/freetype/ @godotengine/buildsystem
/modules/gdnative/text/ @godotengine/gui-nodes
/modules/text_server_adv/ @godotengine/gui-nodes
/modules/text_server_fb/ @godotengine/gui-nodes
## XR
/modules/camera/ @godotengine/xr
/modules/gdnative/arvr/ @godotengine/xr
/modules/mobile_vr/ @godotengine/xr
/modules/webxr/ @godotengine/xr
## Misc
/modules/bullet/ @godotengine/physics
/modules/csg/ @godotengine/3d-nodes
/modules/gridmap/ @godotengine/3d-nodes
/modules/opensimplex/ @godotengine/3d-nodes
/modules/recast/ @godotengine/navigation
/modules/regex/ @godotengine/core
# Platform
/platform/android/ @godotengine/android
/platform/iphone/ @godotengine/ios
/platform/javascript/ @godotengine/html5
/platform/x11/ @godotengine/linux-bsd
/platform/osx/ @godotengine/macos
/platform/uwp/ @godotengine/uwp
/platform/windows/ @godotengine/windows
# Scene
/scene/2d/ @godotengine/2d-nodes
/scene/3d/ @godotengine/3d-nodes
/scene/animation/ @godotengine/animation
/scene/audio/ @godotengine/audio
/scene/debugger/ @godotengine/debugger
/scene/gui/ @godotengine/gui-nodes
/scene/main/ @godotengine/core
/scene/resources/default_theme/ @godotengine/gui-nodes
/scene/resources/font.* @godotengine/gui-nodes
/scene/resources/visual_shader*.* @godotengine/shaders
# Servers
/servers/arvr* @godotengine/xr
/servers/audio* @godotengine/audio
/servers/camera* @godotengine/xr
/servers/physics* @godotengine/physics
/servers/visual* @godotengine/rendering
# Thirdparty
/thirdparty/ @godotengine/buildsystem

2
.github/FUNDING.yml vendored
View File

@ -1,2 +0,0 @@
patreon: godotengine
custom: https://godotengine.org/donate

59
.github/workflows/android_builds.yml vendored Normal file
View File

@ -0,0 +1,59 @@
name: 🤖 Android Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=android verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
ANDROID_NDK_VERSION: 21.1.6352462
jobs:
android-template:
runs-on: "ubuntu-20.04"
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
- name: Set up Java 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Install Android NDK r21
run: |
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;${{env.ANDROID_NDK_VERSION}}'
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/${{env.ANDROID_NDK_VERSION}}/
run: |
scons target=release tools=no android_arch=armv7
scons target=release tools=no android_arch=arm64v8
cd platform/android/java
./gradlew generateGodotTemplates
cd ../../..
ls -l bin/

36
.github/workflows/ios_builds.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: 🍏 iOS Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=iphone verbose=yes warnings=all werror=no debug_symbols=no --jobs=2
jobs:
ios-template:
runs-on: "macos-latest"
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
run: |
scons target=release tools=no
ls -l bin/

63
.github/workflows/javascript_builds.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: 🌐 JavaScript Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=javascript verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
EM_VERSION: 1.39.20
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
javascript-template:
runs-on: "ubuntu-20.04"
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# Additional cache for Emscripten generated system libraries
- name: Load Emscripten cache
id: javascript-template-emscripten-cache
uses: actions/cache@v2
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{github.job}}
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v7
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Verify Emscripten setup
run: |
emcc -v
- name: Compilation
run: |
scons target=release tools=no use_closure_compiler=yes
ls -l bin/

94
.github/workflows/linux_builds.yml vendored Normal file
View File

@ -0,0 +1,94 @@
name: 🐧 Linux Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=linuxbsd verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
jobs:
linux-editor-mono:
runs-on: "ubuntu-20.04"
name: Editor w/ Mono (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# Install all packages (except scons)
- name: Configure dependencies
run: |
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev xvfb \
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
- name: Compilation
run: |
scons tools=yes target=release_debug module_mono_enabled=yes mono_glue=no
xvfb-run ./bin/godot.x11.opt.tools.64.mono --generate-mono-glue modules/mono/glue || true
scons tools=yes target=release_debug module_mono_enabled=yes mono_glue=yes
ls -l bin/
linux-template-mono:
runs-on: "ubuntu-20.04"
name: Template w/ Mono (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# Install all packages (except scons)
- name: Configure dependencies
run: |
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
run: |
scons target=release tools=no module_mono_enabled=yes mono_glue=no
ls -l bin/

67
.github/workflows/macos_builds.yml vendored Normal file
View File

@ -0,0 +1,67 @@
name: 🍎 macOS Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=osx verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
jobs:
macos-editor:
runs-on: "macos-latest"
name: Editor (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
- name: Compilation
run: |
scons tools=yes target=release_debug
ls -l bin/
macos-template:
runs-on: "macos-latest"
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
run: |
scons target=release tools=no
ls -l bin/

88
.github/workflows/server_builds.yml vendored Normal file
View File

@ -0,0 +1,88 @@
name: ☁ Server Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=server verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
jobs:
linux-editor:
runs-on: "ubuntu-20.04"
name: Linux Headless w/ Mono (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# Install all packages (except scons)
- name: Configure dependencies
run: |
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
- name: Compilation
run: |
scons -j2 verbose=yes warnings=all werror=yes platform=server tools=yes target=release_debug module_mono_enabled=yes mono_glue=no
linux-server:
runs-on: "ubuntu-20.04"
name: Linux Server w/ Mono (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
# Install all packages (except scons)
- name: Configure dependencies
run: |
sudo apt-get install build-essential pkg-config libx11-dev libxcursor-dev \
libxinerama-dev libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons
python --version
scons --version
- name: Compilation
run: |
scons -j2 target=release tools=no module_mono_enabled=yes mono_glue=no

40
.github/workflows/static_checks.yml vendored Normal file
View File

@ -0,0 +1,40 @@
name: 📊 Static Checks
on: [push, pull_request]
jobs:
static-checks:
name: Static Checks (clang-format, black format, file format, documentation checks)
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
# Azure repositories are not reliable, we need to prevent Azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
run: |
sudo rm -f /etc/apt/sources.list.d/*
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
- name: Install dependencies
run: |
sudo apt-get install -qq dos2unix recode clang-format-10
sudo update-alternatives --remove-all clang-format
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-10 100
sudo pip3 install black==20.8b1 pygments
- name: File formatting checks (file_format.sh)
run: |
bash ./misc/scripts/file_format.sh
- name: Style checks via clang-format (clang_format.sh)
run: |
bash ./misc/scripts/clang_format.sh
- name: Python style checks via black (black_format.sh)
run: |
bash ./misc/scripts/black_format.sh
- name: Documentation checks
run: |
doc/tools/makerst.py --dry-run doc/classes modules

69
.github/workflows/windows_builds.yml vendored Normal file
View File

@ -0,0 +1,69 @@
name: 🏁 Windows Builds
on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=windows verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
jobs:
windows-editor:
# Windows 10 with latest image
runs-on: "windows-latest"
# Windows Editor - checkout with the plugin
name: Editor (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# Setup scons, print python version and scons version info, so if anything is broken it won't run the build.
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons pywin32
python --version
scons --version
# We should always be explicit with our flags usage here since it's gonna be sure to always set those flags
- name: Compilation
run: |
scons tools=yes target=release_debug
ls -l bin/
windows-template:
runs-on: "windows-latest"
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Configuring Python packages
run: |
python -c "import sys; print(sys.version)"
python -m pip install scons pywin32
python --version
scons --version
- name: Compilation
run: |
scons target=release tools=no
ls -l bin/

19
.gitignore vendored
View File

@ -18,8 +18,9 @@ local.properties
.idea
.gradletasknamecache
project.properties
platform/android/java/app/libs/*
platform/android/java/libs/*
platform/android/java/assets
platform/android/java/lib/.cxx/
# General c++ generated files
*.lib
@ -32,6 +33,8 @@ platform/android/java/assets
*.os
*.Plo
*.lo
# Binutils tmp linker output of the form "stXXXXXX" where "X" is alphanumeric
st[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9]
# Libs generated files
.deps/*
@ -53,6 +56,11 @@ gmon.out
*.cflags
*.cxxflags
# Code::Blocks files
*.cbp
*.layout
*.depend
# Eclipse CDT files
.cproject
.settings/
@ -87,6 +95,9 @@ logs/
*.sln
*.vcxproj*
# Custom SCons configuration override
/custom.py
# Build results
[Dd]ebug/
[Dd]ebugPublic/
@ -335,6 +346,9 @@ platform/windows/godot_res.res
# Visual Studio Code workspace file
*.code-workspace
# Scons construction environment dump
.scons_env.json
# Scons progress indicator
.scons_node_count
@ -346,3 +360,6 @@ compile_commands.json
# Cppcheck
*.cppcheck
# https://clangd.llvm.org/ cache folder
.clangd/

View File

@ -2,10 +2,6 @@ Alexander Holland <alexander.holland@live.de>
Alexander Holland <alexander.holland@live.de> <alexander.holland@haw-hamburg.de>
Alexander Holland <alexander.holland@live.de> <AlexHolly>
Andrea Catania <info@andreacatania.com>
Andreas Haas <liu.gam3@gmail.com>
Andreas Haas <liu.gam3@gmail.com> <hinsbart@gmail.com>
Andreas Haas <liu.gam3@gmail.com> <hinsbart@users.noreply.github.com>
Andreas Haas <liu.gam3@gmail.com> <entenflugstuhl@gmail.com>
Anish Bhobe <anishbhobe@hotmail.com>
Anutrix <numaanzaheerahmed@yahoo.com>
Aren Villanueva <arenvillanueva@yomogi-soft.com> <aren@displaysweet.com>
@ -24,7 +20,11 @@ Chris Bradfield <chris@kidscancode.org> <cb@scribe.net>
Clay John <claynjohn@gmail.com>
Clay John <claynjohn@gmail.com> <clayjohn@shaw.ca>
Dana Olson <dana@shineuponthee.com> <adolson@gmail.com>
dankan1890 <mewuidev2@gmail.com>
Daniel J. Ramirez <djrmuv@gmail.com>
Dominik 'dreamsComeTrue' Jasiński <dominikjasinski@o2.pl>
Emmanuel Barroga <emmanuelbarroga@gmail.com>
Eric M <itsjusteza@gmail.com>
Erik Selecký <35656626+rxlecky@users.noreply.github.com>
Erik Selecký <35656626+rxlecky@users.noreply.github.com> <35656626+SeleckyErik@users.noreply.github.com>
Fabian <supagu@gmail.com>
@ -66,13 +66,20 @@ Kelly Thomas <kelly.thomas@hotmail.com.au>
K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
Leon Krause <lk@leonkrause.com> <eska@eska.me>
Leon Krause <lk@leonkrause.com> <eska014@users.noreply.github.com>
Liz Haas <27thLiz@gmail.com>
Liz Haas <27thLiz@gmail.com> <liu.gam3@gmail.com>
Liz Haas <27thLiz@gmail.com> <hinsbart@gmail.com>
Liz Haas <27thLiz@gmail.com> <hinsbart@users.noreply.github.com>
Liz Haas <27thLiz@gmail.com> <entenflugstuhl@gmail.com>
Manuel Strey <manuel.strey@gmx.de>
Marcelo Fernandez <marcelofg55@gmail.com>
Marcin Zawiejski <dragmz@gmail.com>
Marcus Elg <marcusaccounts@yahoo.se>
Mariano Javier Suligoy <marianognu.easyrpg@gmail.com>
Mario Schlack <m4r10.5ch14ck@gmail.com>
marxin <mliska@suse.cz>
marynate <mary.w.nate@gmail.com> <marynate@github.com>
Mateo Kuruk Miccino <mateomiccino@gmail.com>
Max Hilbrunner <m.hilbrunner@gmail.com>
Max Hilbrunner <m.hilbrunner@gmail.com> <mhilbrunner@users.noreply.github.com>
Michael Alexsander <michaelalexsander@protonmail.com>

View File

@ -1,140 +0,0 @@
language: cpp
# OS config, depends on actual 'os' in build matrix
dist: xenial
stages:
- check
- build
env:
global:
- SCONS_CACHE=$HOME/.scons_cache/$TRAVIS_BRANCH
- SCONS_CACHE_LIMIT=1024
- OPTIONS="debug_symbols=no verbose=yes progress=no builtin_libpng=yes"
- secure: "uch9QszCgsl1qVbuzY41P7S2hWL2IiNFV4SbAYRCdi0oJ9MIu+pVyrQdpf3+jG4rH6j4Rffl+sN17Zz4dIDDioFL1JwqyCqyCyswR8uACC0Rr8gr4Mi3+HIRbv+2s2P4cIQq41JM8FJe84k9jLEMGCGh69w+ibCWoWs74CokYVA="
cache:
directories:
- $SCONS_CACHE
matrix:
include:
- name: Static checks (clang-format) + Documentation checks
stage: check
env: STATIC_CHECKS=yes
os: linux
compiler: gcc
addons:
apt:
sources:
- llvm-toolchain-xenial-8
packages:
- clang-format-8
- name: Linux editor (debug, GCC 9, with Mono)
stage: build
env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
os: linux
compiler: gcc-9
addons:
apt:
sources:
- mono
- ubuntu-toolchain-r-test
packages:
- &gcc9_deps [gcc-9, g++-9]
- &linux_deps [libasound2-dev, libgl1-mesa-dev, libglu1-mesa-dev, libx11-dev, libxcursor-dev, libxi-dev, libxinerama-dev, libxrandr-dev]
- &linux_mono_deps [mono-devel, msbuild, nuget]
- name: Linux export template (release, Clang)
stage: build
env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
apt:
packages:
- *linux_deps
- name: Android export template (release_debug, Clang)
stage: build
env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="warnings=extra werror=yes"
os: linux
compiler: clang
addons:
apt:
packages:
- openjdk-8-jdk
- name: macOS editor (debug, Clang)
stage: build
env: PLATFORM=osx TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-clang EXTRA_ARGS="warnings=extra werror=yes"
os: osx
compiler: clang
- name: iOS export template (debug, Clang)
stage: build
env: PLATFORM=iphone TOOLS=no TARGET=debug CACHE_NAME=${PLATFORM}-clang
os: osx
compiler: clang
- name: Linux headless editor (release_debug, GCC 9, testing project exporting and script running)
stage: build
env: PLATFORM=server TOOLS=yes TARGET=release_debug CACHE_NAME=${PLATFORM}-tools-gcc-9 MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" EXTRA_ARGS="warnings=extra werror=yes" TEST_PROJECT=yes
os: linux
compiler: gcc-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *gcc9_deps
- *linux_deps
- name: Linux export template (release_debug, GCC 5, without 3D support)
stage: build
env: PLATFORM=x11 TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-gcc-5 EXTRA_ARGS="CXXFLAGS=-fno-strict-aliasing disable_3d=yes"
os: linux
compiler: gcc
addons:
apt:
packages:
- *linux_deps
before_install:
- eval "${MATRIX_EVAL}"
- if [ "$STATIC_CHECKS" = "yes" ]; then
unset SCONS_CACHE;
fi
install:
- pip install --user scons;
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$PLATFORM" = "android" ]; then
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/jre/bin:${PATH};
java -version;
misc/travis/android-tools-linux.sh;
fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
export PATH=${PATH}:/Users/travis/Library/Python/2.7/bin;
fi
before_script:
- if [ "$PLATFORM" = "android" ]; then
export ANDROID_HOME=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-sdk;
export ANDROID_NDK_ROOT=$TRAVIS_BUILD_DIR/godot-dev/build-tools/android-ndk;
fi
script:
- if [ "$STATIC_CHECKS" = "yes" ]; then
sh ./misc/travis/clang-format.sh &&
doc/tools/makerst.py --dry-run doc/classes modules;
else
scons -j2 CC=$CC CXX=$CXX platform=$PLATFORM tools=$TOOLS target=$TARGET $OPTIONS $EXTRA_ARGS &&
if [ "$TEST_PROJECT" = "yes" ]; then
git clone --depth 1 "https://github.com/godotengine/godot-tests.git";
sed -i "s:custom_template/release=\"\":custom_template/release=\"$(readlink -e bin/godot_server.x11.opt.tools.64)\":" godot-tests/tests/project_export/export_presets.cfg;
godot-tests/tests/project_export/test_project.sh "bin/godot_server.x11.opt.tools.64";
fi
fi

View File

@ -32,7 +32,6 @@ name is available.
Alexey Khoroshavin (allkhor)
Alket Rexhepi (alketii)
Andrea Catania (AndreaCatania)
Andreas Haas (Hinsbart)
Andrii Doroshenko (Xrayez)
Andy Moss (MillionOstrich)
Anish Bhobe (KidRigger)
@ -61,11 +60,13 @@ name is available.
David Sichma (DavidSichma)
Dharkael (lupoDharkael)
Dmitry Koteroff (Krakean)
Dominik Jasiński (dreamsComeTrue)
DualMatrix
Emmanuel Barroga (codecustard)
Emmanuel Leblond (touilleMan)
Eoin O'Neill (Eoin-ONeill-Yokai)
Eric Lasota (elasota)
Eric M (EricEzaM)
Eric Rybicki (ericrybick)
Erik Selecký (rxlecky)
est31
@ -94,7 +95,9 @@ name is available.
Indah Sylvia (ISylvox)
J08nY
Jakub Grzesik (kubecz3k)
James Buck (jbuck3)
Jérôme Gully (Nutriz)
Jia Jun Chai (SkyLucilfer)
Joan Fons Sanchez (JFonS)
Johan Manuel (29jm)
Joshua Grams (JoshuaGrams)
@ -104,13 +107,18 @@ name is available.
Kelly Thomas (KellyThomas)
Kostadin Damyanov (Max-Might)
K. S. Ernest (iFire) Lee (fire)
Leon Krause (eska014)
lawnjelly
Leon Krause (leonkrause)
Liz Haas (27thLiz)
Lucien Menassol (Kanabenki)
m4nu3lf
Maganty Rushyendra (mrushyendra)
Marcel Admiraal (madmiraal)
Marcelo Fernandez (marcelofg55)
Marc Gilleron (Zylann)
Marcin Zawiejski (dragmz)
Marcus Brummer (mbrlabs)
Marcus (MCrafterzz)
Mariano Javier Suligoy (MarianoGnu)
Mario Schlack (hurikhan)
Martin Capitanio (capnm)
@ -118,14 +126,17 @@ name is available.
Martin Sjursen (binbitten)
marynate
Masoud BH (masoudbh3)
Mateo Kuruk Miccino (kuruk-mm)
Matthias Hölzl (hoelzl)
Max Hilbrunner (mhilbrunner)
merumelu
Michael Alexsander (YeldhamDev)
MichiRecRoom (LikeLakers2)
mrezai
muiroc
Nathan Warden (NathanWarden)
Nils André-Chang (NilsIrl)
Noah Beard (TwistedTwigleg)
Nuno Donato (nunodonato)
Ovnuniarchos
Pascal Richter (ShyRed)
@ -149,13 +160,17 @@ name is available.
Robin Hübner (profan)
romulox-x
Ruslan Mustakov (endragor)
Ryan Roden-Corrent (rrcore)
Saniko (sanikoyes)
santouits
SaracenOne
Sergey Minakov (naithar)
sersoong
Shiqing (kawa-yoiko)
Simon Wenner (swenner)
Stijn Hinlopen (hinlopen)
Swarnim Arun (minraws)
Thakee Nathees (ThakeeNathees)
Theo Hallenius (TheoXD)
Thomas Herzog (karroffel)
Timo Schwarzer (timoschwarzer)

View File

@ -4,6 +4,191 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [3.2.3] - 2020-09-17
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-3-2-3) for details.
### Added
- Android: Add option to enable high precision float in GLES2
- C#: Add Visual Studio support
- HTML5: Improvements and bugfixes backported from the `master` branch
* Note: This PR adds threads support, but as this support is still [disabled in many browsers](https://caniuse.com/#feat=sharedarraybuffer) due to security concerns, the option is not enabled by default. Build HTML5 templates with `threads_enabled=yes` to test it.
- Input: Support SDL2 half axes and inverted axes mappings
- iOS: Add support of iOS's dynamic libraries to GDNative
- iOS: Add methods to embed a framework
- LineEdit: Add option to disable virtual keyboard for LineEdit
- macOS: Implement confined mouse mode
- macOS: Implement seamless display scaling
- Rendering: Allow nearest neighbor lookup when using mipmaps
### Changed
- C#: New `csproj` style with backport of Godot.NET.Sdk
- This change breaks forward compatibility, C# projects opened in 3.2.3 will no longer work with 3.2.2 or earlier. Backup your project files before upgrading.
- GDScript: Auto completion enhanced for extends and class level identifier
- HTML5: Implement HTML5 cancel/ok button swap on Windows
- Physics: Better damping implementation for Bullet rigid bodies
- This makes the behavior of the GodotPhysics and Bullet backends consistent, and more user-friendly with Bullet. If you're using damping with the Bullet backend, you may need to adjust some properties to restore the behavior from 3.2.2 or earlier (see [GH-42051](https://github.com/godotengine/godot/issues/42051#issuecomment-692132877)).
- Project Settings: Enable file logging by default on desktops to help with troubleshooting
- Script editor: Don't open dominant script in external editor
- Sprite3D: Use mesh instead of immediate for drawing Sprite3D
### Fixed
- Android: Fix Return key events in LineEdit & TextEdit on Android
- C#: Fix crash when pass null in print array in `GD.Print`
- C#: Fix restore not called when building game projects
- C#: Fix potential crash with nested classes
- C#: Fix endless reload loop if project has unicode chars
- Core: Fix debugger error when Dictionary key is a freed Object
- Core: Fix leaked ObjectRCs on object Variant reassignment
- GLES2: Fixed mesh data access errors in GLES2
- GLES2: Batching - Fix `FORCE_REPEAT` not being set properly on npot hardware
- GLES3: Force depth prepass when using alpha prepass
- GLES3: Fix OpenGL error when generating radiance
- HTML5: More fixes, audio fallback, fixed FPS
- IK: Fixed SkeletonIK not working with scaled skeletons
- Import: Fix custom tracks causing issues on reimport
- Import: Fix upstream stb_vorbis regression causing crashes with some OGG files
- iOS: Fix for iOS touch recognition
- iOS: Fix possible crash on exit when leaking translation remappings
- macOS: Add support for the Apple Silicon (ARM64) build target
- ARM64 binaries are not included in macOS editor or template builds yet. It's going to take some time before our [dependencies and toolchains](https://github.com/godotengine/godot-build-scripts/pull/10) are updated to support it.
- macOS: Set correct external file attributes, and creation time
- macOS: Refocus last key window after `OS::alert` is closed
- macOS: Fix crash of failed `fork`
- Networking: Fix `UDPServer` and `DTLSServer` on Windows compatibility
- Particles: Fix 2D Particle velocity with directed emission mask
- PathFollow3D: Fix repeated updates of PathFollow3D Transform
- Physics: Trigger broadphase update when changing collision layer/mask
- Physics: Fix laxist collision detection on one way shapes
- Physics: Properly pass safe margin on initialization (fixes jitter in GodotPhysics backend)
- Project Settings: Fix overriding compression related settings
- Rendering: Fixed images in black margins
- Rendering: Properly calculate Polygon2D AABB with skeleton
- RichTextLabel: Fix RichTextLabel fill alignment regression
- RichTextLabel: Fix `center` alignment bug
- Shaders: Fix specular `render_mode` for Visual Shaders
- SkeletonIK: Fix calling `reload_goal()` when starting IK with `start(true)`
- TileSet: Fix potential crash when editing polygons
- Tree: Fix crash when hovering columns after removing a column
- Windows: DirectInput: Use correct joypad ID
- Thirdparty library updates: mbedtls 2.16.8, stb_vorbis 1.20, wslay 1.1.1
## [3.2.2] - 2020-06-26
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-3-2-2) for details.
### Added
- 2D: Expose the `cell_size` affecting `VisibilityNotifier2D` precision
- 2D: Add `MODULATE` builtin to canvas item shaders
- Android: Add signal support to Godot Android plugins
- AStar: Implements `estimate_cost`/`compute_cost` for AStar2D
- C#: Add iOS support
- C#: Allow debugging exported games
- Debug: Add a suffix to the window title when running from a debug build
- Editor: Add rotation widget to 3D viewport
- Editor: Add editor freelook navigation scheme settings
- Editor: Allow duplicating files when holding Control
- GLES2: Add 2D batch rendering across items
- GLES3: Add Nvidia `draw_rect` flickering workaround
- GLES2/GLES3: Add support for OpenGL external textures
- Input: Add keyboard layout enumeration / set / get functions
- macOS: Enable signing of DMG and ZIP'ed exports
- Networking: DTLS support + optional ENet encryption
- Object: Add `has_signal` method
- RichTextLabel: Add option to fit height to contents
- Shaders: Add shader time scaling
- Windows: Add tablet driver selection (WinTab, Windows Ink)
### Changed
- Android: Re-architecture of the plugin system
- Android: The `GodotPayments` plugin was moved to an external first-party plugin using the Google Play Billing library
- Core: Ensure COWData does not always reallocate on resize
- Core: Better handling of `Variant`s pointing to released `Object`s
- Editor: Account for file deletion and renaming in Export Presets
- Editor: Improved go-to definition (Ctrl + Click) in script editor
- Files: Improve UX of drive letters
- HTML5: Switch key detection from `keyCode` to `code`
- HTML5: Use 2-phase setup in JavaScript
- Import: Add support for glTF lights
- Input: Fix joypad GUID conversion to match new SDL format on OSX and Windows
- Language Server: Switch the GDScript LSP from WebSocket to TCP, compatible with more external editors
- Main: Improve the low processor mode sleep precision
- Physics: Normalize up direction vector in `move_and_slide()`
- UWP: Renamed the "Windows Universal" export preset to "UWP", to avoid confusion
- Windows: Make stack size on Windows match Linux and macOS
### Fixed
- Android: Fix `LineEdit` virtual keyboard issues
- AStar: Make `get_closest_point()` deterministic for equidistant points
- Audio: Fix volume interpolation in positional audio nodes
- C#: Sync csproj when files are changed from the FileSystem dock
- C#: Replace uses of old Configuration and update old csprojs
- C#: Revert marshalling of IDictionary/IEnumerable implementing types
- C#: Fix inherited scene not inheriting parent's exported properties
- C#: Fix exported values not updated in the remote inspector
- Core: Fixed false positives in the culling system
- Core: Fix leaks and crashes in `OAHashMap`
- CSG: Various bug fixes
- GDNative: Fix Variant size on 32-bit platforms
- GDScript: Fix leaked objects when game ends with yields in progress
- GDScript: Fix object leaks caused by unfulfilled yields
- GDScript: Various bugs fixed in the parser
- GLES2: Avoid unnecessary material rebind when using skeleton
- GLES2/GLES3: Reset texture flags after radiance map generation
- HTML5: Implement audio buffer size calculation, should fix iOS Safari audio issues
- Image: Fixing wrong blending rect methods
- Image: Fix upscaling image with bilinear interpolation option specified
- Import: Fix changing the import type of multiple files at once
- Import: Respect 'mesh compression' editor import option in Assimp and glTF importers
- Input: Various fixes for touch pen input
- macOS: Ignore process serial number argument passed by macOS Gatekeeper
- macOS: Fix exports losing executable permission when unzipped
- Particles: Fix uninitialized memory in CPUParticles and CPUParticles2D
- Physics: Make soft body completely stiff to attachment point
- Physics: Test collision mask before creating constraint pair in Godot physics broadphase 2D and 3D
- RegEx: Enable Unicode support for RegEx class
- RichTextLabel: Fix alignment bug with `[center]` and `[right]` tags
- Skeleton: Fix IK rotation issue
- VR: Fix aspect ratio on HMD projection matrix
- Windows: Fix certain characters being recognized as special keys when using the US international layout
- Windows: Fix quoting arguments with special characters in `OS.execute()`
- Windows: Do not probe joypads if `DirectInput` cannot be initializer
- Windows: Fix overflow condition with QueryPerformanceCounter
## [3.2.1] - 2020-03-10
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-3-2-1) for details.
### Added
- Skin: Add support for named binds
### Changed
- TileSet: Hide TileSet properties from Inspector, fixing OOM crash on huge tilesets
### Fixed
- Android: Fix double tap pressed event regression
- Android: Fix LineEdit virtual keyboard inputs
- Bullet: Fix detection of concave shape in Area
- Camera2D: Fix inverted use of Camera2D `offset_v`
- Debugger: Fix crash inspecting freed objects
- Expression: Fix parsing integers as 32-bit
- HTML5: Fix `EMWSClient::get_connection_status()`
- HTML5: Fix touch events support with Emscripten 1.39.5+
- macOS: Fix gamepad disconnection callback on macOS Catalina
- Particles: Fix undefined behavior with atan in GPU Particles
- Video: Workaround WebM playback bug after AudioServer latency fixes
- Windows: Fix UPNP regression after upstream update
- Windows: Disable NetSocket address reuse
## [3.2] - 2020-01-29
### Added
@ -250,6 +435,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Drag-and-drop support in the TileSet editor.
- Ability to attach scripts to nodes by dragging a name from the script list to a node in the scene tree.
- Icons are now displayed next to code completion items, making their type easier to distinguish.
- TileMap property `centered_textures` can be used to center textures on their tile, instead of using the tile's top-left corner as position for the texture.
- "Ignore" flag to ignore specific tiles when autotiling in the TileMap editor.
- Keyboard shortcuts to rotate tiles in the TileMap editor.
- Default shortcuts are <kbd>A</kbd> (rotate left), <kbd>S</kbd> (rotate right), <kbd>X</kbd> (flip horizontally), <kbd>Y</kbd> (flip vertically).
@ -383,6 +569,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ogg samples now have an icon in the editor, like WAV samples.
- Camera2D drag margins are now disabled by default.
- If porting a project from Godot 3.1 where drag margins were used, these must be enabled manually again.
- The Camera2D Offset property now ignores the Limit property.
- To get the old behavior back, move the camera itself instead of changing the offset.
- `Camera.project_position()` now requires a second `depth` argument to determine the distance of the point from the camera.
- To get the old behavior back, pass the Camera's `near` property value as the second argument.
- `Skeleton.set_bone_global_pose()` was replaced by `Skeleton.set_bone_global_pose_override()`.
@ -519,6 +707,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Graph lines are now thinner and opaque.
- Graph line widths are now resized to match the editor scale.
- Rounded values now display trailing zeroes to make their precision clearer.
- TileMap support for transform operations on cell textures bigger than the cell size has been reworked to properly support isometric tiles.
- Breaks compatibility with some TileMaps from previous Godot versions. An opt-in `compatibility_mode` property can be used to restore the previous behavior.
- Some TileMap editor options were moved to the toolbar.
- The TileMap editor now displays coordinate information in the 2D viewport's bottom-left corner.
- This fixes the TileMap editor width changing when hovering tiles in a small window.

View File

@ -1,4 +0,0 @@
# Code of Conduct
By participating in this repository, you agree to abide by the
[Godot Engine Code of Conduct](https://godotengine.org/code-of-conduct).

View File

@ -1,70 +1,106 @@
# How to contribute efficiently
Sections covered in this file:
## Table of contents
* [Reporting bugs or proposing features](#reporting-bugs-or-proposing-features)
* [Contributing pull requests](#contributing-pull-requests)
* [Contributing to Godot's translation](#contributing-to-godots-translation)
* [Communicating with developers](#communicating-with-developers)
- [Reporting bugs](#reporting-bugs)
- [Proposing features or improvements](#proposing-features-or-improvements)
- [Contributing pull requests](#contributing-pull-requests)
- [Contributing to Godot's translation](#contributing-to-godots-translation)
- [Communicating with developers](#communicating-with-developers)
**Please read the first section before reporting a bug!**
## Reporting bugs or proposing features
## Reporting bugs
The golden rule is to **always open *one* issue for *one* bug**. If you notice
several bugs and want to report them, make sure to create one new issue for
each of them.
Everything referred to hereafter as "bug" also applies for feature requests.
If you're reporting a new bug, you'll make our life simpler (and the
fix will come sooner) by following these guidelines:
If you are reporting a new issue, you will make our life much simpler (and the
fix come much sooner) by following these guidelines:
### Search first in the existing database
#### Search first in the existing database
Issues are often reported several times by various users. It's good practice to
**search first in the [issue tracker](https://github.com/godotengine/godot/issues)
before reporting your issue**. If you don't find a relevant match or if you're
unsure, don't hesitate to **open a new issue**. The bugsquad will handle it
from there if it's a duplicate.
Issues are often reported several times by various users. It's a good practice
to **search first** in the issues database before reporting your issue. If you
don't find a relevant match or if you are unsure, don't hesitate to **open a
new issue**. The bugsquad will handle it from there if it's a duplicate.
#### Specify the platform
### Specify the platform
Godot runs on a large variety of platforms and operating systems and devices.
If you believe your issue is device/platform dependent (for example if it is
related to the rendering, crashes or compilation errors), please specify:
* Operating system
* Device (including architecture, e.g. x86, x86_64, arm, etc.)
* GPU model (and driver in use if you know it)
**In your bug reports, please always specify:**
#### Specify steps to reproduce
- Operating system and version (e.g. Windows 10, macOS 10.15, Ubuntu 19.10)
- Godot version (e.g. 3.2, 3.1.2, or the Git commit hash if you're using a development branch)
For bugs that are likely OS-specific and/or graphics-related, please also specify:
- Device (CPU model including architecture, e.g. x86, x86_64, ARM, etc.)
- GPU model (and the driver version in use if you know it)
**Bug reports not including the required information may be closed at the
maintainers' discretion.** If in doubt, always include all the requested
information; it's better to include too much information than not enough
information.
### Specify steps to reproduce
Many bugs can't be reproduced unless specific steps are taken. Please **specify
the exact steps** that must be taken to reproduce the condition, and try to
keep them as minimal as possible.
keep them as minimal as possible. If you're describing a procedure to follow
in the editor, don't hesitate to include screenshots.
#### Provide a simple, example project
Making your bug report easy to reproduce will make it easier for contributors
to fix the bug.
Sometimes an unexpected behavior happens in your project. In such case,
### Provide a simple, example project
Sometimes, unexpected behavior can happen in your project. In such case,
understand that:
* What happens to you may not happen to other users.
* We can't take the time to look at your project, understand how it is set up
- What happens to you may not happen to other users.
- We can't take the time to look at your project, understand how it is set up
and then figure out why it's failing.
To speed up our work, please prepare for us **a simple project** that isolates
To speed up our work, **please upload a minimal project** that isolates
and reproduces the issue. This is always the **best way for us to fix it**.
You can attach a zip file with the minimal project directly to the bug report,
You can attach a ZIP file with the minimal project directly to the bug report,
by drag and dropping the file in the GitHub edition field.
We recommend always attaching a minimal reproduction project, even if the issue
may seem simple to reproduce manually.
**If you've been asked by a maintainer to upload a minimal reproduction project,
you *must* do so within 7 days.** Otherwise, your bug report will be closed as
it'll be considered too difficult to diagnose.
Now that you've read the guidelines, click the link below to create a
bug report:
- **[Report a bug](https://github.com/godotengine/godot/issues/new?assignees=&labels=&template=bug_report.md&title=)**
## Proposing features or improvements
**Since August 2019, the main issue tracker no longer accepts feature proposals.**
Instead, head to the [Godot Proposals repository](https://github.com/godotengine/godot-proposals)
and follow the instructions in the README file. High-quality feature proposals
are more likely to be well-received by the maintainers and community, so do
your best :)
See [this article](https://godotengine.org/article/introducing-godot-proposals-repository)
for detailed rationale on this change.
## Contributing pull requests
If you want to add new engine functionalities, please make sure that:
If you want to add new engine features, please make sure that:
* This functionality is desired, which means that it solves a common use case
- This functionality is desired, which means that it solves a common use case
that several users will need in their real-life projects.
* You talked to other developers on how to implement it best (on either
communication channel, and maybe in a GitHub issue first before making your
PR).
* Even if it does not get merged, your PR is useful for future work by another
- You talked to other developers on how to implement it best. See also
[Proposing features or improvements](#proposing-features-or-improvements).
- Even if it doesn't get merged, your PR is useful for future work by another
developer.
Similar rules can be applied when contributing bug fixes - it's always best to
@ -83,7 +119,23 @@ for an introduction to developing on Godot.
The [Contributing docs](https://docs.godotengine.org/en/latest/community/contributing/index.html)
also have important information on the PR workflow and the code style we use.
#### Be nice to the git history
### Document your changes
If your pull request adds methods, properties or signals that are exposed to
scripting APIs, you **must** update the class reference to document those.
This is to ensure the documentation coverage doesn't decrease as contributions
are merged.
[Update the documentation template](https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html#updating-the-documentation-template)
using your compiled binary, then fill in the descriptions.
Follow the style guide described in the
[Docs writing guidelines](https://docs.godotengine.org/en/latest/community/contributing/docs_writing_guidelines.html).
If your pull request modifies parts of the code in a non-obvious way, make sure
to add comments in the code as well. This helps other people understand the
change without having to look at `git blame`.
### Be nice to the Git history
Try to make simple PRs that handle one specific topic. Just like for reporting
issues, it's better to open 3 different PRs that each address a different issue
@ -99,33 +151,31 @@ commit, try to merge them together before making your pull request (see ``git
rebase -i`` and relevant help about rebasing or amending commits on the
Internet).
This git style guide has some good practices to have in mind:
[Git Style Guide](https://github.com/agis-/git-style-guide)
This [Git style guide](https://github.com/agis-/git-style-guide) has some
good practices to have in mind.
See our [PR workflow](https://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html)
documentation for tips on using Git, amending commits and rebasing branches.
#### Format your commit logs with readability in mind
### Format your commit messages with readability in mind
The way you format your commit logs is quite important to ensure that the
commit history and changelog will be easy to read and understand. A git commit
log is formatted as a short title (first line) and an extended description
The way you format your commit messages is quite important to ensure that the
commit history and changelog will be easy to read and understand. A Git commit
message is formatted as a short title (first line) and an extended description
(everything after the first line and an empty separation line).
The short title is the most important part, as it is what will appear in the
`shortlog` changelog (one line per commit, so no description shown) or in the
GitHub interface unless you click the "expand" button. As the name tells it,
try to keep that first line relatively short (ideally <= 50 chars, though it's
rare to be able to tell enough in so few characters, so you can go a bit
higher) - it should describe what the commit does globally, while details would
go in the description. Typically, if you can't keep the title short because you
have too much stuff to mention, it means that you should probably split your
changes in several commits :)
GitHub interface unless you click the "expand" button. As the name says, try to
keep that first line under 72 characters. It should describe what the commit
does globally, while details would go in the description. Typically, if you
can't keep the title short because you have too much stuff to mention, it means
you should probably split your changes in several commits :)
Here's an example of a well-formatted commit log (note how the extended
Here's an example of a well-formatted commit message (note how the extended
description is also manually wrapped at 80 chars for readability):
```
```text
Prevent French fries carbonization by fixing heat regulation
When using the French fries frying module, Godot would not regulate the heat
@ -139,9 +189,9 @@ of cooking oil under normal atmospheric conditions.
Fixes #1789, long live the Realm!
```
*Note:* When using the GitHub online editor (or worse, the drag and drop
feature), *please* edit the commit title to something meaningful. Commits named
"Update my_file.cpp" will not be accepted.
**Note:** When using the GitHub online editor or its drag-and-drop
feature, *please* edit the commit title to something meaningful. Commits named
"Update my_file.cpp" won't be accepted.
## Contributing to Godot's translation
@ -162,6 +212,7 @@ discussions and support, others more for development discussions.
To communicate with developers (e.g. to discuss a feature you want to implement
or a bug you want to fix), the following channels can be used:
- [GitHub issues](https://github.com/godotengine/godot/issues): If there is an
existing issue about a topic you want to discuss, just add a comment to it -
all developers watch the repository and will get an email notification. You
@ -182,6 +233,6 @@ or a bug you want to fix), the following channels can be used:
page](https://listengine.tuxfamily.org/godotengine.org/devel/) for
subscription instructions.
Thanks!
Thanks for your interest in contributing!
The Godot development team
The Godot development team

View File

@ -133,7 +133,7 @@ License: Expat
Files: ./thirdparty/enet/
Comment: ENet
Copyright: 2002-2016, Lee Salzman
Copyright: 2002-2020, Lee Salzman
License: Expat
Files: ./thirdparty/etc2comp/
@ -159,7 +159,7 @@ License: Expat and Bitstream Vera Fonts Copyright
Files: ./thirdparty/freetype/
Comment: The FreeType Project
Copyright: 1996-2019, David Turner, Robert Wilhelm, and Werner Lemberg.
Copyright: 1996-2020, David Turner, Robert Wilhelm, and Werner Lemberg.
License: FTL
Files: ./thirdparty/glad/
@ -245,12 +245,6 @@ Comment: Clipper
Copyright: 2010-2017, Angus Johnson
License: BSL-1.0
Files: ./thirdparty/misc/curl_hostcheck.c
./thirdparty/misc/curl_hostcheck.h
Comment: curl
Copyright: 1998-2012, Daniel Stenberg et al.
License: curl
Files: ./thirdparty/misc/easing_equations.cpp
Comment: Robert Penner's Easing Functions
Copyright: 2001, Robert Penner
@ -259,7 +253,7 @@ License: BSD-3-clause
Files: ./thirdparty/misc/fastlz.c
./thirdparty/misc/fastlz.h
Comment: FastLZ
Copyright: 2005-2007, Ariya Hidayat
Copyright: 2005-2020, Ariya Hidayat
License: Expat
Files: ./thirdparty/misc/hq2x.cpp
@ -356,7 +350,7 @@ License: Expat
Files: ./thirdparty/xatlas/
Comment: xatlas
Copyright: 2018, Jonathan Young
Copyright: 2018-2020, Jonathan Young
2013, Thekla, Inc
2006, NVIDIA Corporation, Ignacio Castano
License: Expat
@ -838,25 +832,6 @@ License: CC-BY-3.0
.
Creative Commons may be contacted at http://creativecommons.org/.
License: curl
All rights reserved.
.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

538
DONORS.md
View File

@ -12,385 +12,522 @@ generous deed immortalized in the next stable release of Godot Engine.
## Platinum sponsors
Gamblify <https://www.gamblify.com>
Heroic Labs <https://heroiclabs.com>
Interblock <http://interblockgaming.com>
## Gold sponsors
Gamblify <https://www.gamblify.com>
None currently, become one! <https://godotengine.org/donate>
## Silver sponsors
Moonwards <https://www.moonwards.com>
## Bronze sponsors
Brandon Lamb
Garry Newman
## Mini sponsors
AD Ford
Alan Beauchamp
Anand Mallik
Andres Hernandez
albinaask
Alejandro Saucedo
alex brown
Andrew Dunai
Brandon Lamb
Christian Baune
Christoffer Sundbom
Christopher Montesano
Darkhan Baimyrza
Darrin Massena
David Mydlarz
Digital Grows
Dov Zimring
Edward Flick
Gamechuck
GameDev.net
GameDev.tv
Grady
Hein-Pieter van Braam
Jacob McKenney
Jasper Brooks
Javary Co.
Jeffery Chiu
Jonah Stich
Justin Arnold
Justo Delgado Baudí
Kyle Szklenski
Leonard Meagher
Mariano Suligoy
Marcel Kräml
Matthieu Huvé
Maxim Karsten
Mike King
Nathan Warden
Neal Gompa (Conan Kudo)
Patrick Schmidt
Ronnie Cheng
Slobodan Milnovic
Stephan Lanfermann
Steve
Thomas Krampl
Tristan Pemble
VilliHaukka
Violin Iliev
蕭惟允
## Gold donors
Andrei
Dave
David Gehrig
David Snopek
Ed Morley
Florian Krick
Florian Rämisch
Jakub Grzesik
Manuele Finocchiaro
Officine Pixel S.n.c.
Retro Village
Ronan Zeegers
Sofox
Taylor Ritenour
Zaven Muradyan
Andrew Morsillo
Asher Glick
Austen McRae
Bernhard Werner
beVR
Brian van der Stel
Carlo Cabanilla
Chris Goddard
Christopher Case
Daniel James
David Gehrig
David Giardi
Default Name
David Snopek
Ed Morley
eggs
Ellen Poe
Florian Breisch
Florian Rämisch
Forge
Gamejunkey
Grady
Jakub Grzesik
Javier Roman
Jay Horton
Joel Höglund
Jeff Nyte
Joan Fons
Jon Woodward
Jose Fernando Alexandre
Karl Werf
Klavdij Voncina
Lex Steers
Luke
Maciej Pendolski
Manuele Finocchiaro
Markus Wiesner
Mason Bially
Matthew Hillier
m kaersten
Mohamed Ikbel Boulabiar
Mored1984
Péter Magyar
Monster Vial
Officine Pixel S.n.c.
Rami
Rene
Rene Tailleur
Retro Village
Rob Messick
Ryan Badour
Scott Wadden
Roland Fredenhagen
Ronan Zeegers
Sandro Jenny
Sarksus
Sean
Sergey
Shawn Yu
thechris
Sofox
Spicylewd
Taylor Ritenour
Tom Langwaldt
Tricky Fat Cat
tukon
William Wold
xagonist
Zaven Muradyan
Alex Khayrullin
Chris Goddard
Chris Serino
Christian Padilla
Conrad Curry
Craig Smith
Darrian Little
Ivan Trombley
Jakub Dering
Joan Fons
Joshua Flores
Krzysztof Jankowski
Lord Bloodhound
Pascal Grüter
Petr Malac
Rami
Reneator
Rob
Robert Willes
Ronnie Ashlock
Thomas Bjarnelöf
Unseen Domains
Valryia
Vincent Henderson
Wojciech Chojnacki
Xavier PATRICELLI
Aaron Winter
Adam Nakonieczny
Adam Neumann
Alexander J Maynard
Alex de la Mare
Alexey Dyadchenko
Alex Khayrullin
alice gambrell
Andreas Funke
André Frélicot
Andrew Bowen
Andrew Harris
Antoni Batchelli
aoshiwik
Arisaka Mayuki
Barugon
Can Eris
Carlos de Sousa Marques
Charlie Whitfield
Chase Taranto
Chelsea Hash
Chris Petrich
Chris Serino
Christian Leth Jeppesen
Christoph Schröder
Cody Parker
Conrad Curry
Craig Ostrin
Craig Smith
D
Daniel Eichler
David White
Eric Monson
Darrian Little
Dev To be curious
Digital Denizen
Easypete
Edgar Sun
Eugenio Hugo Salgüero Jáñez
Fain
Felix Brückner
flesk
F S
Gabrielius Vaiškūnas
Gary Hulst
gavlig
GGGames.org
GiulianoB
Green Fox
Guilherme Felipe de C. G. da Silva
Heath Hayes
Hysteria
Idzard Kwadijk
Hoai Nam Tran
Horváth Péter
Hu Hund
James Couzens
Jared
Jared White
Jeff Nyte
Jeremy Sims
Jerry Ling
Joe Flood
Joel Fivat
Joel Höglund
John G Gentzel
Jose Malheiro
Joseph Crane
Joshie Sparks
Joshua Flores
Joshua Lesperance
Juan Velandia
Judd
Julian Todd
Juraj Móza
Kasper Jeppesen
JUSTIN CARROLL
Justo Delgado Baudí
Kelteseth
kickmaniac
kinfox
kuku
Lachie
Lain Ballard
Leo Fidel R Liban
luca duran
Luc-Frédéric Langis
MadScientistCarl
Marcelo Dornbusch Lopes
Marisa Clardy
Markus Fehr
Markus Wiesner
Martin Eigel
Marvin
Martin Kotz
Martin Soucek
Matt Eunson
Max Bulai
Michael
Michael Dürwald
Mikado069
MuffinManKen
Nick Nikitin
Nick Abousselam
Oliver Dick
Oscar Campos
Patrick Ting
Paul Hocker
Paul Von Zimmerman
Pedro Silva
Pete Goodwin
Péter Magyar
Petr Malac
PhaineOfCatz
pl
Ranoller
Robert Larnach
Robin Arys
Raymond Harris
razmie
Ricardo Alcantara
Rob
Robert Willes
Rob McInroy
Rocknight Studios
Romildo Franco
Ryan
Ronnie Ashlock
Ryan Wilson
Samuel Judd
Scott Pilet
Sean Morgan
Sean Robertson
Sébastien
Serban Serafimescu
Sergey Minakov
Shishir Tandale
SKison
spilldata
Steven Landow
Stoned Xander
Tahiti Bos
TheLevelOfDetail .
Thomas Krampl
Thomas Bjarnelöf
Thomas Kurz
Tim Howard
Timothy Pulliam
Tobias Bocanegra
Urho
Trent Fehl
Valryia
VikFro
Vojtěch
voxelv
William Foster
Wojciech Chojnacki
Xavier PATRICELLI
xzibiting
Zhou Tuizhi
Zie Weaver
蕭惟允
Zoran Kukulj
## Silver donors
1D_Inc
Aaron
Aaron Passchier
Abraham Haskins
Acheron
Adam
Adam Brunnmeier
Adam Carr
Adam Carr
Adam Long
Adam Nakonieczny
Adam McCurdy
Adam N Webber
Adam Smeltzer
Adam Szymański
Adisibio
Adrian Demetrescu
Agar3s - Giovanny Beltrán
Agustinus Arya
Aidan O'Flannagain
Aki Mimoto
Alan Beauchamp
Albin Jonasson Svärdsby
Alder Stefano
AleMax
Alessandro Senese
Alexander Erlemann
Alexandre Beaudoin
alex clavelle
Alex Davies-Moore
Ali Al-Khalifa
Allan Davis
Allen Schade
Andreas Evers
Andreas Krampitz
André Simões
Andre Stackhouse
andrew james morris
Andrew Mansuetti
Andrew Rosenwinkel
Andrew Thomas
Andrzej Skalski
Angelos Arnaoutis
Anthony Staunton
Ano Nim
Anthony Avina
AP Condomines
Arda Erol
Armin Preiml
Arseniy M
Arthur S. Muszynski
Asger
Ashley Claymore
Ashton Scott Snapp
Astier Mickael
Aubrey Falconer
Avencherus
B A
Balázs Batári
Balázs Kondákor
Bartosz Bielecki
Bekhoucha Danyl
Benedikt
Ben G
Ben Phelan
Ben Vercammen
Bernd Jänichen
Bjarne Voigtländer
Black Block
Blair Allen
Bobby CC Wong
Bryan Stevenson
Borkzilla
Bram
brian
Brian mc gowan
Brodie Fairhall
Burney Waring
Caleb Gartner
Cameron Meyer
Carlos Cejudo
Carl van der Geest
Carwyn Edwards
Casey M.
Cas Brugman
Cassidy James
Chad Steadman
Chris Brown
Chris Chapin
Christian Baune
Chris Jagusch
Christian Clavet
Christian Winter
Christoffer Sundbom
Christoffer Dahlblom
Christophe Gagnier
Christopher Schmitt
Christoph Woinke
Clay Heaton
Collin Shooltz
Cole Johnson
Conall O
Curt King
CzechBlueBear
Daniel De Macedo
Daniel Johnson
Daniel Kimblad
DanielMaximiano
Daniel Pontillo
Daniel Reed
Daniel Szarfman
Daniel Tebbutt
Danny Welch
Daren Scot Wilson
Dave Walker
David Bôle
David May
David Rapisarda
David Woodard
Dennis Idzikowsky
Dominic Cooney
David Zanetti
Dmitry Fisher
Dmytro Korchynskyi
Dominik Wetzel
Donn Eddy
Donovan Hutcheon
Dragontrapper
Dr Ewan Murray
Dr.Raccoon
Duobix
Duodecimal
Dylan Todd
Eduardo Teixeira
Edward Herbert
Edward Swartz
Eelco F Hillenius
Egon Elbre
Elmeri '- Duy Kevin Nguyen
Elgenzay
Elias Nykrem
Ephemeral
Eric Ellingson
Eric Williams
Erkki Seppälä
ET Garcia
Evan Rose
Fain
Faisal Alkubaisi
Fancy Ants Studios
Fekinox
Felix Kollmann
fengjiongmax
Felix Bohmann
Flaredown
Forty Doubleu
Frank
FuDiggity
G3Dev sàrl
Gadzhi Kharkharov
gamedev by Celio
Gary Hulst
Gary Thomas
George Marques
GiulianoB
Greg Lincoln
Greg Olson
GREGORY C FEIN
Greg P
Greyson Richey
Grid
Guillaume Audirac
Guillaume Pham Ngoc
Guldoman
Gustavo Loureiro dos Reis
Hal A
helija
Heribert Hirth
Hunter Jones
Hylpher
Ian Williams
Iiari
iKlem
IndustrialRobot
Isaac Morton
Ivan Nikolaev
Jackson Harmer
Jacob
Jaguar
Jaiden Gerig
Jaime Ruiz-Borau Vizárraga
Jake Huxell
Jako Danar
James
James A F Manley
Jannik Gröger
Jax
James Thomas
Jamiee H
Jamie Massey
Janders
JARKKO PARVIAINEN
Jason Uechi
Jean-Baptiste LEPESME
Jeff Hungerford
Jennifer Graves
Jeremy Kahn
Jesse Dubay
Joe Alden
Joel Fivat
Joel Setterberg
Johannes Wuensch
Joe Klemmer
John Gabriel
Jomei Jackson
Jonas
Jonas Bernemann
Jonas Rudlang
Jonas Yamazaki
Jonatan R
Jonathan G
Jonathon
Jon Bonazza
Jon Oakes
Jon Sully
Jose Aleman
Jordy Goodridge
Jorge Antunes
Jose C. Rubio
Joseph Catrambone
Josh Mitchell
Joshua Southerland
Juanfran
Judd
Julian Murgia
June Little
JungleRobba
Justin Calleja
Justin Hamilton
Justin Oaksford
Justin Spedding
Kaiser Bald0
KaDokta
Karel Němec
Kauzig
KC Chan
Keedong Park
Keinan Powers
Keith Bradner
Kent Jofur
Kevin McPhillips
kickmaniac
Kiyohiro Kawamura (kyorohiro)
Kiri Jolly
Kjetil Haugland
Klagsam
Klassix
KR McGinley
Kristian Nygaard Jensen
KsyTek Games
Kuan Cheang
kycho
Kyle Appelgate
Kyuppin
Laurent CHEA
Laurent Tréguier
LEMMiNO
Leonardo Dimano
Levi Lindsey
Lin Chear
Linus Lind Lundgren
Lionel Gaillard
Luigi Renna
LunaticInAHat
Lurkars
Major Haul
Malcolm
Malik Ahmed
Malik Nejer
Marcus Richter
Marco Lardelli
Mark Jad
Mark Krenz
Markus Martin
Markus Michael Egger
Martin FIbik
Martin Holas
Martin Linklater
Martin Liška
Matthew Little
Matti Pohjanvirta
Martin Trbola
Marvin
Mathieu
Matt Edwards
Matthew Booe
Max Fiedler
Maxime Blade
Maxwell
medecau
Megasploot
Melissa Mears
M H
mhilbrunner
Michael Dürwald
Michael Gringauz
mewin
Michael Cullen
Michael Haney
Michael Labbe
Mikael Olsson
Michał Skwarek
Mikayla
Mike Birkhead
Mike Cunningham
Mitchell J. Wagner
Molinghu
Molly Jameson
MoM
Nathan Fish
Natrim
@ -398,99 +535,142 @@ generous deed immortalized in the next stable release of Godot Engine.
Neil Blakey-Milner
Neil Wang
Nerdforge
Nerdyninja
Nicholas
Nicholas Girga
Nick Allen
Nick Macholl
Niclas Eriksen
Nicolas Goll-Perrier
Nicolás Montaña
Nicolas SAN AGUSTIN
Nima Farid
NZ
'@oddgoo
OKV
Oleg Reva
Olivier
Omar Delarosa
Orinxlm
Oscar Domingo
Oscar Norlander
Pan Ip
Parinya Teerakasemsuk
Patrick Dully
Patrick Nafarrete
Paul Gieske
Paul Mason
Paweł Kowal
Paweł Łyczkowski
Pedro Assuncao
Penguin
Petrus Prinsloo
Philip Cohoe
Pierre-Igor Berthet
Pitsanu Tongprasin
Pierre-Nicolas Tollitte
Piotr Góral
Point08
Poryg
Rad Cat
Preethi Vaidyanathan
Price Comstock
pwab
Rafa Laguna
rainerLinux
Raphael Leroux
Remi Rampin
Rémi Verschelde
Ricardo Alcantara
Reneator
Richard Diss
Richard Ivánek
Richard Patching
Robert Farr (Larington)
Robert Hernandez
Rodrigo Loli
Robert Larnach
Rob Ruana
Roger Smith
Roland Rząsa
Roman Tinkov
Ronald Ho Hip (CrimsonZA)
Ronan
Ronny Mühle
Ross Squires
Ryan Groom
Ryan Hentz
Sam.C
Sam Caulfield
Sam Edson
Samuele Zolfanelli
Sasori Olkof
sayaks
Scott D. Yelich
Scott Longley
ScottMakesGames
Sebastian Michailidis
sgnsajgon
Sebastian Vetter
Sergio Mello-Grand
Shaher
Shane
Shane Sicienski
Shane Spoor
Shiomi - Duy Kevin Nguyen
Siim Raidma
Simon Jonas Larsen
Simon Schoenenberger
Simon Wenner
SK
Sintinium
Skalli
smbe19
Stonepyre
smo1704
soft circles
Squirrel
Stefano Caronia
Steve Cloete
Svenne Krap
tadashi endo
Tannen Helmers
Terry
tezuvholovdr
Theodore Lindsey
TheVoiceInMyHead
thomas
Thomas Bechtold
Thomas Detoy
Thomas Kelly
tiansheng li
Tim Drumheller
Tim Erskine
Tim Gleason
Timothy B. MacDonald
tinyBigGames LLC
Tobbun
Tom Fulp
Tom Glenn
Tobias Bradtke
Toni Duran
Tony Zhao
Torgeir Lilleskog
Torsten Crass
Travis O'Brien
Trent Skinner
Triptych
Triumph263 .
Troy Bonneau
Tryggve Sollid
Turgut Temucin
Tyler Compton
Tyler Stafos
UltyX
Vaiktorg
Uther
Valentí Gàmez
Vaughan Ling
Victor
Vigilant Watch
Viktor Ismagilov
Vincent Cloutier
Vitor Balbio
Vladimir Savin
waka nya
Wayne Haak
werner mendizabal
Wiley Thompson
Will
William Edwards
William F Siqueira
William Hogben
Wout Standaert
Windvis
Wyatt Goodin
Yegor
x1212
Yegor Smirnov
YiYin Gu
Yuri Sizov
Zak Stephens
Zgegnesh Hemomancer
ΒΑΣΙΛΗΣ ΓΕΩΡΓΑΚΟΠΟΥΛΟΣ
郝晨煜
## Bronze donors

View File

@ -1,25 +1,46 @@
[![Godot Engine logo](/logo.png)](https://godotengine.org)
**Important:** The `3.2` branch is no longer maintained, as what was planned to be
released as Godot 3.2.4 has been renamed to Godot 3.3:
https://godotengine.org/article/versioning-change-godot-3x
## Godot Engine
This branch was therefore reset to the `3.2.3-stable` state, and will not receive further
updates, unless we decide that a hotfix 3.2.3.1 release is needed.
Homepage: https://godotengine.org
We recommend that all Godot 3.2 users upgrade to Godot 3.3, which has been developed to be
a safe and compatible upgrade for Godot 3.2 users.
#### 2D and 3D cross-platform game engine
If you had a custom branch based on `3.2`, you should rebase on the stable `3.3` branch
which is its continuation, or the `3.x` branch which is the new development branch for
future 3.x releases. All commits which were in the `3.2` branch prior to the rename are
in the `3.3` and `3.x` branches.
Godot Engine is a feature-packed, cross-platform game engine to create 2D and
3D games from a unified interface. It provides a comprehensive set of common
tools, so that users can focus on making games without having to reinvent the
wheel. Games can be exported in one click to a number of platforms, including
the major desktop platforms (Linux, Mac OSX, Windows) as well as mobile
(Android, iOS) and web-based (HTML5) platforms.
-----
#### Free, open source and community-driven
# Godot Engine
<p align="center">
<a href="https://godotengine.org">
<img src="logo.svg" width="400" alt="Godot Engine logo">
</a>
</p>
## 2D and 3D cross-platform game engine
**[Godot Engine](https://godotengine.org) is a feature-packed, cross-platform
game engine to create 2D and 3D games from a unified interface.** It provides a
comprehensive set of common tools, so that users can focus on making games
without having to reinvent the wheel. Games can be exported in one click to a
number of platforms, including the major desktop platforms (Linux, macOS,
Windows), mobile platforms (Android, iOS), as well as Web-based platforms
(HTML5) and
[consoles](https://docs.godotengine.org/en/latest/tutorials/platform/consoles.html).
## Free, open source and community-driven
Godot is completely free and open source under the very permissive MIT license.
No strings attached, no royalties, nothing. The users' games are theirs, down
to the last line of engine code. Godot's development is fully independent and
community-driven, empowering users to help shape their engine to match their
expectations. It is supported by the Software Freedom Conservancy
expectations. It is supported by the [Software Freedom Conservancy](https://sfconservancy.org/)
not-for-profit.
Before being open sourced in February 2014, Godot had been developed by Juan
@ -28,45 +49,48 @@ years as an in-house engine, used to publish several work-for-hire titles.
![Screenshot of a 3D scene in Godot Engine](https://raw.githubusercontent.com/godotengine/godot-design/master/screenshots/editor_tps_demo_1920x1080.jpg)
### Getting the engine
## Getting the engine
#### Binary downloads
### Binary downloads
Official binaries for the Godot editor and the export templates can be found
[on the homepage](https://godotengine.org/download).
#### Compiling from source
### Compiling from source
[See the official docs](https://docs.godotengine.org/en/latest/development/compiling/)
for compilation instructions for every supported platform.
### Community and contributing
## Community and contributing
Godot is not only an engine but an ever-growing community of users and engine
developers. The main community channels are listed [on the homepage](https://godotengine.org/community).
To get in touch with the developers, the best way is to join the
[#godotengine IRC channel](https://webchat.freenode.net/?channels=godotengine)
To get in touch with the engine developers, the best way is to join the
[#godotengine-devel IRC channel](https://webchat.freenode.net/?channels=godotengine-devel)
on Freenode.
To get started contributing to the project, see the [contributing guide](CONTRIBUTING.md).
### Documentation and demos
## Documentation and demos
The official documentation is hosted on [ReadTheDocs](https://docs.godotengine.org).
It is maintained by the Godot community in its own [GitHub repository](https://github.com/godotengine/godot-docs).
The [class reference](https://docs.godotengine.org/en/latest/classes/)
is also accessible from within the engine.
is also accessible from the Godot editor.
The official demos are maintained in their own [GitHub repository](https://github.com/godotengine/godot-demo-projects)
as well.
There are also a number of other learning resources provided by the community,
such as text and video tutorials, demos, etc. Consult the [community channels](https://godotengine.org/community)
for more info.
There are also a number of other
[learning resources](https://docs.godotengine.org/en/latest/community/tutorials.html)
provided by the community, such as text and video tutorials, demos, etc.
Consult the [community channels](https://godotengine.org/community)
for more information.
[![Travis Build Status](https://travis-ci.org/godotengine/godot.svg?branch=master)](https://travis-ci.org/godotengine/godot)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/bfiihqq6byxsjxxh/branch/master?svg=true)](https://ci.appveyor.com/project/akien-mga/godot)
[![Actions Build Status](https://github.com/godotengine/godot/workflows/Godot/badge.svg?branch=master)](https://github.com/godotengine/godot/actions)
[![Code Triagers Badge](https://www.codetriage.com/godotengine/godot/badges/users.svg)](https://www.codetriage.com/godotengine/godot)
[![Translate on Weblate](https://hosted.weblate.org/widgets/godot-engine/-/godot/svg-badge.svg)](https://hosted.weblate.org/engage/godot-engine/?utm_source=widget)
[![Total alerts on LGTM](https://img.shields.io/lgtm/alerts/g/godotengine/godot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/godotengine/godot/alerts)
[![TODOs](https://badgen.net/https/api.tickgit.com/badgen/github.com/godotengine/godot)](https://www.tickgit.com/browse?repo=github.com/godotengine/godot)

View File

@ -7,6 +7,7 @@ import glob
import os
import pickle
import sys
from collections import OrderedDict
# Local
import methods
@ -25,48 +26,46 @@ platform_exporters = []
platform_apis = []
for x in sorted(glob.glob("platform/*")):
if (not os.path.isdir(x) or not os.path.exists(x + "/detect.py")):
if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"):
continue
tmppath = "./" + x
sys.path.insert(0, tmppath)
import detect
if (os.path.exists(x + "/export/export.cpp")):
if os.path.exists(x + "/export/export.cpp"):
platform_exporters.append(x[9:])
if (os.path.exists(x + "/api/api.cpp")):
if os.path.exists(x + "/api/api.cpp"):
platform_apis.append(x[9:])
if (detect.is_active()):
if detect.is_active():
active_platforms.append(detect.get_name())
active_platform_ids.append(x)
if (detect.can_build()):
if detect.can_build():
x = x.replace("platform/", "") # rest of world
x = x.replace("platform\\", "") # win32
platform_list += [x]
platform_opts[x] = detect.get_opts()
platform_flags[x] = detect.get_flags()
sys.path.remove(tmppath)
sys.modules.pop('detect')
module_list = methods.detect_modules()
sys.modules.pop("detect")
methods.save_active_platforms(active_platforms, active_platform_ids)
custom_tools = ['default']
custom_tools = ["default"]
platform_arg = ARGUMENTS.get("platform", ARGUMENTS.get("p", False))
if os.name == "nt" and (platform_arg == "android" or ARGUMENTS.get("use_mingw", False)):
custom_tools = ['mingw']
elif platform_arg == 'javascript':
custom_tools = ["mingw"]
elif platform_arg == "javascript":
# Use generic POSIX build toolchain for Emscripten.
custom_tools = ['cc', 'c++', 'ar', 'link', 'textfile', 'zip']
custom_tools = ["cc", "c++", "ar", "link", "textfile", "zip"]
env_base = Environment(tools=custom_tools)
if 'TERM' in os.environ:
env_base['ENV']['TERM'] = os.environ['TERM']
env_base.AppendENVPath('PATH', os.getenv('PATH'))
env_base.AppendENVPath('PKG_CONFIG_PATH', os.getenv('PKG_CONFIG_PATH'))
if "TERM" in os.environ:
env_base["ENV"]["TERM"] = os.environ["TERM"]
env_base.AppendENVPath("PATH", os.getenv("PATH"))
env_base.AppendENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH"))
env_base.disabled_modules = []
env_base.use_ptrcall = False
env_base.module_version_string = ""
@ -94,7 +93,7 @@ env_base.SConsignFile(".sconsign{0}.dblite".format(pickle.HIGHEST_PROTOCOL))
# Build options
customs = ['custom.py']
customs = ["custom.py"]
profile = ARGUMENTS.get("profile", False)
if profile:
@ -106,59 +105,67 @@ if profile:
opts = Variables(customs, ARGUMENTS)
# Target build options
opts.Add('arch', "Platform-dependent architecture (arm/arm64/x86/x64/mips/...)", '')
opts.Add(EnumVariable('bits', "Target platform bits", 'default', ('default', '32', '64')))
opts.Add('p', "Platform (alias for 'platform')", '')
opts.Add('platform', "Target platform (%s)" % ('|'.join(platform_list), ), '')
opts.Add(EnumVariable('target', "Compilation target", 'debug', ('debug', 'release_debug', 'release')))
opts.Add(EnumVariable('optimize', "Optimization type", 'speed', ('speed', 'size')))
opts.Add(BoolVariable('tools', "Build the tools (a.k.a. the Godot editor)", True))
opts.Add(BoolVariable('use_lto', 'Use link-time optimization', False))
opts.Add(BoolVariable('use_precise_math_checks', 'Math checks use very precise epsilon (useful to debug the engine)', False))
opts.Add("arch", "Platform-dependent architecture (arm/arm64/x86/x64/mips/...)", "")
opts.Add(EnumVariable("bits", "Target platform bits", "default", ("default", "32", "64")))
opts.Add("p", "Platform (alias for 'platform')", "")
opts.Add("platform", "Target platform (%s)" % ("|".join(platform_list),), "")
opts.Add(EnumVariable("target", "Compilation target", "debug", ("debug", "release_debug", "release")))
opts.Add(EnumVariable("optimize", "Optimization type", "speed", ("speed", "size")))
opts.Add(BoolVariable("tools", "Build the tools (a.k.a. the Godot editor)", True))
opts.Add(BoolVariable("use_lto", "Use link-time optimization", False))
opts.Add(BoolVariable("use_precise_math_checks", "Math checks use very precise epsilon (debug option)", False))
# Components
opts.Add(BoolVariable('deprecated', "Enable deprecated features", True))
opts.Add(BoolVariable('gdscript', "Enable GDScript support", True))
opts.Add(BoolVariable('minizip', "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable('xaudio2', "Enable the XAudio2 audio driver", False))
opts.Add(BoolVariable("deprecated", "Enable deprecated features", True))
opts.Add(BoolVariable("gdscript", "Enable GDScript support", True))
opts.Add(BoolVariable("minizip", "Enable ZIP archive support using minizip", True))
opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False))
opts.Add("custom_modules", "A list of comma-separated directory paths containing custom modules to build.", "")
# Advanced options
opts.Add(BoolVariable('verbose', "Enable verbose output for the compilation", False))
opts.Add(BoolVariable('progress', "Show a progress indicator during compilation", True))
opts.Add(EnumVariable('warnings', "Set the level of warnings emitted during compilation", 'all', ('extra', 'all', 'moderate', 'no')))
opts.Add(BoolVariable('werror', "Treat compiler warnings as errors. Depends on the level of warnings set with 'warnings'", False))
opts.Add(BoolVariable('dev', "If yes, alias for verbose=yes warnings=extra werror=yes", False))
opts.Add('extra_suffix', "Custom extra suffix added to the base filename of all generated binary files", '')
opts.Add(BoolVariable('vsproj', "Generate a Visual Studio solution", False))
opts.Add(EnumVariable('macports_clang', "Build using Clang from MacPorts", 'no', ('no', '5.0', 'devel')))
opts.Add(BoolVariable('split_libmodules', "Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)", False))
opts.Add(BoolVariable('disable_3d', "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable('disable_advanced_gui', "Disable advanced GUI nodes and behaviors", False))
opts.Add(BoolVariable('no_editor_splash', "Don't use the custom splash screen for the editor", False))
opts.Add('system_certs_path', "Use this path as SSL certificates default for editor (for package maintainers)", '')
opts.Add(BoolVariable("verbose", "Enable verbose output for the compilation", False))
opts.Add(BoolVariable("progress", "Show a progress indicator during compilation", True))
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(BoolVariable("dev", "If yes, alias for verbose=yes warnings=extra werror=yes", False))
opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all generated binary files", "")
opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False))
opts.Add(EnumVariable("macports_clang", "Build using Clang from MacPorts", "no", ("no", "5.0", "devel")))
opts.Add(
BoolVariable(
"split_libmodules",
"Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)",
False,
)
)
opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False))
opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False))
opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False))
opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "")
# Thirdparty libraries
opts.Add(BoolVariable('builtin_bullet', "Use the built-in Bullet library", True))
opts.Add(BoolVariable('builtin_certs', "Bundle default SSL certificates to be used if you don't specify an override in the project settings", 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))
opts.Add(BoolVariable('builtin_libogg', "Use the built-in libogg library", True))
opts.Add(BoolVariable('builtin_libpng', "Use the built-in libpng library", True))
opts.Add(BoolVariable('builtin_libtheora', "Use the built-in libtheora library", True))
opts.Add(BoolVariable('builtin_libvorbis', "Use the built-in libvorbis library", True))
opts.Add(BoolVariable('builtin_libvpx', "Use the built-in libvpx library", True))
opts.Add(BoolVariable('builtin_libwebp', "Use the built-in libwebp library", True))
opts.Add(BoolVariable('builtin_wslay', "Use the built-in wslay library", True))
opts.Add(BoolVariable('builtin_mbedtls', "Use the built-in mbedTLS library", True))
opts.Add(BoolVariable('builtin_miniupnpc', "Use the built-in miniupnpc library", True))
opts.Add(BoolVariable('builtin_opus', "Use the built-in Opus library", True))
opts.Add(BoolVariable('builtin_pcre2', "Use the built-in PCRE2 library", True))
opts.Add(BoolVariable('builtin_pcre2_with_jit', "Use JIT compiler for the built-in PCRE2 library", True))
opts.Add(BoolVariable('builtin_recast', "Use the built-in Recast 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))
# opts.Add(BoolVariable('builtin_assimp', "Use the built-in Assimp library", True))
opts.Add(BoolVariable("builtin_bullet", "Use the built-in Bullet library", True))
opts.Add(BoolVariable("builtin_certs", "Use the built-in SSL certificates bundles", 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))
opts.Add(BoolVariable("builtin_libogg", "Use the built-in libogg library", True))
opts.Add(BoolVariable("builtin_libpng", "Use the built-in libpng library", True))
opts.Add(BoolVariable("builtin_libtheora", "Use the built-in libtheora library", True))
opts.Add(BoolVariable("builtin_libvorbis", "Use the built-in libvorbis library", True))
opts.Add(BoolVariable("builtin_libvpx", "Use the built-in libvpx library", True))
opts.Add(BoolVariable("builtin_libwebp", "Use the built-in libwebp library", True))
opts.Add(BoolVariable("builtin_wslay", "Use the built-in wslay library", True))
opts.Add(BoolVariable("builtin_mbedtls", "Use the built-in mbedTLS library", True))
opts.Add(BoolVariable("builtin_miniupnpc", "Use the built-in miniupnpc library", True))
opts.Add(BoolVariable("builtin_opus", "Use the built-in Opus library", True))
opts.Add(BoolVariable("builtin_pcre2", "Use the built-in PCRE2 library", True))
opts.Add(BoolVariable("builtin_pcre2_with_jit", "Use JIT compiler for the built-in PCRE2 library", True))
opts.Add(BoolVariable("builtin_recast", "Use the built-in Recast 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))
# Compilation environment setup
opts.Add("CXX", "C++ compiler")
@ -176,68 +183,97 @@ for k in platform_opts.keys():
for o in opt_list:
opts.Add(o)
for x in module_list:
module_enabled = True
tmppath = "./modules/" + x
sys.path.insert(0, tmppath)
import config
enabled_attr = getattr(config, "is_enabled", None)
if (callable(enabled_attr) and not config.is_enabled()):
module_enabled = False
sys.path.remove(tmppath)
sys.modules.pop('config')
opts.Add(BoolVariable('module_' + x + '_enabled', "Enable module '%s'" % (x, ), module_enabled))
# Update the environment now as the "custom_modules" option may be
# defined in a file rather than specified via the command line.
opts.Update(env_base)
opts.Update(env_base) # update environment
Help(opts.GenerateHelpText(env_base)) # generate help
# Detect modules.
modules_detected = OrderedDict()
module_search_paths = ["modules"] # Built-in path.
if env_base["custom_modules"]:
paths = env_base["custom_modules"].split(",")
for p in paths:
try:
module_search_paths.append(methods.convert_custom_modules_path(p))
except ValueError as e:
print(e)
sys.exit(255)
for path in module_search_paths:
# Note: custom modules can override built-in ones.
modules_detected.update(methods.detect_modules(path))
include_path = os.path.dirname(path)
if include_path:
env_base.Prepend(CPPPATH=[include_path])
# Add module options
for name, path in modules_detected.items():
enabled = True
sys.path.insert(0, path)
import config
try:
enabled = config.is_enabled()
except AttributeError:
pass
sys.path.remove(path)
sys.modules.pop("config")
opts.Add(BoolVariable("module_" + name + "_enabled", "Enable module '%s'" % (name,), enabled))
methods.write_modules(modules_detected)
# Update the environment again after all the module options are added.
opts.Update(env_base)
Help(opts.GenerateHelpText(env_base))
# add default include paths
env_base.Prepend(CPPPATH=['#'])
env_base.Prepend(CPPPATH=["#"])
# configure ENV for platform
env_base.platform_exporters = platform_exporters
env_base.platform_apis = platform_apis
if (env_base["use_precise_math_checks"]):
env_base.Append(CPPDEFINES=['PRECISE_MATH_CHECKS'])
if env_base["use_precise_math_checks"]:
env_base.Append(CPPDEFINES=["PRECISE_MATH_CHECKS"])
if (env_base['target'] == 'debug'):
env_base.Append(CPPDEFINES=['DEBUG_MEMORY_ALLOC','DISABLE_FORCED_INLINE'])
if env_base["target"] == "debug":
env_base.Append(CPPDEFINES=["DEBUG_MEMORY_ALLOC", "DISABLE_FORCED_INLINE"])
# The two options below speed up incremental builds, but reduce the certainty that all files
# will properly be rebuilt. As such, we only enable them for debug (dev) builds, not release.
# To decide whether to rebuild a file, use the MD5 sum only if the timestamp has changed.
# http://scons.org/doc/production/HTML/scons-user/ch06.html#idm139837621851792
env_base.Decider('MD5-timestamp')
env_base.Decider("MD5-timestamp")
# Use cached implicit dependencies by default. Can be overridden by specifying `--implicit-deps-changed` in the command line.
# http://scons.org/doc/production/HTML/scons-user/ch06s04.html
env_base.SetOption('implicit_cache', 1)
env_base.SetOption("implicit_cache", 1)
if (env_base['no_editor_splash']):
env_base.Append(CPPDEFINES=['NO_EDITOR_SPLASH'])
if env_base["no_editor_splash"]:
env_base.Append(CPPDEFINES=["NO_EDITOR_SPLASH"])
if not env_base['deprecated']:
env_base.Append(CPPDEFINES=['DISABLE_DEPRECATED'])
if not env_base["deprecated"]:
env_base.Append(CPPDEFINES=["DISABLE_DEPRECATED"])
env_base.platforms = {}
selected_platform = ""
if env_base['platform'] != "":
selected_platform = env_base['platform']
elif env_base['p'] != "":
selected_platform = env_base['p']
if env_base["platform"] != "":
selected_platform = env_base["platform"]
elif env_base["p"] != "":
selected_platform = env_base["p"]
env_base["platform"] = selected_platform
else:
# Missing `platform` argument, try to detect platform automatically
if sys.platform.startswith('linux'):
selected_platform = 'x11'
elif sys.platform == 'darwin':
selected_platform = 'osx'
elif sys.platform == 'win32':
selected_platform = 'windows'
if sys.platform.startswith("linux"):
selected_platform = "x11"
elif sys.platform == "darwin":
selected_platform = "osx"
elif sys.platform == "win32":
selected_platform = "windows"
else:
print("Could not detect platform automatically. Supported platforms:")
for x in platform_list:
@ -248,21 +284,39 @@ else:
print("Automatically detected platform: " + selected_platform)
env_base["platform"] = selected_platform
if selected_platform in ["linux", "bsd", "linuxbsd"]:
if selected_platform == "linuxbsd":
# Alias for forward compatibility.
print('Platform "linuxbsd" is still called "x11" in Godot 3.2.x. Building for platform "x11".')
# Alias for convenience.
selected_platform = "x11"
env_base["platform"] = selected_platform
if selected_platform in platform_list:
tmppath = "./platform/" + selected_platform
sys.path.insert(0, tmppath)
import detect
if "create" in dir(detect):
env = detect.create(env_base)
else:
env = env_base.Clone()
if env['dev']:
env['verbose'] = True
env['warnings'] = "extra"
env['werror'] = True
# Compilation DB requires SCons 3.1.1+.
from SCons import __version__ as scons_raw_version
if env['vsproj']:
scons_ver = env._get_major_minor_revision(scons_raw_version)
if scons_ver >= (4, 0, 0):
env.Tool("compilation_db")
env.Alias("compiledb", env.CompilationDatabase())
if env["dev"]:
env["verbose"] = True
env["warnings"] = "extra"
env["werror"] = True
if env["vsproj"]:
env.vs_incs = []
env.vs_srcs = []
@ -275,7 +329,7 @@ if selected_platform in platform_list:
pieces = fname.split(".")
if len(pieces) > 0:
basename = pieces[0]
basename = basename.replace('\\\\', '/')
basename = basename.replace("\\\\", "/")
if os.path.isfile(basename + ".h"):
env.vs_incs = env.vs_incs + [basename + ".h"]
elif os.path.isfile(basename + ".hpp"):
@ -284,106 +338,125 @@ if selected_platform in platform_list:
env.vs_srcs = env.vs_srcs + [basename + ".c"]
elif os.path.isfile(basename + ".cpp"):
env.vs_srcs = env.vs_srcs + [basename + ".cpp"]
env.AddToVSProject = AddToVSProject
env.extra_suffix = ""
if env["extra_suffix"] != '':
env.extra_suffix += '.' + env["extra_suffix"]
if env["extra_suffix"] != "":
env.extra_suffix += "." + env["extra_suffix"]
CCFLAGS = env.get('CCFLAGS', '')
env['CCFLAGS'] = ''
# Environment flags
CCFLAGS = env.get("CCFLAGS", "")
env["CCFLAGS"] = ""
env.Append(CCFLAGS=str(CCFLAGS).split())
CFLAGS = env.get('CFLAGS', '')
env['CFLAGS'] = ''
CFLAGS = env.get("CFLAGS", "")
env["CFLAGS"] = ""
env.Append(CFLAGS=str(CFLAGS).split())
CXXFLAGS = env.get('CXXFLAGS', '')
env['CXXFLAGS'] = ''
CXXFLAGS = env.get("CXXFLAGS", "")
env["CXXFLAGS"] = ""
env.Append(CXXFLAGS=str(CXXFLAGS).split())
LINKFLAGS = env.get('LINKFLAGS', '')
env['LINKFLAGS'] = ''
LINKFLAGS = env.get("LINKFLAGS", "")
env["LINKFLAGS"] = ""
env.Append(LINKFLAGS=str(LINKFLAGS).split())
# Platform specific flags
flag_list = platform_flags[selected_platform]
for f in flag_list:
if not (f[0] in ARGUMENTS): # allow command line to override platform flags
env[f[0]] = f[1]
# must happen after the flags, so when flags are used by configure, stuff happens (ie, ssl on x11)
# Must happen after the flags definition, so that they can be used by platform detect
detect.configure(env)
# Enable C++11 support
# Set our C and C++ standard requirements.
# Prepending to make it possible to override
# This needs to come after `configure`, otherwise we don't have env.msvc.
if not env.msvc:
env.Append(CXXFLAGS=['-std=c++11'])
# Specifying GNU extensions support explicitly, which are supported by
# both GCC and Clang. This mirrors GCC and Clang's current default
# compile flags if no -std is specified.
env.Prepend(CFLAGS=["-std=gnu11"])
env.Prepend(CXXFLAGS=["-std=gnu++14"])
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++14"])
# Configure compiler warnings
if env.msvc:
# Truncations, narrowing conversions, signed/unsigned comparisons...
disable_nonessential_warnings = ['/wd4267', '/wd4244', '/wd4305', '/wd4018', '/wd4800']
if (env["warnings"] == 'extra'):
env.Append(CCFLAGS=['/Wall']) # Implies /W4
elif (env["warnings"] == 'all'):
env.Append(CCFLAGS=['/W3'] + disable_nonessential_warnings)
elif (env["warnings"] == 'moderate'):
env.Append(CCFLAGS=['/W2'] + disable_nonessential_warnings)
else: # 'no'
env.Append(CCFLAGS=['/w'])
disable_nonessential_warnings = ["/wd4267", "/wd4244", "/wd4305", "/wd4018", "/wd4800"]
if env["warnings"] == "extra":
env.Append(CCFLAGS=["/Wall"]) # Implies /W4
elif env["warnings"] == "all":
env.Append(CCFLAGS=["/W3"] + disable_nonessential_warnings)
elif env["warnings"] == "moderate":
env.Append(CCFLAGS=["/W2"] + disable_nonessential_warnings)
else: # 'no'
env.Append(CCFLAGS=["/w"])
# Set exception handling model to avoid warnings caused by Windows system headers.
env.Append(CCFLAGS=['/EHsc'])
if (env["werror"]):
env.Append(CCFLAGS=['/WX'])
env.Append(CCFLAGS=["/EHsc"])
if env["werror"]:
env.Append(CCFLAGS=["/WX"])
# Force to use Unicode encoding
env.Append(MSVC_FLAGS=['/utf8'])
else: # Rest of the world
env.Append(MSVC_FLAGS=["/utf8"])
else: # Rest of the world
version = methods.get_compiler_version(env) or [-1, -1]
shadow_local_warning = []
all_plus_warnings = ['-Wwrite-strings']
all_plus_warnings = ["-Wwrite-strings"]
if methods.using_gcc(env):
version = methods.get_compiler_version(env)
if version != None and version[0] >= '7':
shadow_local_warning = ['-Wshadow-local']
env.Append(CCFLAGS=["-Wno-misleading-indentation"])
if version[0] >= 7:
shadow_local_warning = ["-Wshadow-local"]
if (env["warnings"] == 'extra'):
if env["warnings"] == "extra":
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
env.Append(CCFLAGS=['-Wall', '-Wextra', '-Wno-unused-parameter']
+ all_plus_warnings + shadow_local_warning)
env.Append(CXXFLAGS=['-Wctor-dtor-privacy', '-Wnon-virtual-dtor'])
env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wno-unused-parameter"] + all_plus_warnings + shadow_local_warning)
env.Append(CXXFLAGS=["-Wctor-dtor-privacy", "-Wnon-virtual-dtor"])
if methods.using_gcc(env):
env.Append(CCFLAGS=['-Walloc-zero',
'-Wduplicated-branches', '-Wduplicated-cond',
'-Wstringop-overflow=4', '-Wlogical-op'])
env.Append(CXXFLAGS=['-Wnoexcept', '-Wplacement-new=1'])
version = methods.get_compiler_version(env)
if version != None and version[0] >= '9':
env.Append(CCFLAGS=['-Wattribute-alias=2'])
elif (env["warnings"] == 'all'):
env.Append(CCFLAGS=['-Wall'] + shadow_local_warning)
elif (env["warnings"] == 'moderate'):
env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + shadow_local_warning)
else: # 'no'
env.Append(CCFLAGS=['-w'])
if (env["werror"]):
env.Append(CCFLAGS=['-Werror'])
else: # always enable those errors
env.Append(CCFLAGS=['-Werror=return-type'])
env.Append(
CCFLAGS=[
"-Walloc-zero",
"-Wduplicated-branches",
"-Wduplicated-cond",
"-Wstringop-overflow=4",
"-Wlogical-op",
]
)
env.Append(CXXFLAGS=["-Wnoexcept", "-Wplacement-new=1"])
if version[0] >= 9:
env.Append(CCFLAGS=["-Wattribute-alias=2"])
elif env["warnings"] == "all":
env.Append(CCFLAGS=["-Wall"] + shadow_local_warning)
elif env["warnings"] == "moderate":
env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + shadow_local_warning)
else: # 'no'
env.Append(CCFLAGS=["-w"])
if env["werror"]:
env.Append(CCFLAGS=["-Werror"])
else: # always enable those errors
env.Append(CCFLAGS=["-Werror=return-type"])
if (hasattr(detect, 'get_program_suffix')):
if hasattr(detect, "get_program_suffix"):
suffix = "." + detect.get_program_suffix()
else:
suffix = "." + selected_platform
if (env["target"] == "release"):
if env["target"] == "release":
if env["tools"]:
print("Tools can only be built with targets 'debug' and 'release_debug'.")
sys.exit(255)
suffix += ".opt"
env.Append(CPPDEFINES=['NDEBUG'])
env.Append(CPPDEFINES=["NDEBUG"])
elif (env["target"] == "release_debug"):
elif env["target"] == "release_debug":
if env["tools"]:
suffix += ".opt.tools"
else:
@ -396,59 +469,62 @@ if selected_platform in platform_list:
if env["arch"] != "":
suffix += "." + env["arch"]
elif (env["bits"] == "32"):
elif env["bits"] == "32":
suffix += ".32"
elif (env["bits"] == "64"):
elif env["bits"] == "64":
suffix += ".64"
suffix += env.extra_suffix
sys.path.remove(tmppath)
sys.modules.pop('detect')
sys.modules.pop("detect")
env.module_list = []
modules_enabled = OrderedDict()
env.module_icons_paths = []
env.doc_class_path = {}
for x in module_list:
if not env['module_' + x + '_enabled']:
for name, path in modules_detected.items():
if not env["module_" + name + "_enabled"]:
continue
tmppath = "./modules/" + x
sys.path.insert(0, tmppath)
env.current_module = x
sys.path.insert(0, path)
env.current_module = name
import config
# can_build changed number of arguments between 3.0 (1) and 3.1 (2),
# so try both to preserve compatibility for 3.0 modules
can_build = False
try:
can_build = config.can_build(env, selected_platform)
except TypeError:
print("Warning: module '%s' uses a deprecated `can_build` "
"signature in its config.py file, it should be "
"`can_build(env, platform)`." % x)
print(
"Warning: module '%s' uses a deprecated `can_build` "
"signature in its config.py file, it should be "
"`can_build(env, platform)`." % x
)
can_build = config.can_build(selected_platform)
if (can_build):
if can_build:
config.configure(env)
env.module_list.append(x)
# Get doc classes paths (if present)
try:
doc_classes = config.get_doc_classes()
doc_path = config.get_doc_path()
for c in doc_classes:
env.doc_class_path[c] = "modules/" + x + "/" + doc_path
env.doc_class_path[c] = path + "/" + doc_path
except:
pass
# Get icon paths (if present)
try:
icons_path = config.get_icons_path()
env.module_icons_paths.append("modules/" + x + "/" + icons_path)
env.module_icons_paths.append(path + "/" + icons_path)
except:
# Default path for module icons
env.module_icons_paths.append("modules/" + x + "/" + "icons")
env.module_icons_paths.append(path + "/" + "icons")
modules_enabled[name] = path
sys.path.remove(tmppath)
sys.modules.pop('config')
sys.path.remove(path)
sys.modules.pop("config")
env.module_list = modules_enabled
methods.update_version(env.module_version_string)
@ -467,47 +543,68 @@ if selected_platform in platform_list:
env["LIBSUFFIX"] = suffix + env["LIBSUFFIX"]
env["SHLIBSUFFIX"] = suffix + env["SHLIBSUFFIX"]
if (env.use_ptrcall):
env.Append(CPPDEFINES=['PTRCALL_ENABLED'])
if env['tools']:
env.Append(CPPDEFINES=['TOOLS_ENABLED'])
if env['disable_3d']:
if env['tools']:
print("Build option 'disable_3d=yes' cannot be used with 'tools=yes' (editor), only with 'tools=no' (export template).")
if env.use_ptrcall:
env.Append(CPPDEFINES=["PTRCALL_ENABLED"])
if env["tools"]:
env.Append(CPPDEFINES=["TOOLS_ENABLED"])
if env["disable_3d"]:
if env["tools"]:
print(
"Build option 'disable_3d=yes' cannot be used with 'tools=yes' (editor), "
"only with 'tools=no' (export template)."
)
sys.exit(255)
else:
env.Append(CPPDEFINES=['_3D_DISABLED'])
if env['gdscript']:
env.Append(CPPDEFINES=['GDSCRIPT_ENABLED'])
if env['disable_advanced_gui']:
if env['tools']:
print("Build option 'disable_advanced_gui=yes' cannot be used with 'tools=yes' (editor), only with 'tools=no' (export template).")
env.Append(CPPDEFINES=["_3D_DISABLED"])
if env["gdscript"]:
env.Append(CPPDEFINES=["GDSCRIPT_ENABLED"])
if env["disable_advanced_gui"]:
if env["tools"]:
print(
"Build option 'disable_advanced_gui=yes' cannot be used with 'tools=yes' (editor), "
"only with 'tools=no' (export template)."
)
sys.exit(255)
else:
env.Append(CPPDEFINES=['ADVANCED_GUI_DISABLED'])
if env['minizip']:
env.Append(CPPDEFINES=['MINIZIP_ENABLED'])
env.Append(CPPDEFINES=["ADVANCED_GUI_DISABLED"])
if env["minizip"]:
env.Append(CPPDEFINES=["MINIZIP_ENABLED"])
editor_module_list = ['regex']
editor_module_list = ["regex"]
for x in editor_module_list:
if not env['module_' + x + '_enabled']:
if env['tools']:
print("Build option 'module_" + x + "_enabled=no' cannot be used with 'tools=yes' (editor), only with 'tools=no' (export template).")
if not env["module_" + x + "_enabled"]:
if env["tools"]:
print(
"Build option 'module_" + x + "_enabled=no' cannot be used with 'tools=yes' (editor), "
"only with 'tools=no' (export template)."
)
sys.exit(255)
if not env['verbose']:
if not env["verbose"]:
methods.no_verbose(sys, env)
if (not env["platform"] == "server"): # FIXME: detect GLES3
env.Append(BUILDERS = { 'GLES3_GLSL' : env.Builder(action=run_in_subprocess(gles_builders.build_gles3_headers), suffix='glsl.gen.h', src_suffix='.glsl')})
env.Append(BUILDERS = { 'GLES2_GLSL' : env.Builder(action=run_in_subprocess(gles_builders.build_gles2_headers), suffix='glsl.gen.h', src_suffix='.glsl')})
if not env["platform"] == "server": # FIXME: detect GLES3
env.Append(
BUILDERS={
"GLES3_GLSL": env.Builder(
action=run_in_subprocess(gles_builders.build_gles3_headers), suffix="glsl.gen.h", src_suffix=".glsl"
)
}
)
env.Append(
BUILDERS={
"GLES2_GLSL": env.Builder(
action=run_in_subprocess(gles_builders.build_gles2_headers), suffix="glsl.gen.h", src_suffix=".glsl"
)
}
)
scons_cache_path = os.environ.get("SCONS_CACHE")
if scons_cache_path != None:
CacheDir(scons_cache_path)
print("Scons cache enabled... (path: '" + scons_cache_path + "')")
Export('env')
Export("env")
# build subdirs, the build order is dependent on link order.
@ -524,16 +621,16 @@ if selected_platform in platform_list:
SConscript("platform/" + selected_platform + "/SCsub") # build selected platform
# Microsoft Visual Studio Project Generation
if env['vsproj']:
env['CPPPATH'] = [Dir(path) for path in env['CPPPATH']]
if env["vsproj"]:
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
methods.generate_vs_project(env, GetOption("num_jobs"))
methods.generate_cpp_hint_file("cpp.hint")
# Check for the existence of headers
conf = Configure(env)
if ("check_c_headers" in env):
if "check_c_headers" in env:
for header in env["check_c_headers"]:
if (conf.CheckCHeader(header[0])):
if conf.CheckCHeader(header[0]):
env.AppendUnique(CPPDEFINES=[header[1]])
elif selected_platform != "":
@ -554,118 +651,9 @@ elif selected_platform != "":
else:
sys.exit(255)
# The following only makes sense when the env is defined, and assumes it is
if 'env' in locals():
screen = sys.stdout
# Progress reporting is not available in non-TTY environments since it
# messes with the output (for example, when writing to a file)
show_progress = (env['progress'] and sys.stdout.isatty())
node_count = 0
node_count_max = 0
node_count_interval = 1
node_count_fname = str(env.Dir('#')) + '/.scons_node_count'
import time, math
class cache_progress:
# The default is 1 GB cache and 12 hours half life
def __init__(self, path = None, limit = 1073741824, half_life = 43200):
self.path = path
self.limit = limit
self.exponent_scale = math.log(2) / half_life
if env['verbose'] and path != None:
screen.write('Current cache limit is ' + self.convert_size(limit) + ' (used: ' + self.convert_size(self.get_size(path)) + ')\n')
self.delete(self.file_list())
def __call__(self, node, *args, **kw):
global node_count, node_count_max, node_count_interval, node_count_fname, show_progress
if show_progress:
# Print the progress percentage
node_count += node_count_interval
if (node_count_max > 0 and node_count <= node_count_max):
screen.write('\r[%3d%%] ' % (node_count * 100 / node_count_max))
screen.flush()
elif (node_count_max > 0 and node_count > node_count_max):
screen.write('\r[100%] ')
screen.flush()
else:
screen.write('\r[Initial build] ')
screen.flush()
def delete(self, files):
if len(files) == 0:
return
if env['verbose']:
# Utter something
screen.write('\rPurging %d %s from cache...\n' % (len(files), len(files) > 1 and 'files' or 'file'))
[os.remove(f) for f in files]
def file_list(self):
if self.path is None:
# Nothing to do
return []
# Gather a list of (filename, (size, atime)) within the
# cache directory
file_stat = [(x, os.stat(x)[6:8]) for x in glob.glob(os.path.join(self.path, '*', '*'))]
if file_stat == []:
# Nothing to do
return []
# Weight the cache files by size (assumed to be roughly
# proportional to the recompilation time) times an exponential
# decay since the ctime, and return a list with the entries
# (filename, size, weight).
current_time = time.time()
file_stat = [(x[0], x[1][0], (current_time - x[1][1])) for x in file_stat]
# Sort by the most recently accessed files (most sensible to keep) first
file_stat.sort(key=lambda x: x[2])
# Search for the first entry where the storage limit is
# reached
sum, mark = 0, None
for i,x in enumerate(file_stat):
sum += x[1]
if sum > self.limit:
mark = i
break
if mark is None:
return []
else:
return [x[0] for x in file_stat[mark:]]
def convert_size(self, size_bytes):
if size_bytes == 0:
return "0 bytes"
size_name = ("bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB")
i = int(math.floor(math.log(size_bytes, 1024)))
p = math.pow(1024, i)
s = round(size_bytes / p, 2)
return "%s %s" % (int(s) if i == 0 else s, size_name[i])
def get_size(self, start_path = '.'):
total_size = 0
for dirpath, dirnames, filenames in os.walk(start_path):
for f in filenames:
fp = os.path.join(dirpath, f)
total_size += os.path.getsize(fp)
return total_size
def progress_finish(target, source, env):
global node_count, progressor
with open(node_count_fname, 'w') as f:
f.write('%d\n' % node_count)
progressor.delete(progressor.file_list())
try:
with open(node_count_fname) as f:
node_count_max = int(f.readline())
except:
pass
cache_directory = os.environ.get("SCONS_CACHE")
# Simple cache pruning, attached to SCons' progress callback. Trim the
# cache directory to a size not larger than cache_limit.
cache_limit = float(os.getenv("SCONS_CACHE_LIMIT", 1024)) * 1024 * 1024
progressor = cache_progress(cache_directory, cache_limit)
Progress(progressor, interval = node_count_interval)
progress_finish_command = Command('progress_finish', [], progress_finish)
AlwaysBuild(progress_finish_command)
# The following only makes sense when the 'env' is defined, and assumes it is.
if "env" in locals():
methods.show_progress(env)
# TODO: replace this with `env.Dump(format="json")`
# once we start requiring SCons 4.0 as min version.
methods.dump(env)

View File

@ -1,68 +1,97 @@
import sys
if sys.version_info < (3,):
def isbasestring(s):
return isinstance(s, basestring)
def open_utf8(filename, mode):
return open(filename, mode)
def byte_to_str(x):
return str(ord(x))
import cStringIO
def StringIO():
return cStringIO.StringIO()
def encode_utf8(x):
return x
def decode_utf8(x):
return x
def iteritems(d):
return d.iteritems()
def itervalues(d):
return d.itervalues()
def escape_string(s):
if isinstance(s, unicode):
s = s.encode('ascii')
result = ''
s = s.encode("ascii")
result = ""
for c in s:
if not (32 <= ord(c) < 127) or c in ('\\', '"'):
result += '\\%03o' % ord(c)
if not (32 <= ord(c) < 127) or c in ("\\", '"'):
result += "\\%03o" % ord(c)
else:
result += c
return result
def qualname(obj):
# Not properly equivalent to __qualname__ in py3, but it doesn't matter.
return obj.__name__
else:
def isbasestring(s):
return isinstance(s, (str, bytes))
def open_utf8(filename, mode):
return open(filename, mode, encoding="utf-8")
def byte_to_str(x):
return str(x)
import io
def StringIO():
return io.StringIO()
import codecs
def encode_utf8(x):
return codecs.utf_8_encode(x)[0]
def decode_utf8(x):
return codecs.utf_8_decode(x)[0]
def iteritems(d):
return iter(d.items())
def itervalues(d):
return iter(d.values())
def charcode_to_c_escapes(c):
rev_result = []
while c >= 256:
c, low = (c // 256, c % 256)
rev_result.append('\\%03o' % low)
rev_result.append('\\%03o' % c)
return ''.join(reversed(rev_result))
rev_result.append("\\%03o" % low)
rev_result.append("\\%03o" % c)
return "".join(reversed(rev_result))
def escape_string(s):
result = ''
result = ""
if isinstance(s, str):
s = s.encode('utf-8')
s = s.encode("utf-8")
for c in s:
if not(32 <= c < 127) or c in (ord('\\'), ord('"')):
if not (32 <= c < 127) or c in (ord("\\"), ord('"')):
result += charcode_to_c_escapes(c)
else:
result += chr(c)
return result
def qualname(obj):
return obj.__qualname__

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
import core_builders
import make_binders
@ -11,31 +11,32 @@ env.core_sources = []
# Generate AES256 script encryption key
import os
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
if "SCRIPT_AES256_ENCRYPTION_KEY" in os.environ:
e = os.environ["SCRIPT_AES256_ENCRYPTION_KEY"]
txt = ""
ec_valid = True
if (len(e) != 64):
if len(e) != 64:
ec_valid = False
else:
for i in range(len(e) >> 1):
if (i > 0):
if i > 0:
txt += ","
txts = "0x" + e[i * 2:i * 2 + 2]
txts = "0x" + e[i * 2 : i * 2 + 2]
try:
int(txts, 16)
except:
ec_valid = False
txt += txts
if (not ec_valid):
if not ec_valid:
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
print("Invalid AES256 encryption key, not 64 bits hex: " + e)
# NOTE: It is safe to generate this file here, since this is still executed serially
with open("script_encryption_key.gen.cpp", "w") as f:
f.write("#include \"core/project_settings.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
f.write('#include "core/project_settings.h"\nuint8_t script_encryption_key[32]={' + txt + "};\n")
# Add required thirdparty code.
@ -49,7 +50,6 @@ thirdparty_misc_sources = [
# C sources
"fastlz.c",
"smaz.c",
# C++ sources
"hq2x.cpp",
"pcg.cpp",
@ -60,30 +60,30 @@ thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_mis
env_thirdparty.add_source_files(env.core_sources, thirdparty_misc_sources)
# Zlib library, can be unbundled
if env['builtin_zlib']:
thirdparty_zlib_dir = "#thirdparty/zlib/"
thirdparty_zlib_sources = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
]
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
if env["builtin_zlib"]:
thirdparty_zlib_dir = "#thirdparty/zlib/"
thirdparty_zlib_sources = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
]
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
# Needs to be available in main env too
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
if (env['target'] == 'debug'):
env_thirdparty.Append(CPPDEFINES=['ZLIB_DEBUG'])
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
# Needs to be available in main env too
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
if env["target"] == "debug":
env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"])
env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources)
env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources)
# Minizip library, could be unbundled in theory
# However, our version has some custom modifications, so it won't compile with the system one
@ -99,7 +99,7 @@ env_thirdparty.add_source_files(env.core_sources, thirdparty_minizip_sources)
# Zstd library, can be unbundled in theory
# though we currently use some private symbols
# https://github.com/godotengine/godot/issues/17374
if env['builtin_zstd']:
if env["builtin_zstd"]:
thirdparty_zstd_dir = "#thirdparty/zstd/"
thirdparty_zstd_sources = [
"common/debug.c",
@ -142,30 +142,43 @@ if env['builtin_zstd']:
env.add_source_files(env.core_sources, "*.cpp")
# Certificates
env.Depends("#core/io/certs_compressed.gen.h", ["#thirdparty/certs/ca-certificates.crt", env.Value(env['builtin_certs']), env.Value(env['system_certs_path'])])
env.CommandNoCache("#core/io/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", run_in_subprocess(core_builders.make_certs_header))
env.Depends(
"#core/io/certs_compressed.gen.h",
["#thirdparty/certs/ca-certificates.crt", env.Value(env["builtin_certs"]), env.Value(env["system_certs_path"])],
)
env.CommandNoCache(
"#core/io/certs_compressed.gen.h",
"#thirdparty/certs/ca-certificates.crt",
run_in_subprocess(core_builders.make_certs_header),
)
# Make binders
env.CommandNoCache(['method_bind.gen.inc', 'method_bind_ext.gen.inc', 'method_bind_free_func.gen.inc'], 'make_binders.py', run_in_subprocess(make_binders.run))
env.CommandNoCache(
["method_bind.gen.inc", "method_bind_ext.gen.inc", "method_bind_free_func.gen.inc"],
"make_binders.py",
run_in_subprocess(make_binders.run),
)
# Authors
env.Depends('#core/authors.gen.h', "../AUTHORS.md")
env.CommandNoCache('#core/authors.gen.h', "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header))
env.Depends("#core/authors.gen.h", "../AUTHORS.md")
env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header))
# Donors
env.Depends('#core/donors.gen.h', "../DONORS.md")
env.CommandNoCache('#core/donors.gen.h', "../DONORS.md", run_in_subprocess(core_builders.make_donors_header))
env.Depends("#core/donors.gen.h", "../DONORS.md")
env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", run_in_subprocess(core_builders.make_donors_header))
# License
env.Depends('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header))
env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache(
"#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header)
)
# Chain load SCsubs
SConscript('os/SCsub')
SConscript('math/SCsub')
SConscript('crypto/SCsub')
SConscript('io/SCsub')
SConscript('bind/SCsub')
SConscript("os/SCsub")
SConscript("math/SCsub")
SConscript("crypto/SCsub")
SConscript("io/SCsub")
SConscript("bind/SCsub")
# Build it all as a library

View File

@ -223,59 +223,49 @@ Array Array::duplicate(bool p_deep) const {
return new_arr;
}
int Array::_fix_slice_index(int p_index, int p_arr_len, int p_top_mod) {
p_index = CLAMP(p_index, -p_arr_len, p_arr_len + p_top_mod);
if (p_index < 0) {
p_index = (p_index % p_arr_len + p_arr_len) % p_arr_len; // positive modulo
int Array::_clamp_slice_index(int p_index) const {
int arr_size = size();
int fixed_index = CLAMP(p_index, -arr_size, arr_size - 1);
if (fixed_index < 0) {
fixed_index = arr_size + fixed_index;
}
return p_index;
return fixed_index;
}
int Array::_clamp_index(int p_index) const {
return CLAMP(p_index, -size() + 1, size() - 1);
}
#define ARRAY_GET_DEEP(idx, is_deep) is_deep ? get(idx).duplicate(is_deep) : get(idx)
Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const { // like python, but inclusive on upper bound
Array new_arr;
ERR_FAIL_COND_V_MSG(p_step == 0, new_arr, "Array slice step size cannot be zero.");
if (empty()) // Don't try to slice empty arrays.
return new_arr;
p_begin = Array::_fix_slice_index(p_begin, size(), -1); // can't start out of range
p_end = Array::_fix_slice_index(p_end, size(), 0);
int x = p_begin;
int new_arr_i = 0;
ERR_FAIL_COND_V(p_step == 0, new_arr);
if (Array::_clamp_index(p_begin) == Array::_clamp_index(p_end)) { // don't include element twice
new_arr.resize(1);
// new_arr[0] = 1;
new_arr[0] = ARRAY_GET_DEEP(Array::_clamp_index(p_begin), p_deep);
return new_arr;
} else {
int element_count = ceil((int)MAX(0, (p_end - p_begin) / p_step)) + 1;
if (element_count == 1) { // delta going in wrong direction to reach end
new_arr.resize(0);
if (p_step > 0) {
if (p_begin >= size() || p_end < -size())
return new_arr;
} else { // p_step < 0
if (p_begin < -size() || p_end >= size())
return new_arr;
}
new_arr.resize(element_count);
}
// if going backwards, have to have a different terminating condition
if (p_step < 0) {
while (x >= p_end) {
new_arr[new_arr_i] = ARRAY_GET_DEEP(Array::_clamp_index(x), p_deep);
x += p_step;
new_arr_i += 1;
int begin = _clamp_slice_index(p_begin);
int end = _clamp_slice_index(p_end);
int new_arr_size = MAX(((end - begin + p_step) / p_step), 0);
new_arr.resize(new_arr_size);
if (p_step > 0) {
int dest_idx = 0;
for (int idx = begin; idx <= end; idx += p_step) {
ERR_FAIL_COND_V_MSG(dest_idx < 0 || dest_idx >= new_arr_size, Array(), "Bug in Array slice()");
new_arr[dest_idx++] = p_deep ? get(idx).duplicate(p_deep) : get(idx);
}
} else if (p_step > 0) {
while (x <= p_end) {
new_arr[new_arr_i] = ARRAY_GET_DEEP(Array::_clamp_index(x), p_deep);
x += p_step;
new_arr_i += 1;
} else { // p_step < 0
int dest_idx = 0;
for (int idx = begin; idx >= end; idx += p_step) {
ERR_FAIL_COND_V_MSG(dest_idx < 0 || dest_idx >= new_arr_size, Array(), "Bug in Array slice()");
new_arr[dest_idx++] = p_deep ? get(idx).duplicate(p_deep) : get(idx);
}
}

View File

@ -44,8 +44,7 @@ class Array {
void _ref(const Array &p_from) const;
void _unref() const;
int _clamp_index(int p_index) const;
static int _fix_slice_index(int p_index, int p_arr_len, int p_top_mod);
inline int _clamp_slice_index(int p_index) const;
public:
Variant &operator[](int p_idx);

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")

View File

@ -320,6 +320,14 @@ int _OS::get_screen_dpi(int p_screen) const {
return OS::get_singleton()->get_screen_dpi(p_screen);
}
float _OS::get_screen_scale(int p_screen) const {
return OS::get_singleton()->get_screen_scale(p_screen);
}
float _OS::get_screen_max_scale() const {
return OS::get_singleton()->get_screen_max_scale();
}
Point2 _OS::get_window_position() const {
return OS::get_singleton()->get_window_position();
}
@ -489,6 +497,11 @@ String _OS::get_executable_path() const {
Error _OS::shell_open(String p_uri) {
if (p_uri.begins_with("res://")) {
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
} else if (p_uri.begins_with("user://")) {
WARN_PRINT("Attempting to open an URL with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
}
return OS::get_singleton()->shell_open(p_uri);
};
@ -564,6 +577,26 @@ String _OS::get_latin_keyboard_variant() const {
}
}
int _OS::keyboard_get_layout_count() const {
return OS::get_singleton()->keyboard_get_layout_count();
}
int _OS::keyboard_get_current_layout() const {
return OS::get_singleton()->keyboard_get_current_layout();
}
void _OS::keyboard_set_current_layout(int p_index) {
OS::get_singleton()->keyboard_set_current_layout(p_index);
}
String _OS::keyboard_get_layout_language(int p_index) const {
return OS::get_singleton()->keyboard_get_layout_language(p_index);
}
String _OS::keyboard_get_layout_name(int p_index) const {
return OS::get_singleton()->keyboard_get_layout_name(p_index);
}
String _OS::get_model_name() const {
return OS::get_singleton()->get_model_name();
@ -843,7 +876,7 @@ Dictionary _OS::get_datetime_from_unix_time(int64_t unix_time_val) const {
} else {
dayno = (unix_time_val - SECS_DAY + 1) / SECS_DAY;
dayclock = unix_time_val - dayno * SECS_DAY;
date.weekday = static_cast<OS::Weekday>((dayno - 3) % 7 + 7);
date.weekday = static_cast<OS::Weekday>(((dayno % 7) + 11) % 7);
do {
year--;
dayno += YEARSIZE(year);
@ -1035,8 +1068,8 @@ bool _OS::has_virtual_keyboard() const {
return OS::get_singleton()->has_virtual_keyboard();
}
void _OS::show_virtual_keyboard(const String &p_existing_text) {
OS::get_singleton()->show_virtual_keyboard(p_existing_text, Rect2());
void _OS::show_virtual_keyboard(const String &p_existing_text, bool p_multiline) {
OS::get_singleton()->show_virtual_keyboard(p_existing_text, Rect2(), p_multiline);
}
void _OS::hide_virtual_keyboard() {
@ -1173,6 +1206,22 @@ Vector<String> _OS::get_granted_permissions() const {
return OS::get_singleton()->get_granted_permissions();
}
int _OS::get_tablet_driver_count() const {
return OS::get_singleton()->get_tablet_driver_count();
}
String _OS::get_tablet_driver_name(int p_driver) const {
return OS::get_singleton()->get_tablet_driver_name(p_driver);
}
String _OS::get_current_tablet_driver() const {
return OS::get_singleton()->get_current_tablet_driver();
}
void _OS::set_current_tablet_driver(const String &p_driver) {
OS::get_singleton()->set_current_tablet_driver(p_driver);
}
_OS *_OS::singleton = NULL;
void _OS::_bind_methods() {
@ -1211,6 +1260,8 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_screen_position", "screen"), &_OS::get_screen_position, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_screen_size", "screen"), &_OS::get_screen_size, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_screen_dpi", "screen"), &_OS::get_screen_dpi, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_screen_scale", "screen"), &_OS::get_screen_scale, DEFVAL(-1));
ClassDB::bind_method(D_METHOD("get_screen_max_scale"), &_OS::get_screen_max_scale);
ClassDB::bind_method(D_METHOD("get_window_position"), &_OS::get_window_position);
ClassDB::bind_method(D_METHOD("set_window_position", "position"), &_OS::set_window_position);
ClassDB::bind_method(D_METHOD("get_window_size"), &_OS::get_window_size);
@ -1302,6 +1353,12 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_latin_keyboard_variant"), &_OS::get_latin_keyboard_variant);
ClassDB::bind_method(D_METHOD("get_model_name"), &_OS::get_model_name);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_count"), &_OS::keyboard_get_layout_count);
ClassDB::bind_method(D_METHOD("keyboard_get_current_layout"), &_OS::keyboard_get_current_layout);
ClassDB::bind_method(D_METHOD("keyboard_set_current_layout", "index"), &_OS::keyboard_set_current_layout);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_language", "index"), &_OS::keyboard_get_layout_language);
ClassDB::bind_method(D_METHOD("keyboard_get_layout_name", "index"), &_OS::keyboard_get_layout_name);
ClassDB::bind_method(D_METHOD("can_draw"), &_OS::can_draw);
ClassDB::bind_method(D_METHOD("is_userfs_persistent"), &_OS::is_userfs_persistent);
ClassDB::bind_method(D_METHOD("is_stdout_verbose"), &_OS::is_stdout_verbose);
@ -1315,7 +1372,7 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("dump_memory_to_file", "file"), &_OS::dump_memory_to_file);
ClassDB::bind_method(D_METHOD("dump_resources_to_file", "file"), &_OS::dump_resources_to_file);
ClassDB::bind_method(D_METHOD("has_virtual_keyboard"), &_OS::has_virtual_keyboard);
ClassDB::bind_method(D_METHOD("show_virtual_keyboard", "existing_text"), &_OS::show_virtual_keyboard, DEFVAL(""));
ClassDB::bind_method(D_METHOD("show_virtual_keyboard", "existing_text", "multiline"), &_OS::show_virtual_keyboard, DEFVAL(""), DEFVAL(false));
ClassDB::bind_method(D_METHOD("hide_virtual_keyboard"), &_OS::hide_virtual_keyboard);
ClassDB::bind_method(D_METHOD("get_virtual_keyboard_height"), &_OS::get_virtual_keyboard_height);
ClassDB::bind_method(D_METHOD("print_resources_in_use", "short"), &_OS::print_resources_in_use, DEFVAL(false));
@ -1366,6 +1423,13 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("request_permissions"), &_OS::request_permissions);
ClassDB::bind_method(D_METHOD("get_granted_permissions"), &_OS::get_granted_permissions);
ClassDB::bind_method(D_METHOD("get_tablet_driver_count"), &_OS::get_tablet_driver_count);
ClassDB::bind_method(D_METHOD("get_tablet_driver_name", "idx"), &_OS::get_tablet_driver_name);
ClassDB::bind_method(D_METHOD("get_current_tablet_driver"), &_OS::get_current_tablet_driver);
ClassDB::bind_method(D_METHOD("set_current_tablet_driver", "name"), &_OS::set_current_tablet_driver);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "tablet_driver"), "set_current_tablet_driver", "get_current_tablet_driver");
ADD_PROPERTY(PropertyInfo(Variant::STRING, "clipboard"), "set_clipboard", "get_clipboard");
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_screen"), "set_current_screen", "get_current_screen");
ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code");

View File

@ -178,6 +178,8 @@ public:
virtual Point2 get_screen_position(int p_screen = -1) const;
virtual Size2 get_screen_size(int p_screen = -1) const;
virtual int get_screen_dpi(int p_screen = -1) const;
virtual float get_screen_scale(int p_screen = -1) const;
virtual float get_screen_max_scale() const;
virtual Point2 get_window_position() const;
virtual void set_window_position(const Point2 &p_position);
virtual Size2 get_max_window_size() const;
@ -242,6 +244,11 @@ public:
String get_locale() const;
String get_latin_keyboard_variant() const;
int keyboard_get_layout_count() const;
int keyboard_get_current_layout() const;
void keyboard_set_current_layout(int p_index);
String keyboard_get_layout_language(int p_index) const;
String keyboard_get_layout_name(int p_index) const;
String get_model_name() const;
@ -249,7 +256,7 @@ public:
void dump_resources_to_file(const String &p_file);
bool has_virtual_keyboard() const;
void show_virtual_keyboard(const String &p_existing_text = "");
void show_virtual_keyboard(const String &p_existing_text = "", bool p_multiline = false);
void hide_virtual_keyboard();
int get_virtual_keyboard_height();
@ -359,6 +366,11 @@ public:
bool request_permissions();
Vector<String> get_granted_permissions() const;
int get_tablet_driver_count() const;
String get_tablet_driver_name(int p_driver) const;
String get_current_tablet_driver() const;
void set_current_tablet_driver(const String &p_driver);
static _OS *get_singleton() { return singleton; }
_OS();
@ -598,9 +610,9 @@ private:
bool _list_skip_hidden;
};
class _Marshalls : public Reference {
class _Marshalls : public Object {
GDCLASS(_Marshalls, Reference);
GDCLASS(_Marshalls, Object);
static _Marshalls *singleton;

View File

@ -16,6 +16,7 @@ def make_certs_header(target, source, env):
buf = f.read()
decomp_size = len(buf)
import zlib
buf = zlib.compress(buf)
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@ -23,9 +24,9 @@ def make_certs_header(target, source, env):
g.write("#define _CERTS_RAW_H\n")
# System certs path. Editor will use them if defined. (for package maintainers)
path = env['system_certs_path']
g.write("#define _SYSTEM_CERTS_PATH \"%s\"\n" % str(path))
if env['builtin_certs']:
path = env["system_certs_path"]
g.write('#define _SYSTEM_CERTS_PATH "%s"\n' % str(path))
if env["builtin_certs"]:
# Defined here and not in env so changing it does not trigger a full rebuild.
g.write("#define BUILTIN_CERTS_ENABLED\n")
g.write("static const int _certs_compressed_size = " + str(len(buf)) + ";\n")
@ -62,7 +63,7 @@ def make_authors_header(target, source, env):
for line in f:
if reading:
if line.startswith(" "):
g.write("\t\"" + escape_string(line.strip()) + "\",\n")
g.write('\t"' + escape_string(line.strip()) + '",\n')
continue
if line.startswith("## "):
if reading:
@ -85,10 +86,26 @@ def make_authors_header(target, source, env):
def make_donors_header(target, source, env):
sections = ["Platinum sponsors", "Gold sponsors", "Mini sponsors",
"Gold donors", "Silver donors", "Bronze donors"]
sections_id = ["DONORS_SPONSOR_PLAT", "DONORS_SPONSOR_GOLD", "DONORS_SPONSOR_MINI",
"DONORS_GOLD", "DONORS_SILVER", "DONORS_BRONZE"]
sections = [
"Platinum sponsors",
"Gold sponsors",
"Silver sponsors",
"Bronze sponsors",
"Mini sponsors",
"Gold donors",
"Silver donors",
"Bronze donors",
]
sections_id = [
"DONORS_SPONSOR_PLATINUM",
"DONORS_SPONSOR_GOLD",
"DONORS_SPONSOR_SILVER",
"DONORS_SPONSOR_BRONZE",
"DONORS_SPONSOR_MINI",
"DONORS_GOLD",
"DONORS_SILVER",
"DONORS_BRONZE",
]
src = source[0]
dst = target[0]
@ -108,7 +125,7 @@ def make_donors_header(target, source, env):
for line in f:
if reading >= 0:
if line.startswith(" "):
g.write("\t\"" + escape_string(line.strip()) + "\",\n")
g.write('\t"' + escape_string(line.strip()) + '",\n')
continue
if line.startswith("## "):
if reading:
@ -151,8 +168,8 @@ def make_license_header(target, source, env):
return line
def next_tag(self):
if not ':' in self.current:
return ('', [])
if not ":" in self.current:
return ("", [])
tag, line = self.current.split(":", 1)
lines = [line.strip()]
while self.next_line() and self.current.startswith(" "):
@ -160,6 +177,7 @@ def make_license_header(target, source, env):
return (tag, lines)
from collections import OrderedDict
projects = OrderedDict()
license_list = []
@ -200,26 +218,30 @@ def make_license_header(target, source, env):
with open_utf8(src_license, "r") as license_file:
for line in license_file:
escaped_string = escape_string(line.strip())
f.write("\n\t\t\"" + escaped_string + "\\n\"")
f.write('\n\t\t"' + escaped_string + '\\n"')
f.write(";\n\n")
f.write("struct ComponentCopyrightPart {\n"
"\tconst char *license;\n"
"\tconst char *const *files;\n"
"\tconst char *const *copyright_statements;\n"
"\tint file_count;\n"
"\tint copyright_count;\n"
"};\n\n")
f.write(
"struct ComponentCopyrightPart {\n"
"\tconst char *license;\n"
"\tconst char *const *files;\n"
"\tconst char *const *copyright_statements;\n"
"\tint file_count;\n"
"\tint copyright_count;\n"
"};\n\n"
)
f.write("struct ComponentCopyright {\n"
"\tconst char *name;\n"
"\tconst ComponentCopyrightPart *parts;\n"
"\tint part_count;\n"
"};\n\n")
f.write(
"struct ComponentCopyright {\n"
"\tconst char *name;\n"
"\tconst ComponentCopyrightPart *parts;\n"
"\tint part_count;\n"
"};\n\n"
)
f.write("const char *const COPYRIGHT_INFO_DATA[] = {\n")
for line in data_list:
f.write("\t\"" + escape_string(line) + "\",\n")
f.write('\t"' + escape_string(line) + '",\n')
f.write("};\n\n")
f.write("const ComponentCopyrightPart COPYRIGHT_PROJECT_PARTS[] = {\n")
@ -228,11 +250,21 @@ def make_license_header(target, source, env):
for project_name, project in iteritems(projects):
part_indexes[project_name] = part_index
for part in project:
f.write("\t{ \"" + escape_string(part["License"][0]) + "\", "
+ "&COPYRIGHT_INFO_DATA[" + str(part["file_index"]) + "], "
+ "&COPYRIGHT_INFO_DATA[" + str(part["copyright_index"]) + "], "
+ str(len(part["Files"])) + ", "
+ str(len(part["Copyright"])) + " },\n")
f.write(
'\t{ "'
+ escape_string(part["License"][0])
+ '", '
+ "&COPYRIGHT_INFO_DATA["
+ str(part["file_index"])
+ "], "
+ "&COPYRIGHT_INFO_DATA["
+ str(part["copyright_index"])
+ "], "
+ str(len(part["Files"]))
+ ", "
+ str(len(part["Copyright"]))
+ " },\n"
)
part_index += 1
f.write("};\n\n")
@ -240,30 +272,37 @@ def make_license_header(target, source, env):
f.write("const ComponentCopyright COPYRIGHT_INFO[] = {\n")
for project_name, project in iteritems(projects):
f.write("\t{ \"" + escape_string(project_name) + "\", "
+ "&COPYRIGHT_PROJECT_PARTS[" + str(part_indexes[project_name]) + "], "
+ str(len(project)) + " },\n")
f.write(
'\t{ "'
+ escape_string(project_name)
+ '", '
+ "&COPYRIGHT_PROJECT_PARTS["
+ str(part_indexes[project_name])
+ "], "
+ str(len(project))
+ " },\n"
)
f.write("};\n\n")
f.write("const int LICENSE_COUNT = " + str(len(license_list)) + ";\n")
f.write("const char *const LICENSE_NAMES[] = {\n")
for l in license_list:
f.write("\t\"" + escape_string(l[0]) + "\",\n")
f.write('\t"' + escape_string(l[0]) + '",\n')
f.write("};\n\n")
f.write("const char *const LICENSE_BODIES[] = {\n\n")
for l in license_list:
for line in l[1:]:
if line == ".":
f.write("\t\"\\n\"\n")
f.write('\t"\\n"\n')
else:
f.write("\t\"" + escape_string(line) + "\\n\"\n")
f.write("\t\"\",\n\n")
f.write('\t"' + escape_string(line) + '\\n"\n')
f.write('\t"",\n\n')
f.write("};\n\n")
f.write("#endif\n")
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())

View File

@ -252,7 +252,9 @@ Error CowData<T>::resize(int p_size) {
ERR_FAIL_COND_V(p_size < 0, ERR_INVALID_PARAMETER);
if (p_size == size())
int current_size = size();
if (p_size == current_size)
return OK;
if (p_size == 0) {
@ -265,24 +267,27 @@ Error CowData<T>::resize(int p_size) {
// possibly changing size, copy on write
_copy_on_write();
size_t current_alloc_size = _get_alloc_size(current_size);
size_t alloc_size;
ERR_FAIL_COND_V(!_get_alloc_size_checked(p_size, &alloc_size), ERR_OUT_OF_MEMORY);
if (p_size > size()) {
if (p_size > current_size) {
if (size() == 0) {
// alloc from scratch
uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true);
ERR_FAIL_COND_V(!ptr, ERR_OUT_OF_MEMORY);
*(ptr - 1) = 0; //size, currently none
*(ptr - 2) = 1; //refcount
if (alloc_size != current_alloc_size) {
if (current_size == 0) {
// alloc from scratch
uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true);
ERR_FAIL_COND_V(!ptr, ERR_OUT_OF_MEMORY);
*(ptr - 1) = 0; //size, currently none
*(ptr - 2) = 1; //refcount
_ptr = (T *)ptr;
_ptr = (T *)ptr;
} else {
void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true);
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
_ptr = (T *)(_ptrnew);
} else {
void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true);
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
_ptr = (T *)(_ptrnew);
}
}
// construct the newly created elements
@ -297,7 +302,7 @@ Error CowData<T>::resize(int p_size) {
*_get_size() = p_size;
} else if (p_size < size()) {
} else if (p_size < current_size) {
if (!__has_trivial_destructor(T)) {
// deinitialize no longer needed elements
@ -307,10 +312,12 @@ Error CowData<T>::resize(int p_size) {
}
}
void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true);
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
if (alloc_size != current_alloc_size) {
void *_ptrnew = (T *)Memory::realloc_static(_ptr, alloc_size, true);
ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY);
_ptr = (T *)(_ptrnew);
_ptr = (T *)(_ptrnew);
}
*_get_size() = p_size;
}

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_crypto = env.Clone()
@ -22,7 +22,9 @@ if not has_module:
env_thirdparty = env_crypto.Clone()
env_thirdparty.disable_warnings()
# Custom config file
env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')])
env_thirdparty.Append(
CPPDEFINES=[("MBEDTLS_CONFIG_FILE", '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]
)
thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/"
thirdparty_mbedtls_sources = [
"aes.c",
@ -30,7 +32,7 @@ if not has_module:
"md5.c",
"sha1.c",
"sha256.c",
"godot_core_mbedtls_platform.c"
"godot_core_mbedtls_platform.c",
]
thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources]
env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources)

View File

@ -67,7 +67,7 @@ Crypto *(*Crypto::_create)() = NULL;
Crypto *Crypto::create() {
if (_create)
return _create();
return memnew(Crypto);
ERR_FAIL_V_MSG(NULL, "Crypto is not available when the mbedtls module is disabled.");
}
void Crypto::load_default_certificates(String p_path) {
@ -82,18 +82,6 @@ void Crypto::_bind_methods() {
ClassDB::bind_method(D_METHOD("generate_self_signed_certificate", "key", "issuer_name", "not_before", "not_after"), &Crypto::generate_self_signed_certificate, DEFVAL("CN=myserver,O=myorganisation,C=IT"), DEFVAL("20140101000000"), DEFVAL("20340101000000"));
}
PoolByteArray Crypto::generate_random_bytes(int p_bytes) {
ERR_FAIL_V_MSG(PoolByteArray(), "generate_random_bytes is not available when mbedtls module is disabled.");
}
Ref<CryptoKey> Crypto::generate_rsa(int p_bytes) {
ERR_FAIL_V_MSG(NULL, "generate_rsa is not available when mbedtls module is disabled.");
}
Ref<X509Certificate> Crypto::generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) {
ERR_FAIL_V_MSG(NULL, "generate_self_signed_certificate is not available when mbedtls module is disabled.");
}
Crypto::Crypto() {
}

View File

@ -76,16 +76,14 @@ public:
static Crypto *create();
static void load_default_certificates(String p_path);
virtual PoolByteArray generate_random_bytes(int p_bytes);
virtual Ref<CryptoKey> generate_rsa(int p_bytes);
virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after);
virtual PoolByteArray generate_random_bytes(int p_bytes) = 0;
virtual Ref<CryptoKey> generate_rsa(int p_bytes) = 0;
virtual Ref<X509Certificate> generate_self_signed_certificate(Ref<CryptoKey> p_key, String p_issuer_name, String p_not_before, String p_not_after) = 0;
Crypto();
};
class ResourceFormatLoaderCrypto : public ResourceFormatLoader {
GDCLASS(ResourceFormatLoaderCrypto, ResourceFormatLoader);
public:
virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
@ -94,8 +92,6 @@ public:
};
class ResourceFormatSaverCrypto : public ResourceFormatSaver {
GDCLASS(ResourceFormatSaverCrypto, ResourceFormatSaver);
public:
virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0);
virtual void get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const;

View File

@ -60,7 +60,7 @@ void Engine::set_target_fps(int p_fps) {
_target_fps = p_fps > 0 ? p_fps : 0;
}
float Engine::get_target_fps() const {
int Engine::get_target_fps() const {
return _target_fps;
}
@ -163,8 +163,10 @@ Array Engine::get_copyright_info() const {
Dictionary Engine::get_donor_info() const {
Dictionary donors;
donors["platinum_sponsors"] = array_from_info(DONORS_SPONSOR_PLAT);
donors["platinum_sponsors"] = array_from_info(DONORS_SPONSOR_PLATINUM);
donors["gold_sponsors"] = array_from_info(DONORS_SPONSOR_GOLD);
donors["silver_sponsors"] = array_from_info(DONORS_SPONSOR_SILVER);
donors["bronze_sponsors"] = array_from_info(DONORS_SPONSOR_BRONZE);
donors["mini_sponsors"] = array_from_info(DONORS_SPONSOR_MINI);
donors["gold_donors"] = array_from_info(DONORS_GOLD);
donors["silver_donors"] = array_from_info(DONORS_SILVER);

View File

@ -85,7 +85,7 @@ public:
float get_physics_jitter_fix() const;
virtual void set_target_fps(int p_fps);
virtual float get_target_fps() const;
virtual int get_target_fps() const;
virtual float get_frames_per_second() const { return _fps; }

View File

@ -392,6 +392,7 @@ void register_global_constants() {
BIND_GLOBAL_ENUM_CONSTANT(BUTTON_MASK_XBUTTON2);
//joypads
BIND_GLOBAL_ENUM_CONSTANT(JOY_INVALID_OPTION);
BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_0);
BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_1);
BIND_GLOBAL_ENUM_CONSTANT(JOY_BUTTON_2);

View File

@ -294,14 +294,14 @@ public:
const TData &get(const TKey &p_key) const {
const TData *res = getptr(p_key);
ERR_FAIL_COND_V(!res, *res);
CRASH_COND_MSG(!res, "Map key not found.");
return *res;
}
TData &get(const TKey &p_key) {
TData *res = getptr(p_key);
ERR_FAIL_COND_V(!res, *res);
CRASH_COND_MSG(!res, "Map key not found.");
return *res;
}

View File

@ -30,6 +30,7 @@
#include "image.h"
#include "core/error_macros.h"
#include "core/hash_map.h"
#include "core/io/image_loader.h"
#include "core/io/resource_loader.h"
@ -85,6 +86,8 @@ const char *Image::format_names[Image::FORMAT_MAX] = {
SavePNGFunc Image::save_png_func = NULL;
SaveEXRFunc Image::save_exr_func = NULL;
SavePNGBufferFunc Image::save_png_buffer_func = NULL;
void Image::_put_pixelb(int p_x, int p_y, uint32_t p_pixelsize, uint8_t *p_data, const uint8_t *p_pixel) {
uint32_t ofs = (p_y * width + p_x) * p_pixelsize;
@ -617,34 +620,35 @@ static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict
enum {
FRAC_BITS = 8,
FRAC_LEN = (1 << FRAC_BITS),
FRAC_HALF = (FRAC_LEN >> 1),
FRAC_MASK = FRAC_LEN - 1
};
for (uint32_t i = 0; i < p_dst_height; i++) {
uint32_t src_yofs_up_fp = (i * p_src_height * FRAC_LEN / p_dst_height);
uint32_t src_yofs_frac = src_yofs_up_fp & FRAC_MASK;
uint32_t src_yofs_up = src_yofs_up_fp >> FRAC_BITS;
uint32_t src_yofs_down = (i + 1) * p_src_height / p_dst_height;
if (src_yofs_down >= p_src_height)
// Add 0.5 in order to interpolate based on pixel center
uint32_t src_yofs_up_fp = (i + 0.5) * p_src_height * FRAC_LEN / p_dst_height;
// Calculate nearest src pixel center above current, and truncate to get y index
uint32_t src_yofs_up = src_yofs_up_fp >= FRAC_HALF ? (src_yofs_up_fp - FRAC_HALF) >> FRAC_BITS : 0;
uint32_t src_yofs_down = (src_yofs_up_fp + FRAC_HALF) >> FRAC_BITS;
if (src_yofs_down >= p_src_height) {
src_yofs_down = p_src_height - 1;
//src_yofs_up*=CC;
//src_yofs_down*=CC;
}
// Calculate distance to pixel center of src_yofs_up
uint32_t src_yofs_frac = src_yofs_up_fp & FRAC_MASK;
src_yofs_frac = src_yofs_frac >= FRAC_HALF ? src_yofs_frac - FRAC_HALF : src_yofs_frac + FRAC_HALF;
uint32_t y_ofs_up = src_yofs_up * p_src_width * CC;
uint32_t y_ofs_down = src_yofs_down * p_src_width * CC;
for (uint32_t j = 0; j < p_dst_width; j++) {
uint32_t src_xofs_left_fp = (j * p_src_width * FRAC_LEN / p_dst_width);
uint32_t src_xofs_frac = src_xofs_left_fp & FRAC_MASK;
uint32_t src_xofs_left = src_xofs_left_fp >> FRAC_BITS;
uint32_t src_xofs_right = (j + 1) * p_src_width / p_dst_width;
if (src_xofs_right >= p_src_width)
uint32_t src_xofs_left_fp = (j + 0.5) * p_src_width * FRAC_LEN / p_dst_width;
uint32_t src_xofs_left = src_xofs_left_fp >= FRAC_HALF ? (src_xofs_left_fp - FRAC_HALF) >> FRAC_BITS : 0;
uint32_t src_xofs_right = (src_xofs_left_fp + FRAC_HALF) >> FRAC_BITS;
if (src_xofs_right >= p_src_width) {
src_xofs_right = p_src_width - 1;
}
uint32_t src_xofs_frac = src_xofs_left_fp & FRAC_MASK;
src_xofs_frac = src_xofs_frac >= FRAC_HALF ? src_xofs_frac - FRAC_HALF : src_xofs_frac + FRAC_HALF;
src_xofs_left *= CC;
src_xofs_right *= CC;
@ -869,6 +873,9 @@ void Image::resize_to_po2(bool p_square) {
int w = next_power_of_2(width);
int h = next_power_of_2(height);
if (p_square) {
w = h = MAX(w, h);
}
if (w == width && h == height) {
@ -1448,6 +1455,8 @@ Error Image::generate_mipmaps(bool p_renormalize) {
ERR_FAIL_COND_V_MSG(!_can_modify(format), ERR_UNAVAILABLE, "Cannot generate mipmaps in compressed or custom image formats.");
ERR_FAIL_COND_V_MSG(format == FORMAT_RGBA4444 || format == FORMAT_RGBA5551, ERR_UNAVAILABLE, "Cannot generate mipmaps in custom image formats.");
ERR_FAIL_COND_V_MSG(width == 0 || height == 0, ERR_UNCONFIGURED, "Cannot generate mipmaps with width or height equal to 0.");
int mmcount;
@ -1573,9 +1582,11 @@ PoolVector<uint8_t> Image::get_data() const {
}
void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format) {
ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH);
ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT);
ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0.");
ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0.");
ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + ".");
ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + ".");
ERR_FAIL_COND_MSG(write_lock.ptr(), "Cannot create image when it is locked.");
int mm = 0;
int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0);
@ -1592,9 +1603,10 @@ void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_forma
}
void Image::create(int p_width, int p_height, bool p_use_mipmaps, Format p_format, const PoolVector<uint8_t> &p_data) {
ERR_FAIL_INDEX(p_width - 1, MAX_WIDTH);
ERR_FAIL_INDEX(p_height - 1, MAX_HEIGHT);
ERR_FAIL_COND_MSG(p_width <= 0, "Image width must be greater than 0.");
ERR_FAIL_COND_MSG(p_height <= 0, "Image height must be greater than 0.");
ERR_FAIL_COND_MSG(p_width > MAX_WIDTH, "Image width cannot be greater than " + itos(MAX_WIDTH) + ".");
ERR_FAIL_COND_MSG(p_height > MAX_HEIGHT, "Image height cannot be greater than " + itos(MAX_HEIGHT) + ".");
int mm;
int size = _get_dst_image_size(p_width, p_height, p_format, mm, p_use_mipmaps ? -1 : 0);
@ -1893,6 +1905,14 @@ Error Image::save_png(const String &p_path) const {
return save_png_func(p_path, Ref<Image>((Image *)this));
}
PoolVector<uint8_t> Image::save_png_to_buffer() const {
if (save_png_buffer_func == NULL) {
return PoolVector<uint8_t>();
}
return save_png_buffer_func(Ref<Image>((Image *)this));
}
Error Image::save_exr(const String &p_path, bool p_grayscale) const {
if (save_exr_func == NULL)
@ -2208,12 +2228,11 @@ void Image::blend_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const P
int dst_y = dest_rect.position.y + i;
Color sc = img->get_pixel(src_x, src_y);
Color dc = get_pixel(dst_x, dst_y);
dc.r = (double)(sc.a * sc.r + dc.a * (1.0 - sc.a) * dc.r);
dc.g = (double)(sc.a * sc.g + dc.a * (1.0 - sc.a) * dc.g);
dc.b = (double)(sc.a * sc.b + dc.a * (1.0 - sc.a) * dc.b);
dc.a = (double)(sc.a + dc.a * (1.0 - sc.a));
set_pixel(dst_x, dst_y, dc);
if (sc.a != 0) {
Color dc = get_pixel(dst_x, dst_y);
dc = dc.blend(sc);
set_pixel(dst_x, dst_y, dc);
}
}
}
@ -2270,12 +2289,11 @@ void Image::blend_rect_mask(const Ref<Image> &p_src, const Ref<Image> &p_mask, c
int dst_y = dest_rect.position.y + i;
Color sc = img->get_pixel(src_x, src_y);
Color dc = get_pixel(dst_x, dst_y);
dc.r = (double)(sc.a * sc.r + dc.a * (1.0 - sc.a) * dc.r);
dc.g = (double)(sc.a * sc.g + dc.a * (1.0 - sc.a) * dc.g);
dc.b = (double)(sc.a * sc.b + dc.a * (1.0 - sc.a) * dc.b);
dc.a = (double)(sc.a + dc.a * (1.0 - sc.a));
set_pixel(dst_x, dst_y, dc);
if (sc.a != 0) {
Color dc = get_pixel(dst_x, dst_y);
dc = dc.blend(sc);
set_pixel(dst_x, dst_y, dc);
}
}
}
}
@ -2316,6 +2334,7 @@ void Image::fill(const Color &c) {
ImageMemLoadFunc Image::_png_mem_loader_func = NULL;
ImageMemLoadFunc Image::_jpg_mem_loader_func = NULL;
ImageMemLoadFunc Image::_webp_mem_loader_func = NULL;
ImageMemLoadFunc Image::_tga_mem_loader_func = NULL;
void (*Image::_image_compress_bc_func)(Image *, float, Image::CompressSource) = NULL;
void (*Image::_image_compress_bptc_func)(Image *, float, Image::CompressSource) = NULL;
@ -2723,6 +2742,7 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("load", "path"), &Image::load);
ClassDB::bind_method(D_METHOD("save_png", "path"), &Image::save_png);
ClassDB::bind_method(D_METHOD("save_png_to_buffer"), &Image::save_png_to_buffer);
ClassDB::bind_method(D_METHOD("save_exr", "path", "grayscale"), &Image::save_exr, DEFVAL(false));
ClassDB::bind_method(D_METHOD("detect_alpha"), &Image::detect_alpha);
@ -2763,6 +2783,7 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("load_png_from_buffer", "buffer"), &Image::load_png_from_buffer);
ClassDB::bind_method(D_METHOD("load_jpg_from_buffer", "buffer"), &Image::load_jpg_from_buffer);
ClassDB::bind_method(D_METHOD("load_webp_from_buffer", "buffer"), &Image::load_webp_from_buffer);
ClassDB::bind_method(D_METHOD("load_tga_from_buffer", "buffer"), &Image::load_tga_from_buffer);
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "_set_data", "_get_data");
@ -3078,6 +3099,11 @@ Error Image::load_webp_from_buffer(const PoolVector<uint8_t> &p_array) {
return _load_from_buffer(p_array, _webp_mem_loader_func);
}
Error Image::load_tga_from_buffer(const PoolVector<uint8_t> &p_array) {
ERR_FAIL_NULL_V_MSG(_tga_mem_loader_func, ERR_UNAVAILABLE, "TGA module was not installed.");
return _load_from_buffer(p_array, _tga_mem_loader_func);
}
Error Image::_load_from_buffer(const PoolVector<uint8_t> &p_array, ImageMemLoadFunc p_loader) {
int buffer_size = p_array.size();

View File

@ -47,6 +47,7 @@
class Image;
typedef Error (*SavePNGFunc)(const String &p_path, const Ref<Image> &p_img);
typedef PoolVector<uint8_t> (*SavePNGBufferFunc)(const Ref<Image> &p_img);
typedef Ref<Image> (*ImageMemLoadFunc)(const uint8_t *p_png, int p_size);
typedef Error (*SaveEXRFunc)(const String &p_path, const Ref<Image> &p_img, bool p_grayscale);
@ -57,6 +58,7 @@ class Image : public Resource {
public:
static SavePNGFunc save_png_func;
static SaveEXRFunc save_exr_func;
static SavePNGBufferFunc save_png_buffer_func;
enum {
MAX_WIDTH = 16384, // force a limit somehow
@ -129,6 +131,7 @@ public:
static ImageMemLoadFunc _png_mem_loader_func;
static ImageMemLoadFunc _jpg_mem_loader_func;
static ImageMemLoadFunc _webp_mem_loader_func;
static ImageMemLoadFunc _tga_mem_loader_func;
static void (*_image_compress_bc_func)(Image *, float, CompressSource p_source);
static void (*_image_compress_bptc_func)(Image *, float p_lossy_quality, CompressSource p_source);
@ -259,6 +262,7 @@ public:
Error load(const String &p_path);
Error save_png(const String &p_path) const;
PoolVector<uint8_t> save_png_to_buffer() const;
Error save_exr(const String &p_path, bool p_grayscale) const;
/**
@ -328,6 +332,7 @@ public:
Error load_png_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_jpg_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_webp_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_tga_from_buffer(const PoolVector<uint8_t> &p_array);
Image(const uint8_t *p_mem_png_jpg, int p_len = -1);
Image(const char **p_xpm);

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")

View File

@ -86,7 +86,8 @@ void ConfigFile::set_value(const String &p_section, const String &p_key, const V
Variant ConfigFile::get_value(const String &p_section, const String &p_key, Variant p_default) const {
if (!values.has(p_section) || !values[p_section].has(p_key)) {
ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, p_default, "Couldn't find the given section/key and no default was given.");
ERR_FAIL_COND_V_MSG(p_default.get_type() == Variant::NIL, Variant(),
vformat("Couldn't find the given section \"%s\" and key \"%s\", and no default was given.", p_section, p_key));
return p_default;
}
return values[p_section][p_key];
@ -111,7 +112,7 @@ void ConfigFile::get_sections(List<String> *r_sections) const {
}
void ConfigFile::get_section_keys(const String &p_section, List<String> *r_keys) const {
ERR_FAIL_COND_MSG(!values.has(p_section), "Cannont get keys from nonexistent section '" + p_section + "'.");
ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot get keys from nonexistent section \"%s\".", p_section));
for (OrderedHashMap<String, Variant>::ConstElement E = values[p_section].front(); E; E = E.next()) {
r_keys->push_back(E.key());
@ -120,12 +121,14 @@ void ConfigFile::get_section_keys(const String &p_section, List<String> *r_keys)
void ConfigFile::erase_section(const String &p_section) {
ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot erase nonexistent section \"%s\".", p_section));
values.erase(p_section);
}
void ConfigFile::erase_section_key(const String &p_section, const String &p_key) {
ERR_FAIL_COND_MSG(!values.has(p_section), "Cannot erase key from nonexistent section '" + p_section + "'.");
ERR_FAIL_COND_MSG(!values.has(p_section), vformat("Cannot erase key \"%s\" from nonexistent section \"%s\".", p_key, p_section));
ERR_FAIL_COND_MSG(!values[p_section].has(p_key), vformat("Cannot erase nonexistent key \"%s\" from section \"%s\".", p_key, p_section));
values[p_section].erase(p_key);
}
@ -255,6 +258,22 @@ Error ConfigFile::_internal_load(const String &p_path, FileAccess *f) {
VariantParser::StreamFile stream;
stream.f = f;
Error err = _parse(p_path, &stream);
memdelete(f);
return err;
}
Error ConfigFile::parse(const String &p_data) {
VariantParser::StreamString stream;
stream.s = p_data;
return _parse("<string>", &stream);
}
Error ConfigFile::_parse(const String &p_path, VariantParser::Stream *p_stream) {
String assign;
Variant value;
VariantParser::Tag next_tag;
@ -270,13 +289,11 @@ Error ConfigFile::_internal_load(const String &p_path, FileAccess *f) {
next_tag.fields.clear();
next_tag.name = String();
Error err = VariantParser::parse_tag_assign_eof(&stream, lines, error_text, next_tag, assign, value, NULL, true);
Error err = VariantParser::parse_tag_assign_eof(p_stream, lines, error_text, next_tag, assign, value, NULL, true);
if (err == ERR_FILE_EOF) {
memdelete(f);
return OK;
} else if (err != OK) {
ERR_PRINTS("ConfgFile::load - " + p_path + ":" + itos(lines) + " error: " + error_text + ".");
memdelete(f);
ERR_PRINT(vformat("ConfigFile parse error at %s:%d: %s.", p_path, lines, error_text));
return err;
}
@ -286,6 +303,8 @@ Error ConfigFile::_internal_load(const String &p_path, FileAccess *f) {
section = next_tag.name;
}
}
return OK;
}
void ConfigFile::_bind_methods() {
@ -303,14 +322,12 @@ void ConfigFile::_bind_methods() {
ClassDB::bind_method(D_METHOD("erase_section_key", "section", "key"), &ConfigFile::erase_section_key);
ClassDB::bind_method(D_METHOD("load", "path"), &ConfigFile::load);
ClassDB::bind_method(D_METHOD("parse", "data"), &ConfigFile::parse);
ClassDB::bind_method(D_METHOD("save", "path"), &ConfigFile::save);
ClassDB::bind_method(D_METHOD("load_encrypted", "path", "key"), &ConfigFile::load_encrypted);
ClassDB::bind_method(D_METHOD("load_encrypted_pass", "path", "pass"), &ConfigFile::load_encrypted_pass);
ClassDB::bind_method(D_METHOD("load_encrypted_pass", "path", "password"), &ConfigFile::load_encrypted_pass);
ClassDB::bind_method(D_METHOD("save_encrypted", "path", "key"), &ConfigFile::save_encrypted);
ClassDB::bind_method(D_METHOD("save_encrypted_pass", "path", "pass"), &ConfigFile::save_encrypted_pass);
}
ConfigFile::ConfigFile() {
ClassDB::bind_method(D_METHOD("save_encrypted_pass", "path", "password"), &ConfigFile::save_encrypted_pass);
}

View File

@ -34,6 +34,7 @@
#include "core/ordered_hash_map.h"
#include "core/os/file_access.h"
#include "core/reference.h"
#include "core/variant_parser.h"
class ConfigFile : public Reference {
@ -46,6 +47,8 @@ class ConfigFile : public Reference {
Error _internal_load(const String &p_path, FileAccess *f);
Error _internal_save(FileAccess *file);
Error _parse(const String &p_path, VariantParser::Stream *p_stream);
protected:
static void _bind_methods();
@ -64,14 +67,13 @@ public:
Error save(const String &p_path);
Error load(const String &p_path);
Error parse(const String &p_data);
Error load_encrypted(const String &p_path, const Vector<uint8_t> &p_key);
Error load_encrypted_pass(const String &p_path, const String &p_pass);
Error save_encrypted(const String &p_path, const Vector<uint8_t> &p_key);
Error save_encrypted_pass(const String &p_path, const String &p_pass);
ConfigFile();
};
#endif // CONFIG_FILE_H

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* platform_refcount.h */
/* dtls_server.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,21 +28,30 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "core/safe_refcount.h"
#include "dtls_server.h"
#include "core/os/file_access.h"
#include "core/project_settings.h"
#ifdef IPHONE_ENABLED
DTLSServer *(*DTLSServer::_create)() = NULL;
bool DTLSServer::available = false;
#define REFCOUNT_T int
#define REFCOUNT_GET_T int const volatile &
DTLSServer *DTLSServer::create() {
#include <libkern/OSAtomic.h>
inline int atomic_conditional_increment(volatile int *v) {
return (*v == 0) ? 0 : OSAtomicIncrement32(v);
if (_create) {
return _create();
}
return NULL;
}
inline int atomic_decrement(volatile int *v) {
return OSAtomicDecrement32(v);
bool DTLSServer::is_available() {
return available;
}
#endif
void DTLSServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("setup", "key", "certificate", "chain"), &DTLSServer::setup, DEFVAL(Ref<X509Certificate>()));
ClassDB::bind_method(D_METHOD("take_connection", "udp_peer"), &DTLSServer::take_connection);
}
DTLSServer::DTLSServer() {
}

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* context_gl_haiku.h */
/* dtls_server.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,35 +28,30 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef CONTEXT_GL_HAIKU_H
#define CONTEXT_GL_HAIKU_H
#ifndef DTLS_SERVER_H
#define DTLS_SERVER_H
#if defined(OPENGL_ENABLED)
#include "core/io/net_socket.h"
#include "core/io/packet_peer_dtls.h"
#include "haiku_direct_window.h"
#include "haiku_gl_view.h"
class DTLSServer : public Reference {
GDCLASS(DTLSServer, Reference);
class ContextGL_Haiku {
private:
HaikuGLView *view;
HaikuDirectWindow *window;
protected:
static DTLSServer *(*_create)();
static void _bind_methods();
bool use_vsync;
static bool available;
public:
Error initialize();
void release_current();
void make_current();
void swap_buffers();
int get_window_width();
int get_window_height();
static bool is_available();
static DTLSServer *create();
void set_use_vsync(bool p_use);
bool is_using_vsync() const;
virtual Error setup(Ref<CryptoKey> p_key, Ref<X509Certificate> p_cert, Ref<X509Certificate> p_ca_chain = Ref<X509Certificate>()) = 0;
virtual void stop() = 0;
virtual Ref<PacketPeerDTLS> take_connection(Ref<PacketPeerUDP> p_peer) = 0;
ContextGL_Haiku(HaikuDirectWindow *p_window);
~ContextGL_Haiku();
DTLSServer();
};
#endif
#endif
#endif // DTLS_SERVER_H

View File

@ -52,18 +52,16 @@ protected:
Error set_error(Error p_error) const;
mutable struct File {
bool open;
int size;
int offset;
bool open = false;
int size = 0;
int offset = 0;
String name;
int access_flags;
int access_flags = 0;
} file;
mutable struct Cache {
Vector<uint8_t> buffer;
int offset;
int offset = 0;
} cache;
virtual int read_data_block(int p_offset, int p_size, uint8_t *p_dest = 0) const = 0;

View File

@ -63,6 +63,10 @@ Error FileAccessCompressed::open_after_magic(FileAccess *p_base) {
f = p_base;
cmode = (Compression::Mode)f->get_32();
block_size = f->get_32();
if (block_size == 0) {
f = NULL; // Let the caller to handle the FileAccess object if failed to open as compressed file.
ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Can't open compressed file '" + p_base->get_path() + "' with block size 0, it is corrupted.");
}
read_total = f->get_32();
int bc = (read_total / block_size) + 1;
int acc_ofs = f->get_position() + bc * 4;
@ -125,13 +129,11 @@ Error FileAccessCompressed::_open(const String &p_path, int p_mode_flags) {
char rmagic[5];
f->get_buffer((uint8_t *)rmagic, 4);
rmagic[4] = 0;
if (magic != rmagic) {
if (magic != rmagic || open_after_magic(f) != OK) {
memdelete(f);
f = NULL;
return ERR_FILE_UNRECOGNIZED;
}
open_after_magic(f);
}
return OK;

View File

@ -28,11 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifdef MINIZIP_ENABLED
#ifndef FILE_ACCESS_ZIP_H
#define FILE_ACCESS_ZIP_H
#ifdef MINIZIP_ENABLED
#include "core/io/file_access_pack.h"
#include "core/map.h"
@ -119,6 +119,6 @@ public:
~FileAccessZip();
};
#endif // FILE_ACCESS_ZIP_H
#endif // MINIZIP_ENABLED
#endif // FILE_ACCESS_ZIP_H

View File

@ -386,6 +386,7 @@ Error JSON::_parse_array(Array &array, const CharType *p_str, int &index, int p_
need_comma = true;
}
r_err_str = "Expected ']'";
return ERR_PARSE_ERROR;
}
@ -453,6 +454,7 @@ Error JSON::_parse_object(Dictionary &object, const CharType *p_str, int &index,
}
}
r_err_str = "Expected '}'";
return ERR_PARSE_ERROR;
}

View File

@ -154,7 +154,7 @@ void RotatedFileLogger::rotate_file() {
char timestamp[21];
OS::Date date = OS::get_singleton()->get_date();
OS::Time time = OS::get_singleton()->get_time();
sprintf(timestamp, "-%04d-%02d-%02d-%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
sprintf(timestamp, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
String backup_name = base_path.get_basename() + timestamp;
if (base_path.get_extension() != String()) {

View File

@ -1169,15 +1169,14 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
while (r_len%4)
r_len++; //pad
*/
Variant *v = d.getptr(E->get());
int len;
encode_variant(E->get(), buf, len, p_full_objects);
encode_variant(v ? E->get() : Variant("[Deleted Object]"), buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)
buf += len;
Variant *v = d.getptr(E->get());
ERR_FAIL_COND_V(!v, ERR_BUG);
encode_variant(*v, buf, len, p_full_objects);
encode_variant(v ? *v : Variant(), buf, len, p_full_objects);
ERR_FAIL_COND_V(len % 4, ERR_BUG);
r_len += len;
if (buf)

View File

@ -61,7 +61,7 @@ public:
virtual Error connect_to_host(IP_Address p_addr, uint16_t p_port) = 0;
virtual Error poll(PollType p_type, int timeout) const = 0;
virtual Error recv(uint8_t *p_buffer, int p_len, int &r_read) = 0;
virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port) = 0;
virtual Error recvfrom(uint8_t *p_buffer, int p_len, int &r_read, IP_Address &r_ip, uint16_t &r_port, bool p_peek = false) = 0;
virtual Error send(const uint8_t *p_buffer, int p_len, int &r_sent) = 0;
virtual Error sendto(const uint8_t *p_buffer, int p_len, int &r_sent, IP_Address p_ip, uint16_t p_port) = 0;
virtual Ref<NetSocket> accept(IP_Address &r_ip, uint16_t &r_port) = 0;

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* path_texture.cpp */
/* packet_peer_dtls.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,63 +28,38 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "path_texture.h"
#include "packet_peer_dtls.h"
#include "core/os/file_access.h"
#include "core/project_settings.h"
void PathTexture::set_begin_texture(const Ref<Texture> &p_texture) {
PacketPeerDTLS *(*PacketPeerDTLS::_create)() = NULL;
bool PacketPeerDTLS::available = false;
begin = p_texture;
update();
PacketPeerDTLS *PacketPeerDTLS::create() {
if (_create) {
return _create();
}
return NULL;
}
Ref<Texture> PathTexture::get_begin_texture() const {
return begin;
bool PacketPeerDTLS::is_available() {
return available;
}
void PathTexture::set_repeat_texture(const Ref<Texture> &p_texture) {
void PacketPeerDTLS::_bind_methods() {
repeat = p_texture;
update();
}
Ref<Texture> PathTexture::get_repeat_texture() const {
ClassDB::bind_method(D_METHOD("poll"), &PacketPeerDTLS::poll);
ClassDB::bind_method(D_METHOD("connect_to_peer", "packet_peer", "validate_certs", "for_hostname", "valid_certificate"), &PacketPeerDTLS::connect_to_peer, DEFVAL(true), DEFVAL(String()), DEFVAL(Ref<X509Certificate>()));
ClassDB::bind_method(D_METHOD("get_status"), &PacketPeerDTLS::get_status);
ClassDB::bind_method(D_METHOD("disconnect_from_peer"), &PacketPeerDTLS::disconnect_from_peer);
return repeat;
BIND_ENUM_CONSTANT(STATUS_DISCONNECTED);
BIND_ENUM_CONSTANT(STATUS_HANDSHAKING);
BIND_ENUM_CONSTANT(STATUS_CONNECTED);
BIND_ENUM_CONSTANT(STATUS_ERROR);
BIND_ENUM_CONSTANT(STATUS_ERROR_HOSTNAME_MISMATCH);
}
void PathTexture::set_end_texture(const Ref<Texture> &p_texture) {
end = p_texture;
update();
}
Ref<Texture> PathTexture::get_end_texture() const {
return end;
}
void PathTexture::set_subdivisions(int p_amount) {
ERR_FAIL_INDEX(p_amount, 32);
subdivs = p_amount;
update();
}
int PathTexture::get_subdivisions() const {
return subdivs;
}
void PathTexture::set_overlap(int p_amount) {
overlap = p_amount;
update();
}
int PathTexture::get_overlap() const {
return overlap;
}
PathTexture::PathTexture() {
overlap = 0;
subdivs = 1;
PacketPeerDTLS::PacketPeerDTLS() {
}

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* audio_driver_media_kit.h */
/* packet_peer_dtls.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,47 +28,41 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "servers/audio_server.h"
#ifndef PACKET_PEER_DTLS_H
#define PACKET_PEER_DTLS_H
#ifdef MEDIA_KIT_ENABLED
#include "core/crypto/crypto.h"
#include "core/io/packet_peer_udp.h"
#include "core/os/mutex.h"
#include "core/os/thread.h"
class PacketPeerDTLS : public PacketPeer {
GDCLASS(PacketPeerDTLS, PacketPeer);
#include <kernel/image.h> // needed for image_id
protected:
static PacketPeerDTLS *(*_create)();
static void _bind_methods();
#include <SoundPlayer.h>
class AudioDriverMediaKit : public AudioDriver {
Mutex *mutex;
BSoundPlayer *player;
static int32_t *samples_in;
static void PlayBuffer(void *cookie, void *buffer, size_t size, const media_raw_audio_format &format);
unsigned int mix_rate;
SpeakerMode speaker_mode;
unsigned int buffer_size;
int channels;
bool active;
static bool available;
public:
const char *get_name() const {
return "MediaKit";
enum Status {
STATUS_DISCONNECTED,
STATUS_HANDSHAKING,
STATUS_CONNECTED,
STATUS_ERROR,
STATUS_ERROR_HOSTNAME_MISMATCH
};
virtual Error init();
virtual void start();
virtual int get_mix_rate() const;
virtual SpeakerMode get_speaker_mode() const;
virtual void lock();
virtual void unlock();
virtual void finish();
virtual void poll() = 0;
virtual Error connect_to_peer(Ref<PacketPeerUDP> p_base, bool p_validate_certs = true, const String &p_for_hostname = String(), Ref<X509Certificate> p_ca_certs = Ref<X509Certificate>()) = 0;
virtual void disconnect_from_peer() = 0;
virtual Status get_status() const = 0;
AudioDriverMediaKit();
~AudioDriverMediaKit();
static PacketPeerDTLS *create();
static bool is_available();
PacketPeerDTLS();
};
#endif
VARIANT_ENUM_CAST(PacketPeerDTLS::Status);
#endif // PACKET_PEER_DTLS_H

View File

@ -31,6 +31,7 @@
#include "packet_peer_udp.h"
#include "core/io/ip.h"
#include "core/io/udp_server.h"
void PacketPeerUDP::set_blocking_mode(bool p_enable) {
@ -38,13 +39,14 @@ void PacketPeerUDP::set_blocking_mode(bool p_enable) {
}
void PacketPeerUDP::set_broadcast_enabled(bool p_enabled) {
ERR_FAIL_COND(udp_server);
broadcast = p_enabled;
if (_sock.is_valid() && _sock->is_open())
_sock->set_broadcasting_enabled(p_enabled);
}
Error PacketPeerUDP::join_multicast_group(IP_Address p_multi_address, String p_if_name) {
ERR_FAIL_COND_V(udp_server, ERR_LOCKED);
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(!p_multi_address.is_valid(), ERR_INVALID_PARAMETER);
@ -59,7 +61,7 @@ Error PacketPeerUDP::join_multicast_group(IP_Address p_multi_address, String p_i
}
Error PacketPeerUDP::leave_multicast_group(IP_Address p_multi_address, String p_if_name) {
ERR_FAIL_COND_V(udp_server, ERR_LOCKED);
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(!_sock->is_open(), ERR_UNCONFIGURED);
return _sock->leave_multicast_group(p_multi_address, p_if_name);
@ -133,7 +135,11 @@ Error PacketPeerUDP::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
}
do {
err = _sock->sendto(p_buffer, p_buffer_size, sent, peer_addr, peer_port);
if (connected && !udp_server) {
err = _sock->send(p_buffer, p_buffer_size, sent);
} else {
err = _sock->sendto(p_buffer, p_buffer_size, sent, peer_addr, peer_port);
}
if (err != OK) {
if (err != ERR_BUSY)
return FAILED;
@ -184,12 +190,72 @@ Error PacketPeerUDP::listen(int p_port, const IP_Address &p_bind_address, int p_
return OK;
}
void PacketPeerUDP::close() {
Error PacketPeerUDP::connect_shared_socket(Ref<NetSocket> p_sock, IP_Address p_ip, uint16_t p_port, UDPServer *p_server) {
udp_server = p_server;
connected = true;
_sock = p_sock;
peer_addr = p_ip;
peer_port = p_port;
packet_ip = peer_addr;
packet_port = peer_port;
return OK;
}
if (_sock.is_valid())
void PacketPeerUDP::disconnect_shared_socket() {
udp_server = nullptr;
_sock = Ref<NetSocket>(NetSocket::create());
close();
}
Error PacketPeerUDP::connect_to_host(const IP_Address &p_host, int p_port) {
ERR_FAIL_COND_V(udp_server, ERR_LOCKED);
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(!p_host.is_valid(), ERR_INVALID_PARAMETER);
Error err;
if (!_sock->is_open()) {
IP::Type ip_type = p_host.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6;
err = _sock->open(NetSocket::TYPE_UDP, ip_type);
ERR_FAIL_COND_V(err != OK, ERR_CANT_OPEN);
_sock->set_blocking_enabled(false);
}
err = _sock->connect_to_host(p_host, p_port);
// I see no reason why we should get ERR_BUSY (wouldblock/eagain) here.
// This is UDP, so connect is only used to tell the OS to which socket
// it shuold deliver packets when multiple are bound on the same address/port.
if (err != OK) {
close();
ERR_FAIL_V_MSG(FAILED, "Unable to connect");
}
connected = true;
peer_addr = p_host;
peer_port = p_port;
// Flush any packet we might still have in queue.
rb.clear();
return OK;
}
bool PacketPeerUDP::is_connected_to_host() const {
return connected;
}
void PacketPeerUDP::close() {
if (udp_server) {
udp_server->remove_peer(peer_addr, peer_port);
udp_server = nullptr;
_sock = Ref<NetSocket>(NetSocket::create());
} else if (_sock.is_valid()) {
_sock->close();
}
rb.resize(16);
queue_count = 0;
connected = false;
}
Error PacketPeerUDP::wait() {
@ -205,6 +271,9 @@ Error PacketPeerUDP::_poll() {
if (!_sock->is_open()) {
return FAILED;
}
if (udp_server) {
return OK; // Handled by UDPServer.
}
Error err;
int read;
@ -212,7 +281,13 @@ Error PacketPeerUDP::_poll() {
uint16_t port;
while (true) {
err = _sock->recvfrom(recv_buffer, sizeof(recv_buffer), read, ip, port);
if (connected) {
err = _sock->recv(recv_buffer, sizeof(recv_buffer), read);
ip = peer_addr;
port = peer_port;
} else {
err = _sock->recvfrom(recv_buffer, sizeof(recv_buffer), read, ip, port);
}
if (err != OK) {
if (err == ERR_BUSY)
@ -220,23 +295,29 @@ Error PacketPeerUDP::_poll() {
return FAILED;
}
if (rb.space_left() < read + 24) {
err = store_packet(ip, port, recv_buffer, read);
#ifdef TOOLS_ENABLED
WARN_PRINTS("Buffer full, dropping packets!");
#endif
continue;
if (err != OK) {
WARN_PRINT("Buffer full, dropping packets!");
}
uint32_t port32 = port;
rb.write(ip.get_ipv6(), 16);
rb.write((uint8_t *)&port32, 4);
rb.write((uint8_t *)&read, 4);
rb.write(recv_buffer, read);
++queue_count;
#endif
}
return OK;
}
Error PacketPeerUDP::store_packet(IP_Address p_ip, uint32_t p_port, uint8_t *p_buf, int p_buf_size) {
if (rb.space_left() < p_buf_size + 24) {
return ERR_OUT_OF_MEMORY;
}
rb.write(p_ip.get_ipv6(), 16);
rb.write((uint8_t *)&p_port, 4);
rb.write((uint8_t *)&p_buf_size, 4);
rb.write(p_buf, p_buf_size);
++queue_count;
return OK;
}
bool PacketPeerUDP::is_listening() const {
return _sock.is_valid() && _sock->is_open();
@ -254,6 +335,7 @@ int PacketPeerUDP::get_packet_port() const {
void PacketPeerUDP::set_dest_address(const IP_Address &p_address, int p_port) {
ERR_FAIL_COND_MSG(connected, "Destination address cannot be set for connected sockets");
peer_addr = p_address;
peer_port = p_port;
}
@ -264,6 +346,8 @@ void PacketPeerUDP::_bind_methods() {
ClassDB::bind_method(D_METHOD("close"), &PacketPeerUDP::close);
ClassDB::bind_method(D_METHOD("wait"), &PacketPeerUDP::wait);
ClassDB::bind_method(D_METHOD("is_listening"), &PacketPeerUDP::is_listening);
ClassDB::bind_method(D_METHOD("connect_to_host", "host", "port"), &PacketPeerUDP::connect_to_host);
ClassDB::bind_method(D_METHOD("is_connected_to_host"), &PacketPeerUDP::is_connected_to_host);
ClassDB::bind_method(D_METHOD("get_packet_ip"), &PacketPeerUDP::_get_packet_ip);
ClassDB::bind_method(D_METHOD("get_packet_port"), &PacketPeerUDP::get_packet_port);
ClassDB::bind_method(D_METHOD("set_dest_address", "host", "port"), &PacketPeerUDP::_set_dest_address);
@ -276,8 +360,10 @@ PacketPeerUDP::PacketPeerUDP() :
packet_port(0),
queue_count(0),
peer_port(0),
connected(false),
blocking(true),
broadcast(false),
udp_server(nullptr),
_sock(Ref<NetSocket>(NetSocket::create())) {
rb.resize(16);
}

View File

@ -35,6 +35,8 @@
#include "core/io/net_socket.h"
#include "core/io/packet_peer.h"
class UDPServer;
class PacketPeerUDP : public PacketPeer {
GDCLASS(PacketPeerUDP, PacketPeer);
@ -52,8 +54,10 @@ protected:
IP_Address peer_addr;
int peer_port;
bool connected;
bool blocking;
bool broadcast;
UDPServer *udp_server;
Ref<NetSocket> _sock;
static void _bind_methods();
@ -70,6 +74,13 @@ public:
void close();
Error wait();
bool is_listening() const;
Error connect_shared_socket(Ref<NetSocket> p_sock, IP_Address p_ip, uint16_t p_port, UDPServer *ref); // Used by UDPServer
void disconnect_shared_socket(); // Used by UDPServer
Error store_packet(IP_Address p_ip, uint32_t p_port, uint8_t *p_buf, int p_buf_size); // Used internally and by UDPServer
Error connect_to_host(const IP_Address &p_host, int p_port);
bool is_connected_to_host() const;
IP_Address get_packet_address() const;
int get_packet_port() const;
void set_dest_address(const IP_Address &p_address, int p_port);

View File

@ -163,7 +163,7 @@ Error PCKPacker::flush(bool p_verbose) {
src->close();
memdelete(src);
count += 1;
if (p_verbose) {
if (p_verbose && files.size() > 0) {
if (count % 100 == 0) {
printf("%i/%i (%.2f)\r", count, files.size(), float(count) / files.size() * 100);
fflush(stdout);

View File

@ -836,15 +836,20 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
uint8_t header[4];
f->get_buffer(header, 4);
if (header[0] == 'R' && header[1] == 'S' && header[2] == 'C' && header[3] == 'C') {
//compressed
// Compressed.
FileAccessCompressed *fac = memnew(FileAccessCompressed);
fac->open_after_magic(f);
error = fac->open_after_magic(f);
if (error != OK) {
memdelete(fac);
f->close();
ERR_FAIL_MSG("Failed to open binary resource file: " + local_path + ".");
}
f = fac;
} else if (header[0] != 'R' || header[1] != 'S' || header[2] != 'R' || header[3] != 'C') {
//not normal
// Not normal.
error = ERR_FILE_UNRECOGNIZED;
f->close();
ERR_FAIL_MSG("Unrecognized binary resource file: " + local_path + ".");
}
@ -919,6 +924,7 @@ void ResourceInteractiveLoaderBinary::open(FileAccess *p_f) {
if (f->eof_reached()) {
error = ERR_FILE_CORRUPT;
f->close();
ERR_FAIL_MSG("Premature end of file (EOF): " + local_path + ".");
}
}
@ -931,14 +937,20 @@ String ResourceInteractiveLoaderBinary::recognize(FileAccess *p_f) {
uint8_t header[4];
f->get_buffer(header, 4);
if (header[0] == 'R' && header[1] == 'S' && header[2] == 'C' && header[3] == 'C') {
//compressed
// Compressed.
FileAccessCompressed *fac = memnew(FileAccessCompressed);
fac->open_after_magic(f);
error = fac->open_after_magic(f);
if (error != OK) {
memdelete(fac);
f->close();
return "";
}
f = fac;
} else if (header[0] != 'R' || header[1] != 'S' || header[2] != 'R' || header[3] != 'C') {
//not normal
// Not normal.
error = ERR_FILE_UNRECOGNIZED;
f->close();
return "";
}
@ -1055,14 +1067,19 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
uint8_t header[4];
f->get_buffer(header, 4);
if (header[0] == 'R' && header[1] == 'S' && header[2] == 'C' && header[3] == 'C') {
//compressed
// Compressed.
FileAccessCompressed *fac = memnew(FileAccessCompressed);
fac->open_after_magic(f);
Error err = fac->open_after_magic(f);
if (err != OK) {
memdelete(fac);
memdelete(f);
ERR_FAIL_V_MSG(err, "Cannot open file '" + p_path + "'.");
}
f = fac;
FileAccessCompressed *facw = memnew(FileAccessCompressed);
facw->configure("RSCC");
Error err = facw->_open(p_path + ".depren", FileAccess::WRITE);
err = facw->_open(p_path + ".depren", FileAccess::WRITE);
if (err) {
memdelete(fac);
memdelete(facw);
@ -1072,9 +1089,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
fw = facw;
} else if (header[0] != 'R' || header[1] != 'S' || header[2] != 'R' || header[3] != 'C') {
//not normal
//error=ERR_FILE_UNRECOGNIZED;
// Not normal.
memdelete(f);
ERR_FAIL_V_MSG(ERR_FILE_UNRECOGNIZED, "Unrecognized binary resource file '" + local_path + "'.");
} else {

View File

@ -275,7 +275,8 @@ RES ResourceLoader::_load(const String &p_path, const String &p_original_path, c
return res;
}
ERR_FAIL_COND_V_MSG(found, RES(), "Failed loading resource: " + p_path + ".");
ERR_FAIL_COND_V_MSG(found, RES(),
vformat("Failed loading resource: %s. Make sure resources have been imported by opening the project in the editor at least once.", p_path));
#ifdef TOOLS_ENABLED
FileAccessRef file_check = FileAccess::create(FileAccess::ACCESS_RESOURCES);
@ -896,6 +897,9 @@ void ResourceLoader::load_translation_remaps() {
void ResourceLoader::clear_translation_remaps() {
translation_remaps.clear();
while (remapped_list.first() != nullptr) {
remapped_list.remove(remapped_list.first());
}
}
void ResourceLoader::load_path_remaps() {

View File

@ -33,10 +33,8 @@
#include "core/os/file_access.h"
#include "core/translation.h"
RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const String &p_path) {
RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
enum Status {
STATUS_NONE,
STATUS_READING_ID,
STATUS_READING_STRING,
@ -56,6 +54,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
bool skip_this = false;
bool skip_next = false;
bool is_eof = false;
const String path = f->get_path();
while (!is_eof) {
@ -67,7 +66,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
if (status == STATUS_READING_ID) {
memdelete(f);
ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected EOF while reading 'msgid' at file: ");
ERR_FAIL_V_MSG(RES(), "Unexpected EOF while reading 'msgid' at: " + path + ":" + itos(line));
} else {
break;
}
@ -76,9 +75,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
if (l.begins_with("msgid")) {
if (status == STATUS_READING_ID) {
memdelete(f);
ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected 'msgid', was expecting 'msgstr' while parsing: ");
ERR_FAIL_V_MSG(RES(), "Unexpected 'msgid', was expecting 'msgstr' while parsing: " + path + ":" + itos(line));
}
if (msg_id != "") {
@ -98,9 +96,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
if (l.begins_with("msgstr")) {
if (status != STATUS_READING_ID) {
memdelete(f);
ERR_FAIL_V_MSG(RES(), p_path + ":" + itos(line) + " Unexpected 'msgstr', was expecting 'msgid' while parsing: ");
ERR_FAIL_V_MSG(RES(), "Unexpected 'msgstr', was expecting 'msgid' while parsing: " + path + ":" + itos(line));
}
l = l.substr(6, l.length()).strip_edges();
@ -115,7 +112,10 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
continue; //nothing to read or comment
}
ERR_FAIL_COND_V_MSG(!l.begins_with("\"") || status == STATUS_NONE, RES(), p_path + ":" + itos(line) + " Invalid line '" + l + "' while parsing: ");
if (!l.begins_with("\"") || status == STATUS_NONE) {
memdelete(f);
ERR_FAIL_V_MSG(RES(), "Invalid line '" + l + "' while parsing: " + path + ":" + itos(line));
}
l = l.substr(1, l.length());
//find final quote
@ -128,7 +128,10 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
}
}
ERR_FAIL_COND_V_MSG(end_pos == -1, RES(), p_path + ":" + itos(line) + " Expected '\"' at end of message while parsing file: ");
if (end_pos == -1) {
memdelete(f);
ERR_FAIL_V_MSG(RES(), "Expected '\"' at end of message while parsing: " + path + ":" + itos(line));
}
l = l.substr(0, end_pos);
l = l.c_unescape();
@ -141,7 +144,6 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
line++;
}
f->close();
memdelete(f);
if (status == STATUS_READING_STRING) {
@ -153,7 +155,7 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S
config = msg_str;
}
ERR_FAIL_COND_V_MSG(config == "", RES(), "No config found in file: " + p_path + ".");
ERR_FAIL_COND_V_MSG(config == "", RES(), "No config found in file: " + path + ".");
Vector<String> configs = config.split("\n");
for (int i = 0; i < configs.size(); i++) {
@ -190,7 +192,6 @@ RES TranslationLoaderPO::load(const String &p_path, const String &p_original_pat
void TranslationLoaderPO::get_recognized_extensions(List<String> *p_extensions) const {
p_extensions->push_back("po");
//p_extensions->push_back("mo"); //mo in the future...
}
bool TranslationLoaderPO::handles_type(const String &p_type) const {

View File

@ -37,7 +37,7 @@
class TranslationLoaderPO : public ResourceFormatLoader {
public:
static RES load_translation(FileAccess *f, Error *r_error, const String &p_path = String());
static RES load_translation(FileAccess *f, Error *r_error);
virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = NULL);
virtual void get_recognized_extensions(List<String> *p_extensions) const;
virtual bool handles_type(const String &p_type) const;

205
core/io/udp_server.cpp Normal file
View File

@ -0,0 +1,205 @@
/*************************************************************************/
/* udp_server.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
/* "Software"), to deal in the Software without restriction, including */
/* without limitation the rights to use, copy, modify, merge, publish, */
/* distribute, sublicense, and/or sell copies of the Software, and to */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions: */
/* */
/* The above copyright notice and this permission notice shall be */
/* included in all copies or substantial portions of the Software. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "udp_server.h"
void UDPServer::_bind_methods() {
ClassDB::bind_method(D_METHOD("listen", "port", "bind_address"), &UDPServer::listen, DEFVAL("*"));
ClassDB::bind_method(D_METHOD("poll"), &UDPServer::poll);
ClassDB::bind_method(D_METHOD("is_connection_available"), &UDPServer::is_connection_available);
ClassDB::bind_method(D_METHOD("is_listening"), &UDPServer::is_listening);
ClassDB::bind_method(D_METHOD("take_connection"), &UDPServer::take_connection);
ClassDB::bind_method(D_METHOD("stop"), &UDPServer::stop);
ClassDB::bind_method(D_METHOD("set_max_pending_connections", "max_pending_connections"), &UDPServer::set_max_pending_connections);
ClassDB::bind_method(D_METHOD("get_max_pending_connections"), &UDPServer::get_max_pending_connections);
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_pending_connections", PROPERTY_HINT_RANGE, "0,256,1"), "set_max_pending_connections", "get_max_pending_connections");
}
Error UDPServer::poll() {
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
if (!_sock->is_open()) {
return ERR_UNCONFIGURED;
}
Error err;
int read;
IP_Address ip;
uint16_t port;
while (true) {
err = _sock->recvfrom(recv_buffer, sizeof(recv_buffer), read, ip, port);
if (err != OK) {
if (err == ERR_BUSY) {
break;
}
return FAILED;
}
Peer p;
p.ip = ip;
p.port = port;
List<Peer>::Element *E = peers.find(p);
if (!E) {
E = pending.find(p);
}
if (E) {
E->get().peer->store_packet(ip, port, recv_buffer, read);
} else {
if (pending.size() >= max_pending_connections) {
// Drop connection.
continue;
}
// It's a new peer, add it to the pending list.
Peer peer;
peer.ip = ip;
peer.port = port;
peer.peer = memnew(PacketPeerUDP);
peer.peer->connect_shared_socket(_sock, ip, port, this);
peer.peer->store_packet(ip, port, recv_buffer, read);
pending.push_back(peer);
}
}
return OK;
}
Error UDPServer::listen(uint16_t p_port, const IP_Address &p_bind_address) {
ERR_FAIL_COND_V(!_sock.is_valid(), ERR_UNAVAILABLE);
ERR_FAIL_COND_V(_sock->is_open(), ERR_ALREADY_IN_USE);
ERR_FAIL_COND_V(!p_bind_address.is_valid() && !p_bind_address.is_wildcard(), ERR_INVALID_PARAMETER);
Error err;
IP::Type ip_type = IP::TYPE_ANY;
if (p_bind_address.is_valid())
ip_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6;
err = _sock->open(NetSocket::TYPE_UDP, ip_type);
if (err != OK)
return ERR_CANT_CREATE;
_sock->set_blocking_enabled(false);
_sock->set_reuse_address_enabled(true);
err = _sock->bind(p_bind_address, p_port);
if (err != OK) {
stop();
return err;
}
bind_address = p_bind_address;
bind_port = p_port;
return OK;
}
bool UDPServer::is_listening() const {
ERR_FAIL_COND_V(!_sock.is_valid(), false);
return _sock->is_open();
}
bool UDPServer::is_connection_available() const {
ERR_FAIL_COND_V(!_sock.is_valid(), false);
if (!_sock->is_open())
return false;
return pending.size() > 0;
}
void UDPServer::set_max_pending_connections(int p_max) {
ERR_FAIL_COND_MSG(p_max < 0, "Max pending connections value must be a positive number (0 means refuse new connections).");
max_pending_connections = p_max;
while (p_max > pending.size()) {
List<Peer>::Element *E = pending.back();
if (!E) {
break;
}
memdelete(E->get().peer);
pending.erase(E);
}
}
int UDPServer::get_max_pending_connections() const {
return max_pending_connections;
}
Ref<PacketPeerUDP> UDPServer::take_connection() {
Ref<PacketPeerUDP> conn;
if (!is_connection_available()) {
return conn;
}
Peer peer = pending[0];
pending.pop_front();
peers.push_back(peer);
return peer.peer;
}
void UDPServer::remove_peer(IP_Address p_ip, int p_port) {
Peer peer;
peer.ip = p_ip;
peer.port = p_port;
List<Peer>::Element *E = peers.find(peer);
if (E) {
peers.erase(E);
}
}
void UDPServer::stop() {
if (_sock.is_valid()) {
_sock->close();
}
bind_port = 0;
bind_address = IP_Address();
List<Peer>::Element *E = peers.front();
while (E) {
E->get().peer->disconnect_shared_socket();
E = E->next();
}
E = pending.front();
while (E) {
E->get().peer->disconnect_shared_socket();
memdelete(E->get().peer);
E = E->next();
}
peers.clear();
pending.clear();
}
UDPServer::UDPServer() :
_sock(Ref<NetSocket>(NetSocket::create())) {
}
UDPServer::~UDPServer() {
stop();
}

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* reverb_sw.h */
/* udp_server.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,61 +28,56 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#ifndef REVERB_SW_H
#define REVERB_SW_H
#ifndef UDP_SERVER_H
#define UDP_SERVER_H
#include "core/os/memory.h"
#include "core/typedefs.h"
#include "core/io/net_socket.h"
#include "core/io/packet_peer_udp.h"
struct ReverbParamsSW;
class UDPServer : public Reference {
GDCLASS(UDPServer, Reference);
class ReverbSW {
public:
enum ReverbMode {
REVERB_MODE_ROOM,
REVERB_MODE_STUDIO_SMALL,
REVERB_MODE_STUDIO_MEDIUM,
REVERB_MODE_STUDIO_LARGE,
REVERB_MODE_HALL,
REVERB_MODE_SPACE_ECHO,
REVERB_MODE_ECHO,
REVERB_MODE_DELAY,
REVERB_MODE_HALF_ECHO
protected:
enum {
PACKET_BUFFER_SIZE = 65536
};
private:
struct State {
int lwl;
int lwr;
int rwl;
int rwr;
unsigned int Offset;
void reset() {
lwl = 0;
lwr = 0;
rwl = 0;
rwr = 0;
Offset = 0;
struct Peer {
PacketPeerUDP *peer;
IP_Address ip;
uint16_t port = 0;
bool operator==(const Peer &p_other) const {
return (ip == p_other.ip && port == p_other.port);
}
State() { reset(); }
} state;
};
uint8_t recv_buffer[PACKET_BUFFER_SIZE];
ReverbParamsSW *current_params;
int bind_port = 0;
IP_Address bind_address;
int *reverb_buffer;
unsigned int reverb_buffer_size;
ReverbMode mode;
int mix_rate;
List<Peer> peers;
List<Peer> pending;
int max_pending_connections = 16;
void adjust_current_params();
Ref<NetSocket> _sock;
static void _bind_methods();
public:
void set_mode(ReverbMode p_mode);
bool process(int *p_input, int *p_output, int p_frames, int p_stereo_stride = 1); // return tru if audio was created
void set_mix_rate(int p_mix_rate);
void remove_peer(IP_Address p_ip, int p_port);
Error listen(uint16_t p_port, const IP_Address &p_bind_address = IP_Address("*"));
Error poll();
bool is_listening() const;
bool is_connection_available() const;
void set_max_pending_connections(int p_max);
int get_max_pending_connections() const;
Ref<PacketPeerUDP> take_connection();
ReverbSW();
~ReverbSW();
void stop();
UDPServer();
~UDPServer();
};
#endif
#endif // UDP_SERVER_H

View File

@ -280,58 +280,57 @@ MethodBind* create_method_bind($ifret R$ $ifnoret void$ (*p_method)($ifconst con
"""
def make_version(template, nargs, argmax, const, ret):
intext = template
from_pos = 0
outtext = ""
while(True):
while True:
to_pos = intext.find("$", from_pos)
if (to_pos == -1):
if to_pos == -1:
outtext += intext[from_pos:]
break
else:
outtext += intext[from_pos:to_pos]
end = intext.find("$", to_pos + 1)
if (end == -1):
if end == -1:
break # ignore
macro = intext[to_pos + 1:end]
macro = intext[to_pos + 1 : end]
cmd = ""
data = ""
if (macro.find(" ") != -1):
cmd = macro[0:macro.find(" ")]
data = macro[macro.find(" ") + 1:]
if macro.find(" ") != -1:
cmd = macro[0 : macro.find(" ")]
data = macro[macro.find(" ") + 1 :]
else:
cmd = macro
if (cmd == "argc"):
if cmd == "argc":
outtext += str(nargs)
if (cmd == "ifret" and ret):
if cmd == "ifret" and ret:
outtext += data
if (cmd == "ifargs" and nargs):
if cmd == "ifargs" and nargs:
outtext += data
if (cmd == "ifretargs" and nargs and ret):
if cmd == "ifretargs" and nargs and ret:
outtext += data
if (cmd == "ifconst" and const):
if cmd == "ifconst" and const:
outtext += data
elif (cmd == "ifnoconst" and not const):
elif cmd == "ifnoconst" and not const:
outtext += data
elif (cmd == "ifnoret" and not ret):
elif cmd == "ifnoret" and not ret:
outtext += data
elif (cmd == "iftempl" and (nargs > 0 or ret)):
elif cmd == "iftempl" and (nargs > 0 or ret):
outtext += data
elif (cmd == "arg,"):
elif cmd == "arg,":
for i in range(1, nargs + 1):
if (i > 1):
if i > 1:
outtext += ", "
outtext += data.replace("@", str(i))
elif (cmd == "arg"):
elif cmd == "arg":
for i in range(1, nargs + 1):
outtext += data.replace("@", str(i))
elif (cmd == "noarg"):
elif cmd == "noarg":
for i in range(nargs + 1, argmax + 1):
outtext += data.replace("@", str(i))
@ -348,7 +347,9 @@ def run(target, source, env):
text_ext = ""
text_free_func = "#ifndef METHOD_BIND_FREE_FUNC_H\n#define METHOD_BIND_FREE_FUNC_H\n"
text_free_func += "\n//including this header file allows method binding to use free functions\n"
text_free_func += "//note that the free function must have a pointer to an instance of the class as its first parameter\n"
text_free_func += (
"//note that the free function must have a pointer to an instance of the class as its first parameter\n"
)
for i in range(0, versions + 1):
@ -361,7 +362,7 @@ def run(target, source, env):
t += make_version(template_typed, i, versions, True, False)
t += make_version(template, i, versions, True, True)
t += make_version(template_typed, i, versions, True, True)
if (i >= versions_ext):
if i >= versions_ext:
text_ext += t
else:
text += t
@ -383,6 +384,7 @@ def run(target, source, env):
f.write(text_free_func)
if __name__ == '__main__':
if __name__ == "__main__":
from platform_methods import subprocess_main
subprocess_main(globals())

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_math = env.Clone()

View File

@ -292,10 +292,16 @@ int AStar::get_closest_point(const Vector3 &p_point, bool p_include_disabled) co
if (!p_include_disabled && !(*it.value)->enabled) continue; // Disabled points should not be considered.
// Keep the closest point's ID, and in case of multiple closest IDs,
// the smallest one (makes it deterministic).
real_t d = p_point.distance_squared_to((*it.value)->pos);
if (closest_id < 0 || d < closest_dist) {
int id = *(it.key);
if (d <= closest_dist) {
if (d == closest_dist && id > closest_id) { // Keep lowest ID.
continue;
}
closest_dist = d;
closest_id = *(it.key);
closest_id = id;
}
}
@ -304,7 +310,6 @@ int AStar::get_closest_point(const Vector3 &p_point, bool p_include_disabled) co
Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const {
bool found = false;
real_t closest_dist = 1e20;
Vector3 closest_point;
@ -325,11 +330,10 @@ Vector3 AStar::get_closest_position_in_segment(const Vector3 &p_point) const {
Vector3 p = Geometry::get_closest_point_to_segment(p_point, segment);
real_t d = p_point.distance_squared_to(p);
if (!found || d < closest_dist) {
if (d < closest_dist) {
closest_point = p;
closest_dist = d;
found = true;
}
}
@ -399,7 +403,7 @@ bool AStar::_solve(Point *begin_point, Point *end_point) {
return found_route;
}
float AStar::_estimate_cost(int p_from_id, int p_to_id) {
real_t AStar::_estimate_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost))
return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id);
@ -415,7 +419,7 @@ float AStar::_estimate_cost(int p_from_id, int p_to_id) {
return from_point->pos.distance_to(to_point->pos);
}
float AStar::_compute_cost(int p_from_id, int p_to_id) {
real_t AStar::_compute_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost))
return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id);
@ -677,25 +681,195 @@ Vector2 AStar2D::get_closest_position_in_segment(const Vector2 &p_point) const {
return Vector2(p.x, p.y);
}
real_t AStar2D::_estimate_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_estimate_cost))
return get_script_instance()->call(SceneStringNames::get_singleton()->_estimate_cost, p_from_id, p_to_id);
AStar::Point *from_point;
bool from_exists = astar.points.lookup(p_from_id, from_point);
ERR_FAIL_COND_V(!from_exists, 0);
AStar::Point *to_point;
bool to_exists = astar.points.lookup(p_to_id, to_point);
ERR_FAIL_COND_V(!to_exists, 0);
return from_point->pos.distance_to(to_point->pos);
}
real_t AStar2D::_compute_cost(int p_from_id, int p_to_id) {
if (get_script_instance() && get_script_instance()->has_method(SceneStringNames::get_singleton()->_compute_cost))
return get_script_instance()->call(SceneStringNames::get_singleton()->_compute_cost, p_from_id, p_to_id);
AStar::Point *from_point;
bool from_exists = astar.points.lookup(p_from_id, from_point);
ERR_FAIL_COND_V(!from_exists, 0);
AStar::Point *to_point;
bool to_exists = astar.points.lookup(p_to_id, to_point);
ERR_FAIL_COND_V(!to_exists, 0);
return from_point->pos.distance_to(to_point->pos);
}
PoolVector<Vector2> AStar2D::get_point_path(int p_from_id, int p_to_id) {
PoolVector3Array pv = astar.get_point_path(p_from_id, p_to_id);
int size = pv.size();
PoolVector2Array path;
path.resize(size);
{
PoolVector<Vector3>::Read r = pv.read();
PoolVector<Vector2>::Write w = path.write();
for (int i = 0; i < size; i++) {
Vector3 p = r[i];
w[i] = Vector2(p.x, p.y);
}
AStar::Point *a;
bool from_exists = astar.points.lookup(p_from_id, a);
ERR_FAIL_COND_V(!from_exists, PoolVector<Vector2>());
AStar::Point *b;
bool to_exists = astar.points.lookup(p_to_id, b);
ERR_FAIL_COND_V(!to_exists, PoolVector<Vector2>());
if (a == b) {
PoolVector<Vector2> ret;
ret.push_back(Vector2(a->pos.x, a->pos.y));
return ret;
}
AStar::Point *begin_point = a;
AStar::Point *end_point = b;
bool found_route = _solve(begin_point, end_point);
if (!found_route) return PoolVector<Vector2>();
AStar::Point *p = end_point;
int pc = 1; // Begin point
while (p != begin_point) {
pc++;
p = p->prev_point;
}
PoolVector<Vector2> path;
path.resize(pc);
{
PoolVector<Vector2>::Write w = path.write();
AStar::Point *p2 = end_point;
int idx = pc - 1;
while (p2 != begin_point) {
w[idx--] = Vector2(p2->pos.x, p2->pos.y);
p2 = p2->prev_point;
}
w[0] = Vector2(p2->pos.x, p2->pos.y); // Assign first
}
return path;
}
PoolVector<int> AStar2D::get_id_path(int p_from_id, int p_to_id) {
return astar.get_id_path(p_from_id, p_to_id);
AStar::Point *a;
bool from_exists = astar.points.lookup(p_from_id, a);
ERR_FAIL_COND_V(!from_exists, PoolVector<int>());
AStar::Point *b;
bool to_exists = astar.points.lookup(p_to_id, b);
ERR_FAIL_COND_V(!to_exists, PoolVector<int>());
if (a == b) {
PoolVector<int> ret;
ret.push_back(a->id);
return ret;
}
AStar::Point *begin_point = a;
AStar::Point *end_point = b;
bool found_route = _solve(begin_point, end_point);
if (!found_route) return PoolVector<int>();
AStar::Point *p = end_point;
int pc = 1; // Begin point
while (p != begin_point) {
pc++;
p = p->prev_point;
}
PoolVector<int> path;
path.resize(pc);
{
PoolVector<int>::Write w = path.write();
p = end_point;
int idx = pc - 1;
while (p != begin_point) {
w[idx--] = p->id;
p = p->prev_point;
}
w[0] = p->id; // Assign first
}
return path;
}
bool AStar2D::_solve(AStar::Point *begin_point, AStar::Point *end_point) {
astar.pass++;
if (!end_point->enabled) return false;
bool found_route = false;
Vector<AStar::Point *> open_list;
SortArray<AStar::Point *, AStar::SortPoints> sorter;
begin_point->g_score = 0;
begin_point->f_score = _estimate_cost(begin_point->id, end_point->id);
open_list.push_back(begin_point);
while (!open_list.empty()) {
AStar::Point *p = open_list[0]; // The currently processed point
if (p == end_point) {
found_route = true;
break;
}
sorter.pop_heap(0, open_list.size(), open_list.ptrw()); // Remove the current point from the open list
open_list.remove(open_list.size() - 1);
p->closed_pass = astar.pass; // Mark the point as closed
for (OAHashMap<int, AStar::Point *>::Iterator it = p->neighbours.iter(); it.valid; it = p->neighbours.next_iter(it)) {
AStar::Point *e = *(it.value); // The neighbour point
if (!e->enabled || e->closed_pass == astar.pass) {
continue;
}
real_t tentative_g_score = p->g_score + _compute_cost(p->id, e->id) * e->weight_scale;
bool new_point = false;
if (e->open_pass != astar.pass) { // The point wasn't inside the open list.
e->open_pass = astar.pass;
open_list.push_back(e);
new_point = true;
} else if (tentative_g_score >= e->g_score) { // The new path is worse than the previous.
continue;
}
e->prev_point = p;
e->g_score = tentative_g_score;
e->f_score = e->g_score + _estimate_cost(e->id, end_point->id);
if (new_point) { // The position of the new points is already known.
sorter.push_heap(0, open_list.size() - 1, 0, e, open_list.ptrw());
} else {
sorter.push_heap(0, open_list.find(e), 0, e, open_list.ptrw());
}
}
}
return found_route;
}
void AStar2D::_bind_methods() {
@ -728,6 +902,9 @@ void AStar2D::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_point_path", "from_id", "to_id"), &AStar2D::get_point_path);
ClassDB::bind_method(D_METHOD("get_id_path", "from_id", "to_id"), &AStar2D::get_id_path);
BIND_VMETHOD(MethodInfo(Variant::REAL, "_estimate_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
BIND_VMETHOD(MethodInfo(Variant::REAL, "_compute_cost", PropertyInfo(Variant::INT, "from_id"), PropertyInfo(Variant::INT, "to_id")));
}
AStar2D::AStar2D() {

View File

@ -43,6 +43,7 @@
class AStar : public Reference {
GDCLASS(AStar, Reference);
friend class AStar2D;
struct Point {
@ -124,8 +125,8 @@ class AStar : public Reference {
protected:
static void _bind_methods();
virtual float _estimate_cost(int p_from_id, int p_to_id);
virtual float _compute_cost(int p_from_id, int p_to_id);
virtual real_t _estimate_cost(int p_from_id, int p_to_id);
virtual real_t _compute_cost(int p_from_id, int p_to_id);
public:
int get_available_point_id() const;
@ -166,9 +167,14 @@ class AStar2D : public Reference {
GDCLASS(AStar2D, Reference);
AStar astar;
bool _solve(AStar::Point *begin_point, AStar::Point *end_point);
protected:
static void _bind_methods();
virtual real_t _estimate_cost(int p_from_id, int p_to_id);
virtual real_t _compute_cost(int p_from_id, int p_to_id);
public:
int get_available_point_id() const;

View File

@ -76,7 +76,7 @@ public:
bool intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip = NULL, Vector3 *r_normal = NULL) const;
_FORCE_INLINE_ bool smits_intersect_ray(const Vector3 &p_from, const Vector3 &p_dir, real_t t0, real_t t1) const;
_FORCE_INLINE_ bool intersects_convex_shape(const Plane *p_planes, int p_plane_count) const;
_FORCE_INLINE_ bool intersects_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count) const;
_FORCE_INLINE_ bool inside_convex_shape(const Plane *p_planes, int p_plane_count) const;
bool intersects_plane(const Plane &p_plane) const;
@ -101,6 +101,10 @@ public:
_FORCE_INLINE_ void project_range_in_plane(const Plane &p_plane, real_t &r_min, real_t &r_max) const;
_FORCE_INLINE_ void expand_to(const Vector3 &p_vector); /** expand to contain a point if necessary */
_FORCE_INLINE_ AABB abs() const {
return AABB(Vector3(position.x + MIN(size.x, 0), position.y + MIN(size.y, 0), position.z + MIN(size.z, 0)), size.abs());
}
operator String() const;
_FORCE_INLINE_ AABB() {}
@ -190,7 +194,7 @@ Vector3 AABB::get_endpoint(int p_point) const {
ERR_FAIL_V(Vector3());
}
bool AABB::intersects_convex_shape(const Plane *p_planes, int p_plane_count) const {
bool AABB::intersects_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count) const {
Vector3 half_extents = size * 0.5;
Vector3 ofs = position + half_extents;
@ -206,6 +210,30 @@ bool AABB::intersects_convex_shape(const Plane *p_planes, int p_plane_count) con
return false;
}
// Make sure all points in the shape aren't fully separated from the AABB on
// each axis.
int bad_point_counts_positive[3] = { 0 };
int bad_point_counts_negative[3] = { 0 };
for (int k = 0; k < 3; k++) {
for (int i = 0; i < p_point_count; i++) {
if (p_points[i].coord[k] > ofs.coord[k] + half_extents.coord[k]) {
bad_point_counts_positive[k]++;
}
if (p_points[i].coord[k] < ofs.coord[k] - half_extents.coord[k]) {
bad_point_counts_negative[k]++;
}
}
if (bad_point_counts_negative[k] == p_point_count) {
return false;
}
if (bad_point_counts_positive[k] == p_point_count) {
return false;
}
}
return true;
}

View File

@ -77,10 +77,6 @@ void Basis::invert() {
void Basis::orthonormalize() {
#ifdef MATH_CHECKS
ERR_FAIL_COND(determinant() == 0);
#endif
// Gram-Schmidt Process
Vector3 x = get_axis(0);
@ -431,12 +427,9 @@ Vector3 Basis::get_euler_xyz() const {
// -cx*cz*sy+sx*sz cz*sx+cx*sy*sz cx*cy
Vector3 euler;
#ifdef MATH_CHECKS
ERR_FAIL_COND_V(!is_rotation(), euler);
#endif
real_t sy = elements[0][2];
if (sy < 1.0) {
if (sy > -1.0) {
if (sy < (1.0 - CMP_EPSILON)) {
if (sy > -(1.0 - CMP_EPSILON)) {
// is this a pure Y rotation?
if (elements[1][0] == 0.0 && elements[0][1] == 0.0 && elements[1][2] == 0 && elements[2][1] == 0 && elements[1][1] == 1) {
// return the simplest form (human friendlier in editor and scripts)
@ -449,12 +442,12 @@ Vector3 Basis::get_euler_xyz() const {
euler.z = Math::atan2(-elements[0][1], elements[0][0]);
}
} else {
euler.x = -Math::atan2(elements[0][1], elements[1][1]);
euler.x = Math::atan2(elements[2][1], elements[1][1]);
euler.y = -Math_PI / 2.0;
euler.z = 0.0;
}
} else {
euler.x = Math::atan2(elements[0][1], elements[1][1]);
euler.x = Math::atan2(elements[2][1], elements[1][1]);
euler.y = Math_PI / 2.0;
euler.z = 0.0;
}
@ -485,16 +478,106 @@ void Basis::set_euler_xyz(const Vector3 &p_euler) {
*this = xmat * (ymat * zmat);
}
Vector3 Basis::get_euler_xzy() const {
// Euler angles in XZY convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
//
// rot = cz*cy -sz cz*sy
// sx*sy+cx*cy*sz cx*cz cx*sz*sy-cy*sx
// cy*sx*sz cz*sx cx*cy+sx*sz*sy
Vector3 euler;
real_t sz = elements[0][1];
if (sz < (1.0 - CMP_EPSILON)) {
if (sz > -(1.0 - CMP_EPSILON)) {
euler.x = Math::atan2(elements[2][1], elements[1][1]);
euler.y = Math::atan2(elements[0][2], elements[0][0]);
euler.z = Math::asin(-sz);
} else {
// It's -1
euler.x = -Math::atan2(elements[1][2], elements[2][2]);
euler.y = 0.0;
euler.z = Math_PI / 2.0;
}
} else {
// It's 1
euler.x = -Math::atan2(elements[1][2], elements[2][2]);
euler.y = 0.0;
euler.z = -Math_PI / 2.0;
}
return euler;
}
void Basis::set_euler_xzy(const Vector3 &p_euler) {
real_t c, s;
c = Math::cos(p_euler.x);
s = Math::sin(p_euler.x);
Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c);
c = Math::cos(p_euler.y);
s = Math::sin(p_euler.y);
Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c);
c = Math::cos(p_euler.z);
s = Math::sin(p_euler.z);
Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0);
*this = xmat * zmat * ymat;
}
Vector3 Basis::get_euler_yzx() const {
// Euler angles in YZX convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
//
// rot = cy*cz sy*sx-cy*cx*sz cx*sy+cy*sz*sx
// sz cz*cx -cz*sx
// -cz*sy cy*sx+cx*sy*sz cy*cx-sy*sz*sx
Vector3 euler;
real_t sz = elements[1][0];
if (sz < (1.0 - CMP_EPSILON)) {
if (sz > -(1.0 - CMP_EPSILON)) {
euler.x = Math::atan2(-elements[1][2], elements[1][1]);
euler.y = Math::atan2(-elements[2][0], elements[0][0]);
euler.z = Math::asin(sz);
} else {
// It's -1
euler.x = Math::atan2(elements[2][1], elements[2][2]);
euler.y = 0.0;
euler.z = -Math_PI / 2.0;
}
} else {
// It's 1
euler.x = Math::atan2(elements[2][1], elements[2][2]);
euler.y = 0.0;
euler.z = Math_PI / 2.0;
}
return euler;
}
void Basis::set_euler_yzx(const Vector3 &p_euler) {
real_t c, s;
c = Math::cos(p_euler.x);
s = Math::sin(p_euler.x);
Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c);
c = Math::cos(p_euler.y);
s = Math::sin(p_euler.y);
Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c);
c = Math::cos(p_euler.z);
s = Math::sin(p_euler.z);
Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0);
*this = ymat * zmat * xmat;
}
// get_euler_yxz returns a vector containing the Euler angles in the YXZ convention,
// as in first-Z, then-X, last-Y. The angles for X, Y, and Z rotations are returned
// as the x, y, and z components of a Vector3 respectively.
Vector3 Basis::get_euler_yxz() const {
/* checking this is a bad idea, because obtaining from scaled transform is a valid use case
#ifdef MATH_CHECKS
ERR_FAIL_COND(!is_rotation());
#endif
*/
// Euler angles in YXZ convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
//
@ -506,8 +589,8 @@ Vector3 Basis::get_euler_yxz() const {
real_t m12 = elements[1][2];
if (m12 < 1) {
if (m12 > -1) {
if (m12 < (1 - CMP_EPSILON)) {
if (m12 > -(1 - CMP_EPSILON)) {
// is this a pure X rotation?
if (elements[1][0] == 0 && elements[0][1] == 0 && elements[0][2] == 0 && elements[2][0] == 0 && elements[0][0] == 1) {
// return the simplest form (human friendlier in editor and scripts)
@ -521,12 +604,12 @@ Vector3 Basis::get_euler_yxz() const {
}
} else { // m12 == -1
euler.x = Math_PI * 0.5;
euler.y = -atan2(-elements[0][1], elements[0][0]);
euler.y = atan2(elements[0][1], elements[0][0]);
euler.z = 0;
}
} else { // m12 == 1
euler.x = -Math_PI * 0.5;
euler.y = -atan2(-elements[0][1], elements[0][0]);
euler.y = -atan2(elements[0][1], elements[0][0]);
euler.z = 0;
}
@ -557,6 +640,100 @@ void Basis::set_euler_yxz(const Vector3 &p_euler) {
*this = ymat * xmat * zmat;
}
Vector3 Basis::get_euler_zxy() const {
// Euler angles in ZXY convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
//
// rot = cz*cy-sz*sx*sy -cx*sz cz*sy+cy*sz*sx
// cy*sz+cz*sx*sy cz*cx sz*sy-cz*cy*sx
// -cx*sy sx cx*cy
Vector3 euler;
real_t sx = elements[2][1];
if (sx < (1.0 - CMP_EPSILON)) {
if (sx > -(1.0 - CMP_EPSILON)) {
euler.x = Math::asin(sx);
euler.y = Math::atan2(-elements[2][0], elements[2][2]);
euler.z = Math::atan2(-elements[0][1], elements[1][1]);
} else {
// It's -1
euler.x = -Math_PI / 2.0;
euler.y = Math::atan2(elements[0][2], elements[0][0]);
euler.z = 0;
}
} else {
// It's 1
euler.x = Math_PI / 2.0;
euler.y = Math::atan2(elements[0][2], elements[0][0]);
euler.z = 0;
}
return euler;
}
void Basis::set_euler_zxy(const Vector3 &p_euler) {
real_t c, s;
c = Math::cos(p_euler.x);
s = Math::sin(p_euler.x);
Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c);
c = Math::cos(p_euler.y);
s = Math::sin(p_euler.y);
Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c);
c = Math::cos(p_euler.z);
s = Math::sin(p_euler.z);
Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0);
*this = zmat * xmat * ymat;
}
Vector3 Basis::get_euler_zyx() const {
// Euler angles in ZYX convention.
// See https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
//
// rot = cz*cy cz*sy*sx-cx*sz sz*sx+cz*cx*cy
// cy*sz cz*cx+sz*sy*sx cx*sz*sy-cz*sx
// -sy cy*sx cy*cx
Vector3 euler;
real_t sy = elements[2][0];
if (sy < (1.0 - CMP_EPSILON)) {
if (sy > -(1.0 - CMP_EPSILON)) {
euler.x = Math::atan2(elements[2][1], elements[2][2]);
euler.y = Math::asin(-sy);
euler.z = Math::atan2(elements[1][0], elements[0][0]);
} else {
// It's -1
euler.x = 0;
euler.y = Math_PI / 2.0;
euler.z = -Math::atan2(elements[0][1], elements[1][1]);
}
} else {
// It's 1
euler.x = 0;
euler.y = -Math_PI / 2.0;
euler.z = -Math::atan2(elements[0][1], elements[1][1]);
}
return euler;
}
void Basis::set_euler_zyx(const Vector3 &p_euler) {
real_t c, s;
c = Math::cos(p_euler.x);
s = Math::sin(p_euler.x);
Basis xmat(1.0, 0.0, 0.0, 0.0, c, -s, 0.0, s, c);
c = Math::cos(p_euler.y);
s = Math::sin(p_euler.y);
Basis ymat(c, 0.0, s, 0.0, 1.0, 0.0, -s, 0.0, c);
c = Math::cos(p_euler.z);
s = Math::sin(p_euler.z);
Basis zmat(c, -s, 0.0, s, c, 0.0, 0.0, 0.0, 1.0);
*this = zmat * ymat * xmat;
}
bool Basis::is_equal_approx(const Basis &p_basis) const {
return elements[0].is_equal_approx(p_basis.elements[0]) && elements[1].is_equal_approx(p_basis.elements[1]) && elements[2].is_equal_approx(p_basis.elements[2]);

View File

@ -36,7 +36,11 @@
class Basis {
public:
Vector3 elements[3];
Vector3 elements[3] = {
Vector3(1, 0, 0),
Vector3(0, 1, 0),
Vector3(0, 0, 1)
};
_FORCE_INLINE_ const Vector3 &operator[](int axis) const {
@ -90,9 +94,22 @@ public:
Vector3 get_euler_xyz() const;
void set_euler_xyz(const Vector3 &p_euler);
Vector3 get_euler_xzy() const;
void set_euler_xzy(const Vector3 &p_euler);
Vector3 get_euler_yzx() const;
void set_euler_yzx(const Vector3 &p_euler);
Vector3 get_euler_yxz() const;
void set_euler_yxz(const Vector3 &p_euler);
Vector3 get_euler_zxy() const;
void set_euler_zxy(const Vector3 &p_euler);
Vector3 get_euler_zyx() const;
void set_euler_zyx(const Vector3 &p_euler);
Quat get_quat() const;
void set_quat(const Quat &p_quat);
@ -244,18 +261,7 @@ public:
elements[2] = row2;
}
_FORCE_INLINE_ Basis() {
elements[0][0] = 1;
elements[0][1] = 0;
elements[0][2] = 0;
elements[1][0] = 0;
elements[1][1] = 1;
elements[1][2] = 0;
elements[2][0] = 0;
elements[2][1] = 0;
elements[2][2] = 1;
}
_FORCE_INLINE_ Basis() {}
};
_FORCE_INLINE_ void Basis::operator*=(const Basis &p_matrix) {

View File

@ -145,7 +145,7 @@ void CameraMatrix::set_for_hmd(int p_eye, real_t p_aspect, real_t p_intraocular_
f3 *= p_oversample;
// always apply KEEP_WIDTH aspect ratio
f3 *= p_aspect;
f3 /= p_aspect;
switch (p_eye) {
case 1: { // left eye

View File

@ -1004,6 +1004,7 @@ Error Expression::_get_token(Token &r_token) {
return OK;
};
case '\'':
case '"': {
String str;
@ -1015,7 +1016,8 @@ Error Expression::_get_token(Token &r_token) {
_set_error("Unterminated String");
r_token.type = TK_ERROR;
return ERR_PARSE_ERROR;
} else if (ch == '"') {
} else if (ch == cchar) {
// cchar contain a corresponding quote symbol
break;
} else if (ch == '\\') {
//escaped characters...
@ -1174,7 +1176,7 @@ Error Expression::_get_token(Token &r_token) {
if (is_float)
r_token.value = num.to_double();
else
r_token.value = num.to_int();
r_token.value = num.to_int64();
return OK;
} else if ((cchar >= 'A' && cchar <= 'Z') || (cchar >= 'a' && cchar <= 'z') || cchar == '_') {

View File

@ -1185,3 +1185,42 @@ Vector<Vector<Point2> > Geometry::_polypath_offset(const Vector<Point2> &p_polyp
}
return polypaths;
}
Vector<Vector3> Geometry::compute_convex_mesh_points(const Plane *p_planes, int p_plane_count) {
Vector<Vector3> points;
// Iterate through every unique combination of any three planes.
for (int i = p_plane_count - 1; i >= 0; i--) {
for (int j = i - 1; j >= 0; j--) {
for (int k = j - 1; k >= 0; k--) {
// Find the point where these planes all cross over (if they
// do at all).
Vector3 convex_shape_point;
if (p_planes[i].intersect_3(p_planes[j], p_planes[k], &convex_shape_point)) {
// See if any *other* plane excludes this point because it's
// on the wrong side.
bool excluded = false;
for (int n = 0; n < p_plane_count; n++) {
if (n != i && n != j && n != k) {
real_t dp = p_planes[n].normal.dot(convex_shape_point);
if (dp - p_planes[n].d > CMP_EPSILON) {
excluded = true;
break;
}
}
}
// Only add the point if it passed all tests.
if (!excluded) {
points.push_back(convex_shape_point);
}
}
}
}
}
return points;
}

View File

@ -1014,6 +1014,8 @@ public:
static void make_atlas(const Vector<Size2i> &p_rects, Vector<Point2i> &r_result, Size2i &r_size);
static Vector<Vector3> compute_convex_mesh_points(const Plane *p_planes, int p_plane_count);
private:
static Vector<Vector<Point2> > _polypaths_do_operation(PolyBooleanOperation p_op, const Vector<Point2> &p_polypath_a, const Vector<Point2> &p_polypath_b, bool is_a_open = false);
static Vector<Vector<Point2> > _polypath_offset(const Vector<Point2> &p_polypath, real_t p_delta, PolyJoinType p_join_type, PolyEndType p_end_type);

View File

@ -34,6 +34,7 @@
#include "core/list.h"
#include "core/map.h"
#include "core/math/aabb.h"
#include "core/math/geometry.h"
#include "core/math/vector3.h"
#include "core/print_string.h"
#include "core/variant.h"
@ -341,6 +342,8 @@ private:
const Plane *planes;
int plane_count;
const Vector3 *points;
int point_count;
T **result_array;
int *result_idx;
int result_max;
@ -1017,8 +1020,7 @@ void Octree<T, use_pairs, AL>::_cull_convex(Octant *p_octant, _CullConvexData *p
continue;
e->last_pass = pass;
if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count)) {
if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) {
if (*p_cull->result_idx < p_cull->result_max) {
p_cull->result_array[*p_cull->result_idx] = e->userdata;
(*p_cull->result_idx)++;
@ -1043,7 +1045,7 @@ void Octree<T, use_pairs, AL>::_cull_convex(Octant *p_octant, _CullConvexData *p
continue;
e->last_pass = pass;
if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count)) {
if (e->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) {
if (*p_cull->result_idx < p_cull->result_max) {
@ -1059,7 +1061,7 @@ void Octree<T, use_pairs, AL>::_cull_convex(Octant *p_octant, _CullConvexData *p
for (int i = 0; i < 8; i++) {
if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count)) {
if (p_octant->children[i] && p_octant->children[i]->aabb.intersects_convex_shape(p_cull->planes, p_cull->plane_count, p_cull->points, p_cull->point_count)) {
_cull_convex(p_octant->children[i], p_cull);
}
}
@ -1288,7 +1290,11 @@ void Octree<T, use_pairs, AL>::_cull_point(Octant *p_octant, const Vector3 &p_po
template <class T, bool use_pairs, class AL>
int Octree<T, use_pairs, AL>::cull_convex(const Vector<Plane> &p_convex, T **p_result_array, int p_result_max, uint32_t p_mask) {
if (!root)
if (!root || p_convex.size() == 0)
return 0;
Vector<Vector3> convex_points = Geometry::compute_convex_mesh_points(&p_convex[0], p_convex.size());
if (convex_points.size() == 0)
return 0;
int result_count = 0;
@ -1296,6 +1302,8 @@ int Octree<T, use_pairs, AL>::cull_convex(const Vector<Plane> &p_convex, T **p_r
_CullConvexData cdata;
cdata.planes = &p_convex[0];
cdata.plane_count = p_convex.size();
cdata.points = &convex_points[0];
cdata.point_count = convex_points.size();
cdata.result_array = p_result_array;
cdata.result_max = p_result_max;
cdata.result_idx = &result_count;

View File

@ -56,7 +56,6 @@ Plane Plane::normalized() const {
}
Vector3 Plane::get_any_point() const {
return get_normal() * d;
}

View File

@ -47,15 +47,26 @@ struct Rect2 {
real_t get_area() const { return size.width * size.height; }
inline bool intersects(const Rect2 &p_rect) const {
if (position.x >= (p_rect.position.x + p_rect.size.width))
return false;
if ((position.x + size.width) <= p_rect.position.x)
return false;
if (position.y >= (p_rect.position.y + p_rect.size.height))
return false;
if ((position.y + size.height) <= p_rect.position.y)
return false;
inline bool intersects(const Rect2 &p_rect, const bool p_include_borders = false) const {
if (p_include_borders) {
if (position.x > (p_rect.position.x + p_rect.size.width))
return false;
if ((position.x + size.width) < p_rect.position.x)
return false;
if (position.y > (p_rect.position.y + p_rect.size.height))
return false;
if ((position.y + size.height) < p_rect.position.y)
return false;
} else {
if (position.x >= (p_rect.position.x + p_rect.size.width))
return false;
if ((position.x + size.width) <= p_rect.position.x)
return false;
if (position.y >= (p_rect.position.y + p_rect.size.height))
return false;
if ((position.y + size.height) <= p_rect.position.y)
return false;
}
return true;
}

View File

@ -71,12 +71,7 @@ void Transform2D::rotate(real_t p_phi) {
}
real_t Transform2D::get_rotation() const {
real_t det = basis_determinant();
Transform2D m = orthonormalized();
if (det < 0) {
m.scale_basis(Size2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.
}
return Math::atan2(m[0].y, m[0].x);
return Math::atan2(elements[0].y, elements[0].x);
}
void Transform2D::set_rotation(real_t p_rot) {

View File

@ -511,7 +511,7 @@ bool TriangleMesh::intersect_ray(const Vector3 &p_begin, const Vector3 &p_dir, V
return inters;
}
bool TriangleMesh::intersect_convex_shape(const Plane *p_planes, int p_plane_count) const {
bool TriangleMesh::intersect_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count) const {
uint32_t *stack = (uint32_t *)alloca(sizeof(int) * max_depth);
//p_fully_inside = true;
@ -548,7 +548,7 @@ bool TriangleMesh::intersect_convex_shape(const Plane *p_planes, int p_plane_cou
switch (stack[level] >> VISITED_BIT_SHIFT) {
case TEST_AABB_BIT: {
bool valid = b.aabb.intersects_convex_shape(p_planes, p_plane_count);
bool valid = b.aabb.intersects_convex_shape(p_planes, p_plane_count, p_points, p_point_count);
if (!valid) {
stack[level] = (VISIT_DONE_BIT << VISITED_BIT_SHIFT) | node;
@ -629,7 +629,7 @@ bool TriangleMesh::intersect_convex_shape(const Plane *p_planes, int p_plane_cou
return false;
}
bool TriangleMesh::inside_convex_shape(const Plane *p_planes, int p_plane_count, Vector3 p_scale) const {
bool TriangleMesh::inside_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count, Vector3 p_scale) const {
uint32_t *stack = (uint32_t *)alloca(sizeof(int) * max_depth);
enum {
@ -666,7 +666,7 @@ bool TriangleMesh::inside_convex_shape(const Plane *p_planes, int p_plane_count,
switch (stack[level] >> VISITED_BIT_SHIFT) {
case TEST_AABB_BIT: {
bool intersects = scale.xform(b.aabb).intersects_convex_shape(p_planes, p_plane_count);
bool intersects = scale.xform(b.aabb).intersects_convex_shape(p_planes, p_plane_count, p_points, p_point_count);
if (!intersects) return false;
bool inside = scale.xform(b.aabb).inside_convex_shape(p_planes, p_plane_count);

View File

@ -90,8 +90,8 @@ public:
bool is_valid() const;
bool intersect_segment(const Vector3 &p_begin, const Vector3 &p_end, Vector3 &r_point, Vector3 &r_normal) const;
bool intersect_ray(const Vector3 &p_begin, const Vector3 &p_dir, Vector3 &r_point, Vector3 &r_normal) const;
bool intersect_convex_shape(const Plane *p_planes, int p_plane_count) const;
bool inside_convex_shape(const Plane *p_planes, int p_plane_count, Vector3 p_scale = Vector3(1, 1, 1)) const;
bool intersect_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count) const;
bool inside_convex_shape(const Plane *p_planes, int p_plane_count, const Vector3 *p_points, int p_point_count, Vector3 p_scale = Vector3(1, 1, 1)) const;
Vector3 get_area_normal(const AABB &p_aabb) const;
PoolVector<Face3> get_faces() const;

View File

@ -337,14 +337,14 @@ bool MessageQueue::is_flushing() const {
MessageQueue::MessageQueue() {
ERR_FAIL_COND_MSG(singleton != NULL, "MessageQueue singleton already exist.");
ERR_FAIL_COND_MSG(singleton != NULL, "A MessageQueue singleton already exists.");
singleton = this;
flushing = false;
buffer_end = 0;
buffer_max_used = 0;
buffer_size = GLOBAL_DEF_RST("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB);
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/message_queue/max_size_kb", PropertyInfo(Variant::INT, "memory/limits/message_queue/max_size_kb", PROPERTY_HINT_RANGE, "0,2048,1,or_greater"));
ProjectSettings::get_singleton()->set_custom_property_info("memory/limits/message_queue/max_size_kb", PropertyInfo(Variant::INT, "memory/limits/message_queue/max_size_kb", PROPERTY_HINT_RANGE, "1024,4096,1,or_greater"));
buffer_size *= 1024;
buffer = memnew_arr(uint8_t, buffer_size);
}

View File

@ -45,6 +45,9 @@
*
* The entries are stored inplace, so huge keys or values might fill cache lines
* a lot faster.
*
* Only used keys and values are constructed. For free positions there's space
* in the arrays for each, but that memory is kept uninitialized.
*/
template <class TKey, class TValue,
class Hasher = HashMapHasherDefault,
@ -149,9 +152,9 @@ private:
uint32_t *old_hashes = hashes;
num_elements = 0;
keys = memnew_arr(TKey, capacity);
values = memnew_arr(TValue, capacity);
hashes = memnew_arr(uint32_t, capacity);
keys = static_cast<TKey *>(Memory::alloc_static(sizeof(TKey) * capacity));
values = static_cast<TValue *>(Memory::alloc_static(sizeof(TValue) * capacity));
hashes = static_cast<uint32_t *>(Memory::alloc_static(sizeof(uint32_t) * capacity));
for (uint32_t i = 0; i < capacity; i++) {
hashes[i] = 0;
@ -163,11 +166,14 @@ private:
}
_insert_with_hash(old_hashes[i], old_keys[i], old_values[i]);
old_keys[i].~TKey();
old_values[i].~TValue();
}
memdelete_arr(old_keys);
memdelete_arr(old_values);
memdelete_arr(old_hashes);
Memory::free_static(old_keys);
Memory::free_static(old_values);
Memory::free_static(old_hashes);
}
void _resize_and_rehash() {
@ -214,8 +220,7 @@ public:
bool exists = _lookup_pos(p_key, pos);
if (exists) {
values[pos].~TValue();
memnew_placement(&values[pos], TValue(p_data));
values[pos] = p_data;
} else {
insert(p_key, p_data);
}
@ -232,8 +237,7 @@ public:
bool exists = _lookup_pos(p_key, pos);
if (exists) {
r_data.~TValue();
memnew_placement(&r_data, TValue(values[pos]));
r_data = values[pos];
return true;
}
@ -284,7 +288,7 @@ public:
bool valid;
const TKey *key;
const TValue *value;
TValue *value;
private:
uint32_t pos;
@ -336,9 +340,9 @@ public:
capacity = p_initial_capacity;
num_elements = 0;
keys = memnew_arr(TKey, p_initial_capacity);
values = memnew_arr(TValue, p_initial_capacity);
hashes = memnew_arr(uint32_t, p_initial_capacity);
keys = static_cast<TKey *>(Memory::alloc_static(sizeof(TKey) * capacity));
values = static_cast<TValue *>(Memory::alloc_static(sizeof(TValue) * capacity));
hashes = static_cast<uint32_t *>(Memory::alloc_static(sizeof(uint32_t) * capacity));
for (uint32_t i = 0; i < p_initial_capacity; i++) {
hashes[i] = EMPTY_HASH;
@ -347,9 +351,19 @@ public:
~OAHashMap() {
memdelete_arr(keys);
memdelete_arr(values);
memdelete_arr(hashes);
for (uint32_t i = 0; i < capacity; i++) {
if (hashes[i] == EMPTY_HASH) {
continue;
}
values[i].~TValue();
keys[i].~TKey();
}
Memory::free_static(keys);
Memory::free_static(values);
Memory::free_static(hashes);
}
};

View File

@ -33,6 +33,7 @@
#include "core/class_db.h"
#include "core/core_string_names.h"
#include "core/message_queue.h"
#include "core/object_rc.h"
#include "core/os/os.h"
#include "core/print_string.h"
#include "core/resource.h"
@ -694,7 +695,7 @@ Variant Object::_call_deferred_bind(const Variant **p_args, int p_argcount, Vari
StringName method = *p_args[0];
MessageQueue::get_singleton()->push_call(get_instance_id(), method, &p_args[1], p_argcount - 1);
MessageQueue::get_singleton()->push_call(get_instance_id(), method, &p_args[1], p_argcount - 1, true);
return Variant();
}
@ -968,6 +969,37 @@ void Object::cancel_delete() {
_predelete_ok = true;
}
#ifdef DEBUG_ENABLED
ObjectRC *Object::_use_rc() {
// The RC object is lazily created the first time it's requested;
// that way, there's no need to allocate and release it at all if this Object
// is not being referred by any Variant at all.
// Although when dealing with Objects from multiple threads some locking
// mechanism should be used, this at least makes safe the case of first
// assignment.
ObjectRC *rc = nullptr;
ObjectRC *const creating = reinterpret_cast<ObjectRC *>(1);
if (unlikely(_rc.compare_exchange_strong(rc, creating, std::memory_order_acq_rel))) {
// Not created yet
rc = memnew(ObjectRC(this));
_rc.store(rc, std::memory_order_release);
return rc;
}
// Spin-wait until we know it's created (or just return if it's already created)
for (;;) {
if (likely(rc != creating)) {
rc->increment();
return rc;
}
rc = _rc.load(std::memory_order_acquire);
}
}
#endif
void Object::set_script_and_instance(const RefPtr &p_script, ScriptInstance *p_instance) {
//this function is not meant to be used in any of these ways
@ -1353,6 +1385,25 @@ Array Object::_get_incoming_connections() const {
return ret;
}
bool Object::has_signal(const StringName &p_name) const {
if (!script.is_null()) {
Ref<Script> scr = script;
if (scr.is_valid() && scr->has_script_signal(p_name)) {
return true;
}
}
if (ClassDB::has_signal(get_class_name(), p_name)) {
return true;
}
if (_has_user_signal(p_name)) {
return true;
}
return false;
}
void Object::get_signal_list(List<MethodInfo> *p_signals) const {
if (!script.is_null()) {
@ -1707,6 +1758,7 @@ void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("has_method", "method"), &Object::has_method);
ClassDB::bind_method(D_METHOD("has_signal", "signal"), &Object::has_signal);
ClassDB::bind_method(D_METHOD("get_signal_list"), &Object::_get_signal_list);
ClassDB::bind_method(D_METHOD("get_signal_connection_list", "signal"), &Object::_get_signal_connection_list);
ClassDB::bind_method(D_METHOD("get_incoming_connections"), &Object::_get_incoming_connections);
@ -1924,6 +1976,9 @@ Object::Object() {
instance_binding_count = 0;
memset(_script_instance_bindings, 0, sizeof(void *) * MAX_SCRIPT_INSTANCE_BINDINGS);
script_instance = NULL;
#ifdef DEBUG_ENABLED
_rc.store(nullptr, std::memory_order_release);
#endif
#ifdef TOOLS_ENABLED
_edited = false;
@ -1937,6 +1992,15 @@ Object::Object() {
Object::~Object() {
#ifdef DEBUG_ENABLED
ObjectRC *rc = _rc.load(std::memory_order_acquire);
if (rc) {
if (rc->invalidate()) {
memdelete(rc);
}
}
#endif
if (script_instance)
memdelete(script_instance);
script_instance = NULL;
@ -2068,18 +2132,26 @@ void ObjectDB::cleanup() {
rw_lock->write_lock();
if (instances.size()) {
WARN_PRINT("ObjectDB Instances still exist!");
WARN_PRINT("ObjectDB instances leaked at exit (run with --verbose for details).");
if (OS::get_singleton()->is_stdout_verbose()) {
// Ensure calling the native classes because if a leaked instance has a script
// that overrides any of those methods, it'd not be OK to call them at this point,
// now the scripting languages have already been terminated.
MethodBind *node_get_name = ClassDB::get_method("Node", "get_name");
MethodBind *resource_get_path = ClassDB::get_method("Resource", "get_path");
Variant::CallError call_error;
const ObjectID *K = NULL;
while ((K = instances.next(K))) {
String node_name;
String extra_info;
if (instances[*K]->is_class("Node"))
node_name = " - Node name: " + String(instances[*K]->call("get_name"));
extra_info = " - Node name: " + String(node_get_name->call(instances[*K], NULL, 0, call_error));
if (instances[*K]->is_class("Resource"))
node_name = " - Resource name: " + String(instances[*K]->call("get_name")) + " Path: " + String(instances[*K]->call("get_path"));
print_line("Leaked instance: " + String(instances[*K]->get_class()) + ":" + itos(*K) + node_name);
extra_info = " - Resource path: " + String(resource_get_path->call(instances[*K], NULL, 0, call_error));
print_line("Leaked instance: " + String(instances[*K]->get_class()) + ":" + itos(*K) + extra_info);
}
print_line("Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).");
}
}
instances.clear();

View File

@ -34,11 +34,16 @@
#include "core/hash_map.h"
#include "core/list.h"
#include "core/map.h"
#include "core/object_id.h"
#include "core/os/rw_lock.h"
#include "core/set.h"
#include "core/variant.h"
#include "core/vmap.h"
#ifdef DEBUG_ENABLED
#include <atomic> // For ObjectRC*
#endif
#define VARIANT_ARG_LIST const Variant &p_arg1 = Variant(), const Variant &p_arg2 = Variant(), const Variant &p_arg3 = Variant(), const Variant &p_arg4 = Variant(), const Variant &p_arg5 = Variant()
#define VARIANT_ARG_PASS p_arg1, p_arg2, p_arg3, p_arg4, p_arg5
#define VARIANT_ARG_DECLARE const Variant &p_arg1, const Variant &p_arg2, const Variant &p_arg3, const Variant &p_arg4, const Variant &p_arg5
@ -397,7 +402,7 @@ public: \
private:
class ScriptInstance;
typedef uint64_t ObjectID;
class ObjectRC;
class Object {
public:
@ -477,6 +482,9 @@ private:
int _predelete_ok;
Set<Object *> change_receptors;
ObjectID _instance_id;
#ifdef DEBUG_ENABLED
std::atomic<ObjectRC *> _rc;
#endif
bool _predelete();
void _postinitialize();
bool _can_translate;
@ -587,6 +595,10 @@ public:
return &ptr;
}
#ifdef DEBUG_ENABLED
ObjectRC *_use_rc();
#endif
bool _is_gpl_reversed() const { return false; }
_FORCE_INLINE_ ObjectID get_instance_id() const { return _instance_id; }
@ -704,6 +716,7 @@ public:
void add_user_signal(const MethodInfo &p_signal);
Error emit_signal(const StringName &p_name, VARIANT_ARG_LIST);
Error emit_signal(const StringName &p_name, const Variant **p_args, int p_argcount);
bool has_signal(const StringName &p_name) const;
void get_signal_list(List<MethodInfo> *p_signals) const;
void get_signal_connection_list(const StringName &p_signal, List<Connection> *p_connections) const;
void get_all_signal_connections(List<Connection> *p_connections) const;

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* visual_server_light_baker.cpp */
/* object_id.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,7 +28,11 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "visual_server_light_baker.h"
#ifndef OBJECTID_H
#define OBJECTID_H
VisualServerLightBaker::VisualServerLightBaker() {
}
#include "core/int_types.h"
typedef uint64_t ObjectID;
#endif

View File

@ -1,5 +1,5 @@
/*************************************************************************/
/* RequestParams.java */
/* object_rc.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@ -28,58 +28,54 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
package org.godotengine.godot.utils;
#ifndef OBJECTRC_H
#define OBJECTRC_H
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
#ifdef DEBUG_ENABLED
/**
*
* @author Luis Linietsky <luis.linietsky@gmail.com>
*/
public class RequestParams {
#include "core/os/memory.h"
#include "core/typedefs.h"
private HashMap<String, String> params;
private String url;
#include <atomic>
public RequestParams() {
params = new HashMap<String, String>();
class Object;
// Used to track Variants pointing to a non-Reference Object
class ObjectRC {
std::atomic<Object *> _ptr;
std::atomic<uint32_t> _users;
public:
// This is for allowing debug builds to check for instance ID validity,
// so warnings are shown in debug builds when a stray Variant (one pointing
// to a released Object) would have happened.
const ObjectID instance_id;
_FORCE_INLINE_ void increment() {
_users.fetch_add(1, std::memory_order_relaxed);
}
public void put(String key, String value) {
params.put(key, value);
_FORCE_INLINE_ bool decrement() {
return _users.fetch_sub(1, std::memory_order_relaxed) == 1;
}
public String get(String key) {
return params.get(key);
_FORCE_INLINE_ bool invalidate() {
_ptr.store(nullptr, std::memory_order_release);
return decrement();
}
public void remove(Object key) {
params.remove(key);
_FORCE_INLINE_ Object *get_ptr() {
return _ptr.load(std::memory_order_acquire);
}
public boolean has(String key) {
return params.containsKey(key);
_FORCE_INLINE_ ObjectRC(Object *p_object) :
instance_id(p_object->get_instance_id()) {
// 1 (the Object) + 1 (the first user)
_users.store(2, std::memory_order_relaxed);
_ptr.store(p_object, std::memory_order_release);
}
};
public List<NameValuePair> toPairsList() {
List<NameValuePair> fields = new ArrayList<NameValuePair>();
#endif
for (String key : params.keySet()) {
fields.add(new BasicNameValuePair(key, this.get(key)));
}
return fields;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
#endif

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")

View File

@ -66,6 +66,16 @@ int DirAccess::get_current_drive() {
return 0;
}
bool DirAccess::drives_are_shortcuts() {
return false;
}
String DirAccess::get_current_dir_without_drive() {
return get_current_dir();
}
static Error _erase_recursive(DirAccess *da) {
List<String> dirs;

View File

@ -76,9 +76,11 @@ public:
virtual int get_drive_count() = 0;
virtual String get_drive(int p_drive) = 0;
virtual int get_current_drive();
virtual bool drives_are_shortcuts();
virtual Error change_dir(String p_dir) = 0; ///< can be relative or absolute, return false on success
virtual String get_current_dir() = 0; ///< return current dir location
virtual String get_current_dir_without_drive();
virtual Error make_dir(String p_dir) = 0;
virtual Error make_dir_recursive(String p_dir);
virtual Error erase_contents_recursive(); //super dangerous, use with care!

View File

@ -348,7 +348,7 @@ void InputEventKey::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
ADD_PROPERTY(PropertyInfo(Variant::INT, "scancode"), "set_scancode", "get_scancode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "unicode"), "set_unicode", "get_unicode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "echo"), "set_echo", "is_echo");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "echo"), "set_echo", "is_echo");
}
InputEventKey::InputEventKey() {
@ -416,7 +416,7 @@ void InputEventMouseButton::set_factor(float p_factor) {
factor = p_factor;
}
float InputEventMouseButton::get_factor() {
float InputEventMouseButton::get_factor() const {
return factor;
}
@ -646,7 +646,7 @@ String InputEventMouseMotion::as_text() const {
button_mask_string = itos(get_button_mask());
break;
}
return "InputEventMouseMotion : button_mask=" + button_mask_string + ", position=(" + String(get_position()) + "), relative=(" + String(get_relative()) + "), speed=(" + String(get_speed()) + ")";
return "InputEventMouseMotion : button_mask=" + button_mask_string + ", position=(" + String(get_position()) + "), relative=(" + String(get_relative()) + "), speed=(" + String(get_speed()) + "), pressure=(" + rtos(get_pressure()) + "), tilt=(" + String(get_tilt()) + ")";
}
bool InputEventMouseMotion::accumulate(const Ref<InputEvent> &p_event) {

View File

@ -61,6 +61,8 @@ enum ButtonList {
enum JoystickList {
JOY_INVALID_OPTION = -1,
JOY_BUTTON_0 = 0,
JOY_BUTTON_1 = 1,
JOY_BUTTON_2 = 2,
@ -328,7 +330,7 @@ protected:
public:
void set_factor(float p_factor);
float get_factor();
float get_factor() const;
void set_button_index(int p_index);
int get_button_index() const;

View File

@ -41,6 +41,7 @@
#include <stdarg.h>
OS *OS::singleton = NULL;
uint64_t OS::target_ticks = 0;
OS *OS::get_singleton() {
@ -196,6 +197,10 @@ bool OS::is_stdout_verbose() const {
return _verbose_stdout;
}
bool OS::is_stdout_debug_enabled() const {
return _debug_stdout;
}
void OS::dump_memory_to_file(const char *p_file) {
//Memory::dump_static_mem_to_file(p_file);
@ -221,7 +226,7 @@ bool OS::has_virtual_keyboard() const {
return false;
}
void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) {
void OS::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, bool p_multiline, int p_max_input_length, int p_cursor_start, int p_cursor_end) {
}
void OS::hide_virtual_keyboard() {
@ -551,6 +556,24 @@ OS::LatinKeyboardVariant OS::get_latin_keyboard_variant() const {
return LATIN_KEYBOARD_QWERTY;
}
int OS::keyboard_get_layout_count() const {
return 0;
}
int OS::keyboard_get_current_layout() const {
return -1;
}
void OS::keyboard_set_current_layout(int p_index) {}
String OS::keyboard_get_layout_language(int p_index) const {
return "";
}
String OS::keyboard_get_layout_name(int p_index) const {
return "";
}
bool OS::is_joy_known(int p_device) {
return true;
}
@ -728,19 +751,60 @@ PoolStringArray OS::get_connected_midi_inputs() {
return MIDIDriver::get_singleton()->get_connected_inputs();
PoolStringArray list;
return list;
ERR_FAIL_V_MSG(list, vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}
void OS::open_midi_inputs() {
if (MIDIDriver::get_singleton())
if (MIDIDriver::get_singleton()) {
MIDIDriver::get_singleton()->open();
} else {
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}
}
void OS::close_midi_inputs() {
if (MIDIDriver::get_singleton())
if (MIDIDriver::get_singleton()) {
MIDIDriver::get_singleton()->close();
} else {
ERR_PRINT(vformat("MIDI input isn't supported on %s.", OS::get_singleton()->get_name()));
}
}
void OS::add_frame_delay(bool p_can_draw) {
const uint32_t frame_delay = Engine::get_singleton()->get_frame_delay();
if (frame_delay) {
// Add fixed frame delay to decrease CPU/GPU usage. This doesn't take
// the actual frame time into account.
// Due to the high fluctuation of the actual sleep duration, it's not recommended
// to use this as a FPS limiter.
delay_usec(frame_delay * 1000);
}
// Add a dynamic frame delay to decrease CPU/GPU usage. This takes the
// previous frame time into account for a smoother result.
uint64_t dynamic_delay = 0;
if (is_in_low_processor_usage_mode() || !p_can_draw) {
dynamic_delay = get_low_processor_usage_mode_sleep_usec();
}
const int target_fps = Engine::get_singleton()->get_target_fps();
if (target_fps > 0 && !Engine::get_singleton()->is_editor_hint()) {
// Override the low processor usage mode sleep delay if the target FPS is lower.
dynamic_delay = MAX(dynamic_delay, (uint64_t)(1000000 / target_fps));
}
if (dynamic_delay > 0) {
target_ticks += dynamic_delay;
uint64_t current_ticks = get_ticks_usec();
if (current_ticks < target_ticks) {
delay_usec(target_ticks - current_ticks);
}
current_ticks = get_ticks_usec();
target_ticks = MIN(MAX(target_ticks, current_ticks - dynamic_delay), current_ticks + dynamic_delay);
}
}
OS::OS() {
@ -752,6 +816,7 @@ OS::OS() {
low_processor_usage_mode = false;
low_processor_usage_mode_sleep_usec = 10000;
_verbose_stdout = false;
_debug_stdout = false;
_no_window = false;
_exit_code = 0;
_orientation = SCREEN_LANDSCAPE;

View File

@ -46,12 +46,14 @@ class Mutex;
class OS {
static OS *singleton;
static uint64_t target_ticks;
String _execpath;
List<String> _cmdline;
bool _keep_screen_on;
bool low_processor_usage_mode;
int low_processor_usage_mode_sleep_usec;
bool _verbose_stdout;
bool _debug_stdout;
String _local_clipboard;
uint64_t _msec_splash;
bool _no_window;
@ -193,6 +195,11 @@ public:
virtual int get_audio_driver_count() const;
virtual const char *get_audio_driver_name(int p_driver) const;
virtual int get_tablet_driver_count() const { return 0; };
virtual String get_tablet_driver_name(int p_driver) const { return ""; };
virtual String get_current_tablet_driver() const { return ""; };
virtual void set_current_tablet_driver(const String &p_driver){};
virtual PoolStringArray get_connected_midi_inputs();
virtual void open_midi_inputs();
virtual void close_midi_inputs();
@ -203,6 +210,8 @@ public:
virtual Point2 get_screen_position(int p_screen = -1) const { return Point2(); }
virtual Size2 get_screen_size(int p_screen = -1) const { return get_window_size(); }
virtual int get_screen_dpi(int p_screen = -1) const { return 72; }
virtual float get_screen_scale(int p_screen = -1) const { return 1.0; }
virtual float get_screen_max_scale() const { return 1.0; };
virtual Point2 get_window_position() const { return Vector2(); }
virtual void set_window_position(const Point2 &p_position) {}
virtual Size2 get_max_window_size() const { return Size2(); };
@ -246,10 +255,6 @@ public:
virtual bool get_window_per_pixel_transparency_enabled() const { return false; }
virtual void set_window_per_pixel_transparency_enabled(bool p_enabled) {}
virtual uint8_t *get_layered_buffer_data() { return NULL; }
virtual Size2 get_layered_buffer_size() { return Size2(0, 0); }
virtual void swap_layered_buffer() {}
virtual void set_ime_active(const bool p_active) {}
virtual void set_ime_position(const Point2 &p_pos) {}
virtual Point2 get_ime_selection() const { return Point2(); }
@ -344,6 +349,8 @@ public:
virtual uint64_t get_system_time_msecs() const;
virtual void delay_usec(uint32_t p_usec) const = 0;
virtual void add_frame_delay(bool p_can_draw);
virtual uint64_t get_ticks_usec() const = 0;
uint32_t get_ticks_msec() const;
uint64_t get_splash_tick_msec() const;
@ -353,6 +360,7 @@ public:
virtual bool is_userfs_persistent() const { return true; }
bool is_stdout_verbose() const;
bool is_stdout_debug_enabled() const;
virtual void disable_crash_handler() {}
virtual bool is_disable_crash_handler() const { return false; }
@ -380,7 +388,7 @@ public:
};
virtual bool has_virtual_keyboard() const;
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1);
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), bool p_multiline = false, int p_max_input_length = -1, int p_cursor_start = -1, int p_cursor_end = -1);
virtual void hide_virtual_keyboard();
// returns height of the currently shown virtual keyboard (0 if keyboard is hidden)
@ -492,6 +500,12 @@ public:
virtual LatinKeyboardVariant get_latin_keyboard_variant() const;
virtual int keyboard_get_layout_count() const;
virtual int keyboard_get_current_layout() const;
virtual void keyboard_set_current_layout(int p_index);
virtual String keyboard_get_layout_language(int p_index) const;
virtual String keyboard_get_layout_name(int p_index) const;
virtual bool is_joy_known(int p_device);
virtual String get_joy_guid(int p_device) const;

View File

@ -307,10 +307,16 @@ void ProjectSettings::_convert_to_last_version(int p_from_version) {
* using the following merit order:
* - If using NetworkClient, try to lookup project file or fail.
* - If --main-pack was passed by the user (`p_main_pack`), load it or fail.
* - Search for .pck file matching binary name. There are two possibilities:
* o exec_path.get_basename() + '.pck' (e.g. 'win_game.exe' -> 'win_game.pck')
* o exec_path + '.pck' (e.g. 'linux_game' -> 'linux_game.pck')
* For each tentative, if the file exists, load it or fail.
* - Search for project PCKs automatically. For each step we try loading a potential
* PCK, and if it doesn't work, we proceed to the next step. If any step succeeds,
* we try loading the project settings, and abort if it fails. Steps:
* o Bundled PCK in the executable.
* o [macOS only] PCK with same basename as the binary in the .app resource dir.
* o PCK with same basename as the binary in the binary's directory. We handle both
* changing the extension to '.pck' (e.g. 'win_game.exe' -> 'win_game.pck') and
* appending '.pck' to the binary name (e.g. 'linux_game' -> 'linux_game.pck').
* o PCK with the same basename as the binary in the current working directory.
* Same as above for the two possible PCK file names.
* - On relevant platforms (Android/iOS), lookup project file in OS resource path.
* If found, load it or fail.
* - Lookup project file in passed `p_path` (--path passed by the user), i.e. we
@ -354,76 +360,68 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
String exec_path = OS::get_singleton()->get_executable_path();
if (exec_path != "") {
// Attempt with exec_name.pck
// We do several tests sequentially until one succeeds to find a PCK,
// and if so we attempt loading it at the end.
// Attempt with PCK bundled into executable.
bool found = _load_resource_pack(exec_path);
// Attempt with exec_name.pck.
// (This is the usual case when distributing a Godot game.)
String exec_dir = exec_path.get_base_dir();
String exec_filename = exec_path.get_file();
String exec_basename = exec_filename.get_basename();
// Based on the OS, it can be the exec path + '.pck' (Linux w/o extension, macOS in .app bundle)
// or the exec path's basename + '.pck' (Windows).
// We need to test both possibilities as extensions for Linux binaries are optional
// (so both 'mygame.bin' and 'mygame' should be able to find 'mygame.pck').
bool found = false;
String exec_dir = exec_path.get_base_dir();
String exec_filename = exec_path.get_file();
String exec_basename = exec_filename.get_basename();
// Try to load data pack at the location of the executable
// As mentioned above, we have two potential names to attempt
if (_load_resource_pack(exec_dir.plus_file(exec_basename + ".pck")) ||
_load_resource_pack(exec_dir.plus_file(exec_filename + ".pck"))) {
found = true;
} else {
// If we couldn't find them next to the executable, we attempt
// the current working directory. Same story, two tests.
if (_load_resource_pack(exec_basename + ".pck") ||
_load_resource_pack(exec_filename + ".pck")) {
found = true;
}
}
#ifdef OSX_ENABLED
// Attempt to load PCK from macOS .app bundle resources
if (!found) {
if (_load_resource_pack(OS::get_singleton()->get_bundle_resource_dir().plus_file(exec_basename + ".pck"))) {
found = true;
}
// Attempt to load PCK from macOS .app bundle resources.
found = _load_resource_pack(OS::get_singleton()->get_bundle_resource_dir().plus_file(exec_basename + ".pck"));
}
#endif
// Attempt with PCK bundled into executable
if (!found) {
if (_load_resource_pack(exec_path)) {
found = true;
}
// Try to load data pack at the location of the executable.
// As mentioned above, we have two potential names to attempt.
found = _load_resource_pack(exec_dir.plus_file(exec_basename + ".pck")) || _load_resource_pack(exec_dir.plus_file(exec_filename + ".pck"));
}
// If we opened our package, try and load our project
if (!found) {
// If we couldn't find them next to the executable, we attempt
// the current working directory. Same story, two tests.
found = _load_resource_pack(exec_basename + ".pck") || _load_resource_pack(exec_filename + ".pck");
}
// If we opened our package, try and load our project.
if (found) {
Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary");
if (err == OK) {
// Load override from location of executable
// Optional, we don't mind if it fails
// Load override from location of the executable.
// Optional, we don't mind if it fails.
_load_settings_text(exec_path.get_base_dir().plus_file("override.cfg"));
}
return err;
}
}
// Try to use the filesystem for files, according to OS. (only Android -when reading from pck- and iOS use this)
// Try to use the filesystem for files, according to OS.
// (Only Android -when reading from pck- and iOS use this.)
if (OS::get_singleton()->get_resource_dir() != "") {
// OS will call ProjectSettings->get_resource_path which will be empty if not overridden!
// If the OS would rather use a specific location, then it will not be empty.
resource_path = OS::get_singleton()->get_resource_dir().replace("\\", "/");
if (resource_path != "" && resource_path[resource_path.length() - 1] == '/') {
resource_path = resource_path.substr(0, resource_path.length() - 1); // chop end
resource_path = resource_path.substr(0, resource_path.length() - 1); // Chop end.
}
Error err = _load_settings_text_or_binary("res://project.godot", "res://project.binary");
if (err == OK) {
// Optional, we don't mind if it fails
// Optional, we don't mind if it fails.
_load_settings_text("res://override.cfg");
}
return err;
@ -444,7 +442,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
while (true) {
err = _load_settings_text_or_binary(current_dir.plus_file("project.godot"), current_dir.plus_file("project.binary"));
if (err == OK) {
// Optional, we don't mind if it fails
// Optional, we don't mind if it fails.
_load_settings_text(current_dir.plus_file("override.cfg"));
candidate = current_dir;
found = true;
@ -463,14 +461,15 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b
}
resource_path = candidate;
resource_path = resource_path.replace("\\", "/"); // windows path to unix path just in case
resource_path = resource_path.replace("\\", "/"); // Windows path to Unix path just in case.
memdelete(d);
if (!found)
return err;
if (resource_path.length() && resource_path[resource_path.length() - 1] == '/')
resource_path = resource_path.substr(0, resource_path.length() - 1); // chop end
if (resource_path.length() && resource_path[resource_path.length() - 1] == '/') {
resource_path = resource_path.substr(0, resource_path.length() - 1); // Chop end.
}
return OK;
}
@ -483,6 +482,14 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo
_load_settings_text(custom_settings);
}
}
// Using GLOBAL_GET on every block for compressing can be slow, so assigning here.
Compression::zstd_long_distance_matching = GLOBAL_GET("compression/formats/zstd/long_distance_matching");
Compression::zstd_level = GLOBAL_GET("compression/formats/zstd/compression_level");
Compression::zstd_window_log_size = GLOBAL_GET("compression/formats/zstd/window_log_size");
Compression::zlib_level = GLOBAL_GET("compression/formats/zlib/compression_level");
Compression::gzip_level = GLOBAL_GET("compression/formats/gzip/compression_level");
return err;
}
@ -998,6 +1005,8 @@ void ProjectSettings::_bind_methods() {
}
ProjectSettings::ProjectSettings() {
// Initialization of engine variables should be done in the setup() method,
// so that the values can be overridden from project.godot or project.binary.
singleton = this;
last_order = NO_BUILTIN_ORDER_BASE;
@ -1201,18 +1210,17 @@ ProjectSettings::ProjectSettings() {
GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
custom_prop_info["debug/settings/profiler/max_functions"] = PropertyInfo(Variant::INT, "debug/settings/profiler/max_functions", PROPERTY_HINT_RANGE, "128,65535,1");
//assigning here, because using GLOBAL_GET on every block for compressing can be slow
Compression::zstd_long_distance_matching = GLOBAL_DEF("compression/formats/zstd/long_distance_matching", false);
GLOBAL_DEF("compression/formats/zstd/long_distance_matching", Compression::zstd_long_distance_matching);
custom_prop_info["compression/formats/zstd/long_distance_matching"] = PropertyInfo(Variant::BOOL, "compression/formats/zstd/long_distance_matching");
Compression::zstd_level = GLOBAL_DEF("compression/formats/zstd/compression_level", 3);
GLOBAL_DEF("compression/formats/zstd/compression_level", Compression::zstd_level);
custom_prop_info["compression/formats/zstd/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zstd/compression_level", PROPERTY_HINT_RANGE, "1,22,1");
Compression::zstd_window_log_size = GLOBAL_DEF("compression/formats/zstd/window_log_size", 27);
GLOBAL_DEF("compression/formats/zstd/window_log_size", Compression::zstd_window_log_size);
custom_prop_info["compression/formats/zstd/window_log_size"] = PropertyInfo(Variant::INT, "compression/formats/zstd/window_log_size", PROPERTY_HINT_RANGE, "10,30,1");
Compression::zlib_level = GLOBAL_DEF("compression/formats/zlib/compression_level", Z_DEFAULT_COMPRESSION);
GLOBAL_DEF("compression/formats/zlib/compression_level", Compression::zlib_level);
custom_prop_info["compression/formats/zlib/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/zlib/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
Compression::gzip_level = GLOBAL_DEF("compression/formats/gzip/compression_level", Z_DEFAULT_COMPRESSION);
GLOBAL_DEF("compression/formats/gzip/compression_level", Compression::gzip_level);
custom_prop_info["compression/formats/gzip/compression_level"] = PropertyInfo(Variant::INT, "compression/formats/gzip/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
// Would ideally be defined in an Android-specific file, but then it doesn't appear in the docs

View File

@ -40,12 +40,14 @@
#include "core/func_ref.h"
#include "core/input_map.h"
#include "core/io/config_file.h"
#include "core/io/dtls_server.h"
#include "core/io/http_client.h"
#include "core/io/image_loader.h"
#include "core/io/marshalls.h"
#include "core/io/multiplayer_api.h"
#include "core/io/networked_multiplayer_peer.h"
#include "core/io/packet_peer.h"
#include "core/io/packet_peer_dtls.h"
#include "core/io/packet_peer_udp.h"
#include "core/io/pck_packer.h"
#include "core/io/resource_format_binary.h"
@ -53,6 +55,7 @@
#include "core/io/stream_peer_ssl.h"
#include "core/io/tcp_server.h"
#include "core/io/translation_loader_po.h"
#include "core/io/udp_server.h"
#include "core/io/xml_parser.h"
#include "core/math/a_star.h"
#include "core/math/expression.h"
@ -155,6 +158,9 @@ void register_core_types() {
ClassDB::register_class<StreamPeerTCP>();
ClassDB::register_class<TCP_Server>();
ClassDB::register_class<PacketPeerUDP>();
ClassDB::register_class<UDPServer>();
ClassDB::register_custom_instance_class<PacketPeerDTLS>();
ClassDB::register_custom_instance_class<DTLSServer>();
// Crypto
ClassDB::register_class<HashingContext>();

View File

@ -33,6 +33,7 @@
#include "core/core_string_names.h"
#include "core/io/resource_loader.h"
#include "core/os/file_access.h"
#include "core/os/os.h"
#include "core/script_language.h"
#include "scene/main/node.h" //only so casting works
@ -472,21 +473,22 @@ void ResourceCache::setup() {
}
void ResourceCache::clear() {
if (resources.size())
ERR_PRINT("Resources Still in use at Exit!");
if (resources.size()) {
ERR_PRINT("Resources still in use at exit (run with --verbose for details).");
if (OS::get_singleton()->is_stdout_verbose()) {
const String *K = nullptr;
while ((K = resources.next(K))) {
Resource *r = resources[*K];
print_line(vformat("Resource still in use: %s (%s)", *K, r->get_class()));
}
}
}
resources.clear();
memdelete(lock);
}
void ResourceCache::reload_externals() {
/*
const String *K=NULL;
while ((K=resources.next(K))) {
resources[*K]->reload_external_data();
}
*/
}
bool ResourceCache::has(const String &p_path) {
@ -573,6 +575,5 @@ void ResourceCache::dump(const char *p_file, bool p_short) {
}
lock->read_unlock();
#endif
}

View File

@ -120,6 +120,9 @@ private:
public:
_FORCE_INLINE_ bool in_list() const { return _root; }
_FORCE_INLINE_ void remove_from_list() {
if (_root) _root->remove(this);
}
_FORCE_INLINE_ SelfList<T> *next() { return _next; }
_FORCE_INLINE_ SelfList<T> *prev() { return _prev; }
_FORCE_INLINE_ const SelfList<T> *next() const { return _next; }

View File

@ -1682,8 +1682,9 @@ int String::hex_to_int(bool p_with_prefix) const {
} else {
return 0;
}
ERR_FAIL_COND_V_MSG(hex > INT32_MAX / 16, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + *this + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
// Check for overflow/underflow, with special case to ensure INT32_MIN does not result in error
bool overflow = ((hex > INT32_MAX / 16) && (sign == 1 || (sign == -1 && hex != (INT32_MAX >> 4) + 1))) || (sign == -1 && hex == (INT32_MAX >> 4) + 1 && c > '0');
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + *this + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
hex *= 16;
hex += n;
s++;
@ -1724,8 +1725,8 @@ int64_t String::hex_to_int64(bool p_with_prefix) const {
} else {
return 0;
}
ERR_FAIL_COND_V_MSG(hex > INT64_MAX / 16, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
bool overflow = ((hex > INT64_MAX / 16) && (sign == 1 || (sign == -1 && hex != (INT64_MAX >> 4) + 1))) || (sign == -1 && hex == (INT64_MAX >> 4) + 1 && c > '0');
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
hex *= 16;
hex += n;
s++;
@ -1764,8 +1765,9 @@ int64_t String::bin_to_int64(bool p_with_prefix) const {
} else {
return 0;
}
ERR_FAIL_COND_V_MSG(binary > INT64_MAX / 2, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
// Check for overflow/underflow, with special case to ensure INT64_MIN does not result in error
bool overflow = ((binary > INT64_MAX / 2) && (sign == 1 || (sign == -1 && binary != (INT64_MAX >> 1) + 1))) || (sign == -1 && binary == (INT64_MAX >> 1) + 1 && c > '0');
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
binary *= 2;
binary += n;
s++;
@ -1788,8 +1790,8 @@ int String::to_int() const {
CharType c = operator[](i);
if (c >= '0' && c <= '9') {
ERR_FAIL_COND_V_MSG(integer > INT32_MAX / 10, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + *this + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
bool overflow = (integer > INT32_MAX / 10) || (integer == INT32_MAX / 10 && ((sign == 1 && c > '7') || (sign == -1 && c > '8')));
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + *this + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
integer *= 10;
integer += c - '0';
@ -1813,16 +1815,14 @@ int64_t String::to_int64() const {
int64_t sign = 1;
for (int i = 0; i < to; i++) {
CharType c = operator[](i);
if (c >= '0' && c <= '9') {
ERR_FAIL_COND_V_MSG(integer > INT64_MAX / 10, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
bool overflow = (integer > INT64_MAX / 10) || (integer == INT64_MAX / 10 && ((sign == 1 && c > '7') || (sign == -1 && c > '8')));
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + *this + " as 64-bit integer, provided value is " + (sign == 1 ? "too big." : "too small."));
integer *= 10;
integer += c - '0';
} else if (integer == 0 && c == '-') {
sign = -sign;
}
}
@ -1847,8 +1847,8 @@ int String::to_int(const char *p_str, int p_len) {
char c = p_str[i];
if (c >= '0' && c <= '9') {
ERR_FAIL_COND_V_MSG(integer > INT32_MAX / 10, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + String(p_str).substr(0, to) + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
bool overflow = (integer > INT32_MAX / 10) || (integer == INT32_MAX / 10 && ((sign == 1 && c > '7') || (sign == -1 && c > '8')));
ERR_FAIL_COND_V_MSG(overflow, sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + String(p_str).substr(0, to) + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
integer *= 10;
integer += c - '0';
@ -3071,6 +3071,7 @@ String String::repeat(int p_count) const {
const CharType *src = this->c_str();
new_string.resize(length() * p_count + 1);
new_string[length() * p_count] = 0;
for (int i = 0; i < p_count; i++)
for (int j = 0; j < length(); j++)
@ -3324,7 +3325,7 @@ String String::humanize_size(uint64_t p_size) {
int prefix_idx = 0;
while (prefix_idx < prefixes.size() && p_size > (_div * 1024)) {
while (prefix_idx < prefixes.size() - 1 && p_size > (_div * 1024)) {
_div *= 1024;
prefix_idx++;
}
@ -4211,27 +4212,40 @@ String String::sprintf(const Array &values, bool *error) const {
}
double value = values[value_index];
String str = String::num(value, min_decimals);
bool is_negative = (value < 0);
String str = String::num(ABS(value), min_decimals);
// Pad decimals out.
str = str.pad_decimals(min_decimals);
// Show sign
if (show_sign && str.left(1) != "-") {
str = str.insert(0, "+");
int initial_len = str.length();
// Padding. Leave room for sign later if required.
int pad_chars_count = (is_negative || show_sign) ? min_chars - 1 : min_chars;
String pad_char = pad_with_zeroes ? String("0") : String(" ");
if (left_justified) {
if (pad_with_zeroes) {
return "left justification cannot be used with zeros as the padding";
} else {
str = str.rpad(pad_chars_count, pad_char);
}
} else {
str = str.lpad(pad_chars_count, pad_char);
}
// Padding
if (left_justified) {
str = str.rpad(min_chars);
} else {
str = str.lpad(min_chars);
// Add sign if needed.
if (show_sign || is_negative) {
String sign_char = is_negative ? "-" : "+";
if (left_justified) {
str = str.insert(0, sign_char);
} else {
str = str.insert(pad_with_zeroes ? 0 : str.length() - initial_len, sign_char);
}
}
formatted += str;
++value_index;
in_format = false;
break;
}
case 's': { // String

Some files were not shown because too many files have changed in this diff Show More