Commit graph

499 commits

Author SHA1 Message Date
Rémi Verschelde
d1f3b622f0 Fix missing/malformed license headers 2019-01-01 12:46:36 +01:00
Rémi Verschelde
dcc7f2b54b
Merge pull request #24545 from akien-mga/osxcross-mono
SCons: Allow building Mono module with OSXCross
2018-12-30 15:07:18 +01:00
Supatier
b173eed8aa
Fix Godot unable to find VSCode binary
VSCode's executable name is not uniform and godot only search for "code".
2018-12-27 15:16:29 +07:00
Kelly Thomas
a5e38586ce fix capitalization for antiquewhite 2018-12-23 08:00:35 +08:00
Rémi Verschelde
d52100f4ff SCons: Allow building Mono module with OSXCross
Improve the test logic to only assume that we're building for macOS
if OSXCROSS_ROOT is defined *and* we requested p=osx.

Supersedes #24480.
2018-12-22 12:36:19 +01:00
Kelly Thomas
09496d93b1 [Mono] Color - add ColorN(), Colors - add named color properties 2018-12-21 15:01:32 +08:00
Rémi Verschelde
9c7bc127b9
Merge pull request #24385 from hpvb/reduce-string-coew
Reduce String CoW
2018-12-16 19:13:35 +01:00
Hein-Pieter van Braam
4e25e5066b Reduce String CoW
By introducing an intermediate proxy class for the array subscript
operator for String and CharString we can control better when CowData
will actually CoW.

This should improve performance of String usage for most cases.
2018-12-16 16:51:38 +01:00
Rémi Verschelde
9df7ed59fb
Merge pull request #19501 from Zylann/custom_loaders
Added basic support for custom resource savers and loaders
2018-12-16 14:26:56 +01:00
Marc Gilleron
065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Ben Rog-Wilhelm
b26487a2b4 Tweaks after feedback 2018-12-08 00:54:12 -08:00
Ben Rog-Wilhelm
f13f2d512f Implement CSharpScript::get_script_method_list and related functionality. 2018-12-07 23:54:40 -08:00
Ignacio Etcheverry
f6f2be7577 Fix crash due to ~CSharpInstance() being called on freed instance
This would be the case when calling SetScript on an object with a C# script.
2018-12-01 02:28:24 +01:00
Ignacio Etcheverry
5fd3ef4e78 Implement CSharpScript::is_valid() 2018-11-30 21:45:44 +01:00
Ignacio Etcheverry
989b93d6a4
Merge pull request #24091 from neikeq/ii
C#: Improve tool script support and fix reloading issues
2018-11-30 21:39:13 +01:00
Ignacio Etcheverry
b9b7dcdf00 C#: Improve tool script support and fix reloading issues 2018-11-30 20:43:06 +01:00
Juan Linietsky
3a93499f89 Allow signal connecting even if script is invalid (only when compiled with tools), fixes #17070 2018-11-27 19:55:37 -03:00
Carter Anderson
d339824f15 Parse C# generics and type constraints correctly 2018-11-24 18:29:23 -08:00
Ignacio Etcheverry
d275d848b3 C#: Replace calls to old of old Basis(Vec3,Vec3,Vec3) constructor 2018-11-20 22:23:09 +01:00
Rémi Verschelde
173b342ca7 Remove trailing whitespace
With `sed -i $(rg -l '[[:blank:]]*$' -g'!thirdparty') -e 's/[[:blank:]]*$//g'`
(+ manual revert of some thirdparty code under `platform/android`).
2018-11-20 11:15:02 +01:00
Ignacio Etcheverry
5712daf2d9
Merge pull request #23833 from neikeq/hh
C#: Fix Basis(Vec3,Vec3,Vec3) constructor
2018-11-20 06:13:29 +01:00
Ignacio Etcheverry
bf94eed60c C#: Fix Basis(Vec3,Vec3,Vec3) constructor
Now it sets axes in order to match GDScript implementation.
2018-11-20 02:08:22 +01:00
Ignacio Etcheverry
43e3582058
Merge pull request #23505 from zorbathut/zorbathut/updateproject
Add option for automatic project updating.
2018-11-08 18:06:24 +01:00
Ignacio Etcheverry
9fa1e0b415
Merge pull request #23595 from neikeq/ff
Fix assertion fail when loading assembly on project export
2018-11-08 17:10:23 +01:00
Ignacio Etcheverry
0f3fc93070 Fix assertion fail when loading assembly on project export 2018-11-08 16:47:15 +01:00
Ignacio Etcheverry
6d7dc9d98b
Merge pull request #23583 from neikeq/ee
Improve the C# API projects generation
2018-11-08 01:52:27 +01:00
Ignacio Etcheverry
02d5ff4cd0 Improve the C# API projects generation
- Now there is only one solution that contains both GodotSharp and GodotSharpEditor project. Previously we had one solution for each project
- GodotSharpEditor reference GodotShatp with a 'ProjectReference'. Previously it was a 'Reference' to the assembly
- This also simplifies the command line option to generate this solution: 'godot --generate-cs-api <OutputDir>'
2018-11-08 01:05:22 +01:00
Ryan Schmitt
366c7e0f48 Fix false error when exporting enum in c# 2018-11-05 01:22:15 -08:00
Ben Rog-Wilhelm
ff6588569b Add option for automatic project updating. 2018-11-04 09:55:42 -08:00
Michael Alexsander Silva Dias
92342690f7 Rename "Log*()" functions to "Push*()" in C# 2018-10-31 15:40:38 -03:00
Rémi Verschelde
4fb35520fb
Merge pull request #23345 from zorbathut/brogwilhelm/logfunctions/cs
Add new log functions for C#.
2018-10-29 23:41:37 +01:00
Ignacio Etcheverry
2cf02f302f Fix C# parsing the full name of base types
Previously it would fail if the type name included its namespace.
2018-10-28 01:31:27 +02:00
Ben Rog-Wilhelm
f2476f8a7c Add new log functions for C#. 2018-10-25 20:32:50 -07:00
Ignacio Etcheverry
d47cec43f2
Merge pull request #23162 from neikeq/cc
Proper support for namespaces and other enhancement/fixes
2018-10-25 18:18:40 +02:00
Ignacio Etcheverry
1aac95a737 Parse C# script namespace and class
- Added a very simple parser that can extract the namespace and class name of a C# script.
2018-10-25 18:00:24 +02:00
Ignacio Etcheverry
c6e2873605 Fix msvc warnings in mono module
- `modules\mono\csharp_script.cpp(576): warning C4099: 'CSharpScriptDepSort': type name first seen using 'class' now seen using 'struct'`
- `modules\mono\signal_awaiter_utils.cpp(144): warning C4003: not enough actual parameters for macro 'ERR_FAIL_V'`
- `modules\mono\editor\net_solution.cpp(101): warning C4129: '%': unrecognized character escape sequence`
- (several) `modules\mono\glue\cs_compressed.gen.h(222): warning C4129: 'E': unrecognized character escape sequence`
2018-10-25 18:00:24 +02:00
Ignacio Etcheverry
92af2e620b Do not generate API project GUIDs randomly 2018-10-25 18:00:24 +02:00
Ignacio Etcheverry
611a476224 Support globs in csproj includes 2018-10-25 18:00:17 +02:00
Ignacio Etcheverry
b42f7b7fae C#: Fix crash when disposing Reference on domain finalize 2018-10-25 17:21:42 +02:00
Ignacio Etcheverry
454b933106 Fix internal assembly load from
- Also make sure we load API assemblies from 'res://.mono/assemblies/'.
2018-10-22 20:35:44 +02:00
Mads Ynddal
16c0c037c8 Removed undeclared and unused variable, which caused a compile error 2018-10-21 21:55:30 +02:00
Ignacio Etcheverry
6312f18f8e
Merge pull request #23128 from neikeq/bb
Make sure API assemblies are up to date at startup
2018-10-19 00:24:15 +02:00
Ignacio Etcheverry
00f758099b Make sure API assemblies are up to date at startup
- If there is a solution and C# project at startup, make sure API assemblies are up to date.
- Fix prebuilt assemblies only being used when building the game project, and not in other instances.
2018-10-19 00:13:15 +02:00
Ignacio Etcheverry
2adef1e52f Fix prefix erasing for the generated C# enum constants 2018-10-18 20:11:11 +02:00
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
Rémi Verschelde
b17e71b6e5
Merge pull request #22808 from KellyThomas/vector-one
Add ONE constants to Vector2 and Vector3
2018-10-07 18:57:27 +02:00
Kelly Thomas
b150ceb62c Update class documentation xml 2018-10-07 21:57:26 +08: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
Rémi Verschelde
44d82b3a07
Merge pull request #22752 from aaronfranke/equals-redundant
Remove redundant "== true" and "== false" code
2018-10-07 10:58:45 +02:00
Ignacio Etcheverry
b63e518ce9 Mono: Fix crash on NodePath/RID disposal during Godot shutdown 2018-10-06 23:00:18 +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
Aaron Franke
37386f112b Remove redundant "== true" code
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-10-06 16:12:36 -04:00
Rémi Verschelde
f5a77f7bdd
Merge pull request #22769 from neikeq/issue-22765
Fix C# API assembly build errors in generics
2018-10-05 20:04:37 +02:00
Ignacio Etcheverry
b5aa5bca12 Fix C# API assembly build errors in generics 2018-10-05 19:39:11 +02:00
Ignacio Etcheverry
9475e86078 Fix build error for windows mono export templates 2018-10-05 17:47:34 +02:00
Rémi Verschelde
6bc18042c2
Merge pull request #22760 from zochris/loosen-generic-guard
Loosen generic guard on some methods
2018-10-05 16:25:20 +02: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
zochris
4a11864968
loosen generic guard on method for ResourceLoader
For more details see #22658
2018-10-05 15:32:33 +02:00
zochris
b84992e374
loosen generic guard on Node extension methods
For more details see #22658
2018-10-05 15:06:05 +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
Rémi Verschelde
64962fe605
Merge pull request #22653 from neikeq/mono-mod-fix-gcc-warnings
Fix GCC compiler warning in mono module
2018-10-03 08:43:43 +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
50fd5ef3b5 Mono: Fix not creating generic Array or Dictionary where expected 2018-09-27 00:11:31 +02:00
Ignacio Etcheverry
0f3de6ef3a Do not update cache if the C# API assembly is out of sync 2018-09-26 23:59:38 +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
a4e4dd3966
Merge pull request #22193 from neikeq/idontlikesanditscoarseandroughandirritatinganditgetseverywhere
Mono: Build and external editor improvements for OSX
2018-09-17 20:22:05 +02:00
Ignacio Etcheverry
50f6dbff87 Mono: Fix opening code editors in OSX and cleanup 2018-09-17 20:00:19 +02:00
Ignacio Etcheverry
b032738a51 Add some mono root dir hints to the build script
This enhancement is specially noticeable in OSX, since it includes Mono's install location (both official and homebrew). This makes it possible to build Godot with Mono on OSX without pkg-config (pkg-config is bundled with Mono, but it's not added to PATH, so finding it would require finding the Mono root directory first).
2018-09-17 19:34:35 +02:00
Sophie Tauchert
99cd17b102
Check for mono binary when finding version 2018-09-16 15:20:44 +02:00
Kelly Thomas
d4b2423428 [Mono] implement Transform.InterpolateWith() 2018-09-15 13:08:21 +08:00
Fabio Alessandrelli
1e9b46d687 Clearly deprecate sync too in favor of remotesync.
NOTE: This changes the RPC_MODE_* enum values.
Games should be re-exported. GDNative rebuilt.
2018-09-15 00:06:03 +02:00
Fabio Alessandrelli
d6b31daec6 Rename slave keyword to puppet
The slave keyword will still be available as deprecated in 3.1 but will
be dropped from future releases.
2018-09-15 00:06:03 +02:00
Rémi Verschelde
1a16dabfb5
Merge pull request #21982 from luzpaz/misc-typos
Misc. typos
2018-09-13 10:59:00 +02:00
luz.paz
08bde5b2de Misc. typos
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12 21:39:17 -04:00
Ignacio Etcheverry
995a40e8ef Move modules/mono/glue/cs_files to modules/mono/glue/Managed/Files
Added dummy MSBuild project and solution to get tooling help when editing these files.
2018-09-12 22:03:36 +02:00
Ignacio Etcheverry
5e57beebb1 Mono: Fix build regression due to wrong return type 2018-09-12 21:08:18 +02:00
Ignacio Etcheverry
6ae47ff19b C#: Fix explicit enum values when exporting member 2018-09-12 18:54:20 +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
691d4e3835 Allow special characters in C# glue files
Fixes #21139

- Surround the generated file modules/mono/glue/cs_compressed.gen.h with ifdef TOOLS_ENABLED
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
Aaron Franke
627ed98ed1 [Mono] Various style changes and naming standardization 2018-09-10 15:22:10 -04:00
Aaron Franke
4743852466 [Mono] Tabs -> Spaces 2018-09-10 15:12:49 -04:00
Ignacio Etcheverry
6b10e3750e
Merge pull request #21497 from neikeq/hm
C# generated classes ignore warning CS1591 and cleanup
2018-08-27 21:43:46 +02:00
Ignacio Etcheverry
aa2bcf3dfc C# generated classes ignore warning CS1591 and cleanup 2018-08-27 20:39:51 +02:00
Ignacio Etcheverry
78bb53f85d
Merge pull request #21205 from KellyThomas/c-sharp-feature-parity-quat
[Mono] Quat - add some missing constructors and methods
2018-08-27 16:18:09 +02:00
Ignacio Etcheverry
db55d8a4b6
Merge pull request #21423 from exts/mono/collections
[Mono] Added Collections namespace to Array & Dictionary
2018-08-26 19:11:45 +02:00
exts
035d498af2 Added Collections namespace to Array & Dictionary 2018-08-25 17:19:37 -05:00
Juan Linietsky
8c435a343e
Merge pull request #16927 from neikeq/rework-refcount-notify
Notify instance binding data api of refcount increment/decrement
2018-08-25 11:01:55 -03:00
Ignacio Etcheverry
d72a281468
Merge pull request #20717 from PJB3005/18-08-04-godot-exceptions
Fix Mono exception handling.
2018-08-24 16:27:43 +02:00
Ignacio Etcheverry
750f128a05
Merge pull request #20707 from aaronfranke/mono-combine
[Mono] Move several related small files
2018-08-24 15:53:38 +02: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
Kelly Thomas
a941684590 mono: Quat - add some missing constructors and methods 2018-08-24 07:56:54 +08:00
Pieter-Jan Briers
af39684885 Fix Mono exception handling.
First of all, this fixes the handling of exceptions so the engine actually notices them,
it was broken in 4172fa03b5.

Next, unhandled exceptions now do NOT cause an abort(). They're logged now,
so before #16987. The pending exception thing still works though.
2018-08-23 20:21:36 +02:00
Aaron Franke
514856d8c7 [Mono] Move several small related files 2018-08-23 12:50:04 -04:00
Kelly Thomas
46207ae7aa [Mono] AABB - Position, Size, End setters, Rect2 - End setter 2018-08-23 23:45:18 +08:00