Commit Graph

1066 Commits

Author SHA1 Message Date
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
Rémi Verschelde 1e729630d6
Merge pull request #21240 from aaronfranke/mono-project-vector
[Mono] Vector2/3 Project methods
2018-08-23 08:59:26 +02:00
Ignacio Etcheverry 908a30964a Notify instance binding data api of refcount increment/decrement 2018-08-23 01:38:48 +02:00
Ignacio Etcheverry 980b81dd2a
Merge pull request #21174 from KellyThomas/c-sharp-feature-parity-rect2
[Mono] Rect2 - add Abs(), rename private fields
2018-08-22 22:34:45 +02:00
Aaron Franke 434973fb83 [Mono] Vector2/3 Project methods 2018-08-22 13:27:35 -04:00
Ignacio Etcheverry 143c471eff Mono: Fix weird crash when loading corlib 2018-08-22 00:49:38 +02:00
Ignacio Etcheverry 5df91099c7
Merge pull request #18502 from space-wizards/18-04-29-assembly-load-hook
assembly_load_hook fallback for registering GDMonoAssemblies.
2018-08-22 00:27:35 +02:00
Rémi Verschelde 404ee1a56b Style: Fix issues that went past CI 2018-08-21 21:28:06 +02:00
Rémi Verschelde a319d72071
Merge pull request #21253 from aaronfranke/plane-constants
Rename Plane constants, add to Mono
2018-08-21 21:16:41 +02:00
Rémi Verschelde 2969dffbe3 Deprecate incorrect Color::gray()
This average is not a proper approximation of a grayscale value,
get_v() is better suited for that.

If we want a real to_grayscale() conversion, it's somewhat more
involved: https://en.wikipedia.org/wiki/Grayscale

Remove the deprecated Gray() from C# bindings as it conflicts
with new named color constants.
2018-08-21 17:48:31 +02:00
Aaron Franke a986686ac4 Rename Plane constants, add to Mono
But I'm not tagging PR as [Core] or [Mono] due to it being a minor change anyway.
2018-08-21 01:35:07 -04:00
Justin Abene c6a4ca5c9e Prevent "cannot use a string pattern on a bytes-like object"
Fixes #21207
2018-08-20 00:42:47 -04:00
Kelly Thomas 792a8446ac mono: add Abs() to Rect2 and rename private fields 2018-08-19 19:18:12 +08: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
Rémi Verschelde 4548ec4a49
Merge pull request #20945 from neikeq/dict-erase-retbool
Dictionary: remove erase_checked(key), make erase(key) return bool
2018-08-15 01:08:23 +02:00
Rémi Verschelde b4f579b5ba
Merge pull request #20583 from neikeq/issue-15371
Fix case where exported properties value is lost
2018-08-14 21:08:56 +02:00
Kelly Thomas 815d08f10c mono: add constants to transform and vector structs 2018-08-15 02:03:36 +08:00
Ignacio Etcheverry 21d285e30f Dictionary: remove erase_checked(key), make erase(key) return bool 2018-08-14 19:19:05 +02:00
Ignacio Etcheverry d7b9fcd336
Merge pull request #20890 from KellyThomas/mono-is-instance-valid
mono: add IsInstanceValid(), move WeakRef()
2018-08-14 18:12:18 +02:00
Kelly Thomas 9341129d14 mono: add IsInstanceValid(), move WeakRef() 2018-08-14 15:48:54 +08:00
Rémi Verschelde 695b8d254e SCons: Fix mono_root initialization
As advised by @neikeq.
2018-08-14 08:55:37 +02:00
Ignacio Etcheverry c4e75aa63a
Merge pull request #20706 from mysticfall/issue-20705
Add missing GetPtr() for Dictionary<> and Array<>
2018-08-13 22:37:09 +02:00
Teashrock 51a0a38135 Fixed absent variable exception while trying to raise another exception. 2018-08-13 16:28:28 +02:00
George Marques eb48119821
Added system for GDScript warnings
- Count and panel per script.
- Ability to disable warnings per script using special comments.
- Ability to disable warnings globally using Project Settings.
- Option to treat enabled warnings as errors.
2018-08-10 16:00:47 -03:00
Juan Linietsky ea3d997f9d
Revert "added get_creation_time function for gdscript" 2018-08-10 13:29:49 -03:00
Juan Linietsky 275e0d5ee4
Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
2018-08-10 13:28:47 -03:00
Xavier Cho 5d2c239772 Add missing GetPtr() for Dictionary<> and Array<>
Add missing GetPtr() method for generic versions of Dictionary
and Array to fix #20705.
2018-08-04 14:34:55 +09:00
Ignacio Etcheverry b911165679
Merge pull request #20600 from exts/new_generic_methods
Mono: Added generic methods for PackedScene & ResourceLoader
2018-08-04 05:22:38 +02:00
exts cdb4ae471b Added generic method for ResourceLoader: Load<T>() 2018-08-03 13:40:42 -05:00
Ignacio Etcheverry 3fa2404a79
Merge pull request #20644 from NickToony/master
Fixed Windows mono compile
2018-08-01 03:52:46 +02:00
Nick Hope 24b4694313 fixed: windows mono compile (#20598)
tidy: formatting.
2018-07-31 21:16:47 +01:00
Ignacio Etcheverry ccce161d0e
Merge pull request #20639 from neikeq/issue-20531-and-cleanup
Mono: Fix property set_value and cleanup
2018-07-31 20:10:04 +02:00
Ignacio Etcheverry 4172fa03b5 Mono: Fix property set_value and cleanup 2018-07-31 19:49:16 +02:00
Ignacio Etcheverry f3c7527225 Fix case where exported properties value is lost
Fixes exported property modified values lost when creating a placeholder script instance with a failed script compilation

- Object set/get will call PlaceHolderScriptInstance's new fallback set/get methods as a last resort. This way, placeholder script instances can keep the values for storage or until the script is compiled successfuly.
- Script::can_instance() will only return true if a real script instance can be created. Otherwise, in the case of placeholder script instances, it will return false.
- Object::set_script(script) is now in charge of requesting the creation of placeholder script instances. It's no longer Script::instance_create(owner)'s duty.
- PlaceHolderScriptInstance has a new method set_build_failed(bool) to determine whether it should call into its script methods or not.
- Fixed a few problems during reloading of C# scripts.
2018-07-29 22:40:12 +02:00
Hein-Pieter van Braam 0deb8dda51 Fix Mono compilation on Windows/Ming
(cherry picked from commit 83140541dc)
2018-07-29 22:31:38 +02:00
Viktor Ferenczi c5bd0c37ce Running builder (content generator) functions in subprocesses on Windows
- Refactored all builder (make_*) functions into separate Python modules along to the build tree
- Introduced utility function to wrap all invocations on Windows, but does not change it elsewhere
- Introduced stub to use the builders module as a stand alone script and invoke a selected function

There is a problem with file handles related to writing generated content (*.gen.h and *.gen.cpp)
on Windows, which randomly causes a SHARING VIOLATION error to the compiler resulting in flaky
builds. Running all such content generators in a new subprocess instead of directly inside the
build script works around the issue.

Yes, I tried the multiprocessing module. It did not work due to conflict with SCons on cPickle.
Suggested workaround did not fully work either.

Using the run_in_subprocess wrapper on osx and x11 platforms as well for consistency. In case of
running a cross-compilation on Windows they would still be used, but likely it will not happen
in practice. What counts is that the build itself is running on which platform, not the target
platform.

Some generated files are written directly in an SConstruct or SCsub file, before the parallel build starts. They don't need to be written in a subprocess, apparently, so I left them as is.
2018-07-27 21:37:55 +02:00
Paul Joannon 877ea882ce
Add missing methods to Node class in the mono glue
* GetNodeOrNull<T>
* GetChild<T>
* GetChildOrNull<T>
* GetOwner<T>
* GetOwnerOrNull<T>
* GetParent<T>
* GetParentOrNull<T>
2018-07-27 08:50:35 +02:00
Rémi Verschelde 47a7dc7b3c
Merge pull request #18282 from aaronfranke/better-mathf
[Core] [Mono] Fix Color missing int export methods, added 64-bit
2018-07-26 10:48:47 +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
Aaron Franke e3368d692d [Mono] Fix Color incorrect ordering of int export methods, added 64-bit
[Mono] Fix Color incorrect ordering of int export methods, added 64-bit long export methods.
2018-07-25 15:34:24 -05:00
Ignacio Etcheverry 762c912e8e Fix continuous attempt to reload domain with API assemblies out of sync 2018-07-25 21:54:21 +02:00
Ignacio Etcheverry f1130f9a8a Mono: Fix domain reload never triggering 2018-07-25 21:31:02 +02:00
Ignacio Etcheverry 8edf85b09c Fix '!valid' error spam on C# script instance create 2018-07-25 21:30:49 +02:00
Ignacio Etcheverry 5aefe5d936 Mono: Fix null dereferences 2018-07-25 21:30:11 +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
Rémi Verschelde df170d81cc Mono: Default to not shipping C# scripts content
Fixes #20053.
2018-07-22 17:28:17 +02:00
Ignacio Etcheverry 525384d8cc
Merge pull request #20337 from aaronfranke/mono-pascal-gd
[Mono] Improvements to GD.cs: PascalCasing and real_t
2018-07-22 03:49:58 +02:00
Rémi Verschelde 7478649b2f
Merge pull request #20229 from aaronfranke/mono-warning-text
[Mono] Update about/warning text
2018-07-22 00:40:15 +02:00
Aaron Franke 174cf31d00 [Mono] Improvements to GD.cs: PascalCasing and real_t
[Mono] Improvements to GD.cs: PascalCasing and real_t
2018-07-21 16:40:46 -05: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
George Marques 03746da73f
Add editor highlight for type-safe lines
The line number is hightlighted to indicate that the line contains only
type-safe code.
2018-07-20 21:55:18 -03: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
oisincar 7a4d593198 Fix bug with Basis.Transposed()
Fix bug where Basis.Transposed() incorrectly updated local basis, and
returned an unmodified copy. This also fixes Transform.Inverse().
2018-07-19 00:17:45 +01: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
Rémi Verschelde 7c9f7452f4 Style: Format code with clang-format 6.0.1 2018-07-18 16:27:03 +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 d4f860c768
Merge pull request #19231 from aaronfranke/mono-fposmod-to-mod
[Mono] Rename Fposmod to PosMod, fix output
2018-07-05 01:05:44 +02:00
Ignacio Etcheverry 02372bfdf7
Merge pull request #19872 from exts/export_signals
Mono: Fixes annotated signal loading in exported binaries
2018-07-04 21:30:49 +02:00
Ignacio Etcheverry 769f172602
Merge pull request #19756 from NathanWarden/mono_lerp_fixes
[C#] Lerp now consistent with Godot API. InverseLerp fixed.
2018-07-04 21:23:50 +02:00
Ignacio Etcheverry 33fd0f762d Mono: Fix build script not decoding process utf-8 output 2018-07-04 16:07:52 +02:00
= 489c9adf03 Mono: Fixes annotated signal loading in exported binaries 2018-07-03 22:12:27 -05:00
Ignacio Etcheverry ac9e736b06
Merge pull request #16987 from neikeq/pending-exceptions
Mono: Pending exceptions and cleanup
2018-07-04 03:45:10 +02:00
Ignacio Etcheverry 4739cb8c00 Mono: Pending exceptions and cleanup 2018-07-04 03:08:29 +02:00
Kelly Thomas 88b89c2084 Changes to default C# script template (#19940) 2018-07-04 03:00:07 +02:00
Max Hilbrunner 0705eb904a
Merge pull request #19251 from YeldhamDev/script_templates_changes
Small changes to the comments in the script templates
2018-07-03 16:48:03 +02:00
Kelly Thomas 753230c275 convert unicode mono root path to ascii string 2018-06-30 08:58:41 +08:00
Aaron Franke 5b2b23c9a9 [Mono] Rename Fposmod to PosMod
[Mono] Rename Fposmod to PosMod
2018-06-27 00:58:24 -05:00
Nathan Warden c2315e3291 Lerp now consistent with Godot API. InverseLerp fixed. 2018-06-24 17:52:17 -05:00
Ignacio Etcheverry 25275de50e
Merge pull request #19016 from neikeq/w
Mono: Module build improvements
2018-06-22 19:18:15 +02:00
Ignacio Etcheverry ec6416d2b6 Mono: Module build improvements
- Add (Csc/Vbc/Fsc)ToolExe environment variables when running Mono's MSBuild.
- Fix directory for the 'mono_assemblies_output_dir' argument being created with the '#' top level directory token as part of its name.
- Allow to build with 'mono_static=yes' on Unix without specifying a mono prefix. The build script will try to find the mono prefix using the output from pkg-config.
2018-06-22 19:14:58 +02:00
Michael Alexsander Silva Dias fd17b960e9 Small changes to the comments in the script templates. 2018-06-11 02:04:51 -03:00
Kelly Thomas 17516822f9 allow undefined GODOT_DEBUG_MSBUILD environment variable 2018-06-06 22:31:54 +08:00
Ignacio Etcheverry b4f66e04e8
Merge pull request #19387 from neikeq/y
Mono fixes and improvements
2018-06-05 22:28:46 +02: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
Ignacio Etcheverry 7933a6cc9f Mono: Null checks when marshaling from MonoArray* and managed Dictionary 2018-06-05 22:14:32 +02:00
Rémi Verschelde 6e32a2886f
Merge pull request #18792 from PJB3005/18-05-11-objectdb-verbose-mono
Fixes ObjectDB leak printout with mono.
2018-06-05 10:03:11 +02:00
Hein-Pieter van Braam f2d669f5d3 Fix Mono static linking on Mingw 2018-06-01 21:46:46 +02:00
Rémi Verschelde 3334209a73 SCons: Pass env to modules can_build method
This allows to disable modules based on the environment,
in particular `env[tools]` which tells us if we are
building the editor or not.
2018-05-30 19:11:36 +02:00
Fabio Alessandrelli 8e35d937a9 New sync keywords in GDScript, NativeScript, Mono 2018-05-29 20:26:41 +02:00
Fabio Alessandrelli 1400f6fdc4 Refactor RPCMode enum and checks 2018-05-29 20:26:41 +02:00
Max Hilbrunner 4c69a495c9
Revert "RPCMode refactor, more sync modes" 2018-05-29 11:47:52 +02:00
Max Hilbrunner d0b62ce155
Merge pull request #19021 from Faless/rpc_sync_fix
RPCMode refactor, more sync modes
2018-05-29 09:44:03 +02:00
Ignacio Etcheverry 97fb999976 Mono: Fix MonoImage filename being set to an invalid path 2018-05-27 17:15:41 +02:00
Fabio Alessandrelli a5e8a3be5e New sync keywords in GDScript, NativeScript, Mono 2018-05-26 10:49:33 +02:00
Fabio Alessandrelli 9de4ffde61 Refactor RPCMode enum and checks 2018-05-26 10:43:43 +02:00
Ignacio Etcheverry a830e633a2
Merge pull request #19074 from cart/optimize-mono-pool-marshal
Reduce allocations when converting mono arrays to pool arrays
2018-05-25 11:04:16 +02:00
Rémi Verschelde 17faf11119
Merge pull request #19063 from KellyThomas/c-sharp-feature-parity-vectors
mono: Add Slerp method to vector classes, expose Cross method for Vector2
2018-05-25 09:44:03 +02:00
Ignacio Etcheverry 64c903580e
Merge pull request #19149 from neikeq/x
Mono: Improve 'script class not found' error
2018-05-24 20:38:18 +02:00
Ignacio Etcheverry c8945fe7d8 Mono: Improve 'script class not found' error
No longer printed when using using placeholder script instances (for non-tool scripts in the editor).
Print different error if the project assembly is not loaded
2018-05-24 20:16:23 +02:00
Michael Alexsander Silva Dias 4e257293d9 Capitalized comments of methods created by the Connect Signal dialog. 2018-05-23 18:11:00 -03:00
Kelly Thomas b335274bcd mono: add Slerp method to vector classes, expose Cross method for Vector2, and fix unnecessary casts in Basis 2018-05-22 08:27:49 +08:00
Kelly Thomas c7e98eef67 Fix index out of range error in string.Extension() 2018-05-21 18:48:53 +08:00
Carter Anderson 56262ceafe Reduce allocations when converting mono arrays to pool arrays 2018-05-20 18:18:06 -07:00
Rémi Verschelde 228b09bafb
Merge pull request #18974 from KellyThomas/c-sharp-feature-parity-basis
Mono: Basis constructor for euler parameter
2018-05-18 21:09:57 +02:00
Ignacio Etcheverry fc90f41f53
Merge pull request #18975 from KellyThomas/c-sharp-feature-parity-color
mono: New Color methods:  Darkened, Lightened and ToRgba32
2018-05-18 20:09:01 +02:00
Kelly Thomas 16e1b4bacf mono: Plane, expose Normal, and D 2018-05-17 23:04:20 +08:00
Kelly Thomas 88bd33f451 mono: New Color methods: Darkened, Lightened and ToRgba32 2018-05-17 21:41:19 +08:00
Kelly Thomas c26d30986a Mono: Basis constructor for euler parameter 2018-05-17 21:31:14 +08: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
Rémi Verschelde c3510cd981
Merge pull request #18949 from neikeq/alo
Mono: Project building fixes
2018-05-17 08:33:54 +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 41f79a6f14
Merge pull request #18889 from madadam/async-await-fix
Set current SynchronizationContext before the game loop starts
2018-05-16 23:44:55 +02:00
Guilherme Felipe 35024d4e7b Add missing copyright headers 2018-05-16 14:50:44 -03:00
Daniele Giuliani d315b0fb8a added get_creation_time function for gdscript 2018-05-16 00:50:57 +02:00
Juan Linietsky 005b69cf6e -New inspector.
-Changed UI resizing code, gained huge amount of speed.
-Reorganized timer sync to clean up behavior (sorry forgot commit this before)

-
2018-05-15 17:14:31 -03:00
Adam Cigánek f25240cfe6 Set current SynchronizationContext before the game loop starts
This fixes the problem that `SynchronizationContext.Current` would be null
during the call to `_EnterTree`, `_Ready` and the first call to `_Process` thus
the task continuations would be scheduled outside the main thread, which is unexpected and might lead to crashes.

With this change, task continuations are scheduled always on the main thread and so async/await can be used without any explicit synchronization, which is what is expected.

Fixes #18849
2018-05-15 15:09:40 +02:00
Pieter-Jan Briers 27d70924a0 Fixes ObjectDB leak printout with mono.
Fixes #18767
2018-05-11 13:50:56 +02:00
Kelly thomas a6bd2c6e72 round / ceil methods for c sharp vectors 2018-05-04 20:17:10 +08:00
Max Hilbrunner ffb6f8f1ca
Merge pull request #18406 from YeldhamDev/script_templates_period
Changed periods in the script templates
2018-05-04 11:20:16 +02:00
Ignacio Etcheverry a02fec47a0
Merge pull request #18562 from neikeq/issue-18526
Fix MSVC check when building with mono
2018-05-02 18:24:57 +02:00
Michael Alexsander Silva Dias 093b069bf6 Changed periods in the script templates. 2018-05-02 11:42:09 -03:00
Ignacio Etcheverry a1aa98e05a Fix MSVC check when building with mono 2018-05-02 15:19:02 +02:00
Ignacio Etcheverry c0192e405d
Merge pull request #18561 from neikeq/fix-find-msbuild-2
Fix editor detecting msbuild with a msvc 'tools only' install
2018-05-02 15:13:44 +02:00
Ignacio Etcheverry 93d13bee8b Fix editor detecting msbuild with a msvc 'tools only' install 2018-05-02 15:06:25 +02:00
Hein-Pieter van Braam 0ec912a79e Fix msbuild with a msvc 'tools only' install
Taken from https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
without '-products *' vswhere does not locate msbuild when installing a
tools-only (no IDE) version of the microsoft compilers.
2018-04-30 12:52:18 +02:00
Pieter-Jan Briers ce4451b45f assembly_load_hook fallback for registering GDMonoAssemblies.
Fixes #18029.

There are ways to load assemblies that the search hook has no way of intercepting,
and handling itself. Such as loading from a byte[] in C# code.

We now handle these cases with a fallback assembly_load_hook,
to avoid crashes when this is indeed done.
2018-04-29 16:32:30 +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 b5e6e142ef Add option to link mono statically on Windows 2018-04-25 21:15:35 +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 f8ce412560 Mono: Do not spam script class not found error
Print this error only when trying to instantiate the script. This way we prevent errors being printed for source files which are not meant to be used as scripts.
2018-04-24 20:46:57 +02:00
Ignacio Etcheverry 89e84185e8 Mono: Fix crash on script load if the scripts domain isn't loaded 2018-04-24 20:46:53 +02:00
Xavier Cho 6b611e6431 #18051: Fix indentation issues introduced during clean up 2018-04-17 07:53:27 +09:00
Xavier Cho e59fad3924 #18051: Do not use `var` in a for-loop, or where type is not obvious 2018-04-17 07:39:37 +09:00
Xavier Cho 94edd92248 #18051: Use common name for Color type argument 2018-04-17 07:39:37 +09:00
Xavier Cho f0bf5532fa #18051: Remove redundant verbatim prefixes 2018-04-17 07:39:37 +09:00
Xavier Cho 85787776a5 #18051: Use default parameter value 2018-04-17 07:39:37 +09:00
Xavier Cho b765c051cb #18051: Use array initializer when applicable 2018-04-17 07:39:37 +09:00
Xavier Cho 9097c71255 #18051: Remove redundant parenthesis 2018-04-17 07:39:37 +09:00
Xavier Cho 93dd59d763 #18051: Remove unnecessary variable assignments 2018-04-17 07:39:37 +09:00
Xavier Cho fdfc478c88 #18051: Use 'var' when applicable 2018-04-17 07:39:37 +09:00
Xavier Cho 0ef3e0577b #18051: Remove redundant casts and 'using', 'else', 'this' statements 2018-04-17 07:39:37 +09:00
Xavier Cho 9e2e6bb1e2 Remove duplicated declaration of RoundToInt() from Mathf 2018-04-17 07:39:37 +09:00
Ignacio Etcheverry e3590a2522
Merge pull request #18038 from Chaosus/mathf
[Mono] Improvements for Mathf
2018-04-13 22:22:28 +02:00
Chaosus 655a4e6540 [Mono] Improve Mathf 2018-04-13 20:15:49 +03: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
Rémi Verschelde 95b499644e
Merge pull request #17834 from Rubonnek/move-to-initializer-list
Move GodotSharp and MonoBuildTab member variables to initializer list
2018-04-03 21:01:58 +02:00
Alexander Alekseev 5677aed175 [mono] Fixes #17936 as GodotSharp (Core\Basic.cs) requires C#7 now, but we most probably should keep C#6 yet 2018-04-03 09:48:03 +03: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
Chaosus d52722c6da Added wrap functions to C# 2018-03-26 14:33:09 +03:00
Carter Anderson 91f271fa9e Fix mono basis GetEuler bug and marshalling/unmarshalling 2018-03-24 13:45:11 -07:00
Ignacio Etcheverry a8d8c06753
Merge pull request #17134 from aaronfranke/master
[Mono] Replace float with real_t, other misc C# improvements
2018-03-24 21:10:41 +01:00
Aaron Franke ff97c97c93 Replace float with real_t, default Vectors, other misc C# improvements
Replace float with real_t in most files, defined at the top of each file via using. Objects such as Vector3 now accept doubles as inputs, and convert to real_t internally. I've added default Vectors such as Vector3.Zero. Other misc C# improvements such as Mathf.RoundToInt(). Color continues to use float only because high precision is not needed for 8-bit color math and to keep things simple. Everything seems to compile and work fine, but testing is requested, as this is the first time I've ever contributed to Godot.
2018-03-22 21:53:21 -05:00
PJB3005 6a7f552c6f Fix mono build properly!
Fixes the mistake I made in #17603 to make it require Python > 3.6.
2018-03-19 16:36:03 +01:00
Rémi Verschelde 4f97d5a7e2
Merge pull request #17603 from PJB3005/18-03-18-fix-mono-build-python3
Fix Mono builds with Python 3.
2018-03-19 09:53:23 +01:00
Ignacio Etcheverry 883afd1b4d
Merge pull request #17619 from neikeq/mono-runtime-main-args
Mono: Runtime main args and assembly search fixes
2018-03-18 23:16:44 +01:00
Ignacio Etcheverry fa1d656af4 Mono: Runtime main args and assembly search fixes
- Setup runtime main args during initialization. This must be done manually by embedders who do not call mono_runtime_run_main. Fixes NullReferenceException in System.Environment.
- Continue to search the assembly in the rest of the search locations if loading it from one of them failed.
2018-03-18 23:07:04 +01:00
Pieter-Jan Briers 998f1977a8 Fix Mono builds with Python 3.
A subprocess call wasn't specifying an encoding,
so this gave a TypeError in Python 3.
2018-03-18 10:51:35 +01:00
Ignacio Etcheverry 389ad72399
Merge pull request #17179 from paulloz/mono-assemblies-preload-facades
[mono] add the 'Facades' subfolder to the searched directories
2018-03-16 21:40:42 +01:00
Rémi Verschelde 99c1323a08
Merge pull request #17388 from Hinsbart/mono_class_name
Mono: Avoid invalid class names.
2018-03-15 19:47:39 +01:00
Andreas Haas 700d07cf7c
Mono: Avoid invalid class names.
Disallow reserved keywords as class names and prefix base class with the Godot
namespace if it's the same as the class name.

Fixes #12483
2018-03-15 19:25:06 +01:00
Paul Joannon ef5672d3f9
[mono] write classes with no constructor as abstract 2018-03-04 15:37:39 +01:00
Paul Joannon d7020aef8d
[mono] rename functions to conform to PascalCase
in:
* StringExtensions.cs
* Transform.cs
2018-03-04 15:37:29 +01:00
Paul Joannon 22606a7bec
[mono] add the 'Facades' subfolder to the searched directories in _preload_hook 2018-03-02 13:38:29 +01:00
Hein-Pieter van Braam c094e90b25 More reliably find mscorlib.dll on Linux 2018-02-27 21:52:24 +01:00
Rémi Verschelde 3fa77b3172 doc: Remove status from hardcoded version string
It has no practical use case and just generates noise for each alpha, beta, etc.
2018-02-27 13:40:49 +01:00
Rémi Verschelde a6d4438fab
Merge pull request #17075 from paulloz/fix-build-mono-debug-notools
[mono] fix build error when compiling with mono, tools=no, target=debug
2018-02-27 11:24:54 +01:00
Rémi Verschelde 75c7e66c5e
Merge pull request #15641 from neikeq/mono-is-picky-regarding-corlib-so-we-must-make-sure-to-ship-the-right-version-otherwise-something-bad-may-happen
Mono: Buildsystem improvements
2018-02-27 11:08:17 +01:00
Paul Joannon 90a705d671
fix build error when compiling with mono, tools=no, target=release
change TTR to RTR in `print_unhandled_exception`
2018-02-27 10:36:58 +01:00
Rémi Verschelde 1bd0fd90cc
Merge pull request #17046 from NathanWarden/fixed_mono_marshalling
[Mono] The marshalling *in* of Transform was also incorrect.
2018-02-26 22:42:31 +01:00
Nathan Warden 60daa9d718 The marshalling in was also incorrect. 2018-02-26 10:01:21 -05:00
Ignacio Etcheverry f37090ccf4 Mono: Better versioning and gracefully unloading of Godot API assemblies 2018-02-25 20:56:27 +01:00
Rémi Verschelde 08584b7e22
Merge pull request #16804 from Valentactive/fix_mono_template_compiling
fix template builds with mono
2018-02-25 10:11:10 +01:00
Ignacio Etcheverry 3647ebc834
Merge pull request #16981 from paulloz/mono-nested-exceptions
[mono] show whole trace of nested exceptions
2018-02-24 21:44:33 +01:00
Paul Joannon 89af6c2cd7
[mono] get stacktraces for all inner exceptions 2018-02-24 21:18:06 +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
Michele Valente 3c7d9001bc fix release builds with mono
"_signals" and "signals_invalidated" were moved out of the
"TOOLS_ENABLED" directive. Updated also the two "update_signals" and
"_update_signals" methods so it makes sense.
2018-02-22 21:23:47 +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
Paul Joannon 7a72395412
[mono] fix signals parameter retrieval 2018-02-21 12:50:05 +01:00
Nathan Warden 72fe70272d [Mono] Fixed "expression did not evaluate to a constant" compiler error for visual studio. 2018-02-20 00:24:52 -05:00
Rémi Verschelde 3c7a39b40c doc: Update version string in header 2018-02-19 10:46:33 +01:00
Ignacio Etcheverry 6e200b1fe0
Merge pull request #16326 from NathanWarden/fix_basis_mono
[Mono] Basis values now marshalled in the correct order.
2018-02-18 19:54:53 +01:00
Ignacio Etcheverry dad47d8876
Merge pull request #16749 from PJB3005/18-02-16-project-manager-mono-debug-fix
Makes project manager never initialize mono debug.
2018-02-18 19:53:46 +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
Rémi Verschelde 2d0c07bd5a
Merge pull request #16770 from paulloz/csharp-signal-attribute
C# Signal attribute
2018-02-17 20:14:39 +01:00
Paul Joannon cfbd7fd21e
implement signal related methods in csharp_script so signals can be used with emit 2018-02-17 19:37:02 +01:00
Paul Joannon efd52cd172
add a [Signal] attribute to CSharpScripts 2018-02-17 19:29:26 +01:00
Ignacio Etcheverry 8bd05f0c71 Mono: Fix build status icons 2018-02-17 18:12:00 +01:00
Pieter-Jan Briers 1099838079 Makes project manager never initialize mono debug.
The heuristic whether we're in the project manager inside GDMono
didn't work if the project manager was launched by not having any path
to run.

This is fixed now by making a Main::is_project_manager().
2018-02-16 16:15:35 +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
Rémi Verschelde 3493c5a337
Merge pull request #16331 from Benjamin-Dobell/pull/fix-pkgconfig-mono
Fixed Mono builds on macOS (pkgconfig detection of mono)
2018-02-14 15:41:55 +01:00
Jonathan Tinkham 70d281b946 Add and use mono build variables with cloned environment. 2018-02-10 20:48:46 -07:00
Nathan Warden 0cc4de1f24 [Mono] Basis values now marshalled in the correct order. 2018-02-02 16:45:30 -05:00
Benjamin Dobell 5920bc6f72 Fix pkgconfig detection of mono 2018-02-03 05:17:53 +11:00
Paolo Perkovic 08d4bfacaf Fix inconsistencies and typos in argument names 2018-02-01 16:47:20 +01:00
Rémi Verschelde 2459eebc1d
Merge pull request #16258 from NathanWarden/fix_mono_decimals_method
[Mono] Fix an infinite recursion in the Mathf.Decimals method when using floats.
2018-02-01 15:39:51 +01:00
Rémi Verschelde c460e38bf3
Merge pull request #16205 from neikeq/issue-15053
Mono: Remove automatic script multilevel calls
2018-02-01 14:51:12 +01:00
Rémi Verschelde 906ac2fc9d
Merge pull request #16002 from bruvzg/mono_loading_form_res
[Mono] Allow loading assemblies (including mscorlib) from resources.
2018-02-01 14:36:05 +01:00
Nathan Warden 2109bd3f97 Fix an infinite recursion in the Mathf.Decimals method when using floats. 2018-01-31 14:02:17 -05:00
bruvzg b3ddf12fb1
Mono: Allow loading `mscorlib` from resources. 2018-01-31 09:20:46 +02:00
Nathan Warden 3dcf0567a1 Added async and await as C# keywords. 2018-01-30 21:18:48 -05:00
Ignacio Etcheverry 84437b4864 Mono: Remove automatic script multilevel calls 2018-01-30 18:53:00 +01:00
Rémi Verschelde dcacf36118
Merge pull request #16118 from neikeq/i-dont-know-what-to-write-here-anymore
Mono: Fix build errors with tools=no and target=release
2018-01-27 23:29:27 +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 0c3bbcaa00 Mono: Fix build errors with tools=no and target=release 2018-01-27 18:44:04 +01:00
Ignacio Etcheverry 562ec3f5e6 Mono: Don't defer call to dispose queue objects when finalizing domain
It's going to be called anyway after `mono_domain_finalize`.
This also prevents crashes, since the MessageQueue singleton could already be freed at this point (see: #15702).
2018-01-26 01:10:25 +01:00
Ignacio Etcheverry 58448561c7 Mono: Fix NodePath and RID bindings 2018-01-25 23:46:54 +01:00
Rémi Verschelde d516aab8fa doc: Sync with current source
Also enhance RigidBody docs as per https://github.com/godotengine/godot-docs/pull/1018
and fix the version tag in all files (not really stable yet, but it makes no sense
to hardcode rc3 at this stage).
2018-01-25 08:50:56 +01:00
Ignacio Etcheverry e1ae7dffd3
Merge pull request #16016 from neikeq/issue-13316
Fix CSharpInstance::call not initializing CallError
2018-01-24 01:35:10 +01:00
Ignacio Etcheverry 8c33939ce6 Fix CSharpInstance::call not initializing CallError 2018-01-24 01:31:51 +01:00
Paul Joannon 76a615aea4
SignalAwaiter::_signal_callback was calling the thunk with a wrong pointer 2018-01-23 12:58:54 +01:00
Rémi Verschelde 511742eb68
Merge pull request #15972 from akien-mga/mono-warning
Mono: Display opt-out warning in editor about WIP status
2018-01-22 22:23:02 +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
Paul Joannon 1eb9c7e6cb
RID cached class was wrong (mono) 2018-01-22 14:01:20 +01:00
Paul Joannon e0ce249621
fix GDMonoProperty::set_value
was calling getter and not setter
should close #15387
2018-01-21 12:29:49 +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
Kelly Thomas ed17b42654
remove c#7 features for compatibility with 2015 Build Tools
https://github.com/godotengine/godot/issues/15742
2018-01-18 19:43:23 +08:00
Paul Joannon 2dc6725cc4
remove an unneeded marshalling function
`Variant mono_object_to_variant(MonoObject*, const ManagedType&)`
2018-01-18 10:33:43 +01:00
Paul Joannon 1de5f7e70b
fix marshalling when a function is returning an object from c# 2018-01-18 10:31:36 +01:00
Rémi Verschelde e28cdc4654 doc: Update version string in XML 2018-01-13 11:43:42 +01:00
Ignacio Etcheverry a45697d8df Mono: Buildsystem improvements
- Bundle with mscorlib.dll to avoid compatibilities issues
- Add build option 'mono_assemblies_output_dir' to specify the output directory where the assemblies will be copied to. '#bin' by default.
2018-01-12 22:44:22 +01:00
Ignacio Etcheverry bff9627dc4 Mono: Some StackTrace to StackInfo[] fixes
- Sometimes `StackFrame.GetMethod()` returns null (e.g.: latest frame of a `MissingMethodException`). Still not sure what to do with that frame (maybe skip it), but at least it no longer fails.
- Skip `CSharpLanguage::debug_get_current_stack_info()` if an error is printed from `GDMonoUtils::update_corlib_cache()`.
- Fix crash when calling `GDMonoUtils::print_unhandled_exception(exc)` if there is no ScriptDebugger attached.
2018-01-12 19:31:15 +01:00
Ignacio Etcheverry feb843da2b Mono: Fix starting MonoDevelop process from the wrong appdomain 2018-01-12 19:19:20 +01:00
Bojidar Marinov 9b8e8b2220
Bind many more properties to scripts
Notable potentially breaking changes:
- PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL
- Some properties were renamed, and sometimes even shadowed by new ones
- New getter methods (some virtual) were added
2018-01-12 00:58:14 +02: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 a60896869e
Merge pull request #15537 from PJB3005/18-01-09-fix-color-string-constructor-mono
Fixes Mono color creation from string being 0-255 instead of 0-1.
2018-01-10 14:50:26 +01:00
Pieter-Jan Briers 6e14cf991a Fixes Mono color creation from string.
Fixes #15468

Also improves the error messages if the string isn't hex, because saying that the color value is negative is just a side effect of the implementation and tells you nothing.
2018-01-10 13:56:30 +01:00
Ignacio Etcheverry f7de51b3a6 Mono: Some fixes for #15463 2018-01-09 22:27:55 +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
Ignacio Etcheverry 5be356b72f Mono: Implement stack info for errors and exceptions 2018-01-09 17:19:03 +01:00
Rémi Verschelde 0e6e98a65f Fix build of GDMonoField
Closes #15385.
2018-01-06 11:06:05 +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
PJB3005 7368a0e0f0 Fix fatal mono logs not getting logged to disk.
They aborted the application without flushing the log file.

Also there was a typo.
2017-12-19 17:36:33 +01:00
Andreas Haas e7c1255b06
Mono: Build in cloned env.
Use a cloned env, so that toggling glue_enabled doesn't force a full rebuild as mentioned in #14584.
2017-12-12 16:20:34 +01:00
Rémi Verschelde 13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
Unknown fd1b94e307 Improve slang, especially in user-visible parts 2017-12-05 15:41:38 +01:00
Nathan Warden 0c22447ebe Exported variables now show in the correct order. 2017-12-02 21:01:58 -05:00
Rémi Verschelde aa5f7e0ff2 Fix mono build after bc2e8d99 2017-11-25 12:16:58 +01:00
Rémi Verschelde bc75fae579 doc: Update header version for 3.0-beta 2017-11-24 09:16:52 +01:00
Andreas Haas e69dd3c712
Mono: Use PascalCase in core types. 2017-11-21 23:32:40 +01:00
pablotato 054a2ac579 Add cartesian to polar conversion functions 2017-11-20 23:34:40 +01:00
Rémi Verschelde ecf80fbbba
Merge pull request #12988 from akien-mga/xdg-home-paths
Add support for XDG Base Directory spec
2017-11-20 00:42:51 +01:00
Rémi Verschelde 32c12a92a5 Add initial support for the XDG Base Directory spec
Spec version 0.7 from https://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html
(latest as of this commit).

Three virtual methods are added to OS for the various XDG paths we will use:
- OS::get_data_path gives XDG_DATA_HOME, or if missing:
  ~/.local/share on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows
- OS::get_config_path gives XDG_CONFIG_HOME, or if missing:
  ~/.config on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows
- OS::get_cache_path gives XDG_CACHE_HOME, or if missing:
  ~/.cache on X11, ~/Library/Caches on macOS and %APPDATA% on Windows

So for Windows there are no changes, for Linux we follow the full split spec
and for macOS stuff will move from ~/.godot to ~/Library/Application Support/Godot.

Support for system-wide installation of templates on Unix was removed for now,
as it's a bit hackish and I don't think anyone uses it.

user:// will still be OS::get_data_path() + "/godot/app_userdata/$name" by
default, but when using the application/config/use_shared_user_dir option
it will now use XDG_DATA_HOME/$name, e.g. ~/.local/share/MyGame.

For now everything still goes in EditorSettings::get_settings_dir(), but
this will be changed in a later commit to make use of the new splitting
where relevant.

Part of #3513.
2017-11-19 20:54:24 +01:00
Ignacio Etcheverry b51b3dc030 Mono: Fix compiler error with Variant::operator AABB() 2017-11-18 18:13:57 +01:00
Rémi Verschelde ad199c3964 EditorSettings: Rename settings_path to settings_dir
Also to prepare for upcoming refactoring for XDG support.
2017-11-17 20:55:09 +01:00
Rémi Verschelde 73049d115e Rename OS::get_data_dir to OS::get_user_data_dir
Will be needed to avoid confusion with system data path (XDG_DATA_HOME)
and editor data dir in upcoming refactoring.
2017-11-17 20:55:09 +01:00
Ferenc Arn d28763a4c1 Rename Rect3 to AABB.
Fixes #12973.
2017-11-17 11:01:41 -05:00
Rémi Verschelde 677e95d8d1 doc: Make all module docs self-contained 2017-11-15 21:29:33 +01:00
Rémi Verschelde e7701bb2de doc: Rename "@Global Scope" to "@GlobalScope"
Spaces in filenames are evil.
2017-11-15 20:41:16 +01:00
Rémi Verschelde 967bfb0c4a doc: Remove revision.module_config from version string
It is now "3.0-alpha" instead of "3.0.alpha.custom_build{,.mono}",
limits unnecessary diffs.
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
Juan Linietsky 79f81b77e2 -Modules can now add custom version info (added it for Mono)
-Version string takes this version info
-Ability to download templates from the interweb (listing does not work yet)
2017-11-01 23:13:27 -03:00
Ignacio Etcheverry 3c97a9543d
Merge pull request #12549 from neikeq/seriously-do-they
Mono cleanup fixes
2017-11-01 01:56:16 +01:00
Ignacio Etcheverry cb3ef3c7e6
Merge pull request #12546 from neikeq/do-people-read-these
Use mono_gc_wbarrier_set_arrayref for Array marshalling
2017-11-01 01:52:42 +01:00
Ignacio Etcheverry a018cbaee1 Fix thread checking to queue instances for deletion 2017-11-01 01:51:12 +01:00
Ignacio Etcheverry 06ea441564 Make sure gchandle bindings are released before cleanup 2017-11-01 01:48:47 +01:00
Ignacio Etcheverry 0525b63421 Use mono_gc_wbarrier_set_arrayref for Array marshalling 2017-11-01 00:17:34 +01:00
Andreas Haas f3218c24c7
Mono: support custom script templates.
Also fixes a bug that prevented methods like `duplicate()` from copying the source code. (Copied from GDScript implementation)
2017-10-31 15:46:30 +01: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
Rémi Verschelde f021b00389
Merge pull request #12525 from neikeq/wololo
Remove Visual Studio for now from the external editors list
2017-10-30 23:47:34 +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 9290fd2a42 Fix 'which' returning file without extension on Windows 2017-10-30 21:09:59 +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
Matthias Hoelzl a6d53effa5 Fix build with Python 3 on Windows 2017-10-29 19:27:12 +01:00
Rémi Verschelde 23740c8a91 Mono: Fix Windows build 2017-10-29 17:28:53 +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
Rémi Verschelde d135008acf Merge pull request #12405 from Jerome67000/clean_getnodetype
Removes Script::get_node_type()

[ci skip]
2017-10-26 08:49:38 +02:00
Przmk 2ae23c9f97 Fix default C# script 2017-10-25 22:43:06 +02:00
Jerome67000 2609cc9ef4 Removes Script::get_node_type()
used before GDScript, with squirrel apparently
2017-10-25 20:11:30 +02:00
Rémi Verschelde 847c55bcb1 Merge pull request #12365 from neikeq/p
Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
2017-10-24 18:59:26 +02:00
Ignacio Etcheverry 63f58da054 Exit after generating mono glue 2017-10-24 16:18:47 +02:00
Ignacio Etcheverry e218a13a64 Add ScriptLanguage::supports_builtin_mode and improve ScriptCreateDialog
- Make ScriptCreateDialog disable the built-in script checked button if the language does not support it.
- ScriptLanguage's get_template and make_template now receive the script path as class name if the the script language does not have named classes.
2017-10-24 15:48:58 +02:00
Ignacio Etcheverry a897f7f606 Merge pull request #12364 from neikeq/o
Mono: Fix and cleanup build start errors
2017-10-24 01:17:36 +02:00
Ignacio Etcheverry 9905002fa6 Mono: Fix and cleanup build start errors 2017-10-24 00:49:44 +02:00
Rémi Verschelde 8ef79ffe68 Merge pull request #12320 from mhilbrunner/issue-11994
Add _process(delta) to new script templates. Closes #11994.
2017-10-23 23:18:14 +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 acaaf2e440 Merge pull request #12326 from neikeq/n
Fix set field from MonoObject*
2017-10-22 22:14:10 +02:00
Ignacio Etcheverry ae725969d3 Fix set field from MonoObject* 2017-10-22 22:07:52 +02:00
mhilbrunner ba779c1c0c Add _process(delta) to new script templates. Closes #11994. 2017-10-22 21:07:34 +02:00
Rémi Verschelde 6361e24f29 Cleanup unnecessary debug prints 2017-10-21 20:41:07 +02:00
Rémi Verschelde a3a85670a3 Mono: Fix static linking on macOS
[ci skip]
2017-10-20 22:11:55 +02:00
Rémi Verschelde e4ec0d007c Merge pull request #12209 from neikeq/m
Mono: Fix warning about exported static fields
2017-10-18 08:40:13 +02:00
Ignacio Etcheverry b1d106adb6 Mono: Fix warning about exported static fields 2017-10-18 08:34:17 +02:00
Rémi Verschelde 9bead2e06f Merge pull request #12208 from neikeq/l
Mono: Fix build with tools=no or target=release
2017-10-18 08:29:37 +02:00
Ignacio Etcheverry fb63ee52fb Mono: Fix build with tools=no or target=release 2017-10-18 08:27:18 +02:00
Rémi Verschelde fb7428e797 Merge pull request #12178 from neikeq/k
Export attribute fixes and improvements
2017-10-17 21:29:19 +02:00
Ignacio Etcheverry 6e6b455d1f Export attribute fixes and improvements
- Allow non-public fields to be exported as well (to avoid confusion).
- Set PROPERTY_HINT_RESOURCE_TYPE for resource derived fields.
- Support enums and automatically fill PROPERTY_HINT_ENUM's hint_string for enum fields.
2017-10-17 14:42:13 +02:00
Ignacio Etcheverry 1bafd0e33a Take self-contained mode into consideration 2017-10-17 11:36:19 +02:00
Rémi Verschelde 8de1dc7e9a Merge pull request #12138 from neikeq/i
Avoid adding built-in script path to csproj
2017-10-16 10:19:16 +02:00
Rémi Verschelde c0293aca59 Merge pull request #12136 from neikeq/h
Improve signature of signal target generated function
2017-10-16 10:18:17 +02:00
Ignacio Etcheverry 132c6deb28 Merge pull request #12104 from akien-mga/monosgen-2
mono: Request monosgen-2 explicitly via pkg-config
2017-10-16 04:32:47 +02:00
Ignacio Etcheverry 967335b969 Avoid adding built-in script path to csproj 2017-10-16 04:26:13 +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
Rémi Verschelde cd69dcafb7 mono: Request monosgen-2 explicitly via pkg-config
Prevents GC mismatch between mono binary and library, fixes #11916.
2017-10-14 23:54:26 +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 14b9ad1296 Fix wrong array index 2017-10-10 18:29:56 +02:00
Ignacio Etcheverry 18d3ba0c50 Fix getting struct elements from MonoArray (#11978)
* Fix getting struct elements from MonoArray
* Revert undesired change
2017-10-10 00:25:36 +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 0c2e882210 Adds 'exposed' field to ClassInfo
This field represents if the class is exposed to the scripting API.
The value is 'true' if the class was registered manually ('ClassDB::register_*class()'), otherwise it's false (registered on '_post_initialize').
- Added missing registration of classes that are meant to be exposed.
2017-10-09 23:49:17 +02:00
Ferenc Arn 8ddbd19777 Apply a few recent chages in Quat and Basis to their respective Mono counterparts. (#11899) 2017-10-09 14:49:53 +02:00
Rémi Verschelde 30a4882cf8 Merge pull request #11910 from hoelzl/pr-python3-mono-build
Fix Python 3 incompatibility in Mono build
2017-10-09 11:00:14 +02:00
Ignacio Etcheverry ff28569d16 Fixed IntPtr unboxing (#11949)
- Fix boolean never reset to false
- Fix IntPtr unboxing and cleanup
2017-10-09 00:10:54 +02:00
Ignacio Etcheverry e5ff814243 Merge pull request #11924 from neikeq/b
Fix dot separated assembly names confused with file extensions
2017-10-07 22:10:02 +02:00
Ignacio Etcheverry eb920406ae Fix dot separated assembly names confused with file extensions 2017-10-07 22:00:35 +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
Matthias Hoelzl a6b48c1706 Fix Python 3 incompatibility in Mono build 2017-10-07 15:36:20 +02:00
Rémi Verschelde 84e7bbafb7 Merge pull request #11843 from hoelzl/pr-python3-build
Fix Python 3 build
2017-10-07 10:54:58 +02:00
Ignacio Etcheverry 5ab3537179 Fix sizeof wrong type 2017-10-07 04:22:26 +02:00
Ignacio Etcheverry 9eda9be3cf Fix assembly load hooks 2017-10-07 04:21:55 +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
Ignacio Etcheverry 85cc879382 Merge pull request #11894 from neikeq/pr-issue-11834
Mono: Make sure editor thread is attached on script reload
2017-10-07 00:47:13 +02:00
Ignacio Etcheverry fdc3de009c Mono: Make sure editor thread is attached on script reload 2017-10-07 00:43:02 +02:00
Ignacio Etcheverry 30328e7dfc Merge pull request #11849 from cart/mono_parent_fields
Mono: support exported parent class fields
2017-10-06 22:36:58 +02:00
Carter Anderson 19df296351 get parent class fields when updating a CSharpScript's exports
This makes the fields viewable / editable in the inspector
2017-10-05 23:50:48 -07:00
Ferenc Arn 17e89c2c66 Fix mono enabled builds (broken by 3d87b70). 2017-10-05 22:11:10 -04:00
Ignacio Etcheverry 1d309439cb Uninitialized local and domain finalize fixes
- Make sure to run the GC before and after finalizing the scripts domain.
2017-10-05 00:12:36 +02: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
Matthias Hoelzl 727a381fc9 Fix Python 3 build
- Take care of the differences in handling unicode characters in
  `escape_string` (formerly in `editor/SCsub`, now in `compat.py)`.
- Conditionally include `_winreg` or `winreg` in the Mono editor
  module.
2017-10-04 23:21:32 +02:00
Ignacio Etcheverry e36fb95c50 Added mono module 2017-10-03 00:01:26 +02:00