summaryrefslogtreecommitdiffstats
path: root/core/variant_op.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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..
* Fix two typos from previous commitRémi Verschelde2017-05-171-15/+16
| | | | Also cleanup comments on variant types.
* Removal of Image from Variant, converted to a Resource.Juan Linietsky2017-05-171-20/+8
|
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-1849/+1932
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Various fixes detected using PVS-Studio static analyzer.Thaer Razeq2017-02-281-2/+2
| | | | | | | - 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
* Revert "Make nan==nan true for GDScript"Juan Linietsky2017-02-141-51/+25
|
* Make nan==nan true for GDScriptHein-Pieter van Braam2017-02-141-25/+51
| | | | | | | | | | | | | 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
* Style: Cleanups, added headers, renamed filesRémi Verschelde2017-01-161-0/+2
| | | | | | | | | 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).
* Made InputEvent use floating point coordinates.Juan Linietsky2017-01-121-6/+6
|
* More efficient iteration syntax, and range() is converted behind the scenes ↵Juan Linietsky2017-01-111-0/+89
| | | | to it.
* Both Array and Dictionary are always in shared mode (removed copy on write).Juan Linietsky2017-01-111-3/+3
|
* Type renames:Juan Linietsky2017-01-111-189/+189
| | | | | | | | | | | | Matrix32 -> Transform2D Matrix3 -> Basis AABB -> Rect3 RawArray -> PoolByteArray IntArray -> PoolIntArray FloatArray -> PoolFloatArray Vector2Array -> PoolVector2Array Vector3Array -> PoolVector3Array ColorArray -> PoolColorArray
* Variant INT and REAL are now 64 bits (other types remain at 32)Juan Linietsky2017-01-081-6/+6
|
* renamed joystick to joypad everywhere around source code!Juan Linietsky2017-01-081-6/+6
|
* Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky2017-01-071-56/+56
| | | | renamed to PoolVector
* Welcome in 2017, dear changelog reader!Rémi Verschelde2017-01-011-1/+1
| | | | | | | | That year should bring the long-awaited OpenGL ES 3.0 compatible renderer with state-of-the-art rendering techniques tuned to work as low as middle end handheld devices - without compromising with the possibilities given for higher end desktop games of course. Great times ahead for the Godot community and the gamers that will play our games!
* Added small modification on parser for '+'Henrique L. Alves2016-10-221-2/+52
|
* fix string iteratorcaryoscelus2016-08-261-1/+1
| | | | | | | Since strings are null-terminated, size() returns incorrect length, so use length() instead. fixes #6287
* Fix warnings in core/variant_op.cppJohan Manuel2016-07-231-2/+8
| | | | | Adds default cases in switches where needed, and replaces '0;' with ';;' in macro expansions (as suggested by @vnen in #5587).
* Add support to String type in gdscript iteration. #5188Samuel Grigolato2016-06-261-0/+24
|
* Expose missing Quaternion operators.Andreas Haas2016-06-211-3/+12
| | | | | | Scripts can now evaluate the following cases: - (quat * real) and (quat / real) - (quat + quat) and (quat - quat)
* Add support for Python-like negative indexingDennis Brakhane2016-06-051-5/+33
| | | | | | | | | | | | | | | Negative indexing is a useful feature in Python, especially when combined with array slicing. Array slicing will hopefully be implemented later, but negative indexing is useful in its own right. A negative index is indexing from the end of an array, "array[-1] == array[array.size()-1]", using a negative index larger/smaller than the length of the array is still an error. While primarily useful for arrays and strings, support is also added to "array like" structures like Vector3 and Color. This is done just to be consistent; vector3[2] is much clearer than vector3[-1], but disallowing it while allowing it for an array with 3 elements seems confusing.
* Move repetitive code to macrosDennis Brakhane2016-06-051-243/+38
| | | | | | | | In preparation for the following "allow negative indexing" commit, replace the repetitive array "set index" and "get index" code with macros. no functional changes were made, the resulting machine code is unchanged.
* Make Color.{rgba}8 return int instead floatAndreas Haas2016-05-311-5/+5
| | | | | According to the class doc, these should be int. Also fixed a little bug: the setter for 'r8' changed the green value
* Removing round from int interpolationpunto-2016-05-171-1/+1
| | | This might break some animations that use int tracks in continuous mode, but it should provide a more uniform interpolation for things like sprite frames.