summaryrefslogtreecommitdiffstats
path: root/core/io/marshalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-53/+104
| | | | | 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-141-114/+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-141-3/+0
| | | | | | | | | | 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.
* Revert "Renamed plane's d to distance"Rémi Verschelde2020-05-101-2/+2
| | | | | | | This reverts commit ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3. This was wrong, `d` is not a distance but the `d` constant in the parametric equation `ax + by + cz = d` describing the plane.
* Renamed plane's d to distanceMarcus Elg2020-05-101-2/+2
|
* Replace NULL with nullptrlupoDharkael2020-04-021-3/+3
|
* Update docs and bindings for new integer vector typesRémi Verschelde2020-02-251-4/+4
|
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-16/+103
| | | | | | | | | | | | | | | | | | | | | - 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.
* Add support for Vector2i, Rect2i and Vector3i to VariantJuan Linietsky2020-02-221-0/+74
| | | | | | | WARNING: Requires C++17 'guaranteed copy elision' to fix ambiguous operator problems in Variant. This was added for this commit (and future C++17 uses) in #36457.
* Added StringName as a variant type.Juan Linietsky2020-02-211-0/+15
| | | | Also changed all relevant properties defined manually to StringName.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-0/+15
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-37/+37
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr.Juan Linietsky2020-02-151-6/+6
|
* ObjectID converted to a structure, fixes many bugs where used incorrectly as ↵Juan Linietsky2020-02-121-5/+4
| | | | 32 bits.
* GDScript: Validate object instance on `is` operationGeorge Marques2020-01-091-0/+12
| | | | | | | | Avoids crashes on debug mode. Instead it now breaks the execution and show the error in-editor. Will still crash on release. Also add a similar check to Marshalls to ensure the debugger doesn't crash when trying to serialize the invalid instance.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Added some obvious errors explanationsqarmin2019-09-251-3/+3
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-10/+0
| | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Added release function to PoolVector::Access.Ibrahn Sahir2019-07-061-6/+0
| | | | | | For clarity, assign-to-release idiom for PoolVector::Read/Write replaced with a function call. Existing uses replaced (or removed if already handled by scope)
* Merge pull request #29941 from qarmin/redundant_code_and_othersRémi Verschelde2019-06-271-7/+0
|\ | | | | Remove redundant code, possible NULL pointers and others
| * Some code changed with Clang-Tidyqarmin2019-06-261-7/+0
| |
* | doc: Document EncodedObjectAsID, expose its propertyRémi Verschelde2019-06-261-4/+6
|/
* Fix always true/false valuesqarmin2019-06-201-4/+1
|
* Initialize padding on PoolByteArray serializationLukas Zanner2019-05-191-1/+5
|
* Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-3/+8
| | | | | | It seems to stay compatible with formatting done by clang-format 6.0 and 7.0, so contributors can keep using those versions for now (they will not undo those changes).
* Use same boolean for objects encode and decode.Fabio Alessandrelli2019-03-281-21/+20
| | | | | | In a very unintuitive move encode needed false to encode an object, decode needed true to decode it. They now need the same value: `true`.
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-3/+3
| | | | Fixes #25316.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Moved member variables to initializer listWilson E. Alvarez2018-12-111-3/+2
|
* One less local variable in marshallsFabio Alessandrelli2018-10-071-3/+2
|
* Fix some more warnings reported by CIRémi Verschelde2018-10-031-2/+0
| | | | | | | | | | | | | | | | Fixes the following Clang 7 warnings: ``` core/io/marshalls.cpp:872:10: warning: unused variable 'f' [-Wunused-variable] core/ustring.cpp:1831:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] core/ustring.cpp:1832:2: warning: 'register' storage class specifier is deprecated and incompatible with C++17 [-Wdeprecated-register] drivers/gles3/rasterizer_gles3.cpp:82:24: warning: unused function '_gl_debug_print' [-Wunused-function,34] main/main.cpp:118:13: warning: unused variable 'auto_build_solutions' [-Wunused-variable] modules/csg/csg_gizmos.cpp:225:46: warning: 'current' may be used uninitialized in this function [-Wmaybe-uninitialized] ```
* Merge pull request #22223 from Faless/fix_int32_encodeRémi Verschelde2018-10-021-3/+3
|\ | | | | Fix put_var encoding some 32bits ints as 64bits.
| * Fix put_var encoding some 32bits ints as 64bits.Fabio Alessandrelli2018-09-181-3/+3
| |
* | Fix warnings about unhandled enum value in switch [-Wswitch]Rémi Verschelde2018-09-271-0/+1
|/ | | | | | | | | | | Fixes GCC 5 warnings of the form: core/io/http_client.cpp:288:9: warning: enumeration value 'STATUS_SSL_HANDSHAKE_ERROR' not handled in switch [-Wswitch] core/io/marshalls.cpp:806:9: warning: enumeration value 'AABB' not handled in switch [-Wswitch] Those can be trivial cases where adding a default fallback is the solution, or more complex issues/hidden bugs where missed values are actually meant to be handled.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+5
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* Fix marshalls size checks.Fabio Alessandrelli2018-07-291-101/+76
| | | | | | | | | | | | | | | Yesterday, when playing around with my network code, I realized there is a security issue in decode_variant, at least when decoding PoolArrays. Basically, the size of the PoolArray is encoded in a uint32_t, when decoding it, that value is cast to int when comparing if the packet is actually that size causing numbers with MSB=1 to be interpreted as negative thus always passing the check. That same value though, is used as uint32_t again to resize the output vector. For this reason, sending a malformed packet with declared type PoolByteArray and size of 2^31(+x) causes the engine to try to allocate 2+GB of pool memory, causing the engine to crash. (cherry picked from commit 5262d1bbcc81a06db66ac45c3f75535f231268bc)
* Merge pull request #16033 from poke1024/marshalls-dictJuan Linietsky2018-05-071-1/+3
|\ | | | | Detects crash-related marshalling errors due to NAN values
| * Detects crash-related marshalling errors due to NAN valuesBernhard Liebl2018-01-241-1/+3
| |
* | Fix garbage in string padding.Andrew Dunai2018-03-041-1/+1
|/
* Fix typos in code and docs with codespellRémi Verschelde2018-01-181-1/+1
| | | | Using v1.11.0 from https://github.com/lucasdemarchi/codespell
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Style: Apply new clang-format 5.0 style to all filesRémi Verschelde2017-12-071-2/+2
|
* Style: Apply clang-format again on all filesRémi Verschelde2017-12-071-2/+2
| | | | | Fixes issues introduced by newer clang-format versions or commits pushed directly without using the clang-format pre-commit hook.
* Merge pull request #12284 from bojidar-bg/allow-subproperty-setRémi Verschelde2017-11-211-14/+6
|\ | | | | Allow for getting/setting "dotted" properties of objects
| * Allow for getting/setting indexed properties of objects using get/set_indexedBojidar Marinov2017-11-211-14/+6
| | | | | | | | Performance is around the same as using pure set() through GDScript.
* | Rename Rect3 to AABB.Ferenc Arn2017-11-171-6/+6
|/ | | | Fixes #12973.
* Fix binary marshalling of ObjectsLeon Krause2017-10-081-1/+2
|
* Fix signed and unsigned comparisonsHein-Pieter van Braam2017-09-011-5/+5
| | | | The first in my quest to make Godot 3.x compile with -Werror on GCC7
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|