Commit graph

715 commits

Author SHA1 Message Date
Ignacio Roldán Etcheverry
1700ab9bc6
Merge pull request #30501 from neikeq/dispose-godotsharpexport
Mono: Fix null dereference in EditorExportPlatformAndroid
2019-07-10 22:35:54 +02:00
Ignacio Etcheverry
9eb0729a05 Mono: Fix Api HintPath and update old game projects
Fixed Api assembly references with more than one HintPath.
Also made the editor update old C# projects use the new Api assembly HintPaths.
2019-07-10 22:00:31 +02:00
Ignacio Etcheverry
2a8294ff24 Mono: Fix null dereference in EditorExportPlatformAndroid
We need to dispose the GodotSharpExport export plugin before the editor destroys EditorSettings. Otherwise, if the GC disposes it at a later time, EditorExportPlatformAndroid will be freed after EditorSettings already was, and its device polling thread will try to access the EditorSettings singleton, resulting in null dereferencing.
2019-07-10 21:51:47 +02:00
Ignacio Roldán Etcheverry
c3da4f854d
Merge pull request #30486 from neikeq/fix-indexoutofbounds-msbuildfinder
Fix IndexOutOfBounds in FindMsBuildToolsPathOnWindows
2019-07-10 21:43:17 +02:00
Ignacio Roldán Etcheverry
8b778f6234
Merge pull request #30489 from neikeq/fix-nullexc-on-gengameproj
Mono: Fix null exception in GenerateGameProject
2019-07-10 15:40:25 +02:00
Ignacio Etcheverry
caf20492cf Mono: Fix null exception in GenerateGameProject
Also fix pdb files for GodotTools.*.dll assemblies not being copied to the output directory.
2019-07-10 15:03:05 +02:00
Ignacio Roldán Etcheverry
63c4d5af72
Merge pull request #30485 from neikeq/remove-frameworkpathoverride-from-scons
SCons no longer passes FrameworkPathOverride to MSBuild
2019-07-10 13:35:40 +02:00
Ignacio Etcheverry
ace0c6ce38 Fix IndexOutOfBounds in FindMsBuildToolsPathOnWindows 2019-07-10 13:30:03 +02:00
Ignacio Etcheverry
c0a4f12fcc SCons no longer passes FrameworkPathOverride to MSBuild 2019-07-10 13:19:52 +02:00
Ignacio Etcheverry
2da83a278b Mono: Add missing GodotTools.sln 2019-07-10 12:30:12 +02:00
Ignacio Etcheverry
d3f48f88bb Fix EditorNavigationMeshGenerator registered in Core API
Also added an option to output a json file with all the ClassDB registered classes and its members. This can be used to compare the API of two different builds by a simple diff.
2019-07-09 23:33:29 +02:00
Rémi Verschelde
d2e620b8fc
Merge pull request #30463 from neikeq/fix-search-dirs
Fix export templates ignoring assemblies in 'res://.mono/assemblies'
2019-07-09 21:59:32 +02:00
Ignacio Etcheverry
4af03e52bd Make SCons check for System MSBuild before Mono's 2019-07-09 16:49:06 +02:00
Ignacio Etcheverry
df6d1656fe Fix export templates ignoring assemblies in 'res://.mono/assemblies' 2019-07-09 16:49:02 +02:00
Rémi Verschelde
29ca79bd68
Merge pull request #30428 from neikeq/gitcheckout-b
Misc Mono Fixes
2019-07-09 08:26:48 +02:00
Ignacio Etcheverry
069af23bdb Mono: Fix build errors with tools=no 2019-07-08 18:07:20 +02:00
Ignacio Etcheverry
dd22cc7527 C#: Fix some crashes during assemblies reloading 2019-07-08 18:07:20 +02:00
Ignacio Etcheverry
aa3b8f7dbb Fix Godot.Object.ToString() infinite recursion
Should not be using Variant to String conversion as that would call ToString() again
2019-07-08 18:07:20 +02:00
Ignacio Etcheverry
5ed3d34cd9 Fix --generate-mono-glue bug when directory doesn't exist
DirAccess::get_full_path(path) only works if the path exists. Implement our own abspath function.
2019-07-08 18:07:15 +02:00
Ignacio Etcheverry
2c83255013 Fix C# bindings detection of abstract classes
ClassDB::can_instance was changed recently breaking our code, as the editor is not yet initialized. Check ClassInfo::creation_func directly.
2019-07-08 15:13:57 +02:00
Ignacio Etcheverry
b0cbf4e2b2 Fix InvalidCastException when loading script metadata
Old value wasn't string so we have to keep that in mind
2019-07-08 15:12:04 +02:00
qarmin
9a77d748c0 Fixes minor issues found by static analyzer 2019-07-07 23:08:51 +02:00
Ignacio Etcheverry
aa9908e4f6 Script API methods must return Ref<T> instead of Reference*
ptrcall assumes methods that return a Reference type do so with Ref<T>. Returning Reference* from a method exposed to the scripting API completely breaks ptrcalls to this method (it can be quite hard to debug!).
2019-07-05 09:38:28 +02:00
Ignacio Etcheverry
270af6fa08 Re-write mono module editor code in C#
Make the build system automatically build the C# Api assemblies to be shipped with the editor.
Make the editor, editor player and debug export templates use Api assemblies built with debug symbols.
Always run MSBuild to build the editor tools and Api assemblies when building Godot.
Several bugs fixed related to assembly hot reloading and restoring state.
Fix StringExtensions internal calls not being registered correctly, resulting in MissingMethodException.
2019-07-05 09:38:23 +02:00
Rémi Verschelde
e4699aa047
Merge pull request #30293 from neikeq/issue-29734
Mono: Fix Array IndexOutOfRangeException not being thrown
2019-07-03 21:26:25 +02:00
Rémi Verschelde
e1478b7a87
Merge pull request #30292 from neikeq/android_fixes
Mono: Android build and shared libraries fixes
2019-07-03 21:26:12 +02:00
Ignacio Etcheverry
3abe6961dc Mono: Fix Array IndexOutOfRangeException not being thrown 2019-07-03 17:56:08 +02:00
Ignacio Etcheverry
9f1a8ce6a2 Mono: Android build and shared libraries fixes
Fix location of Mono's shared libraries.
Fix build failing if the directory 'platform/android/java/libs/{target}/{abi}' doesn't exist.
2019-07-03 17:48:12 +02:00
Rémi Verschelde
b0d41847ed SCons: Use CPPDEFINES instead of CPPFLAGS for pre-processor defines
It's the recommended way to set those, and is more portable
(automatically prepends -D for GCC/Clang and /D for MSVC).

We still use CPPFLAGS for some pre-processor flags which are not
defines.
2019-07-03 09:59:04 +02:00
qarmin
3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +02:00
qarmin
4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
JohnJLight
38d3bfe971 Made use of semicolons more consitent, fixed formatting 2019-06-19 15:24:31 +02:00
Rémi Verschelde
d6176db271 Unexpose subclasses of ResourceFormatLoader and -Saver
ResourceFormatLoader and ResourceFormatSaver are meant to be overridden
to add support for different formats in ResourceLoader and ResourceSaver.
Those should be exposed as they can be overridden in plugins.

On the other hand, all predefined subclasses of those two base classes
are only meant to register support for new file and resource types, but
should not and cannot be used directly from script, so they should not
be exposed.

Also unexposed ResourceImporterOGGVorbis (and thus its base class
ResourceImporter) which are editor-only.
2019-06-18 17:56:23 +02:00
Rémi Verschelde
89ce9a6f46 Mono: Fix -Wduplicated-branches warning 2019-06-15 18:01:34 +02:00
Ignacio Roldán Etcheverry
abbbde87e2
Merge pull request #29606 from neikeq/remove-unneeded-mono-patches
Remove obsolete mono patch for pthread_mutexattr_setprotocol
2019-06-08 21:14:15 +02:00
Ignacio Etcheverry
26f9d907d4 Remove obsolete mono patch for pthread_mutexattr_setprotocol
This has already been fixed in Mono both master and 2019-06 (no other branch other than the skipped 2019-04 branch uses pthread_mutexattr_setprotocol).
2019-06-08 17:00:02 +02:00
Ignacio Etcheverry
ff0c863cb1 Mono: Fix SCons options added to the wrong environment 2019-06-04 16:15:00 +02:00
Ignacio Etcheverry
14df9e5cb2 Android build and export for the mono module 2019-06-03 17:09:24 +02:00
Rémi Verschelde
b9dc2e7e4d
Merge pull request #28099 from lupoDharkael/fix-completion
Fix code completion not working with class_name
2019-06-03 14:01:07 +02:00
Rémi Verschelde
3c4fab295b
Merge pull request #27789 from Giacom/move_towards
Added move_toward functions for float, Vector2 and Vector3
2019-06-01 12:05:18 +02:00
ShyRed
5dc50327cf Escape quote char for non-Windows OS
Quote char appears to be ignored by ProcessStartInfo on non-Windows operating systems, so it needs to be escaped.
2019-05-29 19:13:16 +02:00
Giacom
c00427add3 Added move_toward functions for float, Vector2 and Vector3 2019-05-28 11:39:35 +01:00
Rémi Verschelde
7487d2f852
Merge pull request #28957 from aaronfranke/basis-optimize
Optimize Basis constructor for Axis Angle
2019-05-27 17:42:43 +02:00
Ignacio Roldán Etcheverry
df17cf06d4
Merge pull request #29184 from aaronfranke/mono-tan-xy-yx
[Mono] Change Atan2 arguments to (y, x)
2019-05-26 17:15:29 +02:00
Aaron Franke
19786f77ef
[Mono] Change Atan2 arguments to Y X 2019-05-26 03:15:56 -04:00
ShyRed
60e711a115 Add Godot constants to Mono project builds
This adds constants to projects build via Godot Mono which allows project to conditionally react to different operating systems and 32/64 Bit architecture. Additionally .NET libraries could support multiple engines like Unity and Godot at the same time when compiled from Godot and reacting to definitions.
2019-05-26 08:07:55 +02:00
Ignacio Roldán Etcheverry
0d8f1ba6a9
Merge pull request #29021 from aaronfranke/mono-tuple
[Mono] Misc Basis and AABB improvements
2019-05-26 01:46:07 +02:00
Ignacio Etcheverry
04ebf294f3 C#: Implement ScriptInstance::to_string
Create a blacklist of methods that must not be generated. Includes: "to_string", "_to_string" and "_init".
2019-05-24 00:40:20 +02:00
Aaron Franke
7b6473fec5
[Mono] Misc Basis and AABB improvements 2019-05-22 15:23:51 -04:00
Ignacio Roldán Etcheverry
e2375f487c
Merge pull request #29079 from neikeq/oopsie
Fix C# build error in MarshalUtils debug code
2019-05-21 19:54:34 +02:00
Ignacio Roldán Etcheverry
9c45432309
Merge pull request #29052 from neikeq/fixes-28667------i-think
Replace call to 'mono_runtime_object_init' with manual ctor invoking
2019-05-21 19:15:32 +02:00
Ignacio Etcheverry
9b76c56098 Fix C# build error in MarshalUtils debug code 2019-05-21 19:09:00 +02:00
Ignacio Etcheverry
66b930a266 Replace call to 'mono_runtime_object_init' with manual ctor invoking 2019-05-21 00:06:04 +02:00
Rémi Verschelde
e0574e1d98 Fix typos with codespell
Using codespell 1.15.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-05-19 13:10:35 +02:00
Ignacio Etcheverry
5a4bf4f369 C#: Marshalling support for IEnumerable<> and IDictionary<,>
Also fixed the hint string of exported members.
2019-05-18 19:39:56 +02:00
Aaron Franke
9ff708f008
Optimize Basis constructor for Axis Angle 2019-05-17 05:11:12 -04:00
ShyRed
77ab9ba252 Fix generation of Mono Glue for Visual Studio 2017+
vsnprintf definition should only be changed when MSC version is older than 2013. The version check and fix is taken from StringUtils.h of assimp.
2019-05-05 12:39:02 +02:00
marxin
cdf54d6c5f Ignore a warning in _get_socket_error (-Wlogical-op).
drivers/unix/net_socket_posix.cpp: In member function 'NetSocketPosix::NetError NetSocketPosix::_get_socket_error()':
drivers/unix/net_socket_posix.cpp:197:22: warning: logical 'or' of equal expressions [-Wlogical-op]
  197 |  if (errno == EAGAIN || errno == EWOULDBLOCK)
      |                      ^

and:

modules/mono/utils/string_utils.cpp: In function 'int {anonymous}::sfind(const String&, int)':
modules/mono/utils/string_utils.cpp:68:48: error: logical 'or' of collectively exhaustive tests is always true [-Werror=logical-op]
      found = src[read_pos] == 's' || (c >= '0' || c <= '4');
                                       ~~~~~~~~~^~~~~~~~~~~
2019-05-02 11:11:52 +02:00
Rémi Verschelde
8afc9c3938
Merge pull request #21425 from aaronfranke/decimal-functions
Make "decimal" functions more consistent
2019-05-01 08:16:10 +02:00
Rémi Verschelde
7ff0979747
Merge pull request #28544 from neikeq/issue-28540
Fix missing argument for vsnprintf_s
2019-05-01 07:18:31 +02:00
Ignacio Etcheverry
4eedb97802 Fix missing argument for vsnprintf_s 2019-04-30 23:15:25 +02:00
Aaron Franke
620ec4703f
Make "decimal" functions more consistent
In GDScript, rename "decimals" to "step_decimals". In C#, add "StepDecimals", but keep the old functionality in a method called "DecimalCount".
2019-04-30 13:49:17 -04:00
Rémi Verschelde
a7f00f3bac
Merge pull request #28530 from akien-mga/scons-prepend-cpppath
SCons: Always use env.Prepend for CPPPATH
2019-04-30 18:23:38 +02:00
Rémi Verschelde
d52b70fb5e SCons: Always use env.Prepend for CPPPATH
Include paths are processed from left to right, so we use Prepend to
ensure that paths to bundled thirdparty files will have precedence over
system paths (e.g. `/usr/include` should have lowest priority).
2019-04-30 13:12:06 +02:00
Ignacio Etcheverry
470b80cc55 C#: Support resource type hint in exported arrays
- Elements of types like PackedScene will display with the special editor for such type.
2019-04-29 21:20:05 +02:00
Rémi Verschelde
554c0ea90b
Merge pull request #28423 from neikeq/dont-forget-to-think-a-name-for-this-branch
C#: Deprecate accessor methods and generate correct int and float types
2019-04-29 16:56:25 +02:00
Rémi Verschelde
18e88c8563
Merge pull request #18992 from aaronfranke/mono-equal-approx
[Core] [Mono] Improve and use approximate equality methods
2019-04-29 10:16:46 +02:00
Ignacio Etcheverry
3380565e4b C#: Generate the correct integer and floating point types 2019-04-27 01:30:46 +02:00
Ignacio Etcheverry
791e1294c3 Mono: Lazily load scripts metadata file
- Only load the scripts metadata file when it's really needed. This way we avoid false errors, when there is no C# project,  about missing scripts metadata file.
2019-04-26 19:53:44 +02:00
Ignacio Etcheverry
340252727b C#: Mark generated property accessor methods as Obsolete
- Methods that act as accessors for properties in the same class (like `GetPosition` and `SetPosition` are for `Position`) are now marked as obsolete. They will be made private in the future.
2019-04-25 20:34:35 +02:00
Ignacio Etcheverry
c20a3823a2 C# bindings generator cleanup
- Normal log messages are no longer warnings.
- BindingsGenerator is no longer a singleton.
- Added a log function.
2019-04-25 20:34:28 +02:00
Aaron Franke
c577ec6ae4
[Mono] Approximate equality 2019-04-25 13:20:29 -04:00
Ignacio Etcheverry
d93c354807 Fix invalid mono log file name on Windows 2019-04-24 18:52:03 +02:00
Rémi Verschelde
3610b4fd77
Merge pull request #28179 from neikeq/welp
Use StringBuilder in C# bindings generator
2019-04-22 11:52:30 +02:00
Ignacio Roldán Etcheverry
7be498499b
Merge pull request #27820 from ForLoveOfCats/master
Mono: Convert all items to string before printing
2019-04-20 04:12:22 +02:00
ForLoveOfCats
25f563c4c8 Mono: Convert all items to string before printing 2019-04-19 12:59:22 -04:00
Rémi Verschelde
b29df348e2
Merge pull request #28192 from akien-mga/doc-unused-demos
doc: Drop unused <demos> tag, sync classref
2019-04-19 12:50:42 +02:00
Rémi Verschelde
6af69f851a doc: Drop unused <demos> tag 2019-04-19 11:03:46 +02:00
Ignacio Etcheverry
f64aa02933 Use StringBuilder in C# bindings generator
- Also fixed generation of empty summary comments when no comment should have been generated.
2019-04-19 02:11:39 +02:00
Ignacio Roldán Etcheverry
392f1491e1
Merge pull request #28161 from neikeq/exception-hook-no-abort
Mono: Use exit(status) instead of abort() in exception hook
2019-04-18 16:26:54 +02:00
Ignacio Etcheverry
8759c0e31a Mono: Use exit(status) instead of abort() in exception hook 2019-04-18 15:01:50 +02:00
Ignacio Etcheverry
2b9557c920 C#: Add missing ToString() override methods
Godot.Object, Array, Dictionary and RID were missing ToString() override methods
2019-04-18 14:48:13 +02:00
Ignacio Etcheverry
20e5e2fec7 Mono: Logging improvements
- The default log level in debug builds is now 'info' instead of 'debug'.
- Add option to specify a different log level with the 'GODOT_MONO_LOG_LEVEL' environment variable.
- The name of log files is now a readable date and time.
- Always print the log file path (previously it was printed only it in verbose mode).
2019-04-17 23:03:32 +02:00
lupoDharkael
145a45fd3f Fix code completion not working with class_name 2019-04-16 22:27:13 +02:00
Ignacio Roldán Etcheverry
b7cf4c2050
Merge pull request #27950 from Nonnu42/contrib
Fixes #17233 allowing C# to override _GetPropertyList
2019-04-12 16:43:27 +02:00
Nuno Cardoso
d011c8e109 Fixes #17233 allowing C# to override _GetPropertyList 2019-04-12 03:09:03 +01:00
Rémi Verschelde
c8994b56f9 Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0,
so contributors can keep using those versions for now (they will not undo those
changes).
2019-04-09 17:09:48 +02:00
Ignacio Roldán Etcheverry
9ab17b664d
Merge pull request #27809 from neikeq/github-pls
Workaround for syntax highlighting issue in GitHub
2019-04-08 22:13:13 +02:00
Ignacio Etcheverry
7a4cf6339d Workaround for syntax highlighting issue in GitHub 2019-04-08 14:52:01 +02:00
Rémi Verschelde
6a2b8a263e
Merge pull request #26458 from neikeq/mono-build-cleanup
Mono: Add CPPPATH only to env_mono and cleanup build scripts
2019-04-08 12:50:51 +02:00
Rémi Verschelde
918de768a5
Merge pull request #27711 from neikeq/ifdef-clang-tidy
Replace a few #if/#elif with #ifdef and "#elif defined"
2019-04-08 12:24:30 +02:00
Rémi Verschelde
7f3373d79f
Merge pull request #27452 from Chaosus/direction_to
Added method to retrieve a direction vector from one point to another
2019-04-08 12:00:54 +02:00
Rémi Verschelde
d211aff777
Merge pull request #27231 from Chaosus/smoothstep
Added smoothstep built-in function
2019-04-08 10:03:42 +02:00
Ignacio Etcheverry
2873206aa6 Mono: Add compiler flags to env_mono instead of env
This way we avoid possible conflicts with other modules. Specially with include paths.
2019-04-07 19:03:13 +02:00
Ignacio Etcheverry
6bb29eb847 Mono: Reorganize build scripts
All build scripts, other than config.py and SCSub, are now located in the build_scripts subdirectory.
2019-04-07 19:03:09 +02:00
Chaosus
514a3fb96a Added smoothstep built-in function 2019-04-07 14:11:26 +03:00
Hendrikto
49a81308c0 Remove unused imports 2019-04-06 18:05:05 +02:00
Ignacio Etcheverry
2f3328a039 Fix wrong method binds and registered class 2019-04-06 16:12:59 +02:00
Ignacio Etcheverry
480d4c6fba C#: Support type hints for exported Arrays
Added the code for Dictionary as well, but it's not yet supported by the Godot inspector.
2019-04-06 12:14:43 +02:00
Ignacio Etcheverry
187e6ae26d C#: Add marshalling support for IEnumerable and IDictionary
Added constructor that takes IEnumerable for Array and IEnumerable<T> for Array<T>.
Added constructor that takes IDictionary for Dictionary and IDictionary<TKey, TValue> for Dictionary<TKey, TValue>.
2019-04-06 12:14:37 +02:00