summaryrefslogtreecommitdiff
path: root/core/variant_op.cpp
AgeCommit message (Collapse)Author
2019-12-12Don't allow to use too big or too small shift operatorsRafał Mikrut
2019-07-20Changed some code showed in LGTM and Coverageqarmin
2019-07-01Remove unnecessary code and add some error explanationsqarmin
2019-04-09Style: Apply new changes from clang-format 8.0Rémi Verschelde
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).
2019-03-03Merge pull request #25934 from mrcdk/pool_int_real_color_interpolateRémi Verschelde
Added PoolIntArray, PoolRealArray and PoolColorArray interpolate
2019-02-20Add -Wshadow=local to warnings and fix reported issues.marxin
Fixes #25316.
2019-02-16Added PoolIntArray, PoolRealArray and PoolColorArray interpolateMrCdK
2019-01-01Update copyright statements to 2019Rémi Verschelde
Happy new year to the wonderful Godot community!
2018-11-28Fix many errors found by PVS-StudioAaron Franke
Fix errors 2, 3, 4, 6, 8, 9, 11, 12, 13, 14, and 15.
2018-10-07Optimize interpolation algorithmsqonnop
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
2018-10-07Merge pull request #22752 from aaronfranke/equals-redundantRémi Verschelde
Remove redundant "== true" and "== false" code
2018-10-06Remove redundant "== false" codeAaron Franke
Some of this code has been re-organized. f
2018-10-06Fixed int interpolation issue, closes #22763qonnop
When interpolating between two equal int values a and b, floating point calculation imprecisions can result in different values depending on the interpolation factor.
2018-09-18Color: Fix rounding error converting from float to 8-bitRémi Verschelde
Fixes #16736.
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
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.
2018-07-03Hacked around duplication bug. I think duplicate needs to be even smarter, ↵Juan Linietsky
maybe pass two bools? (containers and/or resources)
2018-07-02-Fixes to how hashing happened, now StringName and NodePath use default ↵Juan Linietsky
hasher, this was leading to some severe slowdown in scenarios -Fixes to some duplication scenarios for instanced scenes
2018-04-22Keep alpha when changing h, s or v on colorShyRed
When modifying the h, s or v properties of a color in GDScript the alpha value needs to stay unchanged.
2018-04-16Fix names of Variant operatorsGeorge Marques
2018-04-08Merge pull request #17382 from bojidar-bg/13971-path-array-unsavedJuan Linietsky
Duplicate Arrays and Dictionaries when instancing scene in editor
2018-03-13Duplicate Arrays and Dictionaries when instancing scene in editorBojidar Marinov
Also, add deep (=false) parameter to Array.duplicate and Dictionary.duplicate Fixes #13971
2018-03-13Fix a potential bug hinted by clangBojidar Marinov
2018-02-22Color:fix setting V switch S to old V valuePoommetee Ketson
2018-02-21Fix typos with codespellluz.paz
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt` Whitelist consists of: ``` ang doubleclick lod nd que te unselect ```
2018-01-06Fix NEQ operation between 2 different ArraysMrCdK
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
2018-01-05Add missing copyright headers and fix formattingRémi Verschelde
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.
2018-01-01Update copyright statements to 2018Rémi Verschelde
Happy new year to the wonderful Godot community!
2017-11-17Rename Rect3 to AABB.Ferenc Arn
Fixes #12973.
2017-10-19Fix Color.r8/g8/b8/a8 being type float instead of type intMarcelo Fernandez
2017-09-25Make variant_op jumptable constHein-Pieter van Braam
Not doing this was a bit of an oversight
2017-09-24Merge pull request #11549 from hpvb/fix-11543Hein-Pieter van Braam
Fix Dictionary set_named
2017-09-24Fix Variant::get_named return when p_index is invalidMarcelo Fernandez
2017-09-24Fix Dictionary set_namedHein-Pieter van Braam
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.
2017-09-24Merge pull request #11473 from hpvb/fix-11466Rémi Verschelde
Implement operator != on Pool*Array types
2017-09-23Massive optimization to Variant::set_named/get_named. Should give a nice ↵Juan Linietsky
boost to GDScript.
2017-09-22Implement operator != on Pool*Array typesHein-Pieter van Braam
These types previously had equality checks but not inequality checks. Add these too. This fixes #11466
2017-09-20Allow equality checks between null and arbitrary typesHein-Pieter van Braam
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.
2017-09-19Allow booleanization of all typesHein-Pieter van Braam
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.
2017-09-19Be type-strict checking on equality checksHein-Pieter van Braam
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.
2017-09-19Fix accidental cast to Vector3 for Vector2 iterHein-Pieter van Braam
2017-09-17Move Variant::evaluate() switch to computed gotoHein-Pieter van Braam
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
2017-09-16Implement +,-,/, * and negate operators for Color type.bncastle
2017-09-15Revert "Don't allow division by false (zero)"Thomas Herzog
2017-09-15Don't allow division by false (zero)Hein-Pieter van Braam
This fixes #10717
2017-08-27Use HTTPS URL for Godot's website in the headersRémi Verschelde
2017-06-30-Many fixes to VisualScript, fixed property names, etc.Juan Linietsky
-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
2017-06-28Reworked translation systemJuan Linietsky
-Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
2017-06-22Reimplement for..in range() so that it always results in intsBojidar Marinov
Fixes #8278, fixup of bfef8de1bc4f7a7b9617a7b181881129033a0b0e
2017-06-09renamed all Rect3.pos to Rect3.positionalexholly
2017-06-04renamed all Rect2.pos to Rect2.positionalexholly