summaryrefslogtreecommitdiffstats
path: root/modules/gdnative/pluginscript
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused GDNative codeRémi Verschelde2022-03-0911-1815/+0
| | | | | | | | | This has been superseded by GDExtension so this code is no longer useful nor usable. There's still some GDNative-related stuff in platform export code which needs to be adapted for GDExtension (e.g. to include GDExtension libraries in exports).
* Refactor some object type checking code with `cast_to`Rémi Verschelde2022-02-081-1/+1
| | | | Less stringly typed logic, and less String allocations and comparisons.
* Update copyright statements to 2022Rémi Verschelde2022-01-0310-20/+20
| | | | Happy new year to the wonderful Godot community!
* Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-092-7/+6
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* clang-format: Various fixes to comments alignment from `clang-format` 13Rémi Verschelde2021-10-281-7/+0
| | | | All reviewed manually and occasionally rewritten to avoid bad auto formatting.
* Remove unimplemented methodsMarcel Admiraal2021-10-211-2/+0
|
* [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-074-8/+8
| | | | | | | | | | | 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".
* Implement inherits_script() for NativeScript and PluginScriptPedro J. Estébanez2021-08-021-3/+14
|
* Implement the ability to disable classesreduz2021-07-131-1/+1
| | | | | | | * This PR adds the ability to disable classes when building. * For now it's only possible to do this via command like: `scons disable_classes=RayCast2D,Area3D` * Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-192-10/+10
|
* Added support for scripts reporting multiple errors to ScriptTextEditorEric M2021-06-192-6/+15
| | | | Scripts can now report multiple errors to the scripting editors in the engine. UI elements were added to support multiple errors.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-2/+2
|
* Core: Move DirAccess and FileAccess to `core/io`Rémi Verschelde2021-06-114-4/+4
| | | | | File handling APIs are typically considered part of I/O, and we did have most `FileAccess` implementations in `core/io` already.
* [Net] Refactor RPCs, remove RSETsFabio Alessandrelli2021-06-014-146/+10
| | | | | | | | | | In this PR: - Removed rset - rpc_config can now optionally configure transfer mode (reliable/unreliable/ordered) and channel (channels are not actually implemented yet.) - Refactor how the RPC id is computed to minimize the logic in Node and scripts that now only needs a single `get_rpc_methods` function.
* Check for _language in PluginScript.instance_hasPaweł Fertyk2021-05-301-0/+2
|
* Rename File::get_len() get_length()Marcel Admiraal2021-05-251-1/+1
|
* Make all file access 64-bit (uint64_t)Pedro J. Estébanez2021-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the types of a big number of variables. General rules: - Using `uint64_t` in general. We also considered `int64_t` but eventually settled on keeping it unsigned, which is also closer to what one would expect with `size_t`/`off_t`. - We only keep `int64_t` for `seek_end` (takes a negative offset from the end) and for the `Variant` bindings, since `Variant::INT` is `int64_t`. This means we only need to guard against passing negative values in `core_bind.cpp`. - Using `uint32_t` integers for concepts not needing such a huge range, like pages, blocks, etc. In addition: - Improve usage of integer types in some related places; namely, `DirAccess`, core binds. Note: - On Windows, `_ftelli64` reports invalid values when using 32-bit MinGW with version < 8.0. This was an upstream bug fixed in 8.0. It breaks support for big files on 32-bit Windows builds made with that toolchain. We might add a workaround. Fixes #44363. Fixes godotengine/godot-proposals#400. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Highlight control flow keywords with a different colorHugo Locurcio2021-05-052-0/+5
| | | | This makes them easier to distinguish from other keywords.
* Add support for _to_string virtual function overwrite in PluginscriptEmmanuel Leblond2021-03-272-0/+8
|
* Improve resource load cachereduz2021-02-112-2/+2
| | | | | | -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.
* Initialize class/struct variables with default values in modules/Rafał Mikrut2021-02-081-3/+3
|
* Update copyright statements to 2021Rémi Verschelde2021-01-0110-20/+20
| | | | | | | | | | | | | | 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 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-1/+1
|
* Merge pull request #44190 from ↵Rémi Verschelde2020-12-082-2/+2
|\ | | | | | | | | touilleMan/constify-ScriptLanguage.can_inherit_from_file Constify ScriptLanguage.can_inherit_from_file
| * Constify ScriptLanguage.can_inherit_from_fileEmmanuel Leblond2020-12-082-2/+2
| |
* | Merge pull request #44176 from touilleMan/global_class_naming-for-pluginscriptRémi Verschelde2020-12-084-0/+41
|\ \ | |/ |/| Add PluginScript support for global class naming/icon path
| * Add PluginScript support for global class naming/icon pathEmmanuel Leblond2020-12-084-0/+41
| |
* | Allow PluginScript to customize language's can_inherit_from_file attributeEmmanuel Leblond2020-12-082-1/+5
|/
* Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-0/+2
|
* Documentation generation for GDScriptThakee Nathees2020-11-291-0/+7
| | | | | | | | | | | | | | | | | | - ClassDoc added to GDScript and property reflection data were extracted from parse tree - GDScript comments are collected from tokenizer for documentation and applied to the ClassDoc by the GDScript compiler - private docs were excluded (name with underscore prefix and doesn't have any doc comments) - default values (of non exported vars), arguments are extraced from the parser - Integrated with GDScript 2.0 and new enums were added. - merge conflicts fixed
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-077-9/+9
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Remove multilevel callsGeorge Marques2020-07-241-6/+0
| | | | | | In general they are more confusing to users because they expect inheritance to fully override parent methods. This behavior can be enabled by script writers using a simple super() call.
* Add override keywords.Marcel Admiraal2020-07-101-33/+33
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-142-15/+27
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-144-10/+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-142-10/+5
| | | | | | | | | | 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.
* Add ability to bind typed arrays to script APIJuan Linietsky2020-04-212-0/+9
| | | | | | | Note: Only replaced 2 instances to test, Node.get_children and TileMap.get_used_cells Note: Will do a mass replace on later PRs of whathever I can find, but probably need a tool to grep through doc. Warning: Mono will break, needs to be fixed (and so do TypeScript and NativeScript, need to ask respective maintainers)
* Exposed RenderingDevice to script APIJuan Linietsky2020-04-202-2/+2
| | | | | | | | | | | | | Also added an easier way to load native GLSL shaders. Extras: Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload. Note: The precommit hooks are broken because they don't seem to support enums from one class being used in another. Feel free to fix this after merging this PR.
* Replace NULL with nullptrlupoDharkael2020-04-026-21/+21
|
* SCons: Format buildsystem files with psf/blackRémi Verschelde2020-03-301-3/+3
| | | | | | | | | | | | | | | | | | | | | Configured for a max line length of 120 characters. psf/black is very opinionated and purposely doesn't leave much room for configuration. The output is mostly OK so that should be fine for us, but some things worth noting: - Manually wrapped strings will be reflowed, so by using a line length of 120 for the sake of preserving readability for our long command calls, it also means that some manually wrapped strings are back on the same line and should be manually merged again. - Code generators using string concatenation extensively look awful, since black puts each operand on a single line. We need to refactor these generators to use more pythonic string formatting, for which many options are available (`%`, `format` or f-strings). - CI checks and a pre-commit hook will be added to ensure that future buildsystem changes are well-formatted.
* Adding missing include guards to header files identified by LGTM.Rajat Goswami2020-03-231-0/+5
| | | | This addresses the issue godotengine/godot#37143
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-172-2/+2
| | | | | | | | | | 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`.
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Removed interactive loader, added proper thread loading.Juan Linietsky2020-02-282-2/+2
|
* Reimplement Mutex with C++'s <mutex>Pedro J. Estébanez2020-02-262-24/+3
| | | | | | | | | | | | | | | | 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`.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-204-12/+12
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-183-15/+15
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Optmized data sent during RPC and RSet calls.Andrea Catania2020-02-124-23/+140
| | | | | | | | | | - Now is sent the method ID rather the full function name. - The passed IDs (Node and Method) are compressed so to use less possible space. - The variant (INT and BOOL) is now encoded and compressed so to use much less data. - Optimized RPCMode retrieval for GDScript functions. - Added checksum to assert the methods are the same across peers. This work has been kindly sponsored by IMVU.
* Use StringName in pluginscript's set/get_prop and add_global_constantEmmanuel Leblond2020-02-012-6/+3
|
* Remove unused #if 0'ed codeRémi Verschelde2020-01-212-53/+10
|