summaryrefslogtreecommitdiff
path: root/modules/mono/mono_gd
AgeCommit message (Collapse)Author
2022-06-03Support explicit values in flag properties, add C# flags supportRaul Santos
- Add support for explicit values in properties using `PROPERTY_HINT_FLAGS` that works the same way it does for enums. - Fix enums and flags in VisualScriptEditor (it wasn't considering the explicit value). - Use `PROPERTY_HINT_FLAGS` for C# enums with the FlagsAttribute instead of `PROPERTY_HINT_ENUM`.
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-12Add a new HashMap implementationreduz
Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
2022-04-29Rename Basis "elements" to "rows"Aaron Franke
2022-04-29Rename Transform2D "elements" to "columns"Aaron Franke
2022-04-12Narrow FileAccess scope to prevent deadlocks.bruvzg
2022-04-11Make FileAccess and DirAccess classes reference counted.bruvzg
2022-04-04Zero initialize all pointer class and struct membersRémi Verschelde
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
2022-03-31Fix typos with codespellRémi Verschelde
Using codespell 2.2-dev from current git. Fix a couple incorrect uses of gendered pronouns.
2022-03-11Convert uses of `DirAccess *` to `DirAccessRef` to prevent memleaksRémi Verschelde
`DirAccess *` needs to be deleted manually, and this is often forgotten especially when doing early returns with `ERR_FAIL_COND`. `DirAccessRef` is deleted automatically when it goes out of scope. Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-02-16Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde
Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
2022-02-12Use EditorFileDialog instead of FileDialog in the project managerHendrik Brucker
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-12-04Fix get_all_delegates method for generic classesRaul Santos
If the class is generic, we must get its generic type definition and use it to retrieve the delegates.
2021-11-30Don't return reference on copy assignment operatorsRémi Verschelde
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this can lead to confusing code and subtle bugs. According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++ allows any arbitrary return type, so this is standard compliant. This could be re-assessed if/when we have an actual need for a behavior more akin to that of the C++ STL, for now this PR simply changes a handful of cases which were inconsistent with the rest of the codebase (`void` return type was already the most common case prior to this commit).
2021-11-10Move Mono unhandled exception setting to be located within a subsectionHugo Locurcio
Settings that aren't within a subsection are difficult to reach when other settings do have a subsection. This also adds documentation for the project setting.
2021-10-28clang-format: Enable `BreakBeforeTernaryOperators`Rémi Verschelde
clang-format keeps breaking the way it handles break *after* ternary operators, so I give up and go with the only style they seem to actually test.
2021-10-28clang-format: Disable alignment of operands, too unreliableRémi Verschelde
Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
2021-10-20Mono: Fix build after #52940Rémi Verschelde
Chose to pass unhandled exceptions to the toaster, we might want to reconsider if those are already reported somewhere else (e.g. in the Mono panel).
2021-10-19C#: Fix property set call boxing value when unboxed was expectedIgnacio Roldán Etcheverry
2021-10-18Fix marshaling generic Godot.Object in C#Raul Santos
2021-10-15Fix hint_string for C# enum arraysRaul Santos
2021-10-15Merge pull request #53627 from raulsntos/fix-list-marshalRémi Verschelde
2021-10-15Merge pull request #53581 from raulsntos/mono-marshal-genericsRémi Verschelde
2021-10-10Fix C# List<T> marshallingRaul Santos
2021-10-08Support marshaling generic Godot.ObjectRaul Santos
Allows using generic C# types in signals as long as they inherit from `Godot.Object`.
2021-10-08Support arrays of StringName, NodePath and RID in monoRaul Santos
2021-10-01[Net] Rename RPC constants and annotation arguments.Fabio Alessandrelli
any -> any_peer sync -> call_local ordered -> unreliable_ordered Multiplayer.RPC_MODE_ANY -> RPC_MODE_ANY_PEER Multiplayer.TRANSFER_MODE_ORDERED -> TRANSFER_MODE_UNRELIABLE_ORDERED
2021-09-28Update C# RPC attributes to share new Any/Auth naming conventionEdward Auttonberry
Update attribute class references in mono cache
2021-08-30[Net] Rename RPC "puppet" to "auth" (authority). Drop "master".Fabio Alessandrelli
This commit completely removes the RPC_MODE_MASTER ("master" keyword), and renames the RPC_MODE_PUPPET to RPC_MODE_AUTHORITY ("auth" keyword). This commit also renames the "Node.[get|set]_network_master" methods to "Node.[get|set]_network_authority". This commit also renames the RPC_MODE_REMOTE constant to RPC_MODE_ANY. RPC_MODE_MASTER in Godot 3.x meant that a given RPC would be callable by any puppet peer on the master, while RPC_MODE_PUPPET meant that it would be callable by the master on any puppet. Beside proving to be very confusing to the user (referring to where it could be called instead of who can call it) the RPC_MODE_MASTER is quite useless. It is almost the same as RPC_MODE_REMOTE (anyone can call) with the exception that the network master cannot. While this could be useful to check in some case, in such a function you would anyway need to check in code who is the caller via get_rpc_sender_id(), so adding the check there for those rare cases does not warrants a dedicated mode.
2021-08-24Merge pull request #47295 from omegachysis/script-bind-mutexIgnacio Roldán Etcheverry
Fix race condition on `script_binding` in C#
2021-08-20C#: Fix bindings generator for Callable argument default valueIgnacio Roldán Etcheverry
Previously there weren't any Callable arguments with a default value, but d4dd859991205e6cecfa9a0553b89db47c983d0b introduced one.
2021-08-17Namespaces instead of underscore prefix for bindsMax Hilbrunner
Thanks to neikeq for the initial work. Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-16Fix C# native instance bindings after recent re-writeIgnacio Roldán Etcheverry
This was needed after: 44691448911f1d29d4d79dbdd5553734761e57c4
2021-07-27Use C++ iterators in the Mono moduleRaul Santos
2021-07-25Use const references where possible for List range iteratorsRémi Verschelde
2021-07-23Use C++ iterators for Lists in many situationsAaron Franke
2021-07-20[Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli
- Move the "sync" property for RPCs to RPCConfig. - Unify GDScript annotations into a single one: - `@rpc(master)` # default - `@rpc(puppet)` - `@rpc(any)` # former `@remote` - Implement three additional `@rpc` options: - The second parameter is the "sync" option (which also calls the function locally when RPCing). One of "sync", "nosync". - The third parameter is the transfer mode (reliable, unreliable, ordered). - The third parameter is the channel (unused for now).
2021-07-08Redo how instance bindings workreduz
* 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.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-06-13Improve & fix Mono buildPedro J. Estébanez
- 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`.
2021-06-12Merge pull request #49123 from aaronfranke/it-is-timeRémi Verschelde
Add a Time singleton
2021-06-11Rename Reference to RefCountedPedro J. Estébanez
2021-06-11Add Time singletonAaron Franke
2021-06-11Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde
File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
2021-06-04Rename Quat to QuaternionMarcel Admiraal
2021-06-03Rename Variant TRANSFORM to TRANSFORM3DAaron Franke
Also _transform to _transform3d
2021-06-03Rename Transform to Transform3D in coreAaron Franke
2021-04-29Replace remaining uses of `NULL` with `nullptr`Rémi Verschelde
Follow-up to #38736 (these uses were likely added after this PR was merged).
2021-04-26Remove uses of `auto` for better readability and online code reviewsHugo Locurcio
The current code style guidelines forbid the use of `auto`. Some uses of `auto` are still present, such as in UWP code (which can't be currently tested) and macros (where removing `auto` isn't easy).