summaryrefslogtreecommitdiff
path: root/modules
AgeCommit message (Collapse)Author
2022-08-22C#: Begin move to .NET CoreIgnacio Roldán Etcheverry
We're targeting .NET 5 for now to make development easier while .NET 6 is not yet released. TEMPORARY REGRESSIONS --------------------- Assembly unloading is not implemented yet. As such, many Godot resources are leaked at exit. This will be re-implemented later together with assembly hot-reloading.
2022-08-22C#: Restructure code prior move to .NET CoreIgnacio Roldán Etcheverry
The main focus here was to remove the majority of code that relied on Mono's embedding APIs, specially the reflection APIs. The embedding APIs we still use are the bare minimum we need for things to work. A lot of code was moved to C#. We no longer deal with any managed objects (`MonoObject*`, and such) in native code, and all marshaling is done in C#. The reason for restructuring the code and move away from embedding APIs is that once we move to .NET Core, we will be limited by the much more minimal .NET hosting. PERFORMANCE REGRESSIONS ----------------------- Some parts of the code were written with little to no concern about performance. This includes code that calls into script methods and accesses script fields, properties and events. The reason for this is that all of that will be moved to source generators, so any work prior to that would be a waste of time. DISABLED FEATURES ----------------- Some code was removed as it no longer makes sense (or won't make sense in the future). Other parts were commented out with `#if 0`s and TODO warnings because it doesn't make much sense to work on them yet as those parts will change heavily when we switch to .NET Core but also when we start introducing source generators. As such, the following features were disabled temporarily: - Assembly-reloading (will be done with ALCs in .NET Core). - Properties/fields exports and script method listing (will be handled by source generators in the future). - Exception logging in the editor and stack info for errors. - Exporting games. - Building of C# projects. We no longer copy the Godot API assemblies to the project directory, so MSBuild won't be able to find them. The idea is to turn them into NuGet packages in the future, which could also be obtained from local NuGet sources during development.
2022-08-22C#: Re-write GD and some other icalls as P/InvokeIgnacio Roldán Etcheverry
2022-08-22C#: Re-write Array, Dictionary, NodePath, String icalls as P/InvokeIgnacio Roldán Etcheverry
2022-08-22C#: Remove DynamicGodotObject/Object.DynamicObjectIgnacio Roldán Etcheverry
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-22C#: Move marshaling logic and generated glue to C#Ignacio Roldán Etcheverry
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-20Expose Basis `set_orthogonal_index` method as a GridMap functionrafallus
2022-08-20Changed the title of change node type dialogUmang Kalra
2022-08-20Merge pull request #64170 from YuriSizov/docs-annotations-in-technicolorMax Hilbrunner
Add documentation for all annotations
2022-08-19Merge pull request #64334 from YuriSizov/core-bind-property-revert-methodsYuri Sizov
Make `property_*_revert` methods multilevel and expose them for scripting
2022-08-19Add documentation for all annotationsYuri Sizov
2022-08-19Merge pull request #63326 from MewPurPur/binary-highlighting-fixMax Hilbrunner
Fix highlighting of multiple operators
2022-08-18Merge pull request #64156 from bruvzg/sys_msdfClay John
Allow MSDF rendering for system fonts, fix crash on loading damaged / unsupported font files.
2022-08-18Remove unintentional PROPERTY_USAGE_INTERNALRedMser
The flag only matters for property definition, but was also used in _validate_property a lot.
2022-08-18Add collision weight to PhysicsBody for penetrations must be avoidedSilc Renew
Co-authored-by: Juan Linietsky <reduzio@gmail.com>
2022-08-18Make `property_*_revert` methods multilevel and expose them for scriptingYuri Sizov
2022-08-15Fix action name completion for `Input`Haoyu Qiu
2022-08-15Improve the `make_rst.py` parser for BBCode tagsYuri Sizov
2022-08-14GLTF: Fix orthographic cameras, internally store data in GLTF's formatAaron Franke
2022-08-14Document GLTFLight and GLTFSpecGlossAaron Franke
2022-08-14Improve binary operator highlightingVolTer
2022-08-13Add Navigation Debug for GridMap edge connectionssmix8
Adds navigation visual debug for GridMap edge connections that use baked navigationmesh with bake_navigation=true.
2022-08-13Rename Navigation's `neighbor_dist` to `neightbor_distance`Micky
NavigationAgent2D/3D.`neighbor_dist` -> `neighbor_distance` (also affects setters and getters) NavigationServer2D/3D.`agent_set_neighbor_dist()` -> `agent_set_neighbor_distance()` Also changes their parameters' names. Doesn't affect "Agent.neighborDist_" in Agent.h
2022-08-11Expose string array properties in OpenXR module as PackedStringArrayRaul Santos
2022-08-10Merge pull request #62934 from Xwdit/script_doc_arg_def_varRémi Verschelde
2022-08-10Merge pull request #63015 from Xwdit/fix_gds_editor_tooltip_arg_typeRémi Verschelde
2022-08-10Merge pull request #63020 from Xwdit/fix_gds_editor_tooltip_return_typeRémi Verschelde
2022-08-10Merge pull request #64169 from hakro/fix-gltf-animations-always-importedRémi Verschelde
2022-08-10Fix script documentation method argument default valuesXwdit
Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
2022-08-10Fixed incorrect type display of function argument in GDScript editor tooltipsXwdit
2022-08-10Fixed incorrect type display of void return in GDScript editor tooltipsXwdit
2022-08-10Merge pull request #64206 from Chaosus/gds_fixRémi Verschelde
2022-08-10Merge pull request #64188 from YeldhamDev/gridmap_item_fixRémi Verschelde
2022-08-10Prevent AnimationPlayer from being added on GLTF import if the option is ↵Hakim
unchecked. Fixes #63954
2022-08-10Prevent global functions from overriding completion of subscriptYuri Rubinsky
2022-08-09Fix error when switching to another `GridMap` with an item with higher index ↵Michael Alexsander
selected
2022-08-09Allow MSDF rendering for system fonts, fix crash on loading damaged / ↵bruvzg
unsupported font files.
2022-08-09vector4 distance_squared_to and update csharpantonWetzel
2022-08-08Merge pull request #64099 from A-Lamia/lsp_uri_path_fixesRémi Verschelde
2022-08-08Rename the argument tag to param in XML documentationYuri Sizov
2022-08-08Merge pull request #64076 from raulsntos/doc-fixesRémi Verschelde
Add `@GDScript.type_exists` documentation, Fix typo in weakref documentation
2022-08-08Merge pull request #64004 from YuriSizov/doctool-fail-on-unnamed-argsRémi Verschelde
Add checks and tests for empty/unnamed arguments
2022-08-08Merge pull request #63932 from smix8/navigation_heightmapshape_baking_4.xRémi Verschelde
2022-08-08Add `@GDScript.type_exists` documentationRaul Santos
2022-08-08Add tests for empty/unnamed arguments to ClassDB, Variant, GDScriptYuri Sizov
2022-08-08fix: modifies workspace->root_uri so that p_uri is symmetrical to other ↵Lamia
operating systems. #63388
2022-08-08Merge pull request #64085 from raulsntos/fix-rider-checkRémi Verschelde
2022-08-08Merge pull request #64046 from ↵Rémi Verschelde
AntonioDell/bugfix/63715-infer-preloaded-const-types
2022-08-08Avoid paths with invalid characters in `IsRider`Raul Santos
2022-08-07Various fixes to C# documentationRaul Santos