Commit Graph

45879 Commits

Author SHA1 Message Date
c4ccabd3fb C#: Remove DynamicGodotObject/Object.DynamicObject
We are moving in the direction of no dynamic code generation,
so this is no longer desired.

The feature can still be easily implemented by any project that
still want it.
2022-08-22 03:35:59 +02:00
124fbf95f8 C#: Move marshaling logic and generated glue to C#
We will be progressively moving most code to C#.
The plan is to only use Mono's embedding APIs to set things at launch.
This will make it much easier to later support CoreCLR too which
doesn't have rich embedding APIs.

Additionally the code in C# is more maintainable and makes it easier
to implement new features, e.g.: runtime codegen which we could use to
avoid using reflection for marshaling everytime a field, property or
method is accessed.

SOME NOTES ON INTEROP

We make the same assumptions as GDNative about the size of the Godot
structures we use. We take it a bit further by also assuming the layout
of fields in some cases, which is riskier but let's us squeeze out some
performance by avoiding unnecessary managed to native calls.

Code that deals with native structs is less safe than before as there's
no RAII and copy constructors in C#. It's like using the GDNative C API
directly. One has to take special care to free values they own.
Perhaps we could use roslyn analyzers to check this, but I don't know
any that uses attributes to determine what's owned or borrowed.

As to why we maily use pointers for native structs instead of ref/out:
- AFAIK (and confirmed with a benchmark) ref/out are pinned
  during P/Invoke calls and that has a cost.
- Native struct fields can't be ref/out in the first place.
- A `using` local can't be passed as ref/out, only `in`. Calling a
  method or property on an `in` value makes a silent copy, so we want
  to avoid `in`.

REGARDING THE BUILD SYSTEM

There's no longer a `mono_glue=yes/no` SCons options. We no longer
need to build with `mono_glue=no`, generate the glue and then build
again with `mono_glue=yes`. We build only once and generate the glue
(which is in C# now).
However, SCons no longer builds the C# projects for us. Instead one
must run `build_assemblies.py`, e.g.:
```sh
%godot_src_root%/modules/mono/build_scripts/build_assemblies.py \
        --godot-output-dir=%godot_src_root%/bin \
        --godot-target=release_debug`
```
We could turn this into a custom build target, but I don't know how
to do that with SCons (it's possible with Meson).

OTHER NOTES

Most of the moved code doesn't follow the C# naming convention and
still has the word Mono in the names despite no longer dealing with
Mono's embedding APIs. This is just temporary while transitioning,
to make it easier to understand what was moved where.
2022-08-22 03:35:59 +02:00
e298144a41 Fix ItemList selection visual when the scrollbar visibility changes 2022-08-21 22:10:41 -03:00
84ba33f627 Properly refer to functions definition color in description 2022-08-21 17:19:26 +02:00
da7a5653f4 Expose Basis set_orthogonal_index method as a GridMap function 2022-08-20 21:42:20 -05:00
8893b2bdb4 Clean up mesh include code and comments 2022-08-20 13:24:40 -05:00
7ef5dfcfc3 Changed the title of change node type dialog 2022-08-20 22:53:07 +05:30
0c5f254956 Merge pull request #64110 from Geometror/fix-light-shadow-off 2022-08-20 17:06:03 +02:00
104ac29b54 Remove duplicate ignore_empty_terrains paragraph
Removes a duplicate `ignore_empty_terrains` paragraph in the `TileMap` documentation
2022-08-20 16:41:12 +02:00
1e044da15c Merge pull request #64481 from jamie-pate/master
Improve performance of screen_get_dpi() in Javascript
2022-08-20 13:36:04 +02:00
f00cf3ff11 3to4: Fix handling of arrays in connect() and JSON alignment 2022-08-20 13:57:49 +03:00
5119d0d974 Merge pull request #64625 from Chaosus/shader_pp_defined 2022-08-20 11:51:58 +03:00
499fd0a4e7 Add defined keyword support to shader preprocessor 2022-08-20 11:26:59 +03:00
5e0d2b5097 Merge pull request #62046 from clayjohn/vertexless-draw
Allow creating meshes without vertex positions
2022-08-20 05:32:28 +02:00
18585c69b3 Fix OmniLight/SpotLight shadow opacity calculation 2022-08-20 01:05:44 +02:00
47d3fd99a2 Merge pull request #64461 from bitsawer/fix_windows_list_dir
Fix Windows list dir handle leak
2022-08-20 00:58:42 +02:00
79717dcb46 Merge pull request #64170 from YuriSizov/docs-annotations-in-technicolor
Add documentation for all annotations
2022-08-20 00:57:01 +02:00
bbbcdd725a Remove requirement to have vertex positions when creating a mesh. Meshes can now be constructed from an index buffer alone 2022-08-19 14:50:12 -06:00
8779f51a5e Merge pull request #63960 from bitsawer/fix-macro-expansion 2022-08-19 23:37:47 +03:00
fafd15014f Merge pull request #64510 from KoBeWi/PR_packed_with_docs😎
Complete documentation of packed arrays
2022-08-19 22:05:05 +02:00
019d6584ee Merge pull request #64167 from clayjohn/screen-texture-hint
Add shader uniform hints for screen textures
2022-08-19 21:51:39 +02:00
117c530e1d Merge pull request #64342 from clayjohn/DOF-scale
Properly scale depth in bokeh_dof effect
2022-08-19 21:16:32 +02:00
8f2083e6c0 Fix MenuBar minimum size adding unnecessary extra spacing after the last item. 2022-08-19 22:04:58 +03:00
b35ff86c17 Merge pull request #64612 from bruvzg/fix_shortcuts
Fix MenuBar not processing shortcuts.
2022-08-19 20:43:17 +03:00
469c18152f Merge pull request #64592 from mhilbrunner/move-fast-break-things
Unexpose VelocityTracker3D
2022-08-19 20:43:02 +03:00
96ba6e8cf9 Merge pull request #64595 from mhilbrunner/ergo-proxy
Unexpose ProxyTexture
2022-08-19 20:42:27 +03:00
7895a66cf2 Merge pull request #64334 from YuriSizov/core-bind-property-revert-methods
Make `property_*_revert` methods multilevel and expose them for scripting
2022-08-19 20:41:41 +03:00
2040087898 Fix MenuBar not processing shortcuts. 2022-08-19 16:49:50 +03:00
a0995182fe Add documentation for all annotations 2022-08-19 15:06:39 +03:00
dded7c72c1 Make cubic_interpolate() consider key time in animation 2022-08-19 14:48:37 +09:00
35cfaafda8 Merge pull request #64459 from Chaosus/shader_elif 2022-08-19 07:01:22 +03:00
92bdeb7eb5 Unexpose ProxyTexture 2022-08-19 03:01:47 +02:00
da567cb1f9 Unexpose VelocityTracker3D 2022-08-19 02:28:24 +02:00
0ba1046355 Merge pull request #64580 from asmaloney/doc-grammar-less
[doc] Fix grammar in class docs: less vs. fewer/lower
2022-08-19 01:51:31 +02:00
0d95b8bff2 Merge pull request #59045 from Calinou/editor-theme-popup-no-rounded-corners
Don't use rounded corners for PopupMenus in the editor theme
2022-08-19 02:42:17 +03:00
8cc0d07b49 Merge pull request #59851 from Calinou/doc-object-meta-editor-only
Document that Object metadata starting with `_` is editor-only
2022-08-19 01:41:25 +02:00
6f273d2156 Merge pull request #63326 from MewPurPur/binary-highlighting-fix
Fix highlighting of multiple operators
2022-08-19 01:27:02 +02:00
420a8c888e Merge pull request #63950 from bruvzg/menu_bar3
Implement MenuBar control to wrap Popup menus or native menu, use native menu for editor.
2022-08-19 01:24:24 +02:00
b099a8570c Complete documentation of packed arrays 2022-08-19 00:43:29 +02:00
480586899a Merge pull request #63358 from YuriSizov/control-simplify-enhance-toolbar
Improve editor toolbar for `Control` nodes
2022-08-19 00:46:46 +03:00
17ca5b913c Merge pull request #64156 from bruvzg/sys_msdf
Allow MSDF rendering for system fonts, fix crash on loading damaged / unsupported font files.
2022-08-18 14:58:57 -06:00
6923076850 Merge pull request #64302 from neikeq/unreference-callback-regr-from-44691448
Fix instance binding unreference callback regression
2022-08-18 14:53:31 -06:00
903a3a641e Merge pull request #64315 from Daylily-Zeleen/fixed-GraphEdit-signal-argument-type
Fixed GraphEdit signal argument type
2022-08-18 14:50:33 -06:00
547e64d226 Merge pull request #63999 from QbieShay/qbie/vs-qol
Quality of life visual shaders updates
2022-08-18 14:47:23 -06:00
de083c8f63 Merge pull request #64345 from Mickeon/docs-better-draw
Improve documentation of `CanvasItem`'s draw logic
2022-08-18 14:44:28 -06:00
72e25f794c Merge pull request #55032 from Calinou/tweak-default-window-size
Increase the default project window size for better usability
2022-08-18 23:43:01 +03:00
1811a4d784 Merge pull request #64356 from Calinou/editor-hide-dummy-text-driver
Hide Dummy text driver in the Project Settings as it makes editor unusable
2022-08-18 14:38:38 -06:00
0a313b4b83 Merge pull request #64449 from Calinou/label3d-hide-ineffective-properties
Hide properties that have no effect in Label3D inspector
2022-08-18 14:31:19 -06:00
ce8b402f3a Don't use rounded corners for PopupMenus in the editor theme
PopupMenus use separate windows by default in the editor, and windows
no longer support per-pixel transparency for now in 4.0.
Even if per-pixel transparency was reimplemented, we can't assume
that it'll always work in practice (e.g. when compositing is disabled).
2022-08-18 22:17:55 +02:00
d60db2dba8 Merge pull request #64468 from aaronfranke/editor-prop-visual-shader-mode
Rename `EditorPropertyShaderMode` to `EditorPropertyVisualShaderMode`
2022-08-18 14:14:12 -06:00