summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rename String::is_rel_path to String::is_relative_pathWilson E. Alvarez2021-08-291-4/+4
|
* Remove underscore hacksMax Hilbrunner2021-08-171-7/+2
| | | | | | Way less cruft. :) Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
* Use Ref<T> references as iterators where relevantRémi Verschelde2021-07-261-14/+14
| | | | And const when possible.
* Fix instantiate line classJulien Nguyen2021-07-251-4/+4
|
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-6/+5
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-31/+30
|
* 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.
* [Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli2021-07-201-9/+5
| | | | | | | | | | | | | | | | - 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).
* [Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli2021-07-121-1/+1
|
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-8/+8
|
* Fix slow load/save of scenes with many instances of the same scriptPedro J. Estébanez2021-06-131-5/+9
|
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-10/+10
|
* Merge pull request #49511 from akien-mga/core-diraccess-fileaccess-ioRémi Verschelde2021-06-111-1/+1
|\ | | | | Core: Move DirAccess and FileAccess to `core/io`
| * 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.
* | Merge pull request #49279 from Calinou/rename-string-is-abs-path-methodRémi Verschelde2021-06-111-1/+1
|\ \ | |/ |/| Rename `String.is_abs_path()` to `String.is_absolute_path()`
| * Rename `String.is_abs_path()` to `String.is_absolute_path()`Hugo Locurcio2021-06-031-1/+1
| | | | | | | | This is more consistent with `NodePath.is_absolute()`.
* | [Net] Refactor RPCs, remove RSETsFabio Alessandrelli2021-06-011-113/+8
|/ | | | | | | | | | 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.
* Rename File::get_len() get_length()Marcel Admiraal2021-05-251-1/+1
|
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD 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 ```
* 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-051-0/+13
| | | | This makes them easier to distinguish from other keywords.
* Add runner for GDScript testingGeorge Marques2021-04-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is meant for testing the GDScript implementation, not for testing user scripts nor testing the engine using scripts. Tests consists in a GDScript file and a .out file with the expected output. The .out file format is: expected status (based on the enum GDScriptTest::TestStatus) on the first line, followed by either an error message or the resulting output. Warnings are added after the first line, before the output (or compiler errors) if the parser pass without any error. The test script must have a function called `test()` which takes no argument. Such function will be called by the test runner. The test should not have any dependency unless it's part of the test too. Global classes (using `class_name`) are registered before the runner starts, so those should work if needed. Use the command `godot --gdscript-generate-tests godot-source/modules/gdscript/tests/scripts` to update the .out files with the current output (make sure the output are the expected values before committing). The tests themselves are part of the doctest suite so those can be executed with `godot --test`. Co-authored-by: Andrii Doroshenko (Xrayez) <xrayez@gmail.com>
* Style: Apply clang-tidy's `modernize-use-nullptr`Rémi Verschelde2021-04-051-1/+1
|
* Merge pull request #46991 from madmiraal/rename-invert-reverseRémi Verschelde2021-04-011-2/+2
|\ | | | | Rename Array.invert() to Array.reverse()
| * Rename Array.invert() to Array.reverse()Marcel Admiraal2021-03-211-2/+2
| | | | | | | | | | Does the same internally for List and Vector<>, which includes all PackedArray types.
* | Add typed arrays to GDScriptGeorge Marques2021-03-291-13/+21
|/ | | | | | | | - Use `Array[type]` for type-hints. e.g.: `var array: Array[int] = [1, 2, 3]` - Array literals are typed if their storage is typed (variable asssignment of as argument in function all). Otherwise they are untyped.
* Improve resource load cachereduz2021-02-111-1/+1
| | | | | | -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-12/+1
|
* 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 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-10/+10
|
* Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-2/+5
|\ | | | | GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-2/+5
| | | | | | | | | | | | | | | | | | | | | | They are now called "utility functions" to avoid confusion with methods of builtin types, and be consistent with the naming in Variant. Core utility functions are now available in GDScript. The ones missing in core are added specifically to GDScript as helpers for convenience. Some functions were remove when there are better ways to do, reducing redundancy and cleaning up the global scope.
* | Merge pull request #41095 from ThakeeNathees/GDScript-DocumentationRémi Verschelde2020-12-021-9/+238
|\ \ | | | | | | GDScript(2.0) Documentation generation system
| * | Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-16/+4
| | |
| * | Documentation generation for GDScriptThakee Nathees2020-11-291-9/+250
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* / Implement proper error print, Fixes a crash when no error messages are ↵AndreaCatania2020-11-281-2/+6
|/ | | | generated by the analyser.
* Refactored variant constructor logicreduz2020-11-091-1/+2
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-5/+5
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Merge pull request #41829 from RandomShaper/fix_40353Rémi Verschelde2020-10-011-2/+6
|\ | | | | Avoid warning about harmless unfulfilled yields
| * Avoid warning about harmless unfulfilled yieldsPedro J. Estébanez2020-09-061-2/+6
| |
* | Avoid infinite loop in GDScript at shutdownPedro J. Estébanez2020-09-261-2/+12
| |
* | Ensure cyclic dependencies between scripts are broken at exitPedro J. Estébanez2020-09-101-2/+20
|/
* GDScript: Use pointer instead of references in cacheGeorge Marques2020-08-231-3/+1
| | | | | They are not supposed to be kept alive and this is cleaner and less error-prone than unreferencing the elements.
* GDScript: Add script to cache on reloadGeorge Marques2020-08-181-0/+15
| | | | | | This ensures that scripts created without a resource loader are properly included in the cache (such as builtin scripts) and are not tried to be loaded from the disk.
* Remove multilevel callsGeorge Marques2020-07-241-33/+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.
* Wrap up GDScript 2.0 base implementationGeorge Marques2020-07-221-20/+15
|
* Reintroduce code completionGeorge Marques2020-07-201-1/+1
|
* Add warning checks in GDScript analyzerGeorge Marques2020-07-201-12/+11
| | | | Reenable checking those when validating code.
* Add GDScript cache singletonGeorge Marques2020-07-201-0/+3
|
* New GDScript tokenizer and parserGeorge Marques2020-07-201-310/+147
| | | | | | | | | | Sometimes to fix something you have to break it first. This get GDScript mostly working with the new tokenizer and parser but a lot of things isn't working yet. It compiles and it's usable, and that should be enough for now. Don't worry: other huge commits will come after this.