Commit graph

5131 commits

Author SHA1 Message Date
George Marques 3155368093
GDScript: Add lambdas to the type analyzer
- Lambdas are always callables (no specific signature match).
- Captures from the current context are evaluated.
2021-04-28 10:56:16 -03:00
George Marques c6e66a43b0
GDScript: Add lambda syntax parsing
Lambda syntax is the same as a the function syntax (using the same
`func` keyword) except that the name is optional and it can be embedded
anywhere an expression is expected. E.g.:

    func _ready():
        var my_lambda = func(x):
            print(x)
        my_lambda.call("hello")
2021-04-28 10:56:16 -03:00
Rémi Verschelde 35a8693e6a
Raycast: Fix use of removed copymem after #48239 2021-04-28 11:09:20 +02:00
Rémi Verschelde 305b2a15bf
Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
Rémi Verschelde 1c2766e240
Merge pull request #48245 from madmiraal/fix-24111
Update CSGMesh3D's documentation to explain how vertex normals are used
2021-04-27 23:04:59 +02:00
Marcel Admiraal c2f6a73e4e Update CSGMesh3D's documentation to explain how vertex normals are used 2021-04-27 18:32:25 +01:00
Rémi Verschelde 95cfce661b
Merge pull request #48050 from JFonS/occlusion_culling 2021-04-27 19:07:12 +02:00
Rémi Verschelde 8247667a3e
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
Johannes Witt bab36f1273
Fix CSG Path Polygon cache being removed after connect
fixes #30229
2021-04-27 13:58:01 +02:00
Rémi Verschelde 83cc6bcf55
Merge pull request #48187 from brakhane/remove-dupe-comments
Remove duplicate comments
2021-04-27 09:42:09 +02:00
Rémi Verschelde 639b02f454
Merge pull request #48185 from Calinou/codestyle-no-auto
Remove uses of `auto` for better readability and online code reviews
2021-04-26 22:32:50 +02:00
Hugo Locurcio 5d124c4a8f
Remove uses of auto for better readability and online code reviews
The current code style guidelines forbid the use of `auto`.

Some uses of `auto` are still present, such as in UWP code (which
can't be currently tested) and macros (where removing `auto` isn't
easy).
2021-04-26 14:59:28 +02:00
Rémi Verschelde f6e5ea774b
Merge pull request #48172 from madmiraal/fix-empty-csgshape-error
Fix new `CSGMesh` errors
2021-04-26 12:19:48 +02:00
Dennis Brakhane 31d41d83c3 Remove duplicate comments
A few single line comments were duplicated, probably due to bad merges.

This commit removes the obviously duplicate ones.
2021-04-25 20:03:52 +02:00
Marcel Admiraal 4311c2f66e Fix CSGMesh undo not refreshing gizmo 2021-04-25 09:07:26 +01:00
Marcel Admiraal 48d3269aa4 Fix empty CSGShape error 2021-04-25 08:08:14 +01:00
Rémi Verschelde d1dc28e46c
Merge pull request #48139 from vnen/gdscript-dict-keys
Fix mismatch between String and StringName in dictionary keys
2021-04-24 19:46:59 +02:00
Rémi Verschelde db90ab86b9
Merge pull request #47891 from Razoric480/lsp-update-filesystem
Make LSP update the filesystem for changed scripts
2021-04-24 13:17:31 +02:00
jfons 4d9d99bb82 Implement occlusion culling
Added an occlusion culling system with support for static occluder meshes.
It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`.

Occluders are defined via the new `Occluder3D` resource and instanced using the new
`OccluderInstance3D` node. The occluders can also be automatically baked from a
scene using the built-in editor plugin.
2021-04-23 21:45:23 +02:00
George Marques 1e4ff2ede6
GDScript: Make sure Lua-style dicts use StringName as keys 2021-04-23 16:00:23 -03:00
George Marques c7511de02e
GDScript: Fix resolution of dictionary keys
There was a mixup between String and StringName keys. Now they're
clearly separated. This also means you have to consider which type
you're using for the dictionary keys and how you are accessing them.
2021-04-23 15:42:33 -03:00
rafallus cfa06f0f76 Unexpose _direct_state_changed in PhysicsBody
Removed _direct_state_changed bindings
Affects 2D and 3D nodes
Callbacks now use Callable
Tests were changed accordingly
2021-04-22 23:20:58 -05:00
Rémi Verschelde 4753b309a8
Merge pull request #48074 from akien-mga/fbx-fix-zlib-unbundling
fbx: Fix include for zlib that broke unbundling
2021-04-22 16:53:06 +02:00
bruvzg b56241f22f
ICU: Update to version 69.1, improve ICU data export process. 2021-04-22 16:56:53 +03:00
bruvzg a4423c82f8
Fix crash on GDNative API json generator exit. 2021-04-22 10:24:13 +03:00
Rémi Verschelde 93b7406138
fbx: Fix include for zlib that broke unbundling
It's possible to link against system zlib on Linux, so we should use system paths.
2021-04-22 02:18:44 +02:00
Rémi Verschelde 8a8dd9cef4
Merge pull request #47896 from Calinou/videoplayer-stream-position-warning
Print a warning when trying to seek in VideoPlayer
2021-04-20 20:07:13 +02:00
Rémi Verschelde fdf041a466
Merge pull request #47347 from nekomatata/heightmap-support
Heightmap collision shape support in Godot Physics
2021-04-20 17:40:28 +02:00
Rémi Verschelde a9ecf66342
Merge pull request #47956 from vnen/gdscript-double-stack
GDScript: Use special stack space for temporaries to reduce type changes
2021-04-20 17:39:09 +02:00
Rémi Verschelde 8ba06e3161
Merge pull request #47448 from madmiraal/rename-lineedit-cursor
Rename LineEdit getters and setters to match property names
2021-04-19 10:40:29 +02:00
Rémi Verschelde dfe4feb188
Merge pull request #47917 from akien-mga/squish-decompress-only
Import: Cleanup and optimize etcpak compression method
2021-04-18 17:00:21 +02:00
Marcel Admiraal 86822b187e Rename LineEdit caret_* properties getters and setters to match property 2021-04-17 12:41:23 +01:00
Ignacio Roldán Etcheverry 27a66ee528 C#: Fix double casting in wasm m2n trampolines
The trampolines were casting double to `size_t` (likely a copy-paste
mistake), so the value was getting truncated.
2021-04-17 05:45:52 +02:00
Rémi Verschelde 0ab928e060
Import: Cleanup and optimize etcpak compression method
Avoid unnecessary allocation of temporary buffers for each mip, and creates
only one Image with the compressed data.
Also renames variable and reorders code for clarity.

Clarify that squish is now only used for decompression.

Documented which formats can be decompressed in Image.
2021-04-16 17:08:36 +02:00
George Marques 9411bf05a4
GDScript: Adjust type of temporaries when needed 2021-04-16 12:04:08 -03:00
Rémi Verschelde 200d9a734c
Merge pull request #47701 from vnen/gdscript-test-runner 2021-04-16 10:34:39 +02:00
Rémi Verschelde 88015f4e72
Merge pull request #47880 from RevoluPowered/fix-fbx-parser
FBX Improve Parser and File Compatibility
2021-04-16 08:41:46 +02:00
Rémi Verschelde c7a4e2196e
Merge pull request #47878 from clayjohn/rename-get_surface_material
Rename get_surface_material to get_surface_override_material
2021-04-15 07:57:15 +02:00
Gordon MacPherson 061b77e5e6 This stops using FBXPropertyTable as a pointer.
The base object will inherit the property table, for every FBX object, if it doesn't exist it will be ignored.

The previous code was dangerous and not simple to understand, this makes the code simpler and should result in no leaks with PropertyTable.

Features/Fixes:

Adds ability for multiple millions of polygons to be loaded.
Fixes memory leaks with tokens
Fixes memory leaks with property table
Fixes loading some corrupt files
Fixes meshes not having a unique name to the mesh node.
Opens up loading for two more versions: 7100 and 7200, up to 2020.
Preliminary support for Cinema4D files in parser now, before this was not possible it would cause memory corruption, which is gone now.

FBXProperties not being pointers presented simpler challenges in the long run also, fixed a bunch of bugs.
2021-04-15 05:54:50 +01:00
clayjohn 92731d292c Rename get_surface_material to get_surface_override_material 2021-04-14 20:24:03 -07:00
Hugo Locurcio ea46639e22
Print a warning when trying to seek in VideoPlayer
Seeking isn't implemented in built-in video formats and can only
be supported in GDNative-provided video formats.
2021-04-14 20:39:13 +02:00
George Marques 40502a1689
GDScript: Pool temporary values by type on the stack
So the stack slots perform less type changes, which is useful for
future optimizations.
2021-04-14 14:35:51 -03:00
Francois Belair b16bb33a5b Make LSP update the filesystem of changed scripts
This updates global classes and exposes base member variables.
Fixes #39713
2021-04-14 13:12:39 -04:00
Rémi Verschelde b6a31d0bf6
Merge pull request #47890 from akien-mga/etcpak-compress-only
etcpak: We only need the compression code, remove rest of etcpak app
2021-04-14 17:44:20 +02:00
Rémi Verschelde 638cfec853
etcpak: We only need the compression code, remove rest of etcpak app
We do our own image loading, threading, and memory management in Godot already,
so the only components we need from etcpak (at least as of now) are the
`Compress*` methods defined in `ProcessDxtc.cpp` and `ProcessRGB.cpp`.

So we don't need to compile or vendor the rest.
2021-04-14 16:50:02 +02:00
reduz d3b49c416a Refactor GLSL shader compilation
-Used a more consistent set of keywords for the shader
-Remove all harcoded entry points
-Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization.
-Entry point for sky shaders is now sky().
-Entry point for particle shaders is now process().
2021-04-14 11:37:52 -03:00
George Marques 8fc4a732de
Merge pull request #47330 from Blackiris/fix-corrupt-scene-when-export-has-setter
Fix corrupt scene when export var has setter
2021-04-14 10:00:57 -03:00
Rémi Verschelde 3d1d3ab3db
Merge pull request #47807 from Blackiris/fix-is-type-treated-as-address
Fix type argument in is_builtin which was treated as an address
2021-04-14 14:50:02 +02:00
Julien Nguyen 79a16b8a44 Fix corrupt scene when export var has setter 2021-04-14 09:14:50 +02:00
K. S. Ernest (iFire) Lee 3cae9a802b Export gltf2 normal textures correctly. 2021-04-13 13:28:26 -07:00