Commit graph

1191 commits

Author SHA1 Message Date
Ignacio Etcheverry 6e7da72648 C#: Fix editor unable to play game after IDE PlayRequest
The editor wasn't clearing the debugger agent
settings properly after a processing a play
request from an IDE. This caused consequent play
attempts to fail if not launched from the IDE,
as the game would still attempt and fail to
connect to the debugger.

The concrete cause: Forgetting to clear the
`GODOT_MONO_DEBUGGER_AGENT` environment variable.
2020-08-19 00:14:57 +02:00
Aaron Franke 56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
Nhiqill 42d1b4f389 Pop from front to avoid infinite loop with nested classes 2020-07-27 16:36:56 -04:00
Rémi Verschelde dc456059a4
Merge pull request #40595 from neikeq/godot-net-sdk-and-net-standard
C#: Switch games to MSBuild Sdks and .NET Standard
2020-07-26 20:47:35 +02:00
Rémi Verschelde f940e5e000 CI: Install master version of psf/black
Until https://github.com/psf/black/pull/1328 makes it in a stable release,
we have to use the latest from Git.

Apply new style fixes done by latest black.
2020-07-26 19:48:25 +02:00
Ignacio Etcheverry ced77b1e9b C#: Switch games to MSBuild Sdks and .NET Standard
Godot.NET.Sdk
-------------

Godot uses its own custom MSBuild Sdk for game
projects. This new Sdk adds its own functionality
on top of 'Microsoft.NET.Sdk'.

The new Sdk is resolved from the NuGet package.

All the default boilerplate was moved from game
projects to the Sdk. The default csproj for
game project can now be as simple as:

```
<Project Sdk="Godot.NET.Sdk/4.0.0-dev2">
  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
  </PropertyGroup>
</Project>
```

Source files are included by automatically so
Godot no longer needs to keep the csproj in sync
when creating new source files.

Define constants
----------------

Godot defines a list of constants for conditional
compilation. When exporting games, this list also
included engine 'features' and platform 'bits'.
There were a few problems with that:

- The 'features' constants were only defined when
  exporting games. Not when building the game for
  running in the editor player.
- If the project was built externally by an IDE,
  the constants wouldn't be defined at all.

The new Sdk assigns default values to these
constants when not built from the Godot editor,
i.e.: when built from an IDE or from the command
line. The default define constants are determined
from the system MSBuild is running on.

However, it's not possible for MSBuild to
determine the set of supported engine features.
It's also not possible to determine if a project
is being built to run on a 32-bit or 64-bit
Godot executable.

As such the 'features' and 'bits' constants had
to be removed.
The benefit of checking those at compile time
was questionable, and they can still be checked
at runtime.

The new list of define constants includes:

- GODOT
- GODOT_<PLATFORM>
  Defaults to the platform MSBuild is running on.
- GODOT_<PC/MOBILE/WEB>
- TOOLS
  When building with the 'Debug' configuration
  (editor and editor player).
- GODOT_REAL_T_IS_DOUBLE
  Not defined by default unless $(GodotRealTIsDouble)
  is overriden to be 'true'.

.NET Standard
-------------

The target framework of game projects was changed
to 'netstandard2.1'.
2020-07-25 19:22:01 +02:00
George Marques 2b9d9bc364
Remove multilevel calls
In general they are more confusing to users because they expect
inheritance to fully override parent methods. This behavior can be
enabled by script writers using a simple super() call.
2020-07-24 14:13:58 -03:00
mega-bit 0ca96ae2c1 Fix typos in GodotSharp code docs 2020-07-22 22:46:04 +02:00
Ignacio Etcheverry 4a30289eee C#: Fix restore not called when building game projects 2020-07-22 14:28:47 +02:00
Aaron Franke ad96b6314c
Fix XML in Plane.cs 2020-07-21 20:13:51 -04:00
Aaron Franke 83e324d670
Update core documentation to match recent C# changes
Also a few minor API changes like adding AABB.abs()

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-07-21 14:44:53 -04:00
Rémi Verschelde 861c6c63b6
Merge pull request #40218 from aaronfranke/mono-docs
Add C# XML documentation to core C# math types
2020-07-14 10:17:10 +02:00
Aaron Franke 9986439352
Commit other files changed by file_format.sh 2020-07-13 14:14:11 -04:00
Aaron Franke 5fd4fa0b73
Add C# XML documentation to core C# math types 2020-07-11 05:07:24 -04:00
bruvzg 5d54c015b2
[macOS, Mono] Fix "Wdeprecated-declarations" build error. 2020-07-10 18:45:12 +03:00
George Marques 9654365547
Add a map of autoloads to ProjectSettings
So places that need to look into it can use the list instead of parsing
ProjectSettings details (like checking "*" in path for testing if it's
singleton).
2020-07-06 12:35:51 -03:00
Daniel Doran c3b16e825c Fix Mono PackedArray Marshalling 2020-07-05 14:54:31 -06:00
Rémi Verschelde 347a55d4c2
Merge pull request #40137 from neikeq/fix-clangtidy-warnings-mono
Mono/C#: Fix several clang-tidy warnings and cleanup
2020-07-05 22:32:27 +02:00
Ignacio Etcheverry 2511c43972 Mono/C#: Fix several clang-tidy warnings and cleanup 2020-07-05 19:19:36 +02:00
endlesstravel d2461bad63 fix crash when pass null in print array in GD.print
fix crash when pass null in print array in GD.print 2

fix crash when pass null in print array in GD.print 3

fix space
2020-07-03 16:55:09 +08:00
G'lek a5abacd1e7
Change assembly watcher after notification changes
Fixed Mono not building after #39986 was merged due to a constant that got renamed.
2020-06-30 17:41:38 -04:00
Rémi Verschelde 87d2397273
Merge pull request #39837 from neikeq/fix-invalid-unbox-long-as-int
Mono/C#: Fix InvalidCast because of attempt to unbox long as int
2020-06-26 07:56:42 +02:00
Rémi Verschelde aa42bd14ac
Merge pull request #39839 from neikeq/use-/restore-instead-of-/t-restore
Mono/C#: Use /restore instead of /t:restore when building
2020-06-26 07:49:40 +02:00
Ignacio Etcheverry 4b0c78b3ca Mono/C#: Use /restore instead of /t:restore when building
Documentation recommends not to use /t:restore
together with other targets (like /t:build),
as it messes with the environment.
2020-06-25 23:50:05 +02:00
Ignacio Etcheverry e8d632720f Mono/C#: Fix InvalidCast because of attempt to unbox long as int 2020-06-25 23:37:53 +02:00
Ignacio Etcheverry f87ae395ee Mono/C#: Fix unhandled exception not being printed
For some reason `mono_unhandled_exception` is not
printing the exception as its comment claims.
Use `mono_print_unhandled_exception` instead.
2020-06-25 23:28:53 +02:00
Rémi Verschelde 04795d7f1e
Merge pull request #39739 from MichaelBelousov/fix/long-enum-fix-rider-cast
fix underlying type of enum crashing cast in RiderPathManager
2020-06-24 22:51:07 +02:00
Michael Belousov 9f61f1ed54 Mono: fix bad long casts and wrong underlying enum types in GodotTools 2020-06-24 09:35:13 -04:00
Rémi Verschelde 7d60a88888
Merge pull request #39783 from neikeq/messaging-codecompletion-localize-fix
C#: Fix completion request with case insensitive resource path
2020-06-24 01:00:05 +02:00
Ignacio Etcheverry d569b447ff C#: Fix completion request with case insensitive resource path
Sometimes Visual Studio documents have the root path all in upper case.
Since Godot doesn't support loading resource files with a case insensitive path,
this makes script resource loading to fail when the Godot editor gets code
completion requests from Visual Studio.
This fix allows the resource path part of the path to be case insensitive. It
still doesn't support cases where the rest of the path is also case insensitive.
For that we would need a proper API for comparing paths. However, this fix
should be enough for our current cases.
2020-06-23 20:29:19 +02:00
Hugo Locurcio 31b7f02a29
Remove ToolButton in favor of Button
ToolButton has no redeeming differences with Button;
it's just a Button with the Flat property enabled by default.
Removing it avoids some confusion when creating GUIs.

Existing ToolButtons will be converted to Buttons, but the Flat
property won't be enabled automatically.

This closes https://github.com/godotengine/godot-proposals/issues/1081.
2020-06-19 20:49:49 +02:00
Rémi Verschelde d5c659c992
Merge pull request #39652 from paulloz/generics-getnodesingroup
[mono] Implement generics GetNodesInGroup
2020-06-19 18:52:36 +02:00
Paul Joannon 183dc04d70 [mono] implement generics GetNodesInGroup 2020-06-19 08:49:24 +02:00
Rémi Verschelde 9562fb900e
Merge pull request #39629 from MichaelBelousov/dont-slice-longs-to-mono
Dont slice 64-bit integers marshaled to mono in dynamic contexts
2020-06-19 07:50:34 +02:00
Hugo Locurcio 24a8d43272 Document Mono-specific classes
This fully documents all Mono-specific classes.
2020-06-18 10:32:34 +02:00
Michael Belousov 60fcefba69 return boxed long when marshalling a godot int to mono runtime in dynamic contexts 2020-06-17 17:16:17 -04:00
Rémi Verschelde ba0db95909 DocData: Skip language-specific ClassDoc without methods/constants
Removes the useless `@C#`, `@NativeScript` and `@VisualScript` entries.
2020-06-17 15:09:07 +02:00
Ignacio Etcheverry 7756351f47 Fix dynamic linking of MSVC Mono with MinGW Godot 2020-06-15 21:29:50 +02:00
Ignacio Etcheverry 54df72dcc6 C#: Add VisualStudio support 2020-06-15 21:29:16 +02:00
NutmegStudio a77f633161 Fixes building mono release templates 2020-05-30 12:21:24 +07:00
Maganty Rushyendra 3d03be7a56 Update Mono C# warning to reflect latest list of platforms supported
Simple fix for #38627. iOS (#20268) and HTML5 (#20270) removed from list of exceptions
for platforms supported in warning message.
2020-05-26 09:19:45 +08:00
Rémi Verschelde 2a3f650bf6
Merge pull request #38962 from neikeq/4.0-scons-option-build-cil
Add SCons option to not build C# solutions
2020-05-22 18:29:13 +02:00
Ignacio Etcheverry e3a54152e4 Add SCons option to not build C# solutions 2020-05-22 17:44:33 +02:00
Rémi Verschelde 07ada02cb4
Merge pull request #38943 from neikeq/yakamashi
Mono/C#: Don't try to load project assembly in project manager
2020-05-22 09:16:26 +02:00
Ignacio Etcheverry d7e21ecd63 Mono/C#: Don't try to load project assembly in project manager
This was causing an error message when launching the manager,
because there is no project assembly to load.
2020-05-22 02:17:59 +02:00
Ignacio Etcheverry 51e1614d28 Mono/C#: Fix values not updated in remote inspector 2020-05-22 00:58:38 +02:00
Rémi Verschelde cba1f492cc
Merge pull request #38863 from neikeq/csharp-no-false-error-objtype-reload
Mono/C#: Remove script load error about not a Godot.Object
2020-05-19 20:48:59 +02:00
Ignacio Etcheverry 38cd2152e6 Mono/C#: Remove script load error about not a Godot.Object
Any C# file can be loaded as script and at load
time we don't yet know if it's actually meant to
be used as a script. As such, such an check can
result in a lot of false errors.

If the file is really meant to be used as a
script, an error would be printed later when
attempting to instantiate it any way.
2020-05-19 17:51:56 +02:00
Ignacio Etcheverry 9fa4b402a7 Added tests for ClassDB 2020-05-16 17:32:58 +02:00
Rémi Verschelde 07bc4e2f96 Style: Enforce separation line between function definitions
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
  -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
  -o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```

This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.

This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde 1a8167867b Modernize remaining uses of 0/NULL instead of nullptr (C++11)
Using clang-tidy's `modernize-use-nullptr`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
2020-05-14 13:45:01 +02:00
Rémi Verschelde 1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Rémi Verschelde dbd90b9478
Merge pull request #38638 from pepegadeveloper123/mono_inherited_scene_bug
Fix inherited C# scene not inheriting parent's fields
2020-05-11 10:19:15 +02:00
Rémi Verschelde 54bb4cb6d6
Merge pull request #38650 from neikeq/dotnet-cli-support
C#: Support for building with the dotnet CLI
2020-05-11 10:16:01 +02:00
Ignacio Etcheverry dcf1dc4fe0 C#: Support for building with the dotnet CLI
By adding a reference to the 'Microsoft.NETFramework.ReferenceAssemblies' nuget
package, we can build projects targeting .NET Framework with the dotnet CLI.
By referencing this package we also don't need to install Mono on Linux/macOS
or .NET Framework on Windows, as the assemblies are taken from the package.
2020-05-11 08:17:37 +02:00
Ignacio Etcheverry 840255a04b Implement CSharpScript::inherits_script 2020-05-10 21:49:15 +02:00
pepegadeveloper123 4e00d8520d Inherited C# scene not inheriting parent's fields
When a child scene inherits a parent scene with a C# root node, the
parent scene's export variables appear to assume values set in the
parent scene, in the child scene's Inspector. However, when the child
scene is played, the parent scene's export variables assume default
values.
When a node is created, it inherits its parent C# script's fields from
the map CSharpScriptInstance::script->member_info. However this map was
not initialized outside the editor, and this commit ensured it is. This
fixes issues #36480 and #37581.
2020-05-11 03:20:11 +09:00
Rémi Verschelde 94721f5ab8 Revert "Renamed plane's d to distance"
This reverts commit ec7b481170.

This was wrong, `d` is not a distance but the `d` constant in the
parametric equation `ax + by + cz = d` describing the plane.
2020-05-10 16:47:11 +02:00
Rémi Verschelde 6ab92464bc
Merge pull request #38621 from akien-mga/stylé-comme-jamais
Style: clang-format: Disable if statements and case labels on single line
2020-05-10 15:38:53 +02:00
Ignacio Roldán Etcheverry 54b20a25b9
Merge pull request #38600 from neikeq/no
Switch to nuget Microsoft.Build and rewrite GodotTools messasing protocol
2020-05-10 13:33:03 +02:00
Rémi Verschelde 69de7ce38c Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
2020-05-10 13:13:54 +02:00
Rémi Verschelde e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
Marcus Elg ec7b481170 Renamed plane's d to distance 2020-05-10 12:12:51 +02:00
Ignacio Etcheverry 3ce09246d1 C#: Rewrite GodotTools messaging protocol 2020-05-09 21:49:40 +02:00
Ignacio Etcheverry f3bcd5f8dd C#: Use Sdks in GodotTools csprojs and switch to nuget Microsoft.Build 2020-05-09 21:36:31 +02:00
Ignacio Etcheverry af4acb5b11 C#/Mono: Check assembly version when loading
Not sure if we should check revision too, but this is good enough for what we want.
This will be needed to load the correct Microsoft.Build when we switch to the nuget version.
2020-05-09 20:54:16 +02:00
Ignacio Etcheverry 4441222194 C#: Remove StringExtensions.Empty() function
Causes issues with some editors as it's confused with `string.Empty`.
Should use `string.IsNullOrEmpty(str)` instead.
2020-05-09 20:48:00 +02:00
Ignacio Roldán Etcheverry 61306eb830
Merge pull request #38596 from neikeq/msbuild-restore
Mono: Use msbuild instead of nuget.exe for restoring
2020-05-09 20:16:52 +02:00
Ignacio Etcheverry b61ffef0ab Mono: Use msbuild instead of nuget.exe for restoring
- Make GodotTools output directly to the SCons output directory.
- Removed xbuild_fallback from the build system.
2020-05-09 19:45:04 +02:00
Ignacio Etcheverry e0a001549e Mono: Fix hot-reloading of nested classes 2020-05-09 19:18:28 +02:00
Rémi Verschelde ae33cf5f45
Merge pull request #36379 from aaronfranke/color-constructors
Add a Color constructor for Color with alpha
2020-05-07 21:16:51 +02:00
Hugo Locurcio 596d426151
Remove some C++11 polyfill defines that are no longer needed 2020-05-03 00:42:04 +02:00
Aaron Franke 90df1d67cb
Color with alpha constructor 2020-04-29 14:41:12 -04:00
Nannaquin 0ac6f4c40b Fix growMargin() not returning modified Rect2/Rect2i 2020-04-29 11:29:57 -04:00
Aaron Franke ad3c3e1bbb
[Mono] Rename LinearInterpolate to Lerp 2020-04-29 04:02:24 -04:00
Rémi Verschelde 41af228b76
Merge pull request #36960 from pycbouh/docs-improve-shortcuts
Improve shortcut formatting in docs
2020-04-29 09:40:52 +02:00
Ignacio Etcheverry f5510262bc Mono/C#: Fix load hook not called for some assemblies on domain reload 2020-04-23 18:55:44 +02:00
Ignacio Etcheverry 81f13f6171 C#: Fix always saving copy of csproj even with no changes
This was a regression from 93d7ec8836 (#38110).
Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to
always return true.
This workaround can be reverted once we switch to official Microsoft.Build.
2020-04-23 16:18:55 +02:00
Rémi Verschelde 8012be867c
Merge pull request #38123 from neikeq/fix-hotreload-twice
Mono/C#: Fix assemblies being reloaded a second time unnecesarily
2020-04-23 11:34:28 +02:00
Ignacio Etcheverry 20b9dbb1d5 C#: Revert marshalling of IDictionary/IEnumerable implementing types
Added marshalling for `System.Collections.Generic.List<T>` and
`System.Collections.Generic.Dictionary<TKey, TValue>`.
2020-04-23 02:26:43 +02:00
Ignacio Etcheverry c9882e61e2 Mono/C#: Fix assemblies being reloaded a second time unnecesarily 2020-04-23 02:23:25 +02:00
Ignacio Roldán Etcheverry 28f0b15c9d
Merge pull request #38117 from neikeq/export-mono-array-godot-object
Mono/C#: Allow exporting System.Array of type Godot.Object
2020-04-22 17:41:34 +02:00
Ignacio Roldán Etcheverry 3ad9652a5d
Merge pull request #38110 from neikeq/csproj-safer-migration
C#: Save copy of sln and csproj before applying fixes
2020-04-22 17:27:07 +02:00
Ignacio Etcheverry 0fec3cb5ed Mono/C#: Allow exporting System.Array of type Godot.Object 2020-04-22 17:19:45 +02:00
Ignacio Etcheverry 93d7ec8836 C#: Save copy of sln and csproj before applying fixes 2020-04-22 16:50:43 +02:00
Ignacio Etcheverry 71fc87e101 Mono/C#: Allow debugging exported games
- Include PDB files in exported games.
- Release export templates also allow debugging now.

Right now the only way to enable debugging in exported games is with the  environment variables, which may be cumbersome or not even possible on some platforms.
2020-04-22 16:44:03 +02:00
Juan Linietsky 5d4dc2d45c Add ability to bind typed arrays to script API
Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells
Note: Will do a mass replace on later PRs of whathever I can find, but probably need
a tool to grep through doc.
Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
2020-04-21 10:15:40 +02:00
Juan Linietsky ae09b55a19 Exposed RenderingDevice to script API
Also added an easier way to load native GLSL shaders.

Extras:

Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.

Note:

The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
2020-04-20 21:21:58 -03:00
Rémi Verschelde 2cd952bd84 Fix handling of PROPERTY_USAGE_SUBGROUP in DocData and editor
Subgroups were added in #37678 but not properly handled everywhere
where PROPERTY_USAGE_GROUP is.
2020-04-20 17:13:06 +02:00
Rémi Verschelde 408fab8442 Mono: Fix include for Android support
This was a typo in #37153.

Co-authored-by: Ignacio Etcheverry <ignalfonsore@gmail.com>
2020-04-18 21:28:51 +02:00
Yuri Sizov 1ea7295bd2 Improve shortcut formatting in docs 2020-04-10 18:42:11 +03:00
Ignacio Etcheverry 27ddb27da8 Fix C# bindings after recent breaking changes 2020-04-03 01:38:48 +02:00
Rémi Verschelde ea7b497065 Replace more occurrences of NULL with nullptr 2020-04-02 14:56:01 +02:00
lupoDharkael 95a1400a2a Replace NULL with nullptr 2020-04-02 13:38:00 +02:00
Rémi Verschelde e53cbba36c
Merge pull request #37484 from Calinou/csharp-verbatim-string-highlight
Remove syntax highlighting for C# verbatim strings due to bugs
2020-04-01 15:10:19 +02:00
Hugo Locurcio 49efd6093e Remove syntax highlighting for C# verbatim strings due to bugs
This closes #32336.
2020-04-01 09:12:47 +02:00
Ignacio Etcheverry 77dd061345 Mono/C#: Add iOS support
Right now, games only work on devices when exported with FullAOT+Interpreter.
There are some issues left that need to addressed for FullAOT alone. Right now,
it's giving issues with the Godot.NativeCalls static constructor.
2020-03-31 09:37:16 +02:00
Ignacio Etcheverry fa08437694 Mono/C#: Fix MinGW build not supporting .lib libraries
MinGW should support both its own format `.a` and MSVC's format `.lib`,
but Mono's module was only using the former. With this change it's now
possible to build with MinGW and link the official Mono for Windows
which is built with MSVC.
2020-03-31 09:37:11 +02:00
Rémi Verschelde f3c74afd28
Merge pull request #37436 from akien-mga/doc-node-renames
doc: Update classref with node renames
2020-03-30 20:32:11 +02:00
Rémi Verschelde eaaee63b62 doc: Update classref with node renames
A few extra renames for classes which were missed in last week's PRs.
2020-03-30 18:23:02 +02:00
Rémi Verschelde cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
Juan Linietsky eaae4b6408 Renamed 2D and 3D nodes to make their types explicit
Fixes #30736.
2020-03-27 14:54:04 +01:00
Mateo Kuruk Miccino f387b9b4f4 Multiple changes to DisplayServerX11
- Travis: Change x11 to linuxbsd
- SCons: Change x11 plataform to linuxbsd
- Plugins: Remove ; to avoid fallthrough warning
- DisplayServerX11: Implement set_icon
- DisplayServerX11: Fix X11 bug when a window was erased from windows
  map, all the changes from that erased windows are sending to the main
  window
- DisplayServerX11: Reorder create_window commands
- DisplayServerX11: Change every Size2 to Size2i and Rect2 to Rect2i
  where it belongs

+ More X11 fixes which have been integrated directly back into reduz's
original commits while rebasing the branch.
2020-03-26 15:49:54 +01:00
Rémi Verschelde 3d2dd79ecd SCons: Drop support for Python 2
We now require SCons 3.0+ (first version with Python 3 support),
and we set min required Python 3 version to 3.5 (3.4 and earlier are
EOL).
2020-03-25 15:25:37 +01:00
Rémi Verschelde cfd84625f0 Move DocData and Collada out of their subfolders
Now that the unused DocDump was removed, the `editor/doc` subfolder is
redundant.

Similarly, there's no reason for Collada to have a subfolder for itself
when glTF or OBJ don't.
2020-03-24 09:56:04 +01:00
Rémi Verschelde 7acdf74a6a
Merge pull request #37210 from van800/fix-36995
Fix warning: Property not found: mono/editor/editor_path_optional
2020-03-22 09:34:47 +01:00
Aaron Franke 7dbe8b65ae
Make file formatting comply with POSIX and Unix standards
UTF-8, LF, no BOM, and newlines at the end of files
2020-03-21 17:41:03 -04:00
Ivan.Shakhov 05946be2f1 Fix warning: Property not found: mono/editor/editor_path_optional (#36995) 2020-03-21 15:33:14 +01:00
Rémi Verschelde 194d2ccb72
Merge pull request #37116 from neikeq/issue-12917
Sync csproj when files are changed from the Godot FileSystem dock
2020-03-18 16:07:49 +01:00
Ignacio Roldán Etcheverry 97efd33ada
Merge pull request #37145 from neikeq/issue-37128
C#: Fix uses of old Configuration names
2020-03-18 15:36:12 +01:00
Rémi Verschelde 4663625d11
Merge pull request #37112 from Xrayez/mono-generate-help
Generate command line help text for the `mono` module
2020-03-18 15:32:08 +01:00
Ignacio Etcheverry 40f8de4c1e Sync csproj when files are changed from the Godot FileSystem dock 2020-03-18 15:06:41 +01:00
Ignacio Etcheverry 66c0b7ce98 C#: Fix uses of old Configuration names 2020-03-18 14:50:49 +01:00
Ignacio Roldán Etcheverry f62fc10bb6
Merge pull request #37131 from van800/master
fix RiderPathLocator - searching for toolbox on Mac
2020-03-18 14:25:02 +01:00
Ivan.Shakhov dc16b8742a fix RiderPathLocator - searching for toolbox on Mac 2020-03-18 09:23:29 +01:00
Ignacio Roldán Etcheverry ed298f5982
Merge pull request #36756 from aaronfranke/mono-vec2i3i
[Mono] Add Vector2i and Vector3i
2020-03-18 02:23:03 +01:00
Aaron Franke 9b322d46d3
[Mono] Marshaling for Vector2i, Vector3i, and Rect2i 2020-03-17 18:03:28 -04:00
Aaron Franke 22ba912d90
[Mono] Add Vector2i, Vector3i, and Rect2i
These have conversion operators between their non-integer equivalents. Vector2i to Vector2 is implicit, while Vector2 to Vector2i is explicit. All conversion code is done in the integer files, so Vector2.cs contains no reference to Vector2i etc.
2020-03-17 18:03:28 -04:00
Ignacio Etcheverry 0b814ea78d Mono/C#: Optimize the way we store GC handles for scripts
Don't store GC handles for C# script instances and instance bindings as 'Ref<MonoGCHandle>'; store the raw data instead. Initially this was not possible as we needed to store a Variant, but this had not been the case for a looong time yet the stored type was never updated.
2020-03-17 21:51:05 +01:00
Ignacio Etcheverry 6a85cdf640 Fix C# bindings after recent breaking changes
Implementation for new Variant types Callable, Signal, StringName.
Added support for PackedInt64Array and PackedFloat64Array.

Add generation of signal members as events, as well as support for
user created signals as events.
NOTE: As of now, raising such events will not emit the signal. As such,
one must use `EmitSignal` instead of raising the event directly.

Removed old ThreadLocal fallback class. It's safe to use thread_local now since
it's supported on all minimum versions of compilers we support.
2020-03-17 16:30:04 +01:00
Andrii Doroshenko (Xrayez) 94b6c1363c Generate command line help text for mono module 2020-03-17 17:26:09 +02:00
Rémi Verschelde cb282c6ef0 Style: Set clang-format Standard to Cpp11
For us, it practically only changes the fact that `A<A<int>>` is now
used instead of the C++03 compatible `A<A<int> >`.

Note: clang-format 10+ changed the `Standard` arguments to fully
specified `c++11`, `c++14`, etc. versions, but we can't use `c++17`
now if we want to preserve compatibility with clang-format 8 and 9.
`Cpp11` is still supported as deprecated alias for `Latest`.
2020-03-17 07:36:24 +01:00
Ignacio Etcheverry 1b634785b5 C#: Replace uses of old Configuration and update old csprojs 2020-03-14 19:01:29 +01:00
Ivan Shakhov ce01b83c4a reorder solution configurations + migration 2020-03-11 17:22:12 +01:00
Rémi Verschelde 478337c412
Merge pull request #36751 from Faless/debugger/threads_and_profilers
ScriptDebugger refactor, threading, profilers.
2020-03-09 19:08:07 +01:00
Andrii Doroshenko (Xrayez) 3acebdeecd Fix missing module editor icons
Module icons need to be renamed to PascalCase as well
for them to be registered in 4.0.

See godotengine/godot#36513.
2020-03-08 19:32:25 +02:00
Fabio Alessandrelli b8ddaf9c33 Refactor ScriptDebugger.
EngineDebugger is the new interface to access the debugger.
It tries to be as agnostic as possible on the data that various
subsystems can expose.

It allows 2 types of interactions:

- Profilers:
  A subsystem can register a profiler, assigning it a unique name.
  That name can be used to activate the profiler or add data to it.
  The registered profiler can be composed of up to 3 functions:
    - Toggle: called when the profiler is activated/deactivated.
    - Add: called whenever data is added to the debugger
      (via `EngineDebugger::profiler_add_frame_data`)
    - Tick: called every frame (during idle), receives frame times.

- Captures: (Only relevant in remote debugger for now)
  A subsystem can register a capture, assigning it a unique name.
  When receiving a message, the remote debugger will check if it starts
  with `[prefix]:` and call the associated capture with name `prefix`.

Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new
profiler system.

Port SceneDebugger and RemoteDebugger to the new capture system.
The LocalDebugger also uses the new profiler system for scripts
profiling.
2020-03-08 12:36:39 +01:00
Fabio Alessandrelli 540ca05a80 Threaded networking for editor debugger. 2020-03-08 12:16:09 +01:00
Rémi Verschelde 6635e25b2c
Merge pull request #36842 from Phischermen/mono-resource-loader-extension-update
Mono/C#: Add missing parameters to 'ResourceLoader.Load<T>()'
2020-03-06 22:54:11 +01:00
Phischermen 1b0819bd59 Added parameters to Load() 2020-03-06 13:41:35 -08:00
Rémi Verschelde 5b040ef2e8 Mono: Fix detection of Apple platforms in build script 2020-03-05 09:00:41 +01:00
Rémi Verschelde 30ff00d6c8
Merge pull request #36657 from van800/rpl3
On Windows find Rider installed for CurrentUser
2020-03-04 10:27:03 +01:00
Raul Santos 6b9c22542f
Fix missing null check in Mono Binding of GD.print 2020-03-02 16:26:29 +01:00
Ivan Shakhov c95e20a089 On Windows find Rider installed for CurrentUser 2020-02-28 21:34:20 +01:00
Juan Linietsky 475e4ea67b Removed interactive loader, added proper thread loading. 2020-02-28 11:20:45 -03:00
Rémi Verschelde b7b3978684
Merge pull request #36556 from RandomShaper/rework_mutex
Reimplement `Mutex` with C++'s `<mutex>` (plus more)
2020-02-28 00:26:01 +01:00
Rémi Verschelde 5c4878191a
Merge pull request #36602 from van800/jetbrains_msbuild
Allow using Rider MSBuild on Windows, when Rider is selected as external editor
2020-02-27 20:46:50 +01:00
Ivan Shakhov a9c2ab81cf use Rider MSBuild on Windows, when Rider is selected as external editor 2020-02-27 15:32:35 +01:00
Ivan Shakhov 33af53c1a6 Support toolbox custom "Tools install location", by reading .settings.json 2020-02-27 15:22:12 +01:00
Pedro J. Estébanez 18fbdbb456 Reimplement Mutex with C++'s <mutex>
Main:
- It's now implemented thanks to `<mutex>`. No more platform-specific implementations.
- `BinaryMutex` (non-recursive) is added, as an alternative for special cases.
- Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes.
- Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts.
- A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this.
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- Thread-safe utilities are therefore simpler now.

Misc.:
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
- Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock).
- `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
2020-02-26 20:40:10 +01:00
Juan Linietsky 33b5c57199 Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.
- Renames PackedIntArray to PackedInt32Array.
- Renames PackedFloatArray to PackedFloat32Array.
- Adds PackedInt64Array and PackedFloat64Array.
- Renames Variant::REAL to Variant::FLOAT for consistency.

Packed arrays are for storing large amount of data and creating stuff like
meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of
memory. That said, many users requested the ability to have 64 bits packed
arrays for their games, so this is just an optional added type.

For Variant, the float datatype is always 64 bits, and exposed as `float`.

We still have `real_t` which is the datatype that can change from 32 to 64
bits depending on a compile flag (not entirely working right now, but that's
the idea). It affects math related datatypes and code only.

Neither Variant nor PackedArray make use of real_t, which is only intended
for math precision, so the term is removed from there to keep only float.
2020-02-25 12:55:53 +01:00
Fabio Alessandrelli cbc450c0e5 Huge Debugger/EditorDebugger refactor. 2020-02-21 11:12:03 +01:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Rémi Verschelde 213a85521d doc: Sync classref with current source
Handle removal of Pool*Array types and other recent changes.
2020-02-18 14:02:02 +01:00
Rémi Verschelde 702976cd7a Mono: Fix build after ObjectID and Texture2D changes 2020-02-18 11:36:48 +01:00
Juan Linietsky 3205a92ad8 PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
2020-02-18 10:10:36 +01:00
Juan Linietsky 867d073b98 Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr. 2020-02-15 08:36:04 -03:00
Rémi Verschelde 54ac8eaba6 Remove more deprecated methods and code 2020-02-13 12:37:45 +01:00
Rémi Verschelde 1f39a2d3e6 Remove deprecated sync and slave networking keywords
Those keywords were deprecated for 3.1 in #22087.

Also fix token name for `TK_REMOTE`, should be "remote" like the keyword.
2020-02-13 08:59:36 +01:00
Rémi Verschelde 09534e2922 Fix Mono and GDNative builds after changes to ObjectID
Issues caused by cf8c679a23.

The Mono change is actually a bugfix (used the int instead of ObjectID
by mistake).

The GDNative change is a temporary revert until a more exhaustive approach
is taken to make 'godot_int' 64-bit, is confirmed wanted by GDNative users.
2020-02-12 20:06:30 +01:00
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
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
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
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
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
unknown 4aac44f173 Remove the last ERR_PRINTS that was missed by #33391 2020-02-07 00:15:46 +05:30
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
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
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
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 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
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
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
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
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
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
Ignacio Etcheverry 1a40f250bd Mono/C#: Fix false positive in unsafe reference checks 2020-01-15 23:46:42 +01:00
Rémi Verschelde 9b8d1383ce Mono: Fix parsing assembly names as UTF-8
Fixes #27185.
2020-01-15 11:51:03 +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
dankan1890 51c601d2e3 [Mono]: the C# script icon is now visible in the editor. 2020-01-03 22:49:22 +01:00
Rémi Verschelde 399e53e8c3
Merge pull request #34784 from neikeq/fix-hintpath-godottools
Mono/C#: Fix wrong HintPath for package in GodotTools
2020-01-03 16:34:08 +01:00
Ignacio Etcheverry 9ce0ddcf0d Mono/C#: Fix wrong HintPath for package in GodotTools 2020-01-03 15:53:16 +01:00
Aaron Franke 68ba2588b8
[Mono] Color arithmetic operators 2020-01-03 06:00:14 -05:00
Aaron Franke 0b3f1cc70a
[Mono] Make Sign methods consistent with GDScript and System.Math 2020-01-02 16:41:41 -05:00
Ignacio Etcheverry c1ff3ef9e8 Mono/C#: Fix comment generation for non-constant param default
- Generate the comment for the param, even if the method has no description.
- Generate the comment outside the <summary> element.
2020-01-02 18:10:02 +01:00
Ignacio Etcheverry f3aa793ba3 Mono/C#: Fix bindings generator with void vararg methods
Commit 4d727f1ee6 made it possible for vararg
methods to return void. This broke the C# bindings generator which was
assuming in one place that vararg methods always return Variant.
2020-01-02 18:02:48 +01:00
Ignacio Etcheverry 844a8d215b Mono/C#: Make 'GD.Print' and its variants fallback to 'ToString()'
Up until now, 'GD.Print' would convert parameters first to
Variant and only then to String. This meant parameters that cannot be
converted to Variant would be printed as "Null".
This commit makes 'GD.Print' fallback to 'System.Object.ToString()'
if the parameter could not be converted to Variant.
The same applies to all 'GD.Print' variants:
'GD.PrintS', 'GD.PrintT', 'GD.PrintErr' and 'GD.PrintRaw'.
2020-01-02 13:54:20 +01:00
Ignacio Etcheverry ea75ea50d2 Mono/C#: Fix GD.PrintErr now showing in the Output panel 2020-01-02 13:13:22 +01:00
Rémi Verschelde a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
Ignacio Roldán Etcheverry 7fddf5eb7c
Merge pull request #34699 from van800/godot-guid
Custom property for Godot generated project
2019-12-31 20:28:14 +01:00
Rémi Verschelde edf2ed5e50
Merge pull request #34582 from timothyqiu/forward-decl
Cleans up headers included in editor_node.h
2019-12-30 16:28:47 +01:00
Ivan Shakhov af2e6e12d1 add custom property to csproj, which identifies that project is generated by Godot 2019-12-30 16:16:47 +01:00
Dan Kramer 1b26f2c505 Fix msbuild target argument 2019-12-29 17:03:21 -05:00
Ignacio Etcheverry 86274b9fc9 Mono/C#: Re-structure API solution and GodotTools post-build target
Previously we had a placeholder solution called 'Managed' to benefit from
tooling while editing the a part of the C# API.
Later the bindings generator would create the final 'GodotSharp' solution
including these C# files as well as the auto-generated C# API.
Now we replaced the 'Managed' solution with the final 'GodotSharp' solution
which is no longer auto-generated, and the bindings generator only takes
care of the auto-generated C# API.
This has the following benefits:
- It's less confusing as there will no longer be two versions of the same file
(the original and a generated copy of it). Now there's only one.
- We no longer need placeholder for auto-generated API classes, like Node or
Resource. We used them for benefiting from tooling. Now we can just use the
auto-generated API itself.
- Simplifies the build system and bindings generator. Removed lot of code
that is not needed anymore.

Also added a post-build target to the GodotTools project to copy the output to
the data dir. This makes it easy to iterate when doing changes to GodotTools,
as SCons doesn't have to be executed anymore just to copy these new files.
2019-12-28 20:48:55 +01:00
Ignacio Roldán Etcheverry 318c693516
Merge pull request #34595 from van800/mac_rider
Fix search for Rider path on Mac
2019-12-26 02:16:55 +01:00
Ignacio Roldán Etcheverry f90e8c41a2
Merge pull request #34604 from neikeq/issue-27674
Mono/C#: Fix memory leak with new Reference instances created from C#
2019-12-25 20:47:07 +01:00
Ignacio Etcheverry 0ef635c0e3 Mono/C#: Fix memory leak with new Reference instances created from C# 2019-12-25 19:33:59 +01:00
Ivan.Shakhov 682dd04b2d fix Rider path on Mac 2019-12-25 00:14:31 +01:00
Haoyu Qiu 078c0d75f2 Cleans up headers included in editor_node.h 2019-12-24 21:46:05 +08:00
Dan Kramer 097d1c9383 add suggested fix 2019-12-21 13:26:29 -05:00
Rémi Verschelde a10449bbbc
Merge pull request #34514 from neikeq/remove-dep-on-mono-posix
Mono/C#: Remove GodotTools dependency on the Mono.Posix assembly
2019-12-21 17:07:18 +01:00
Ignacio Etcheverry 5a3ccf4f14 Mono/C#: Remove GodotTools dependency on the Mono.Posix assembly
MSBuild on Windows uses the system .NET Framework BCL instead of Mono's. Because
of this, it may not be able to find the Mono.Posix assembly, so it's better
not to depend on it. We needed Mono.Posix to call Syscall.access, so we can
replace this with an internal call that does the same in C++.
2019-12-21 15:55:45 +01:00
Rémi Verschelde 2a4c528d06
Merge pull request #34465 from neikeq/no-hardcode-debugger-wait
Mono/C#: Remove hard-coded debugger wait at initialization
2019-12-19 21:27:59 +01:00
Ignacio Etcheverry f3c6c63b94 Mono/C#: Remove hard-coded debugger wait at initialization
Up until now debug builds would always wait up to 500 ms during initialization
to give time for debuggers to attach to the game.
We no longer want this as it increases startup time unnecesarily.
The way forward is to setup the debugger agent as client instead of server.
This way it's the game that connect to the debugger, not the other way around.
If server mode is still desired, suspend=y can be used to indefinitely wait
for the debugger to attach. This all can be specified with the environment
variable 'GODOT_MONO_DEBUGGER_AGENT' when launching the game.
2019-12-19 17:07:20 +01:00
Ignacio Etcheverry 98dc07f25f Mono/C#: Fix Variant -> MonoString* when type is Variant:NIL
`Variant::operator String()` returns "Null" if the type is `Variant:NIL`.
We must consider that and return a null `MonoString*` instead when marshalling.
This was also causing a "Null" error to be displayed when exporting a game
because null string members would be set to "Null" during hot-reload.
2019-12-19 16:51:32 +01:00
Rémi Verschelde 1c6b9bfdff Mono: Copy native and btls libs on macOS 2019-12-18 08:39:37 +01:00
Ignacio Etcheverry 20d7013c60 Mono/C#: Fix project export and fix FindLast/GetFile regression
d09193b08a introduced a regression in
StringExtensions.FindLast. StringExtensions.GetFile was also affected as it
relies on FindLast. This in turn broke the project exporter as it uses GetFile.
The cause of the regression is that now FindLast is calling LastIndexOf
with 'startIndex: 0'. This should be 'startIndex: str.Length - 1' instead.

Also fixed another regression in the project exporter:
de7c2ad21b moved 'GodotTools/GodotSharpExport.cs'
to 'GodotTools/Export/ExportPlugin.cs' and in doing so accidently reverted
the changes from commit e439581198.
2019-12-17 13:06:41 +01:00
Rémi Verschelde c3ea4ea9b7
Merge pull request #34382 from van800/profiler
Allow attaching any external profiler, including JetBrains dotTrace
2019-12-16 22:00:36 +01:00
Ivan Shakhov 7c64779516 Allow attaching any external profiler, including JetBrains dotTrace 2019-12-16 20:34:30 +01:00
Rémi Verschelde a866028a7a Mono: Enable threads suspend workaround on Windows
This appears to be necessary for current official builds cross-compiled
with MinGW from Linux, using Mono 6.6.0.160.

Follow-up to #31784, see #29812 for details.
2019-12-16 15:40:26 +01:00
Rémi Verschelde 12ee35737f
Merge pull request #34334 from neikeq/issue-33503
Mono/C#: Fix class parser bug with 'where T : struct'
2019-12-13 20:13:28 +01:00
Ignacio Etcheverry f2a2293709 Mono/C#: Fix class parser incorrectly handling nested namespaces
It would incorrectly error thinking the nested namespace is being declared inside a struct/class. This was because of an incorrect nesting level being used for classes and structs.
2019-12-13 19:55:32 +01:00
Ignacio Etcheverry c1ab956dd0 Mono/C#: Fix class parser bug with 'where T : struct'
The struct decl parsing was outdated. Make both struct decl and class declparsing share the same code.
2019-12-13 19:50:42 +01:00
Rémi Verschelde 9f68626fb2 doc: Sync classref with current source
Also apply clang-format.
2019-12-13 10:41:06 +01:00
Rémi Verschelde d39284a65f
Merge pull request #34295 from aaronfranke/potato-knishes
[Mono] Fix string Find methods having reversed case sensitivity
2019-12-13 08:47:26 +01:00
Aaron Franke d09193b08a
Fix string Find methods having reversed case sensitivity 2019-12-12 02:21:16 -05:00
Aaron Franke 5771f9959c
Mono formatting
No space for casting, add spaces inside braces, 4 space indentation, remove trailing indentation, remove BOM.
2019-12-11 16:32:47 -05:00
Rémi Verschelde cd9d513285
Merge pull request #34181 from van800/rider
Support Rider as external editor for Godot mono version
2019-12-11 09:20:31 +01:00
Ivan Shakhov 8fbc9d33fd Support Rider as External Editor 2019-12-11 08:39:04 +01:00
Jonas 11258db001
Fix missing null checks in Mono Binding of GD
The print methods of mono binding was missing null checks for the params
2019-12-06 11:56:50 +01:00
Ignacio Roldán Etcheverry 6544a0e908
Merge pull request #34018 from dsge/show-template-directory-path-in-error-message
Make sure to include the path in the "Data template directory not found" error message
2019-12-05 14:17:23 +01:00
Ignacio Etcheverry 066ae9d83b Mono/C#: Several android fixes
- Added correct config file for android dllmaps.
- Fix __Internal DllImports with a dlopen fallback.
- Add missing P/Invoke functions and internal calls expected by the monodroid BCL and our custom version of the 'Android.Runtime.AndroidEnvironment' class (this last one can be found in the godot-mono-builds repo).
- Make sure to set 'btls' instead of 'legacy' as the default TLS provider on Android.
2019-12-04 19:03:42 +01:00
Ignacio Etcheverry 3797f19926 C#: Add Duplicate method to the Array and Dictionary bindings 2019-12-04 15:22:30 +01:00
dsge 81cae314b4 Make sure to include the path in the "Data template directory not found" error message 2019-11-30 15:44:18 +01:00
Rémi Verschelde fa0e682027
Merge pull request #33982 from neikeq/issue-29349
Mono/C#: Add option to export assemblies outside of PCK
2019-11-29 11:37:18 +01:00
Ignacio Etcheverry 85d8c42763 Mono/C#: Fix crash on exported games that don't use C# 2019-11-29 01:35:46 +01:00
Ignacio Etcheverry 66de28eda8 Mono/C#: Add option to export assemblies outside of PCK
When using this options, assemblies will be saved in the Assemblies folder of the  data directory: 'data_AppName/Assemblies/'.
2019-11-29 00:36:05 +01:00
Rémi Verschelde 636bc5c32f
Merge pull request #33828 from neikeq/貴様
Mono/C#: Prevent SCons from building API solutions in parallel
2019-11-23 11:24:48 +01:00
Ignacio Etcheverry ebdd2bc474 Mono/C#: Prevent SCons from building API solutions in parallel 2019-11-22 23:42:24 +01:00
Rémi Verschelde c41c24562d Style: Add missing copyright headers 2019-11-22 08:37:09 +01:00
Ignacio Roldán Etcheverry 63b321dbbb
Merge pull request #33791 from neikeq/issue-33761
C#: Fix PathWhich on Windows when name already has extension
2019-11-21 21:34:12 +01:00
Ignacio Etcheverry f91416d9ac C#: Fix PathWhich on Windows when name already has extension
Also make the Posix version of PathWhich check if the file has executable access.
2019-11-21 14:53:00 +01:00
Rémi Verschelde 73323a2838
Merge pull request #33763 from neikeq/issue-33725
Fix C# export error dialog showing up when it should not
2019-11-20 13:23:20 +01:00
Ignacio Etcheverry d79aeca599 Fix C# export error dialog showing up when it should not 2019-11-20 13:07:26 +01:00
Ignacio Etcheverry 3f247ea507 Mono/C#: Bundle libmono-btls-shared.dll on Windows if it exists 2019-11-19 17:22:06 +01:00
Ignacio Etcheverry 008769aee9 C#: Throw NullReferenceException for null NodePath/RID params 2019-11-18 12:23:54 +01:00
Ignacio Etcheverry 8cbe4a3db4 Make C# internal calls return structs as ref parameters
The Mono IL interpreter's WebAssembly to native trampolines don't support passing structs by value, so we need to do it this way.

Also now we pass and return long, ulong, float and double as ref parameters as well. This is due to missing trampolines for float and long types. This is likely a temporary workaround that will be reverted in the future. The correct solution would be to patch 'mono/mini/m2n-gen.cs' when building the Mono runtime for WASM in order to generate the trampolines we need.
2019-11-15 03:22:25 +01:00
Ignacio Etcheverry 2b67924a0b Mono/C#: Initial exporter support for AOT compilation 2019-11-15 03:22:18 +01:00
Ignacio Etcheverry de7c2ad21b Mono/C#: WebAssembly support 2019-11-13 21:41:11 +01:00
Ignacio Roldán Etcheverry 953f37f49b
Merge pull request #33249 from JoshLee0915/MonoHeadlessServer
Added missing server platform checks to template dir and shared lib copy in mono_configure.py
2019-11-12 14:57:29 +01:00
Rémi Verschelde 77816fea8b
Merge pull request #32477 from aaronfranke/equal-approx-separate
Make is_equal_approx separate and make == exact again
2019-11-07 14:54:15 +01:00
Aaron Franke 4922a48a9e
[Mono] Alphabetize Mathf 2019-10-29 10:10:24 -04:00
Rémi Verschelde e96319c7f3
Merge pull request #32670 from aaronfranke/mono-plane
[Mono] Change Plane intersect methods to return nullable Vector3
2019-10-23 21:44:05 +02:00
JoshLee0915 cbd98d0fcf Added the server platform checks to template dir and shared lib copy 2019-10-21 20:47:24 -06:00
Aaron Franke 218f38c7ec
Expose is_equal_approx and restore == to be exact again
This commit changes behavior for GDScript and C#.

Also did some organizing of the order to logically group related methods, mostly for Rect2 and AABB.
2019-10-14 16:48:59 -04:00
Aaron Franke 86922ff70b
Make is_equal_approx separate for structures
This commit adds exposed behavior for C#
2019-10-14 16:46:54 -04:00