summaryrefslogtreecommitdiffstats
path: root/modules/mono/mono_gd/gd_mono_utils.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Redo how instance bindings workreduz2021-07-081-0/+3
| | | | | | | | * The harcoded 8 slots are no more and impose limits in the new extension system. * New system is limitless, although it will impose small performance hit with a mutex. * Use a token to request the instance binding. **Warning**: Mono will most likely break as a result of this, will need to be modified to use the new system.
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-1/+1
|
* Improve & fix Mono buildPedro J. Estébanez2021-06-131-1/+1
| | | | | | - Fix C++ compile errors about pending variable renames after the `Reference` to `RefCount` change. - Fix C# compile errors due to the recent rename of `EnablePlugin()` and `Build()`, which are now underscore-prefixed in bindings. - Additional rename: `godot_icall_Reference_Dtor` to `godot_icall_RefCounted_Dtor`.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-5/+5
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-111-1/+1
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Merge pull request #44106 from neikeq/mono-invoke-no-params-boxingRémi Verschelde2020-12-061-7/+0
|\ | | | | Don't box params on Native->C# calls with Variant params
| * Don't box params on Native->C# calls with Variant paramsIgnacio Etcheverry2020-12-061-7/+0
| | | | | | | | | | | | | | | | | | Godot uses Variant parameters for calls to script methods. Up until now we were boxing such parameters when marshalling them for invokation, even if they were value types. Now Godot allocates the marshalled parameters on the stack, reducing the GC allocations resulted from boxing.
* | Fix unhandled exception re-thrown in the editorIgnacio Etcheverry2020-12-051-0/+1
|/
* Remove empty lines around braces with the formatting scriptAaron Franke2020-11-161-2/+0
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-1/+1
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Mono/C#: Fix several clang-tidy warnings and cleanupIgnacio Etcheverry2020-07-051-18/+17
|
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-1/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-2/+1
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-3/+4
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* C#: Revert marshalling of IDictionary/IEnumerable implementing typesIgnacio Etcheverry2020-04-231-35/+25
| | | | | Added marshalling for `System.Collections.Generic.List<T>` and `System.Collections.Generic.Dictionary<TKey, TValue>`.
* Replace NULL with nullptrlupoDharkael2020-04-021-52/+52
|
* Mono/C#: Add iOS supportIgnacio Etcheverry2020-03-311-0/+5
| | | | | | Right now, games only work on devices when exported with FullAOT+Interpreter. There are some issues left that need to addressed for FullAOT alone. Right now, it's giving issues with the Godot.NativeCalls static constructor.
* Mono/C#: Optimize the way we store GC handles for scriptsIgnacio Etcheverry2020-03-171-4/+19
| | | | Don't store GC handles for C# script instances and instance bindings as 'Ref<MonoGCHandle>'; store the raw data instead. Initially this was not possible as we needed to store a Variant, but this had not been the case for a looong time yet the stored type was never updated.
* Fix C# bindings after recent breaking changesIgnacio Etcheverry2020-03-171-4/+30
| | | | | | | | | | | | | Implementation for new Variant types Callable, Signal, StringName. Added support for PackedInt64Array and PackedFloat64Array. Add generation of signal members as events, as well as support for user created signals as events. NOTE: As of now, raising such events will not emit the signal. As such, one must use `EmitSignal` instead of raising the event directly. Removed old ThreadLocal fallback class. It's safe to use thread_local now since it's supported on all minimum versions of compilers we support.
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | EngineDebugger is the new interface to access the debugger. It tries to be as agnostic as possible on the data that various subsystems can expose. It allows 2 types of interactions: - Profilers: A subsystem can register a profiler, assigning it a unique name. That name can be used to activate the profiler or add data to it. The registered profiler can be composed of up to 3 functions: - Toggle: called when the profiler is activated/deactivated. - Add: called whenever data is added to the debugger (via `EngineDebugger::profiler_add_frame_data`) - Tick: called every frame (during idle), receives frame times. - Captures: (Only relevant in remote debugger for now) A subsystem can register a capture, assigning it a unique name. When receiving a message, the remote debugger will check if it starts with `[prefix]:` and call the associated capture with name `prefix`. Port MultiplayerAPI, Servers, Scripts, Visual, Performance to the new profiler system. Port SceneDebugger and RemoteDebugger to the new capture system. The LocalDebugger also uses the new profiler system for scripts profiling.
* Threaded networking for editor debugger.Fabio Alessandrelli2020-03-081-1/+1
|
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-261-2/+2
| | | | | | | | | | | | | | | | Main: - It's now implemented thanks to `<mutex>`. No more platform-specific implementations. - `BinaryMutex` (non-recursive) is added, as an alternative for special cases. - Doesn't need allocation/deallocation anymore. It can live in the stack and be part of other classes. - Because of that, it's methods are now `const` and the inner mutex is `mutable` so it can be easily used in `const` contexts. - A no-op implementation is provided if `NO_THREADS` is defined. No more need to add `#ifdef NO_THREADS` just for this. - `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`. - Thread-safe utilities are therefore simpler now. Misc.: - `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same. - Every case of lock, do-something, unlock is replaced by `MutexLock` (complex cases where it's not straightfoward are kept as as explicit lock and unlock). - `ShaderRD` contained an `std::mutex`, which has been replaced by `Mutex`.
* Huge Debugger/EditorDebugger refactor.Fabio Alessandrelli2020-02-211-1/+1
|
* Remove duplicate ERR_PRINT macro.Marcel Admiraal2020-02-051-2/+2
|
* Mono/C#: Script interface calls now attach the current threadIgnacio Etcheverry2020-01-161-4/+31
| | | | | | | | | Added guards to all C# script interface calls to attach the current thread for the current scope if the thread is not already attached. This is far from ideal, as attaching the thread is not cheap and all managed thread local storage is lost when we detach the thread at the end of the calls. However, it's the best we can do for now to avoid crashing when an unattached thread tries to interact with C# code.
* Mono/C#: Add error checks to detect possible Reference leaksIgnacio Etcheverry2020-01-131-0/+1
|
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Mono/C#: WebAssembly supportIgnacio Etcheverry2019-11-131-294/+21
|
* C#: Fix detection of outdated release Godot API assembliesIgnacio Etcheverry2019-10-111-0/+2
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'modules/mono'Ignacio Etcheverry2019-08-091-12/+8
| | | | | | And 'CRASH_*_MSG' as well. Also make error messages puntuation and quotation more consistent.
* Mono: Add option to keep running after unhandled exceptionsIgnacio Etcheverry2019-07-241-5/+12
| | | | | By default, an unhandled exception will cause the application to be terminated; but the project setting `mono/unhandled_exception_policy` was added to change this behaviour. The editor is hard-coded to never terminate because of unhandled exceptions, as that would make writing editor plugins a painful task, and we cannot kill the editor because of a mistake in a thirdparty plugin.
* Re-write mono module editor code in C#Ignacio Etcheverry2019-07-051-47/+67
| | | | | | | | 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.
* Android build and export for the mono moduleIgnacio Etcheverry2019-06-031-16/+10
|
* Merge pull request #29079 from neikeq/oopsieIgnacio Roldán Etcheverry2019-05-211-4/+24
|\ | | | | Fix C# build error in MarshalUtils debug code
| * Fix C# build error in MarshalUtils debug codeIgnacio Etcheverry2019-05-211-4/+24
| |
* | Replace call to 'mono_runtime_object_init' with manual ctor invokingIgnacio Etcheverry2019-05-211-9/+8
|/
* C#: Marshalling support for IEnumerable<> and IDictionary<,>Ignacio Etcheverry2019-05-181-2/+126
| | | | Also fixed the hint string of exported members.
* Mono: Use exit(status) instead of abort() in exception hookIgnacio Etcheverry2019-04-181-5/+0
|
* C#: Support type hints for exported ArraysIgnacio Etcheverry2019-04-061-0/+4
| | | | Added the code for Dictionary as well, but it's not yet supported by the Godot inspector.
* C#: Add marshalling support for IEnumerable and IDictionaryIgnacio Etcheverry2019-04-061-5/+18
| | | | | 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>.
* C#: Add 'Singleton' property to singleton wrapper classIgnacio Etcheverry2019-02-191-0/+5
| | | | | | This property returns an instance of the singleton. The purpose of this is to allow using methods from the base class like 'Connect'. Since all Godot singletons inherit Object, the type of the returned instance is Godot.Object.
* Use script instance binding for objects constructed from C#Ignacio Etcheverry2019-02-091-6/+9
| | | | | | | Only possible if the object class is a "native type". If the object class is a user class (that derives a "native type") then a script is needed. Since CSharpLanguage does cleanup of script instance bindings when finished, cases like #25621 will no longer cause problems. Fixed ~Object() trying to free script instance bindings after the language has already been removed, which would result in a NULL dereference.
* Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry2019-02-031-35/+44
| | | | | | | Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner). It's now safe to replace the script instance without leaking or crashing. Also fixed godot_icall_Object_weakref return reference being freed before returning.
* Mono: CleanupIgnacio Etcheverry2019-02-031-4/+4
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* C#: Improve tool script support and fix reloading issuesIgnacio Etcheverry2018-11-301-0/+4
|
* Improve the C# API projects generationIgnacio Etcheverry2018-11-081-10/+10
| | | | | | - 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>'
* Rename slave keyword to puppetFabio Alessandrelli2018-09-151-2/+4
| | | | | The slave keyword will still be available as deprecated in 3.1 but will be dropped from future releases.
* C#: Fix explicit enum values when exporting memberIgnacio Etcheverry2018-09-121-0/+29
|