summaryrefslogtreecommitdiffstats
path: root/core/variant_op.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-2135/+0
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Refactored variant setters/gettersreduz2020-11-071-1/+12
| | | | | | -Discern between named, indexed and keyed -Get direct access to functions for typed GDScript and GDNative bindings -Small changes to some classes in order to work with the new setget binder
* Refactored Variant Operators.reduz2020-11-061-4412/+1928
| | | | | -Using classes to call and a table -For typed code (GDS or GDNative), can obtain functions to call prevalidated or ptr.
* Refactor MethodBind to use variadic templatesreduz2020-10-181-1/+1
| | | | Removed make_binders and the old style generated binders.
* Allow commutative multiplication in VariantGeorge Marques2020-09-171-2/+61
| | | | Also allow quaternions to be multiplied by integers.
* Fix Vector{2,3}i casting on Variant multiplication with numbersGeorge Marques2020-09-121-16/+16
|
* [Complex Test Layouts] Change `String` to use UTF-32 encoding on all platforms.bruvzg2020-09-031-1/+1
|
* Fix hard-coded OP_MAX in variant_op.cppstrank2020-09-011-26/+26
|
* Addition of SDFGI for open world global illuminationJuan Linietsky2020-06-261-0/+1
| | | | Move GI to a deferred pass
* Style: Remove unnecessary semicolons from `core`Rémi Verschelde2020-05-191-15/+15
| | | | | | | | | | 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-93/+183
| | | | | 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-186/+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-5/+5
| | | | | | | 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-4/+8
| | | | Part of #33027.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-75/+110
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Merge pull request #37020 from aaronfranke/rangeRémi Verschelde2020-05-101-40/+96
|\ | | | | Allow using integer vectors for iteration and make range() use them
| * Allow Vector2/Vector3 iterators to have non-integer valuesAaron Franke2020-05-091-10/+10
| |
| * Allow using integer vectors for iteration and make range() use themAaron Franke2020-05-091-32/+88
| |
* | Renamed plane's d to distanceMarcus Elg2020-05-101-5/+5
|/
* [Core] Rename linear_interpolate to lerpAaron Franke2020-04-291-8/+8
|
* Replace NULL with nullptrlupoDharkael2020-04-021-5/+5
|
* Refactor ScriptDebugger.Fabio Alessandrelli2020-03-081-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Update docs and bindings for new integer vector typesRémi Verschelde2020-02-251-24/+24
|
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-229/+411
| | | | | | | | | | | | | | | | | | | | | - 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.
* Store arrays inside of Variant as shared.Juan Linietsky2020-02-231-46/+73
| | | | | | | | | | | | | Arrays inside of Variant are unique and use reference counting. When you assign a variant containing a packed array to another, or when you call non const functions to arrays, this will work even if the array is inside a dictionary, so they will from now pass as reference. The difference with regular variant arrays is that, once passed to a function in the C++ API, they are no longer shared. This is required for security and thread safety, as those arrays are mainly used to pass data back and forth even between threads.
* Add support for Vector2i, Rect2i and Vector3i to VariantJuan Linietsky2020-02-221-8/+423
| | | | | | | 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-16/+62
| | | | Also changed all relevant properties defined manually to StringName.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-35/+78
| | | | objects and made them default.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-262/+262
| | | | | 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-34/+32
|
* 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.
* Don't allow to use too big or too small shift operatorsRafał Mikrut2019-12-121-0/+4
|
* Changed some code showed in LGTM and Coverageqarmin2019-07-201-1/+1
|
* Remove unnecessary code and add some error explanationsqarmin2019-07-011-1/+2
|
* Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-4/+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).
* Merge pull request #25934 from mrcdk/pool_int_real_color_interpolateRémi Verschelde2019-03-031-3/+67
|\ | | | | Added PoolIntArray, PoolRealArray and PoolColorArray interpolate
| * Added PoolIntArray, PoolRealArray and PoolColorArray interpolateMrCdK2019-02-161-3/+67
| |
* | Add -Wshadow=local to warnings and fix reported issues.marxin2019-02-201-9/+9
|/ | | | Fixes #25316.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix many errors found by PVS-StudioAaron Franke2018-11-281-2/+2
| | | Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.
* Optimize interpolation algorithmsqonnop2018-10-071-7/+6
| | | | | Interpolation in the form of va + (vb - va) * c is faster and prevents floating point issues for int/string Followup to https://github.com/godotengine/godot/pull/22786
* Merge pull request #22752 from aaronfranke/equals-redundantRémi Verschelde2018-10-071-1/+1
|\ | | | | Remove redundant "== true" and "== false" code
| * Remove redundant "== false" codeAaron Franke2018-10-061-1/+1
| | | | | | | | | | | | Some of this code has been re-organized. f
* | Fixed int interpolation issue, closes #22763qonnop2018-10-061-1/+4
|/ | | | | | When interpolating between two equal int values a and b, floating point calculation imprecisions can result in different values depending on the interpolation factor.
* Color: Fix rounding error converting from float to 8-bitRémi Verschelde2018-09-181-4/+4
| | | | Fixes #16736.
* 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.
* Hacked around duplication bug. I think duplicate needs to be even smarter, ↵Juan Linietsky2018-07-031-0/+2
| | | | maybe pass two bools? (containers and/or resources)
* -Fixes to how hashing happened, now StringName and NodePath use default ↵Juan Linietsky2018-07-021-2/+9
| | | | | | hasher, this was leading to some severe slowdown in scenarios -Fixes to some duplication scenarios for instanced scenes
* Keep alpha when changing h, s or v on colorShyRed2018-04-221-9/+9
| | | | When modifying the h, s or v properties of a color in GDScript the alpha value needs to stay unchanged.