summaryrefslogtreecommitdiff
path: root/core/variant_op.cpp
AgeCommit message (Collapse)Author
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
2017-05-20Removal of InputEvent as built-in Variant type..Juan Linietsky
this might cause bugs I haven't found yet..
2017-05-17Fix two typos from previous commitRémi Verschelde
Also cleanup comments on variant types.
2017-05-17Removal of Image from Variant, converted to a Resource.Juan Linietsky
2017-04-08Add "Godot Engine contributors" copyright lineRémi Verschelde
2017-03-05A Whole New World (clang-format edition)Rémi Verschelde
I can show you the code Pretty, with proper whitespace Tell me, coder, now when did You last write readable code? I can open your eyes Make you see your bad indent Force you to respect the style The core devs agreed upon A whole new world A new fantastic code format A de facto standard With some sugar Enforced with clang-format A whole new world A dazzling style we all dreamed of And when we read it through It's crystal clear That now we're in a whole new world of code
2017-02-28 Various fixes detected using PVS-Studio static analyzer.Thaer Razeq
- Add FIXME tags comments to some unfixed potential bugs - Remove some checks (always false: unsigned never < 0) - Fix some if statements based on reviews. - Bunch of missing `else` statements
2017-02-14Revert "Make nan==nan true for GDScript"Juan Linietsky
2017-02-14Make nan==nan true for GDScriptHein-Pieter van Braam
After discussing this with Reduz this seemed like the best way to fix #7354. This will make composite values that contain NaN in the same places as well as the same other values compare as the same. Additionally non-composite values now also compare equal if they are both NaN. This breaks IEEE specifications but this is probably what most users expect. There is a GDScript function check for NaN if the user needs this information. This fixes #7354 and probably also fixes #6947
2017-01-16Style: Cleanups, added headers, renamed filesRémi Verschelde
Made sure files in core/ and tools/ have a proper Godot license header when written by us. Also renamed aabb.{cpp,h} and object_type_db.{cpp,h} to rect3.{cpp,h} and class_db.{cpp,h} respectively. Also added a proper header to core/io/base64.{c,h} after clarifying the licensing with the original author (public domain).