Commit graph

563 commits

Author SHA1 Message Date
Ignacio Etcheverry
23ae64b15e C#: Optimize struct marshalling
- We no longer box struct to return them from internal calls.
- Use reinterpret_cast if the managed struct layout is the same as the native struct.
2018-10-17 22:36:26 +02:00
Ignacio Etcheverry
eeaa9124af C# API: Hide method bind fields from debugger 2018-10-16 17:22:27 +02:00
Ignacio Etcheverry
3a9b23bcc2 Check if directory exists before trying to delete it 2018-10-08 23:03:58 +02:00
Ignacio Etcheverry
c1dad2ae2d C# bindings generator fixes
- Fix unused bool local for MonoBoolean argument.
- Append U to API hashes. Fixes warning: 'integer constant is so large that it is unsigned'
2018-10-07 11:00:05 +02:00
Aaron Franke
4f7b33cdcf Remove redundant "== false" code
Some of this code has been re-organized.
f
2018-10-06 16:20:41 -04:00
Rémi Verschelde
aa85b7ed62
Merge pull request #22688 from neikeq/lotsofgoodies
Mono: Editor and export template dependencies and fixes
2018-10-05 16:24:21 +02:00
Ignacio Etcheverry
d7ece43b74 Mono: Editor and export template dependencies and fixes
- Bundle editor dependencies:
    - 'GodotSharp': Root data directory for the editor
        - 'Tools': Editor dependencies. Only GodotSharp.dll for now.
        - 'Api': Prebuilt GodotSharp and GodotSharpEditor API assemblies.
        - 'Mono': Mono files to bundle with the editor.
            - 'bin': (Optional, not used for now) Mono bin directory.
            - 'etc': Mono configuration files.
            - 'lib': Mono dependency shared libraries.
            - 'lib/mono/4.5': Framework assemblies.
    - Added build option to copy the required files from the mono installation to 'GodotSharp/Mono'. Enable with 'copy_mono_root=yes'. Disabled by default.

- Export template dependencies:
    - 'data_AppName'/'data_Godot':
        - 'Mono': Mono files to bundle with the game.
            - 'etc': Mono configuration files.
            - 'lib': Mono dependency shared libraries.
    - The data directory is generated when compiling and must be bundled with the export templates. In the case of OSX, the data directory must be placed inside the 'osx.zip' export template.
    - In OSX, alternative location for directories (needed for app bundles) are:
        - 'data_AppName/Mono/etc' --> '../Resources/GodotSharp/Mono/etc'
        - 'data_AppName/Mono/lib' --> '../Frameworks/GodotSharp/Mono/lib'

- The editor can bundle prebuilt API assemblies.
    - Generate them with a tools build by running: `--generate-cs-core-api <GodotSharp_OutputDir> --generate-cs-editor-api <GodotSharpEditor_OutputDir> <GodotSharp_OutputDir>/bin/Release/GodotSharp.dll` (This command will be simplified in the future and both projects will be in the same solution)
    - Build the solutions and copy the output files to '#bin/GodotSharp/Api'.
- Fixed API assembly being added twice during the export process.
2018-10-03 19:16:29 +02:00
Ignacio Etcheverry
2c8980f44c Fix GCC compiler warning in mono module
- thread_local.h: 'delegating constructors only available with -std=c++11 or -std=gnu++11'
- mono_reg_utils.cpp: 'extra tokens at end of #endif directive'
- mono_bottom_panel.cpp: '<fieldB> will be initialized after <fieldA> when initialized here'
- bindings_generator.cpp: 'name lookup of 'i' changed (...) matches this 'i' under ISO standard rules (...) matches this 'i' under old rules (...)'
2018-10-03 00:56:28 +02:00
Ignacio Etcheverry
e463834a8b Fix missing mono internal call
- Also fixed uninitalized variable in buildscript
2018-09-17 22:54:47 +02:00
Ignacio Etcheverry
50f6dbff87 Mono: Fix opening code editors in OSX and cleanup 2018-09-17 20:00:19 +02:00
Rémi Verschelde
277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Ignacio Etcheverry
d21c64cc3b C#: Fix cs_files glue mismatch bug 2018-09-12 03:24:08 +02:00
Ignacio Etcheverry
e558e1ec09 Fix/workaround for issue #21667
When a Reference managed instance is garbage collected and its finalizer is called, it could happen that the native instance is referenced once again before the finalizer can unreference and memdelete it. The workaround is to create a new managed instance when this happens (at least for now).
2018-09-12 03:24:08 +02:00
Ignacio Etcheverry
61426464ea Add some mono root hint dirs for OSX
Fixes #13355
2018-09-12 03:24:08 +02:00
Ignacio Etcheverry
b1356a3590 Cleanup of c# api files and bindings generator
- We no longer generate RID and NodePath C# classes. Both will be maintained manually.
- We no longer generate C# declarations and runtime registration of internal calls for the following classes: RID, NodePath, String, GD, SignalAwaiter and Godot.Object (partial base).
- We no longer auto-generate the base members of Godot.Object. They will be maintained manually as a partial class.

This makes it easier to maintain these C# classes and their internal calls, as well as the bindings generator which no longer generates C# classes that don't derive from Godot Object, and it no longer generates the Godot.Object base members (which where unreadable in the bindings generator code).

- Added missing 'RID(Object from)' constructor to the RID C# class.
- Replaced MONO_GLUE_DISABLED constant macro with MONO_GLUE_ENABLED.
- Add sources in module/mono/glue even if glue is disabled, but surround glue files with ifdef MONO_GLUE_ENABLED.
2018-09-12 03:23:45 +02:00
Ignacio Etcheverry
aa2bcf3dfc C# generated classes ignore warning CS1591 and cleanup 2018-08-27 20:39:51 +02:00
exts
035d498af2 Added Collections namespace to Array & Dictionary 2018-08-25 17:19:37 -05:00
Rémi Verschelde
de59fe04e7 Add print_verbose to print to stdout only in verbose mode
Equivalent of the cumbersome:
if (OS::get_singleton()->is_stdout_verbose())
	print_line(msg);
2018-08-24 09:23:20 +02:00
Ignacio Etcheverry
7287300433 Mono: Improve C# core files (glue/cs_files) buildsystem
- Search C# files recursively in 'glue/cs_files'.
- Determine a version for the C# core files automatically. The latest modified time will do for now.
2018-08-17 13:51:55 +02:00
Hein-Pieter van Braam
0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Ignacio Etcheverry
fe28e323b3
Merge pull request #20298 from PJB3005/18-07-20-mono-partial-api-ext
Makes Mono binding classes partial & adds GetNode<T>.
2018-07-25 18:03:57 +02:00
Ignacio Etcheverry
779c9d638e
Merge pull request #15880 from neikeq/better-collections
Mono: Add Dictionary and Array classes
2018-07-23 23:59:04 +02:00
Aaron Franke
69530ef614 [Mono] Update about/warning text
I've removed the section about being unable to export games using C# - as you are now able to do this, as long as the export templates are installed. Also, I've made a few minor grammar tweaks.
2018-07-21 15:26:41 -05:00
Pieter-Jan Briers
a8c97eb094 Makes Mono bindings partial & adds GetNode<T>. 2018-07-20 13:55:13 +02:00
Ignacio Etcheverry
ee3c476c9a Add Array and Dictionary wrapper classes to C# 2018-07-20 01:44:30 +02:00
Ignacio Etcheverry
a731bd5864
Merge pull request #20253 from neikeq/nobranchnameideasfeelsbadman
Make C# bindings generator ignore disabled classes
2018-07-18 21:20:34 +02:00
Ignacio Etcheverry
92c7fe422b Make C# bindings generator ignore disabled classes 2018-07-18 21:15:41 +02:00
Mads Ynddal
39aabba0a9 Added path for Mono installed through Homebrew
On macOS, it is common to install packages like Mono through the third-party
package-manager Homebrew. This commit simply adds an additional path to
where Homebrew installs the Mono framework.
2018-07-10 00:29:05 +02:00
Ignacio Etcheverry
4739cb8c00 Mono: Pending exceptions and cleanup 2018-07-04 03:08:29 +02:00
Kelly Thomas
17516822f9 allow undefined GODOT_DEBUG_MSBUILD environment variable 2018-06-06 22:31:54 +08:00
Ignacio Etcheverry
4a021fa7a2 Mono: Add 'View log' button to open the MSBuild log of a build 2018-06-05 22:21:52 +02:00
Ignacio Etcheverry
25f10b3c40 Mono: Fix passing wrong logger assembly path to MSBuild
- Add option to print MSBuild's stdout and stderr instead of redirecting it. This can be enabled by setting the environment variable: Godot_DEBUG_MSBUILD=1
2018-06-05 22:18:43 +02:00
Michele Valente
6c74f3de6d fixes build error on Linux after its introduction in #18949
The function expects now a return value. Returning NULL seems to work in
this case.
2018-05-17 11:34:05 +02:00
Ignacio Etcheverry
01397a10d9 Mono: Project building fixes
- Set (Csc/Vbc/Fsc)ToolExe environment variables to point to the batch files in Mono's bin directory when building with Mono's MSBuild.
- Set Mono's MSBuild as the default build tool on Windows.
- Generate projects with portable DebugType instead of full.
2018-05-17 01:26:23 +02:00
Ignacio Etcheverry
fbc808012f Mono: BindingsGenerator enum fixes
- Make enums have an unique signature name of int. This means that when generating internal methods, there is no difference between different enums types nor between enums and int. This way enums can re-use internal methods.
- Make type resolver fallback to int if a type is not found and it's an enum.
2018-04-28 22:25:25 +02:00
Ignacio Etcheverry
6faa96fb89
Merge pull request #18399 from neikeq/u
Mono fixes
2018-04-24 20:58:25 +02:00
Ignacio Etcheverry
ff7fe9e771 Mono: Fix '!t' error messages when generating bindings
This error wasn't affecting the bindings generation process.
2018-04-24 20:47:06 +02:00
Ignacio Etcheverry
ea0e73f3c8
Merge pull request #17864 from NikodemL/fix_mono_bottom_panel_issue_activated
Fixed mono bottom panel to select the correct file when messages are filtered
2018-04-09 09:15:43 +02:00
Nikodem Lokatelj
4fdee1d9f1 Fixed _issue_activated to take the correct issue id from the list 2018-03-30 16:32:14 +02:00
Wilson E. Alvarez
3f86fefb64
Move GodotSharp and MonoBuildTab member variables to initializer list 2018-03-27 21:14:52 -04:00
Paul Joannon
ef5672d3f9
[mono] write classes with no constructor as abstract 2018-03-04 15:37:39 +01:00
Ignacio Etcheverry
f37090ccf4 Mono: Better versioning and gracefully unloading of Godot API assemblies 2018-02-25 20:56:27 +01:00
Ignacio Etcheverry
71602c7491
Merge pull request #16986 from neikeq/issue-16983
Mono: Fix bindings for parameters in vararg methods
2018-02-24 20:06:41 +01:00
Ignacio Etcheverry
0c82858121 Mono: Fix bindings for parameters in vararg methods 2018-02-24 20:03:16 +01:00
Ignacio Etcheverry
9fd606c549 Mono: Add project export plugin 2018-02-22 13:39:41 +01:00
Rémi Verschelde
24cf4fe062 Update warning about C# support 2018-02-21 22:47:44 +01:00
Ignacio Etcheverry
e380a98109
Merge pull request #16746 from PJB3005/18-02-16-fix-nodepath-pascalcase
Makes NodePath and RID follow PascalCase in C#.
2018-02-18 19:51:33 +01:00
Ignacio Etcheverry
f4dcfa38f7
Merge pull request #16747 from PJB3005/18-02-16-nodepath-tostring
Give C# NodePath a ToString().
2018-02-18 19:50:45 +01:00
Ignacio Etcheverry
8bd05f0c71 Mono: Fix build status icons 2018-02-17 18:12:00 +01:00
Pieter-Jan Briers
b1a81374d4 Makes NodePath and RID follow PascalCase in C#.
Fixes #15685
2018-02-16 14:09:20 +01:00
Pieter-Jan Briers
3c1f8efd9e Give C# NodePath a ToString().
It already had an implicit cast operator to string,
but this doesn't get used in say string formatting.

So now something like $"path: {GetPath()}" works.
2018-02-16 14:07:19 +01:00
Rémi Verschelde
2eb7a321ba
Merge pull request #15574 from paulloz/mono-build-project-button
Change 'Build Project' button style in Mono panel
2018-02-14 16:41:25 +01:00
Paolo Perkovic
08d4bfacaf Fix inconsistencies and typos in argument names 2018-02-01 16:47:20 +01:00
Ignacio Etcheverry
72b0a9432b Mono: Fix method_bind fields being generated as instance members 2018-01-27 22:45:57 +01:00
Ignacio Etcheverry
58448561c7 Mono: Fix NodePath and RID bindings 2018-01-25 23:46:54 +01:00
Rémi Verschelde
e48ccc235f Mono: Display opt-out warning in editor about WIP status
This ensures that all users of the Mono flavour of Godot 3.0 are aware
of its current shortcomings (no export, crashes and usability issues).
The dialog is shown each time the editor is started, until the checkbox
is disabled (i.e. until users will have actually read it).

Fixes #15956.
2018-01-22 14:57:42 +01:00
Rémi Verschelde
9f479f096c Fix typos in code and docs with codespell
Using v1.11.0 from https://github.com/lucasdemarchi/codespell
2018-01-18 22:01:42 +01:00
Ignacio Etcheverry
feb843da2b Mono: Fix starting MonoDevelop process from the wrong appdomain 2018-01-12 19:19:20 +01:00
Paul Joannon
484f664331 Change 'Build Project' button style in Mono panel
Address #15208
2018-01-10 21:03:07 +01:00
Rémi Verschelde
c037f6339f
Merge pull request #15463 from neikeq/the-stack-frame-madness
Mono: Implement stack info for errors and exceptions
2018-01-09 19:44:10 +01:00
Ignacio Etcheverry
252702a304 Mono: Fix iteration order of object types when generating bindings 2018-01-09 19:06:59 +01:00
Ignacio Etcheverry
1c6269f2dd External editor fixes
- Fix VS Code opening on the previous line to the desired one.
- Fix running MonoDevelop without the line and column parameters.
- Fix `ScriptEditor::_goto_script_line` not working with language overriden external editors.
2018-01-09 17:25:23 +01:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Ignacio Etcheverry
119a910bc6 Mono: Add properties support in scripts 2018-01-04 21:16:22 +01:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Ignacio Etcheverry
fe391393d4 Mono: Change BindingsGenerator singleton to avoid StringName leaks 2018-01-01 03:05:19 +01:00
Ignacio Etcheverry
b271aa48e4 Mono: Script lifetime fixes
- alloc_language_binding: Use strong GC handle as well for references. Fixes #15138
- Set the native instance field of Godot.Object to IntPtr.Zero when it's freed.
- Create weak handles without tracking resurrection (that was causing trouble). This means we have to call notification predelete before queueing a native Object for deletion, and use the MonoObject* passed by the finalizer because the weak GC handle target will return NULL at this point.
2018-01-01 03:05:13 +01:00
Ignacio Etcheverry
e350a56efd Mono: Bindings no longer relie on DocData for accessors 2017-12-29 02:18:46 +01:00
Noshyaar
ab444a8ca9
Merge pull request #14996 from neikeq/enums-mono
Mono: Make the bindings generator output enums
2017-12-27 10:29:00 +07:00
Ignacio Etcheverry
8b0ad17b76
Merge pull request #14997 from neikeq/issue-14988
Marshal NULL MonoString* as empty Godot string
2017-12-24 17:50:28 +01:00
Ignacio Etcheverry
0a0a44da8d Mono: Make the bindings generator output enums
- Switch to PascalCase for constants names
2017-12-24 04:20:41 +01:00
Ignacio Etcheverry
6e3d4ee9a6 Marshal NULL MonoString* as empty Godot string 2017-12-24 03:32:40 +01:00
geequlim
52ad2e5418 Add more translatable text for editor plugins. 2017-12-23 22:40:15 +08:00
Rémi Verschelde
13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
Rémi Verschelde
aa5f7e0ff2 Fix mono build after bc2e8d99 2017-11-25 12:16:58 +01:00
Ferenc Arn
d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Rémi Verschelde
e7701bb2de doc: Rename "@Global Scope" to "@GlobalScope"
Spaces in filenames are evil.
2017-11-15 20:41:16 +01:00
Leon Krause
9b7b46143d Move singleton management from ProjectSettings to Engine 2017-11-14 15:15:13 +01:00
Matthias Hoelzl
1f6d766332 Remove preprocessor directives from macro arguments
Preprocessor directives within macro arguments lead to undefined
behavior, and VC++ actually rejects them as compiler errors.
2017-11-10 10:14:04 +01:00
Daniel J. Ramirez
c57fc8ee7d Fixed editor settings disappearing.
Some items that are no longer defined may disappear, but thats expected i guess.
2017-11-09 22:10:48 -06:00
Rémi Verschelde
9a78efc7c2
Merge pull request #12642 from BrainBlasted/fix_msbuild_unix
Added fallback for msbuild.exe.
2017-11-05 11:54:26 +01:00
Rémi Verschelde
5bc2cf257b Convert DOS line endings to Unix line endings
Should fix issues some of us have with `misc/dist/uwp_template/AppxManifest.xml`
always showing up as modified.
Might cause issues on Windows due to the removal of BOMs or change of line endings
in some of the Mono, UWP or gradlew.bat files, we will test and adapt if need be.
2017-11-05 11:37:59 +01:00
BrainBlasted
8e2a756eb8 Added for fallback msbuild.exe.
Fixes #12613
2017-11-04 21:05:22 -04:00
Ignacio Etcheverry
157fa55e34
Merge pull request #12535 from neikeq/wtf···
Fix msbuild hint paths returning only the directory
2017-10-31 15:19:25 +01:00
Ignacio Etcheverry
32ee3ecce4 Fix msbuild hint paths returning only the directory 2017-10-31 15:15:42 +01:00
Ignacio Etcheverry
ad194f81b6 Remove Visual Studio for now from the external editors list 2017-10-30 23:43:26 +01:00
Ignacio Etcheverry
619e4eb23d
Merge pull request #12491 from neikeq/waitasecond···
Fix FrameworkPathOverride and assemblies path loop
2017-10-29 22:33:27 +01:00
Ignacio Etcheverry
aa5a0b550f Fix FrameworkPathOverride and assemblies path loop 2017-10-29 22:22:38 +01:00
Rémi Verschelde
c193286186
Merge pull request #12475 from neikeq/ohuiii
Fix regression from #12473 and #12388
2017-10-29 11:32:00 +01:00
Rémi Verschelde
6ea8ffc12f
Merge pull request #12474 from neikeq/s
Mono: Add build project button and reload interval
2017-10-29 11:09:49 +01:00
Ignacio Etcheverry
15e30187ee Fix regression from #12473 and #12388 2017-10-29 10:11:20 +01:00
Ignacio Etcheverry
8fca54fb0d
Merge pull request #12473 from neikeq/Alpha2&#63;-Let'sDoThis
BindingsGenerator cleanup and improved error messages
2017-10-29 05:58:26 +01:00
Ignacio Etcheverry
27b7fb8e66 Mono: Add build project button and reload interval 2017-10-29 05:57:38 +01:00
Ignacio Etcheverry
09a1e11765
Merge pull request #12388 from neikeq/r
Buildsystem improvements for the Mono module
2017-10-29 04:28:36 +01:00
Ignacio Etcheverry
9f469887fc Buildsystem improvements for the Mono module
- Make sure to search the mono installation directory for the right architecture in the windows registry.
- Do not build GodotSharpTools directly to #bin dir. Instead build to the default output path and copy it. This way we avoid MSBuild adding files we don't want to #bin.
- Add hint path for MSBuild in OSX.
- Copy shared library on Unix if not statically linking.
- Use vswhere to search MSBuild and search for 14.0 tools version in the registry instead of 4.0.
- SCons will only fallback xbuild when msbuild is not found if 'xbuild_fallback=yes' is passed to the command.
- Use mono's assembly path as FrameworkPathOverride if using with system's MSBuild (not mono's fork).
- Cleanup.
2017-10-29 04:26:13 +01:00
Ignacio Etcheverry
452313ffb1 BindingsGenerator cleanup and improved error messages
If there is an error generating a property or a method, the error message will include the member and class names.
2017-10-29 02:37:13 +01:00
Unknown
a2247d45fc Mono: Use "UnnamedProject" if application/config/name is empty 2017-10-27 21:22:54 +02:00
Ignacio Etcheverry
63f58da054 Exit after generating mono glue 2017-10-24 16:18:47 +02:00
Ignacio Etcheverry
9905002fa6 Mono: Fix and cleanup build start errors 2017-10-24 00:49:44 +02:00
Ignacio Etcheverry
45e5e23ee8 Mono: Prevent raising exceptions in native code
For now we will just print the exceptions we catch. Later, we should use something similar to 'mono_set_pending_exception(ex)'.
2017-10-23 00:35:14 +02:00
Ignacio Etcheverry
8ed3247a63 Improve signature of signal target generated function 2017-10-16 04:19:36 +02:00
Ignacio Etcheverry
1a9efb417a Merge pull request #12135 from neikeq/g
Re-write SignalAwaiter implementation
2017-10-16 03:58:51 +02:00
Ignacio Etcheverry
63369ec306 Re-write SignalAwaiter implementation
Old implementation had issues where you could only await on the same signal of the same source once.
2017-10-16 03:54:23 +02:00
Ignacio Etcheverry
740ef3dc97 Merge pull request #11954 from neikeq/d
Added 'exposed' field to ClassInfo for registered classes
2017-10-11 13:54:34 +02:00
Ignacio Etcheverry
9b6f65af82 Mono: Make use of ClassInfo's exposed API
- BindingsGenerator only generates exposed classes.
- Fix creation of managed instances of non-exposed classes.
2017-10-09 23:50:06 +02:00
Ignacio Etcheverry
5a49106ff4 Merge pull request #11900 from neikeq/a
Fix assembly load hooks and sizeof wrong type
2017-10-07 20:12:25 +02:00
Ignacio Etcheverry
5ab3537179 Fix sizeof wrong type 2017-10-07 04:22:26 +02:00
Ignacio Etcheverry
195b12212d Merge pull request #11896 from neikeq/pr-issue-11892
Quote MSBuild arguments
2017-10-07 01:27:06 +02:00
Ignacio Etcheverry
14280ac44b Quote MSBuild arguments. Fixes #11892 2017-10-07 01:21:11 +02:00
Ferenc Arn
17e89c2c66 Fix mono enabled builds (broken by 3d87b70). 2017-10-05 22:11:10 -04:00
Ignacio Etcheverry
df22bbd7ed Add C# script to csproj when attaching it to an object 2017-10-05 00:10:51 +02:00
Ignacio Etcheverry
b4d758e067 Add alternative search locations for msbuild 2017-10-05 00:08:38 +02:00
Ignacio Etcheverry
e36fb95c50 Added mono module 2017-10-03 00:01:26 +02:00