summaryrefslogtreecommitdiffstats
path: root/modules/visual_script/visual_script_nodes.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace most uses of Map by HashMapreduz2022-05-161-1/+1
| | | | | | | | | | | | * 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!
* Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`Rémi Verschelde2022-05-021-38/+34
| | | | | | | | | | | Didn't commit all the changes where it wants to initialize a struct with `{}`. Should be reviewed in a separate PR. Option `IgnoreArrays` enabled for now to be conservative, can be disabled to see if it proposes more useful changes. Also fixed manually a handful of other missing initializations / moved some from constructors.
* Fix some issues found by cppcheck.bruvzg2022-04-061-52/+52
|
* Use `RTR()` for VisualScriptNode captions and textsHaoyu Qiu2022-03-111-26/+26
|
* Remove VARIANT_ARG* macrosreduz2022-03-091-1/+1
| | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* Fix VisualScript crash when using Set Index nodeHaoyu Qiu2022-02-161-4/+1
|
* Refactor some object type checking code with `cast_to`Rémi Verschelde2022-02-081-5/+5
| | | | Less stringly typed logic, and less String allocations and comparisons.
* i18n: Make VisualScript node caption & text translatableHaoyu Qiu2022-01-111-26/+26
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-8/+8
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* Rename `remove()` to `remove_at()` when removing by indexLightning_A2021-11-231-3/+3
|
* Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-3/+3
| | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-5/+5
| | | | | | | | | | | Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
* [Net] Rename RPC "puppet" to "auth" (authority). Drop "master".Fabio Alessandrelli2021-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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.
* Fix misspelled "overriden"Haoyu Qiu2021-08-261-1/+1
| | | | In recent GDVIRTUAL PR and SkeletonModification3DJiggle doc.
* Replace BIND_VMETHOD by new GDVIRTUAL syntaxreduz2021-08-221-70/+94
| | | | | | | | | | | * New syntax is type safe. * New syntax allows for type safe virtuals in native extensions. * New syntax permits extremely fast calling. Note: Everything was replaced where possible except for `_gui_input` `_input` and `_unhandled_input`. These will require API rework on a separate PR as they work different than the rest of the functions. Added a new method flag METHOD_FLAG_OBJECT_CORE, used internally. Allows to not dump the core virtuals like `_notification` to the json API, since each language will implement those as it is best fits.
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-10/+10
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-28/+26
|
* Merge pull request #48972 from ↵Rémi Verschelde2021-07-211-0/+32
|\ | | | | | | DavidCambre/Expose_VisualScriptCustomNode_TypeHints_m
| * expose type hints for VisualScriptCustomNodeDavid Cambré2021-07-211-0/+32
| | | | | | | | Co-Authored-By: Rémi Verschelde <rverschelde@gmail.com>
* | Use the standard C `INFINITY` and `NAN` constants directlyHugo Locurcio2021-07-211-2/+2
| | | | | | | | | | | | | | The `Math_INF` and `Math_NAN` defines were just aliases for those constants, so we might as well use them directly. Some portions of the code were already using `INFINITY` directly.
* | Merge pull request #50566 from reduz/optimize-stringname-usageRémi Verschelde2021-07-191-1/+1
|\ \ | | | | | | Optimize StringName usage
| * | Optimize StringName usagereduz2021-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
* | | Prevents some warnings from appearing in visual scriptsYuri Roubinsky2021-07-181-1/+4
|/ /
* | Use PROPERTY_USAGE_NONE instead of 0 for no property usageAaron Franke2021-07-011-2/+2
| | | | | | | | Also use const more often.
* | Fixes Visual script nodes operator mismatch issue #49943Dipal M Zambare2021-06-291-36/+68
| |
* | Fix logic operators mislabeled #49412Martin2021-06-231-33/+63
| |
* | Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-30/+30
| |
* | Rename Quat to QuaternionMarcel Admiraal2021-06-041-1/+1
| |
* | Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-1/+1
|/ | | Also _transform to _transform3d
* Improve resource load cachereduz2021-02-111-0/+15
| | | | | | -Added a new method in Resource: reset_state , used for reloading the same resource from disk -Added a new cache mode "replace" in ResourceLoader, which reuses existing loaded sub-resources but resets their data from disk (or replaces them if they chaged type) -Because the correct sub-resource paths are always loaded now, this fixes bugs with subresource folding or subresource ordering when saving.
* Removed _change_notifyreduz2021-02-101-23/+23
| | | | | | -For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
* 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 🎆
* Refactored variant constructor logicreduz2020-11-091-3/+3
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-7/+7
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Refactored Variant Operators.reduz2020-11-061-3/+0
| | | | | -Using classes to call and a table -For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
* added temp variable because *p_inputs[2] is the same as *p_outputs[0]Jacob Edie2020-10-061-1/+3
|
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-26/+26
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-70/+134
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+67
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-422/+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.
* Rename InputFilter back to InputRémi Verschelde2020-04-281-5/+5
| | | | | | | | | | | | | | | | It changed name as part of the DisplayServer and input refactoring in #37317, with the rationale that input no longer goes through the main loop, so the previous Input singleton now only does filtering. But the gains in consistency are quite limited in the renaming, and it breaks compatibility for all scripts and tutorials that access the Input singleton via the scripting language. A temporary option was suggested to keep the scripting singleton named `Input` even if its type is `InputFilter`, but that adds inconsistency and breaks C#. Fixes godotengine/godot-proposals#639. Fixes #37319. Fixes #37690.
* Deconstruct VSNodes for new Variant typesSwarnim Arun2020-04-021-0/+3
|
* Replace NULL with nullptrlupoDharkael2020-04-021-4/+4
|
* Refactored input, goes all via windows now.Juan Linietsky2020-03-261-5/+5
| | | | Also renamed Input to InputFilter because all it does is filter events.
* Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky2020-03-261-1/+1
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Signals: Port connect calls to use callable_mpRémi Verschelde2020-02-281-3/+1
| | | | | | | | | Remove now unnecessary bindings of signal callbacks in the public API. There might be some false positives that need rebinding if they were meant to be public. No regular expressions were harmed in the making of this commit. (Nah, just kidding.)
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-49/+49
| | | | objects and made them default.