Commit graph

3705 commits

Author SHA1 Message Date
Ignacio Etcheverry 0604b1839d Fix C# preprocessor infinite loop and incorrect parsing of #if! 2020-01-24 17:53:17 +01:00
Fabio Alessandrelli 5bd9f14ad9 Lower WebSocket latency, fixes.
WSLPeer now tries to flush packet queue after put_packet call.
WSLServer::listen correctly returns TCP_Server::listen return value.
2020-01-24 14:50:53 +01:00
Hugo Locurcio a002b93d86
Add explanations for errors related to Vector/Quat normalization 2020-01-24 14:19:23 +01:00
Rémi Verschelde 55f580b24a
Merge pull request #35491 from neikeq/issue-35450
Mono/C#: Lighten up unsafe reference checks
2020-01-23 23:06:58 +01:00
Ignacio Etcheverry 55b2e58a98 Mono/C#: Lighten up unsafe reference checks
Because of the weird case with multi-threading and ResourceLoader, it can be the case that a resource is GCed while being referenced again in the main thread. In such cases, a new unsafe reference is created before the finalizer thread removes the previous one.
2020-01-23 21:23:32 +01:00
Rémi Verschelde cadf946863
Merge pull request #35478 from neikeq/issue-32260
Mono/C#: Add setting to include I18N assemblies in the exported game
2020-01-23 18:24:15 +01:00
Ignacio Etcheverry 59ec19d5a8 Mono/C#: Add setting to include I18N assemblies in the exported game 2020-01-23 17:47:09 +01:00
Rémi Verschelde b75fff5a56
Merge pull request #35473 from neikeq/default-to-net47
Mono/C#: Default to net47 for new projects
2020-01-23 17:23:33 +01:00
Ignacio Roldán Etcheverry 8dc7f3960c
Merge pull request #35472 from neikeq/issue-35448
Mono/C#: Add Basis.Slerp, update Quat.Xform and add some math checks
2020-01-23 16:21:09 +01:00
Ignacio Etcheverry 82b0899e54 Mono/C#: Add Basis.Slerp, update Quat.Xform and add some math checks 2020-01-23 16:13:28 +01:00
Ignacio Etcheverry d9ff5f7fc2 Mono/C#: Default to net47 for new projects 2020-01-23 15:57:47 +01:00
clayjohn 6b66957b85 Finish documenting CSG* and *probes 2020-01-23 13:54:17 +01:00
Rémi Verschelde ba177ccaec doc: Misc updates for AnimationNode* and others
- Add some missing descriptions.
- Add links to tutorials for ARVR and AnimationTree.
- Style fixes.
- Engine changes:
  * Make `AnimationNodeTransition.input_<number>` properties internal
    so that they don't appear in the docs. They still appear in the
    inspector based on the actual number of inputs requested.
  * Drop unimplemented `CPUParticles.flatness`. It's only used for 3D
    particles in `ParticlesMaterial`, and thus only relevant for
    `CPUParticles3D`.
2020-01-23 12:37:33 +01:00
Rémi Verschelde 36e11d1c34
Merge pull request #35412 from DaividFrank/check_overriding_self
Disabled re-assigning 'self'
2020-01-22 20:47:52 +01:00
DaividFrank badabdf8b9 GDScript: Added checks in assign operations to disable re-assigning 'self' 2020-01-22 19:00:54 +02:00
Rémi Verschelde 4faaf6089a Remove unused #if 0'ed code 2020-01-21 21:41:54 +01:00
Rémi Verschelde 79aaafc686
Merge pull request #35408 from Faless/ws/fix_packet_count
Fix MultiplayerAPI crash when peer implementation misbehave.
2020-01-21 21:06:11 +01:00
Fabio Alessandrelli 50f1b035b8 Fix MultiplayerAPI crash when peer impl misbehave.
Also fix WebSocketMultiplayer::get_available_packet_count() return value
when peer is not configured to use the multiplayer API.
2020-01-21 20:46:32 +01:00
Ignacio Roldán Etcheverry 24960e2254
Merge pull request #35407 from neikeq/issue-27285
Add dummy preprocessor for the C# script class parser
2020-01-21 20:39:23 +01:00
Ignacio Etcheverry d53c15b12c Make script class parser errors to not abort the build
As our script class parser is error prone, we should not impede the build from continuing because of a parsing error.
This should be reverted in the future once we switch to Roslyn.
2020-01-21 20:07:26 +01:00
Ignacio Etcheverry 378fc592b1 Add dummy preprocessor for the C# script class parser
No attempts are made at conditional compilation. The main if branch is always assumed to be true.
2020-01-21 19:57:38 +01:00
Rémi Verschelde 41b21dee01 Bullet: Prevent potential division by zero
Fixes #33715.
2020-01-21 00:20:57 +01:00
Ignacio Etcheverry e4330e33e6 Mono/C#: Fix error when parsing nested generics
Also fixed the editor not including the parse error message in the error.
2020-01-20 19:08:08 +01:00
Hugo Locurcio 9e3393a624
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.
2020-01-20 00:31:04 +01:00
Rémi Verschelde f70438ac45
Merge pull request #35270 from ChibiDenDen/fix_extends_sub_subclass
Fix subclass finding in extend statement for sub-sub classes
2020-01-19 23:18:40 +01:00
Ignacio Etcheverry a6105c8ea0 Fix ClassDB API portability with some android and editor classes
- `EditorNavigationMeshGenerator` was being registered as part of the Core API,
even after d3f48f88bb. We must make sure to
set Editor as the current ClassDB API type before creating an instance.

- The `VisualScriptEngineSingleton.constant` property has a property hint string
that's different between tools and non-tools builds. This commit makes the
hint string to no longer be set in `_bind_methods`, and to instead set it in
`_validate_property`. This way it's ignored when calculating the API hash.

- `JavaClassWrapper` is now registered in ClassDB on all platforms,
using a dummy implementation on platforms other than Android.
This fixes API portability between Android and other platforms.

- Updated `--class-db-json` command to ignore non-virtual methods that start
with an underscore (see: 4be87c6016).
2020-01-19 20:15:13 +01:00
Dani Frank 8f5e424c66 Fix subclass finding in extend statement for sub-sub classes
lookup was always done on top level script instead of advancing to subclass each time.
this commit changes the lookup to always be at last found subclass
2020-01-18 11:55:27 +02:00
Rémi Verschelde ba7aca4199
Merge pull request #35224 from ChibiDenDen/constant_lookup_through_subclass_instance
Fix constant access in base class through subclass instance
2020-01-17 06:58:00 +01:00
ChibiDenDen 9ffa9a6bac Fix constant access in base class through subclass instance
Fixes as issue where a subclass calls a base class method that tries to access a constant from the script.
The original code went through every ower class, and for each owner, went through its inheritance tree.
This seems like the wrong order, the modified code goes to each base class, and for each base class goes through the owner tree.
This is more in line with what the parser does, as the current impelemtation allows an access that the parser does not support.
This change should not negatively affect existing code due to the way the parser works
2020-01-17 00:12:45 +02:00
Rémi Verschelde 4c99301d69
Merge pull request #34789 from Faless/enet/disconnect_relay
ENet optional server_relay when disconnecting peer
2020-01-16 23:12:40 +01:00
Rémi Verschelde 8b0e2a409b
Merge pull request #35218 from bojidar-bg/26691-parse-error-errors
Fix errors raised when showing parse errors in the editor
2020-01-16 22:32:49 +01:00
Ignacio Roldán Etcheverry 1191d26ddc
Merge pull request #35208 from neikeq/mono-lazy-thread-attach
Mono/C#: Script interface calls now attach the current thread
2020-01-16 21:27:08 +01:00
Bojidar Marinov da5b138e64
Fix errors raised when showing parse errors in the editor
Fixes #26691
2020-01-16 22:12:24 +02:00
Ignacio Etcheverry d68b9c20d6 Mono/C#: Script interface calls now attach the current thread
Added guards to all C# script interface calls to attach the current thread
for the current scope if the thread is not already attached.
This is far from ideal, as attaching the thread is not cheap and all managed
thread local storage is lost when we detach the thread at the end of the calls.
However, it's the best we can do for now to avoid crashing
when an unattached thread tries to interact with C# code.
2020-01-16 17:47:36 +01:00
Rémi Verschelde f2aa99a8e2
Merge pull request #35201 from bojidar-bg/27582-gdfunction-validate-instance
Validate instances of objects before trying to check their type in GDScript
2020-01-16 15:57:44 +01:00
Rémi Verschelde 4998983bd5
Merge pull request #35199 from dalexeev/master
Fix function arguments hint format in GDScript editor
2020-01-16 15:53:28 +01:00
Rémi Verschelde df13245408
Merge pull request #35203 from timothyqiu/image-loader-null
Adds null check before using image loader
2020-01-16 15:51:46 +01:00
Rémi Verschelde cd7b51b943
Merge pull request #35102 from ChibiDenDen/reuse_orphaned_subclass
#34161: Keep a weak reference to orphan subclasses to reuse on class reload
2020-01-16 15:49:52 +01:00
Bojidar Marinov dc4455d819
Validate instances of objects before trying to check their type in GDScript
Fixes #27582
2020-01-16 16:39:59 +02:00
Rémi Verschelde 9986f3804c
Merge pull request #35198 from bojidar-bg/27575-poolarrayexport-default
Fix slight problems related to default values of exported typed arrays
2020-01-16 14:58:06 +01:00
Haoyu Qiu 92b36d4706 Adds NULL check before using image loader 2020-01-16 21:49:23 +08:00
Bojidar Marinov 19ce2d5159
Fix slight problems related to default values of exported typed arrays 2020-01-16 14:50:29 +02:00
Danil Alexeev 45b510b332 Fix function arguments hint format in GDScript editor
for consistency with the format of the documentation:
"type func_name(arg1: type, arg2: type)"
2020-01-16 15:41:02 +03:00
Rémi Verschelde 1de633205f Validate input in (CPU)Particles set_emission_shape()
Fixes #29777.

Co-authored-by: Cameron Reikes <cameronreikes@gmail.com>
2020-01-16 11:08:51 +01:00
Ignacio Etcheverry 1a40f250bd Mono/C#: Fix false positive in unsafe reference checks 2020-01-15 23:46:42 +01:00
ChibiDenDen 86aa12e806 Keep a weak reference to orphan subclasses to reuse on class reload 2020-01-15 22:54:01 +02:00
Rémi Verschelde 5f99e3396f
Merge pull request #35156 from MadEqua/fix-grid-map
Fix GridMap getter of baked meshes.
2020-01-15 17:55:52 +01:00
Bruno Lourenço da9eede933 Fix GridMap getter of baked meshes. 2020-01-15 14:30:17 +00:00
Rémi Verschelde 9b8d1383ce Mono: Fix parsing assembly names as UTF-8
Fixes #27185.
2020-01-15 11:51:03 +01:00
Houkime e1a0ce5af9 Prevent GDScript language server from listening to external hosts by default
* Add bind_ip property to WebSocketServer defaulting to "*" (listen to everyone)
* Set default for GDscript Language Server to listen only to localhost

Fixes potential security issue with GDScript language server being exposed to the
broad net by default.
Since it is the server which primary usage is to provide utility to the local
editor there is no need to expose it.
2020-01-15 00:29:59 +00:00
Rémi Verschelde 40f0649e5b Fix typos with codespell
Using codespell 1.16.0.

See ab3bccdb78 for procedure.
2020-01-15 00:49:52 +01:00
Rémi Verschelde 3d88a7bb22
Merge pull request #35122 from ChibiDenDen/fully_qualified_name_gdscript
Add fully_qualified_name for GDScript class
2020-01-14 18:54:52 +01:00
Rémi Verschelde 1bafd2d2c8
Merge pull request #35120 from Faless/docs/html5_restrictions
Update documentation to reflect HTML5 limitations.
2020-01-14 17:23:54 +01:00
Dani Frank d6f10cd08e Add fully_qualified_name for GDScript class 2020-01-14 17:33:33 +02:00
Fabio Alessandrelli aa744aee7d Update documentation to reflect HTML5 limitations. 2020-01-14 15:42:47 +01:00
Haoyu Qiu ddde73cc62 Makes adding port in Visual Script nodes deferred 2020-01-14 21:03:09 +08:00
Rémi Verschelde f06372cb73
Merge pull request #35097 from neikeq/issue-34954
Mono/C#: Fix _update_exports() leaking temporary Object/Node instances
2020-01-13 22:01:11 +01:00
Ignacio Etcheverry a6a5ef0fd6 Mono/C#: Add error checks to detect possible Reference leaks 2020-01-13 21:00:07 +01:00
Ignacio Etcheverry ea737db43c Mono/C#: Fix _update_exports() leaking temporary Object/Node instances 2020-01-13 20:58:46 +01:00
George Marques 1d129f9bec
GDScript: Check function arguments on release too
Needed because otherwise the certain type operations (such as type
casting) used as a function argument might become unresolved on release,
causing a compilation failure.

Fix #28680
2020-01-13 15:58:53 -03:00
Rémi Verschelde c7b701dfd2 Image: Include S3TC compression via Squish in non-tools build
We already build Squish in templates build for S3TC decompression,
so we can as well expose the compression feature.

Fixes #25640.
2020-01-13 15:58:49 +01:00
Rémi Verschelde e32d232053
Merge pull request #35076 from vnen/gdscript-type-match-assign
Type match on assignment only if operators have type
2020-01-13 13:14:57 +01:00
George Marques e6060706ca
GDScript: Type match on assignment only if operators have type
This ensures that a value without type won't be wrongly assigned to a
typed variable when the types mismatch.
2020-01-13 08:51:24 -03:00
Geequlim d5e1890c85 Fix infinite loop error in document link parsing 2020-01-13 19:23:29 +08:00
geequlim e804eebfe5 Remove completion triggers for ',' and '(' which may conflict with signature helper 2020-01-11 23:51:25 +08:00
geequlim d901d5993b Allow enable/disable threading for LSP server
Restart LSP server when configurations change without restart the editor
2020-01-11 23:50:32 +08:00
Rémi Verschelde 0b185278f3
Merge pull request #34225 from madmiraal/fix-34210
Add check for zero length motion at beginning of each sweep test loop in SpaceBullet::test_body_motion
2020-01-11 11:57:41 +01:00
Rémi Verschelde 0ab1726b43
Merge pull request #35003 from vnen/gdscript-forbid-script-as-member
GDScript: Forbid using "script" as member name
2020-01-11 00:03:55 +01:00
George Marques 4c20d9407d
GDScript: Forbid using "script" as member name
Avoids the user breaking things by creating a "script" variable with
something else, effectively overwriting the "script" slot on Object.
2020-01-10 19:43:33 -03:00
K. S. Ernest (iFire) Lee dfb713bce6 Use cycle and loop hint flags in FBX. 2020-01-10 08:23:24 -08:00
Rémi Verschelde 673f4fabd8
Merge pull request #34962 from KoBeWi/randocs
Complete documentation of various classes
2020-01-10 14:41:30 +01:00
Tomasz Chabora 508e624b87 Complete documentation of various classes 2020-01-10 14:14:07 +01:00
toasteater 677e72d2f6 Expose instance_from_id to GDNative
This function is available to GDScript but not to GDNative. When exposed, it
allows building more ergonomic safe abstractions over the GDNative APIs, and
covers the use cases of the original PR.

Close #28478. Supersedes #28791.

Co-authored-by: Markus Ewald <cygon@nuclex.org>
2020-01-10 11:59:37 +00:00
Rémi Verschelde 0d2993659b
Merge pull request #34978 from GodotExplorer/lsp-fix-bracket-completion
LSP: Fix bracket completion for functions with one argument
2020-01-10 07:58:26 +01:00
Rémi Verschelde 09aa12a0dd
Merge pull request #34958 from vnen/gdscript-is-check-valid-instance
GDScript: Validate object instance on `is` operation
2020-01-10 07:40:56 +01:00
Geequlim 6190d42825 LSP: Fix bracket completion for functions with one argument 2020-01-10 14:23:01 +08:00
George Marques 76678b2609
GDScript: Fix type name on error message for function parameters 2020-01-09 15:50:06 -03:00
George Marques 1aef8bfeb1
GDScript: Fix resolution of default parameter values
Fix #26556
2020-01-09 15:42:31 -03:00
George Marques 3718f8f592
GDScript: Validate object instance on is operation
Avoids crashes on debug mode. Instead it now breaks the execution and
show the error in-editor. Will still crash on release.

Also add a similar check to Marshalls to ensure the debugger doesn't
crash when trying to serialize the invalid instance.
2020-01-09 13:59:33 -03:00
George Marques cc9ca9eb34
GDScript: Don't re-evaluate index on assigment with operation
Pass the calculated index from the stack and use the same to get and set
the value. This avoids a function with side effects being evaluated
twice when using indexing in an assignment with operation statement
(e.g. a[function()] += 1).
2020-01-09 10:43:29 -03:00
Rémi Verschelde e97e951741
Merge pull request #34948 from vnen/gdscript-copy-constructor
GDScript: Allow copy constructor for built-in types
2020-01-09 13:42:10 +01:00
George Marques 41ed905c1a
GDScript: Allow copy constructor for built-in types
Those are implicitly defined in Variant.
2020-01-09 09:03:09 -03:00
George Marques 7d4fc79eb3
Add GDScript warning for standalone expression
This makes the error message clearer as it might be used to call
functions with side effects.
2020-01-09 08:30:14 -03:00
George Marques e7b7dc57fc
GDScript: set assign operation on local var made by match
This is needed in a all local variables with assigment to properly set
the typed operation.

Fix #34928
2020-01-08 19:28:07 -03:00
Rémi Verschelde b9a553f99d
Merge pull request #34921 from akien-mga/bullet-2.89
bullet: Sync with upstream 2.89
2020-01-08 21:17:33 +01:00
Rémi Verschelde 5a8107f70a
Merge pull request #34920 from GodotExplorer/lsp-signatureHelper
GDScript LSP: Implement signatureHelp
2020-01-08 18:29:39 +01:00
Rémi Verschelde c456d87ee6
Merge pull request #34918 from vnen/gdscript-assign-op
GDScript: enable type checks on release mode
2020-01-08 18:22:38 +01:00
Rémi Verschelde 29e07dfa4e bullet: Sync with upstream 2.89
This allows distro unbundling again for distros that ship Bullet 2.89+.
2020-01-08 18:05:43 +01:00
geequlim d35c018a7a GDScript LSP: Implement signatureHelp
Enable smart resolve default to true as it is required for script symbol lookup
2020-01-09 00:57:54 +08:00
George Marques d26414f9fe
GDScript: enable type checks on release mode
Also make builtin GDScript functions report return type as Variant in
release so type is converted when needed.
2020-01-08 12:38:18 -03:00
George Marques 899f7999b4
GDScript: properly set type of local variable initialization
Properly sets the type of the identifier for the local variable
that is stored in the assignment operation. This makes sure that the
compiler is aware of typing for local variables when they are
initialized with the declaration.
2020-01-08 11:36:50 -03:00
Rémi Verschelde cd408c5256
Merge pull request #34886 from JFonS/fix_32699
Make NoiseTexture threading more robust
2020-01-07 12:46:43 +01:00
JFonS 4e10c62024 Make NoiseTexture threading more robust
Fixes crash when a NoiseTexture was freed before the generation thread finished.
2020-01-07 11:35:34 +01:00
geequlim eb5861f9f1 GDScript LSP: Implement goto declaration 2020-01-04 20:02:26 +08:00
Rémi Verschelde 34c71157f0
Merge pull request #34795 from dankan1890/mono_cs_icon
[Mono]: the C# script icon is now visible in the editor.
2020-01-04 00:03:38 +01:00
dankan1890 51c601d2e3 [Mono]: the C# script icon is now visible in the editor. 2020-01-03 22:49:22 +01:00
Rémi Verschelde db1a01501b
Merge pull request #34790 from clayjohn/ETC-support-alpha
Add support for Lum-alpha textures to ETC fallback
2020-01-03 22:48:22 +01:00
Fabio Alessandrelli 411f08c506 Fix ENet max clients highest value.
Was 4096, while actually it's 4095. Fixed now in both docs and
`create_server` check.
2020-01-03 20:18:33 +01:00
clayjohn cd21200944 Add support for Lum-alpha textures to ETC fallback 2020-01-03 11:10:44 -08:00
Fabio Alessandrelli ce47d5af77 ENet optional server_relay when disconnecting peer
Was not correctly enforced before, always notifying other peers of the
disconnection.
2020-01-03 20:09:49 +01:00