summaryrefslogtreecommitdiffstats
path: root/core/io/marshalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@cb411fa960f0b7fdbd97dcdb4c90f9346360ee0eSpartan3222024-11-121-144/+261
|\
| * Core: Add typed dictionary support for binary serializationDanil Alexeev2024-11-121-144/+261
| |
* | Merge commit godotengine/godot@c6c464cf9ae56e8b68620af65125dd980d0e8122Spartan3222024-11-021-4/+4
|\|
| * [Core] Improve error messages with `vformat`A Thousand Ships2024-10-301-4/+4
| |
* | Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
| |
* | Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* [Core] Fix TypedArray encoding when full objects is disabledFabio Alessandrelli2024-07-181-5/+13
|
* Use Core/Scene stringnames consistentlykobewi2024-05-131-1/+0
|
* Add shorthand for using singleton string nameskobewi2024-05-111-1/+1
|
* Add PackedVector4Array Variant typeK. S. Ernest (iFire) Lee2024-05-031-0/+94
| | | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Core: Fix binary serialization of objects in typed arraysDanil Alexeev2024-04-161-13/+16
| | | | | | * Allow typed arrays to be encoded even if `p_full_objects` is `false`. * Use `Array[EncodedObjectAsID]` instead of the encoded element type when decoding an array if `p_allow_objects` is `false`.
* Core: Fix `RefCounted` handling in `marshalls.cpp`Danil Alexeev2024-04-151-8/+12
|
* [Core] Add iteration support to `Array`A Thousand Ships2024-04-101-2/+2
|
* [IO] Fix marshall decoding when script is NILFabio Alessandrelli2024-04-071-1/+1
| | | | | | | We changed how scripts are binary serialized, and added a check to ensure the new format is enforced, but there is still a case where the old format (plain "prop"-"value" combo) is used, and that is when the script is NIL.
* Core: Add typed array support for binary serializationDanil Alexeev2024-03-201-43/+169
|
* Prevent encoding/decoding objects that cannot be instantiatedA Thousand Ships2023-12-181-0/+4
|
* Prevent `encode_variant` doing `memcpy` from `nullptr`A Thousand Ships2023-10-291-2/+4
|
* Apply missing flag to vector4/projectionThaddeus Crews2023-10-121-0/+2
|
* [Core] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicableA Thousand Ships2023-09-111-2/+2
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix usages of mesh simplification functions in float=64 buildsMarc Gilleron2022-11-121-0/+21
|
* Rename Projection `matrix` to `columns`Aaron Franke2022-10-041-3/+3
|
* Fix a minor bug in the Projection binary decode logicAaron Franke2022-09-011-1/+1
|
* Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+104
| | | | | | | | | | | | | Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
* Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows ↵bruvzg2022-07-071-1/+1
| | | | filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose.
* Add serialization for RID and SignalMinusKube2022-06-301-7/+38
|
* Merge pull request #60627 from aaronfranke/rename-elementsRémi Verschelde2022-05-031-9/+9
|\ | | | | Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
| * Rename Basis "elements" to "rows"Aaron Franke2022-04-291-6/+6
| |
| * Rename Transform2D "elements" to "columns"Aaron Franke2022-04-291-3/+3
| |
* | Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`Hugo Locurcio2022-05-031-1/+1
|/ | | | | | These typedefs don't save much typing compared to the full `Ref<Resource>` and `Ref<RefCounted>`, yet they sometimes introduce confusion among new contributors.
* Merge pull request #58205 from Zylann/fix_variant_encode_with_doublesRémi Verschelde2022-02-191-0/+15
|\ | | | | Add missing flag when encode_variant writes math types with doubles
| * Add missing flag when encode_variant writes math types with doublesMarc Gilleron2022-02-161-0/+15
| |
* | Style: Cleanup single-line blocks, semicolons, dead codeRémi Verschelde2022-02-161-13/+0
| | | | | | | | | | Remove currently unused implementation of TextureBasisU, could be re-added later on if needed and ported.
* | Fixed variant decoding Segmentation FaultMax2022-02-141-5/+6
|/
* Fix typos with codespellRémi Verschelde2022-02-101-1/+1
| | | | | | | Using codespell 2.2-dev from current git. Added `misc/scripts/codespell.sh` to make it easier to run it once in a while and update the skip and ignore lists.
* Rename or refactor macros to avoid leading underscoresOmar Polo2022-01-201-3/+2
| | | | | These are not used consistently and some can conflict with system-specific defines. While here, also delete some unused macros.
* 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-1/+1
| | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* [Marshalls] Fix Float64Array and Int64Array serialization.Fabio Alessandrelli2021-08-021-4/+3
| | | | | | One was incorrectly reading the size (potentially causing out-of-buffer read), the other also potentially causing out-of-buffer write during encoding.
* [Net] Fix Marshalls infinite recursion crash.Fabio Alessandrelli2021-07-301-8/+10
| | | | | | | | | | Variants like dictionaries and arrays can have cyclic references, which caused `encode_variant` to run an infinite recursion. Instead of keeping a stack and looking for cyclic references which would make serialization slower, this commit adds a `MAX_RECURSION_DEPTH` constant to Variant, and have `encode_variant` keep track of the current recursion depth, bailing when it's too high since this likely means a cyclic reference has been encountered.
* Use const references where possible for List range iteratorsRémi Verschelde2021-07-251-3/+3
|
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-9/+9
|
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-2/+2
|
* Binary serialization for realsAaron Franke2021-06-171-169/+336
| | | | | | Added new "encode_real" methods for handling real_t, and used them for vector types. Types are encoded based on compilation setting. But for decoding, always check how it was encoded. This way, serialized data is cross-compatible with Godot compiled with singles and Godot compiled with doubles. At least, in theory.
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-3/+3
|
* Style: Cleanup uses of double spaces between wordsRémi Verschelde2021-06-071-1/+1
| | | | | Or after punctuation. Tried to leave third-party stuff alone, unless it has been heavily modified for Godot.
* Rename Quat to QuaternionMarcel Admiraal2021-06-041-4/+4
|
* Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-2/+2
| | | Also _transform to _transform3d
* Rename Transform to Transform3D in coreAaron Franke2021-06-031-2/+2
|
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-8/+8
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.