summaryrefslogtreecommitdiffstats
path: root/core/variant_parser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* VariantParser: Fix crash on malformed vectorsRémi Verschelde2020-06-081-64/+15
| | | | | | | | | Each time `r_err_str` is set, we should return a parse error. Removed redundant `return OK;` which were already handled after the big `if`/`else if`/`else` for `TK_IDENTIFIER`. Part of #17372.
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-13/+13
| | | | | | | | | | Semicolons are not necessary after function definitions or control flow blocks, and having some code use them makes things inconsistent (and occasionally can mess up `clang-format`'s formatting). Removing them is tedious work though, I had to do this manually (regex + manual review) as I couldn't find a tool for that. All other code folders would need to get the same treatment.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-72/+136
| | | | | 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/+2
| | | | | | | | | | | | | | | | | | | | | | | 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-153/+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.
* Revert "Renamed plane's d to distance"Rémi Verschelde2020-05-101-1/+1
| | | | | | | 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.
* Style: clang-format: Disable AllowShortCaseLabelsOnASingleLineRémi Verschelde2020-05-101-5/+15
| | | | Part of #33027.
* Renamed plane's d to distanceMarcus Elg2020-05-101-1/+1
|
* Refactored Input, create DisplayServer and DisplayServerX11Juan Linietsky2020-03-261-1/+1
|
* Merge pull request #36042 from sumit0190/exportInfNanRémi Verschelde2020-03-041-2/+8
|\ | | | | Read and write exported infs/nans correctly (#35388)
| * Read and write exported infs/nans correctly (#35388)sumit01902020-02-091-2/+8
| |
* | Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-20/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* | Fix project.godot for projects with class_namenathanwfranke2020-02-241-0/+4
| | | | | | Fixes #36438
* | Merge pull request #36461 from akien-mga/c++17-fallthrough-attributeRémi Verschelde2020-02-231-1/+1
|\ \ | | | | | | Replace FALLTHROUGH macro by C++17 [[fallthrough]]
| * | Replace FALLTHROUGH macro by C++17 [[fallthrough]]Rémi Verschelde2020-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attribute is now part of the standard we target so we no longer need compiler-specific hacks. Also enables -Wimplicit-fallthrough for Clang now that we can properly support it. It's already on by default for GCC's -Wextra. Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
* | | Add support for Vector2i, Rect2i and Vector3i to VariantJuan Linietsky2020-02-221-0/+55
|/ / | | | | | | | | | | | | 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-2/+30
| | | | | | | | Also changed all relevant properties defined manually to StringName.
* | PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-56/+51
| | | | | | | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* | Remove more deprecated methods and codeRémi Verschelde2020-02-131-199/+2
| |
* | Fix VariantParser::StreamString EOF determinationPedro J. Estébanez2020-02-101-2/+8
|/
* 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.
* Encodes property names properly in project.godotHaoyu Qiu2019-12-201-3/+0
|
* Changed some code found by Clang Tidy and Coverityqarmin2019-09-221-1/+1
|
* Changed some code showed in LGTM and Coverageqarmin2019-07-201-2/+0
|
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-14/+0
|
* Merge pull request #26787 from ptrojahn/utf8assignRémi Verschelde2019-04-221-0/+3
|\ | | | | Support UTF-8 input action names
| * Support UTF-8 input action namesPaul Trojahn2019-03-081-0/+3
| | | | | | | | Fixes #26380
* | Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-1/+2
|/ | | | | | 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).
* Fix VariantWriter overflow on 64-bit intRémi Verschelde2019-02-211-1/+1
| | | | | | | | Integers in Godot are signed 64-bit ints (int64_t), but var2str used int behind the scenes and would thus overflow after 2^31. Also properly documented the actual bounds of int and the behaviour when overflowing them.
* Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-16/+16
| | | | Fixes #25316.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde2018-09-131-2/+2
|\ | | | | Misc. typos
| * Misc. typosluz.paz2018-09-121-2/+2
| | | | | | Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
* | Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-3/+3
|/ | | | | | 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.
* add template argument for size in StringBufferkarroffel2018-01-201-3/+3
| | | | | | | Until now the pre-allocated array size was defined to be 64 without a way of adjusting it from the calling side. This commit adds the size as a template parameter.
* 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!
* Make old scenes readable againJuan Linietsky2017-11-201-1/+1
|
* Rename Rect3 to AABB.Ferenc Arn2017-11-171-5/+5
| | | | Fixes #12973.
* Optimize memory allocations in VariantParser::get_tokenEvgeny Zuev2017-09-051-10/+12
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-241-1/+1
| | | | | | | | | | | | Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
* Fix tokenization of doublesPedro J. Estébanez2017-08-211-3/+1
| | | | Fixes #9600.
* Update GDScript completion names for Pool*ArraysAndrii Doroshenko (Xrayez)2017-07-251-2/+2
| | | | | | | | | | | Notice: GDScript tokenizer used the old PoolFloatArray name. Renamed PoolFloatArray to PoolRealArray. Moved "project_settings.h" down one line to comply with the clang-format rules. Fixes #9638 Closed pull request #9714 because I messed up with commits, sorry!
* renamed all Rect3.pos to Rect3.positionalexholly2017-06-091-1/+1
|
* Merge pull request #9015 from mcanders/mcanders/ParseObjectVariantFixRémi Verschelde2017-06-071-2/+6
|\ | | | | Fix Variant::OBJECT token parsing
| * Fix Variant::OBJECT token parsingCarter Anderson2017-06-041-2/+6
| |
* | renamed all Rect2.pos to Rect2.positionalexholly2017-06-041-1/+1
|/
* -Added .hdr format supportJuan Linietsky2017-05-281-13/+146
| | | | | | -Added default environment editor setting -Added environment created by default in new projects -Removed default light and ambient from spatial editor, to make the editor more PBR compliant
* Removal of InputEvent as built-in Variant type..Juan Linietsky2017-05-201-151/+30
| | | | this might cause bugs I haven't found yet..