Commit graph

3784 commits

Author SHA1 Message Date
Andrea Catania eb07e87981 Optmized data sent during RPC and RSet calls.
- Now is sent the method ID rather the full function name.
- The passed IDs (Node and Method) are compressed so to use less possible space.
- The variant (INT and BOOL) is now encoded and compressed so to use much less data.
- Optimized RPCMode retrieval for GDScript functions.
- Added checksum to assert the methods are the same across peers.

This work has been kindly sponsored by IMVU.
2020-02-12 13:36:47 +01:00
Rémi Verschelde 49eef1180b
Merge pull request #36135 from akien-mga/doc-update
doc: Sync classref with current source
2020-02-12 13:29:44 +01:00
Rémi Verschelde 0e3d625737 doc: Sync classref with current source
Lots of internal API changes and some docstrings were lost in the conversion.
I manually salvaged many of them but for all the rendering-related ones, an
additional pass is needed.

Added missing enum bindings in BaseMaterial3D and VisualServer.
2020-02-12 12:37:13 +01:00
Hanif Bin Ariffin 7bc1dc828f Remove deprecated Color::gray
It was marked to be removed in Godot 3.1.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-02-12 11:22:33 +01:00
geequlim 03d2d01082 Fix hover symbol content position 2020-02-12 17:59:20 +08:00
Marcel Admiraal 11cd8b8e4a Fix assign instead of comparison in image_save_tinyexr.cpp. 2020-02-11 17:11:39 +01:00
Rémi Verschelde db81928e08 Vulkan: Move thirdparty code out of drivers, style fixes
- `vk_enum_string_helper.h` is a generated file taken from the SDK
  (Vulkan-ValidationLayers).
- `vk_mem_alloc.h` is a library from GPUOpen:
  https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
2020-02-11 14:08:44 +01:00
Rémi Verschelde fff4240bb4 Fix code formatting issues and VS compilation
Also temporarily disable multicheck build so that we get a full build
even when there are style issues on Vulkan.

Fixes #33356.
2020-02-11 12:05:19 +01:00
bruvzg 26318f3bd1 Fix Vector3 ambiguities and out of bounds init. 2020-02-11 12:03:39 +01:00
Rémi Verschelde 3695c08782 basis_universal: Use proper basisu_transcoder.h header, fixes Clang build
Also renames bu to basisu to be more explicit and match upstream name.
2020-02-11 12:03:07 +01:00
Juan Linietsky d5cf1a872b Fixes to Basis Universal. 2020-02-11 12:02:59 +01:00
Rémi Verschelde 65ad12e79a glslang: Disable warnings and allow unbundling 2020-02-11 12:02:50 +01:00
Rémi Verschelde 7458a601ce basis_universal: Fix py3 build and document license and provenance
Also drop unneeded files.

Fix build with MinGW. Closes #32384.
2020-02-11 12:02:45 +01:00
Juan Linietsky 4aea9f74e6 Rewritten StreamTexture for better code reuse, added basis universal support 2020-02-11 12:02:36 +01:00
Juan Linietsky dd3682e5fe Modernized default 3D material, fixes material bugs. 2020-02-11 12:01:24 +01:00
Juan Linietsky 6deffa62fb Several fixes to 3D rendering, and multimesh implementation. 2020-02-11 12:01:22 +01:00
Juan Linietsky 449df8f688 Base 3D engine done, still untested, though. 2020-02-11 11:59:25 +01:00
Rémi Verschelde 6289e7d147 Merge pull request #29993 from bruvzg/vulkan
Initial Vulkan support for macOS (MoltenVK) and Windows
2020-02-11 11:57:40 +01:00
bruvzg eb48be51db Add static Vulkan loader.
Initial Vulkan support for Windows.
Initial Vulkan support for macOS.
2020-02-11 11:57:11 +01:00
Juan Linietsky 4fe3ee1730 Moved the shader source compilation code outside RenderingDevice and Vulkan 2020-02-11 11:53:29 +01:00
Juan Linietsky c613ead5fa Added a spinlock template as well as a thread work pool class.
Also, optimized shader compilation to happen on threads.
2020-02-11 11:53:29 +01:00
Juan Linietsky 50e9befb88 Changes to material required to add custom shaders in RD renderer 2020-02-11 11:53:28 +01:00
Juan Linietsky 9b0dd4f571 A lot of progress with canvas rendering, still far from working. 2020-02-11 11:53:27 +01:00
Juan Linietsky 3f335ce3d4 Texture refactor
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
2020-02-11 11:53:26 +01:00
Juan Linietsky 4f163972bb Refactored RID/RID_Owner to always use O(1) allocation.
* Implements a growing chunked allocator
* Removed redudant methods get and getptr, only getornull is supported now.
2020-02-11 11:53:26 +01:00
Marcel Admiraal a3b938d6dc Refactor image_saver_tinyexr.cpp to prevent compiler warnings.
Prevents GCC compiler throwing: control reaches end of non-void function.
Prevents Visual Studio throwing C4715: not all control paths return a value.
2020-02-11 10:29:09 +01:00
Aaron Franke 0a39c7b354
[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.
2020-02-10 12:20:04 -05:00
Andrea Catania e6be3f68da - Integrated NavigationServer and Navigation2DServer.
- Added Navigation Agents and Obstacles.
- Integrated Collision Avoidance.

This work has been kindly sponsored by IMVU.
2020-02-10 14:38:52 +01:00
Rémi Verschelde 8d96a44582 Merge pull request #33950 from Calinou/gridmap-editor-zoom-shortcut
Implement zooming using Ctrl + Mouse wheel in the GridMap editor
2020-02-10 11:30:10 +01:00
Rémi Verschelde 10de9978b8 Merge pull request #35812 from touilleMan/gdnative-uses-godot_string_name-where-possible
Use StringName in pluginscript's set/get_prop and add_global_constant
2020-02-10 10:47:22 +01:00
Yuri Roubinsky 386d0fe988 Fix VisualScriptClassConstant to be updated properly 2020-02-10 10:55:27 +03:00
Rémi Verschelde d617df5f34
Merge pull request #36048 from AndreaCatania/SoftBodyStiff
Make softbody completelly stiff to attachment point
2020-02-09 16:05:19 +01:00
Rémi Verschelde cedf9f68b1
Merge pull request #35649 from aaronfranke/color-unsigned
Use uint/ulong for Color in C#
2020-02-09 13:35:05 +01:00
Andrea Catania ca7ee56759 Make softbody completelly stiff to attachment point 2020-02-09 10:18:11 +01:00
Rémi Verschelde 9cc4f5e3ae
Merge pull request #36013 from raulsntos/fix-issubsequenceof
Avoid going out of bounds in IsSubsequenceOf
2020-02-09 00:02:30 +01:00
Rémi Verschelde b2a7c08cc4
Merge pull request #36011 from madmiraal/fix-33391
Remove do{ } while(0) wrapper around error macros.
2020-02-08 23:27:06 +01:00
Rémi Verschelde 42f04cbc1a
Merge pull request #35982 from akien-mga/scons-modules-enabled-header-and-split
SCons: Split libmodules.a in folder-based libs
2020-02-08 15:43:10 +01:00
Raul Santos 4b79ef5ebe
Avoid going out of bounds in IsSubsequenceOf
Closes #35598
2020-02-08 12:07:41 +01:00
Marcel Admiraal d2b02a3d7b Remove do{ } while(0) wrapper around error macros.
As pointed out by Faless, a do{ } while(0) wrapper around a continue or
break just ends the do{ } while(0) loop. The do{ } while(0) loop exists
to enable the macro to be used as a function which requires a semicolon.

The alternative approach is to use an if(1) { } else ((void)0) wrapper.
Since the macro already has an if(unlikely(m_cond)) { } this patch simply
adds the else ((void)0) to this if statement instead.

For consistency all the macros have been updated in the same way, and
trailing else warnings corrected. However, the wrappers around ERR_PRINT
and WARN_PRINT were removed, because they generated too many ambiguous
trailing else warnings. They are also single line macros so a wrapper is
not needed.
2020-02-08 11:21:46 +01:00
Rémi Verschelde da411d1625 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.
2020-02-07 21:01:05 +01:00
Rémi Verschelde 4e2dbb1bc0 SCons: Split libmodules.a in folder-based libs
This removes the need for the hacky split_libmodules logic on Windows,
since all libs are now of manageable size.
2020-02-07 14:19:51 +01:00
Rémi Verschelde f3726ee994 Use modules_enabled.gen.h to improve inter dependency checks
- Fix build with gdscript module disabled. Fixes #31011.
- Remove unused `gdscript` compile option.
- Fix build with regex module disabled.
- Fix ImageLoaderSVG to forward declare thirdparty structs.
2020-02-07 11:50:40 +01:00
Rémi Verschelde b7297fb39c SCons: Generate header with info on which modules are enabled
We already had `MODULE_*_ENABLED` defines but only in the modules
environment, and a few custom `*_ENABLED` defines in the main env
when we needed the information in core.

Now this is defined in a single header which can be included in the
files that need this information.
2020-02-07 11:31:37 +01:00
unknown 4aac44f173 Remove the last ERR_PRINTS that was missed by #33391 2020-02-07 00:15:46 +05:30
Rémi Verschelde d0e90cf07a
Merge pull request #35749 from Chaosus/vst_fix_constants
Fix GlobalConstant/BasicTypeConstant return type in visual scripts
2020-02-06 11:19:08 +01:00
Rémi Verschelde 7a094fdf40
Merge pull request #35912 from bruce965/fix-empty-audio-loop
Fix empty audio infinite loop
2020-02-05 16:36:10 +01:00
Marcel Admiraal 6d69cd40bd Add do..while(0) wrappers to macros without one.
- Add do..while(0) wrapper to ERR_FAIL_NULL macros.
- Add do..while(0) wrapper to ERR_FAIL_COND macros.
- Add do..while(0) wrapper to ERR_CONTINUE macros.
- Add do..while(0) wrapper to ERR_BREAK macros.
- Add do..while(0) wrapper to CRASH_COND macros.
- Add do..while(0) wrapper to ERR_FAIL macros.
- Add do..while(0) wrapper to ERR_PRINT macros.
- Add do..while(0) wrapper to WARN_PRINT macros.
- Add do..while(0) wrapper to WARN_DEPRECATED macros.
- Add do..while(0) wrapper to CRASH_NOW macros.
2020-02-05 11:19:12 +01:00
Marcel Admiraal f0db13502a Remove duplicate WARN_PRINT macro. 2020-02-05 11:13:24 +01:00
Marcel Admiraal 5af3b4ca27 Remove duplicate ERR_PRINT macro. 2020-02-05 11:13:24 +01:00
Fabio Iotti 5ed4ad81c3 Fix empty audio infinite loop 2020-02-04 21:11:38 +00:00
Hugo Locurcio 61bf5bf73f
Improve error explanations related to NetworkedMultiplayerENet 2020-02-02 23:34:47 +01:00
Rémi Verschelde 0edcb8ed58
Merge pull request #35809 from clayjohn/DOCS-update-version
Update docs to version 4.0
2020-02-01 19:42:31 +01:00
Rémi Verschelde 739f583151
Merge pull request #35811 from touilleMan/remove-useless-pluginscript-get_rpc-rset_mode
Remove useless pluginscript godot_pluginscript_script_desc.get_rpc/rset_mode fields
2020-02-01 17:09:14 +01:00
Emmanuel Leblond af8905fdf3
Use StringName in pluginscript's set/get_prop and add_global_constant 2020-02-01 05:16:48 +01:00
Emmanuel Leblond 491a6411d9
Remove useless pluginscript godot_pluginscript_script_desc.get_rpc/rset_mode fields 2020-02-01 05:04:47 +01:00
clayjohn 57e27683ba Update docs to version 4.0 2020-01-31 17:15:41 -08:00
Rémi Verschelde 8c3b14bed7
Merge pull request #35778 from touilleMan/remove-gdnative-wrapper
Remove deprecated GDNative wrapper code
2020-01-31 13:16:23 +01:00
Emmanuel Leblond 4c5205b550
Remove deprecated GDNative wrapper code 2020-01-31 11:20:25 +01:00
Rémi Verschelde a5d5579105
Merge pull request #35761 from Calinou/opensimplexnoise-increase-max-octaves
Increase the maximum number of octaves in OpenSimplexNoise to 9
2020-01-31 10:38:48 +01:00
Rémi Verschelde 43f84445ba
Merge pull request #35340 from Calinou/optimize-editor-icon-generation
Optimize the editor icon generation
2020-01-31 10:15:01 +01:00
Hugo Locurcio 13622d40fc
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.
2020-01-30 23:55:38 +01:00
Yuri Roubinsky c19933eec4 Fix GlobalConstant/BasicTypeConstant return type in visual scripts 2020-01-30 20:20:33 +03:00
Fabián L f595486076
Fixed GetNodeOrNull<T>
GetNodeOrNull<T> was using GetNode instead of GetNodeOrNull
2020-01-29 14:54:40 -03:00
Aaron Franke d49e8af8de
Use uint/ulong for Color in C# 2020-01-29 12:53:13 -05:00
Francois Belair f6968d5f17 Fix static functions loop using class' functions
Besides being incorrect, it also caused a hard editor crash for purely
static classes or classes with more static functions than methods.
2020-01-28 14:19:09 -05:00
Fabio Alessandrelli a48d0b5eef Disable Nagle's algorithm for WebSocket TCP.
This should greatly decrease latency for the most common use cases.
A new function WebSocketPeer::set_no_delay will allow to configure it if
so desired.
2020-01-28 14:10:46 +01:00
Rémi Verschelde f0f0f38d1a
Merge pull request #35516 from Faless/ws/fix_latency_32
Lower WebSocket latency, fixes.
2020-01-26 19:03:00 +01:00
Rémi Verschelde 4cee1cda5e
Merge pull request #35589 from akien-mga/doc-drop-category-property
doc: Drop unused 'category' property from header
2020-01-26 16:34:13 +01:00
Rémi Verschelde 09ced94dd4 doc: Do not expose Variant::NIL as a type in the class reference
Fix signals Variant arguments incorrectly listed as Nil.

Fixes #12520.
2020-01-26 16:08:11 +01:00
Rémi Verschelde 2d20fc39aa doc: Drop unused 'category' property from header
We already removed it from the online docs with #35132.

Currently it can only be "Built-In Types" (Variant types) or "Core"
(everything else), which is of limited use.

We might also want to consider dropping it from `ClassDB` altogether
in Godot 4.0.
2020-01-26 16:02:39 +01:00
Rémi Verschelde fe26e53065
Merge pull request #35581 from akien-mga/doc-color-constants
doc: Document named color constants
2020-01-26 13:36:44 +01:00
Rémi Verschelde cbdbfb00ca doc: Document named color constants
Busywork but it's good for our completion rate :)
2020-01-26 12:08:16 +01:00
Rémi Verschelde bb6c0d3e8b doc: Complete documentation for VideoStreams
Also quick clean up of the matching C++ files.
2020-01-26 11:29:07 +01:00
Rémi Verschelde 139ff35e76
Merge pull request #35567 from Xrayez/doc-noise-null-data
Mention that `NoiseTexture` uses threads internally
2020-01-26 10:22:26 +01:00
clayjohn c5700f7464 Complete various class references 2020-01-26 00:27:51 -08:00
Andrii Doroshenko (Xrayez) 5b1c6656d3 Mention that NoiseTexture uses threads internally
Provided a snippet on how to properly retrieve the noise texture data
given that it's generated in a thread.
2020-01-26 02:40:09 +02:00
Rémi Verschelde c96f08dc86
Merge pull request #35527 from neikeq/issue-35259
Mono/C#: Fix _update_exports possible crash with Reference types
2020-01-24 21:51:57 +01:00
Rémi Verschelde 75ab07546b
Merge pull request #35524 from neikeq/issue-35496
Fix C# preprocessor infinite loop and incorrect parsing of `#if!`
2020-01-24 21:51:38 +01:00
Ignacio Etcheverry 966a126186 Mono/C#: Fix _update_exports possible crash with Reference types
The code was attempting to dynamic cast the native instance to Reference after
the managed instance was disposed. As the managed instance acts as a Ref,
the native instance was freed during that disposal.
This made the dynamic cast fail and we attempted to memdelete a second time.

The fix is to make the dynamic cast before disposal.
2020-01-24 18:28:40 +01:00
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