summaryrefslogtreecommitdiffstats
path: root/core/variant_op.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Fix names of Variant operatorsGeorge Marques2018-04-161-1/+2
|
* Merge pull request #17382 from bojidar-bg/13971-path-array-unsavedJuan Linietsky2018-04-081-0/+13
|\ | | | | Duplicate Arrays and Dictionaries when instancing scene in editor
| * Duplicate Arrays and Dictionaries when instancing scene in editorBojidar Marinov2018-03-131-0/+13
| | | | | | | | | | | | Also, add deep (=false) parameter to Array.duplicate and Dictionary.duplicate Fixes #13971
* | Fix a potential bug hinted by clangBojidar Marinov2018-03-131-4/+4
|/
* Color:fix setting V switch S to old V valuePoommetee Ketson2018-02-221-1/+1
|
* Fix typos with codespellluz.paz2018-02-211-1/+1
| | | | | | | | | | | | | | Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt` Whitelist consists of: ``` ang doubleclick lod nd que te unselect ```
* Fix NEQ operation between 2 different ArraysMrCdK2018-01-061-4/+4
| | | | it was returning false if it found the same content in both arrays which isn't correct, it should return true when it finds different values
* 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!
* Rename Rect3 to AABB.Ferenc Arn2017-11-171-30/+30
| | | | Fixes #12973.
* Fix Color.r8/g8/b8/a8 being type float instead of type intMarcelo Fernandez2017-10-191-4/+4
|
* Make variant_op jumptable constHein-Pieter van Braam2017-09-251-26/+26
| | | | Not doing this was a bit of an oversight
* Merge pull request #11549 from hpvb/fix-11543Hein-Pieter van Braam2017-09-241-1/+1
|\ | | | | Fix Dictionary set_named
| * Fix Dictionary set_namedHein-Pieter van Braam2017-09-241-1/+1
| | | | | | | | | | | | Reduz optimized field indexing in 3c85703 but the changes didn't apply to dictionary so this code remained untouched. However, the logic for validity checking was changed but not updated for the dictionary case.
* | Fix Variant::get_named return when p_index is invalidMarcelo Fernandez2017-09-241-0/+1
|/
* Merge pull request #11473 from hpvb/fix-11466Rémi Verschelde2017-09-241-8/+14
|\ | | | | Implement operator != on Pool*Array types
| * Implement operator != on Pool*Array typesHein-Pieter van Braam2017-09-221-8/+14
| | | | | | | | | | | | | | These types previously had equality checks but not inequality checks. Add these too. This fixes #11466
* | Massive optimization to Variant::set_named/get_named. Should give a nice ↵Juan Linietsky2017-09-231-27/+458
|/ | | | boost to GDScript.
* Allow equality checks between null and arbitrary typesHein-Pieter van Braam2017-09-201-156/+201
| | | | | | | | Uninitialzed values in GDScript are of type NIL so not allowing null comparisons did end up breaking some code. This commit reenables NULL equality checks for all types. We're going to have to figure out how to make this fast for the compiler later.
* Allow booleanization of all typesHein-Pieter van Braam2017-09-191-75/+12
| | | | | | | | | | | | | We now allow booleanization of all types. This means that empty versions of all types now evaluate to false. So a Vector2(0,0), Dictionary(), etc. This allows you to write GDScript like: if not Dictionary(): print("Empty dict") Booleanization can now also no longer fail. There is no more valid flag, this changes Variant and GDNative API.
* Be type-strict checking on equality checksHein-Pieter van Braam2017-09-191-67/+63
| | | | | | | | | | | After a short discussion with @reduz and @karroffel we decided to make all non number/number comparisons return type errors on comparisons. Now bool == bool is allowed but Vector2 == Vector3 is a type error and no longer 'not equal'. The same has been done for the != operators. In addition I forgot to add some failures to some Object operators meaning that there was a potential for a crasher.
* Fix accidental cast to Vector3 for Vector2 iterHein-Pieter van Braam2017-09-191-1/+1
|
* Move Variant::evaluate() switch to computed gotoHein-Pieter van Braam2017-09-171-693/+970
| | | | | | | | | | | | | In an effort to make GDScript a little faster replace the double switch() with a computed goto on compilers that set __GNUC__. For compilers that don't support computed goto it will fall back to regular switch/case statements. In addition disable using boolean values in a mathematical context. Now boolean values can only be compared with other booleans. Booleans will also no longer be coerced to integers. This PR replaces #11308 and fixes #11291
* Implement +,-,/, * and negate operators for Color type.bncastle2017-09-161-5/+5
|
* Revert "Don't allow division by false (zero)"Thomas Herzog2017-09-151-28/+1
|
* Don't allow division by false (zero)Hein-Pieter van Braam2017-09-151-1/+28
| | | | This fixes #10717
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* -Many fixes to VisualScript, fixed property names, etc.Juan Linietsky2017-06-301-9/+7
| | | | | | -Added ability to set/get a field in GetSet, as well as assignment ops -Added a Select node -Fixed update bugs related to variable list and exported properties, closes #9458
* Reworked translation systemJuan Linietsky2017-06-281-1/+1
| | | | | -Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
* Reimplement for..in range() so that it always results in intsBojidar Marinov2017-06-221-20/+22
| | | | Fixes #8278, fixup of bfef8de1bc4f7a7b9617a7b181881129033a0b0e
* renamed all Rect3.pos to Rect3.positionalexholly2017-06-091-8/+8
|
* renamed all Rect2.pos to Rect2.positionalexholly2017-06-041-9/+9
|
* Removal of InputEvent as built-in Variant type..Juan Linietsky2017-05-201-714/+0
| | | | this might cause bugs I haven't found yet..