Commit graph

349 commits

Author SHA1 Message Date
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 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