aboutsummaryrefslogtreecommitdiff
path: root/core/variant.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Convert Object::cast_to() to the static versionHein-Pieter van Braam2017-08-241-2/+2
| | | | | | | | | | | | Currently we rely on some undefined behavior when Object->cast_to() gets called with a Null pointer. This used to work fine with GCC < 6 but newer versions of GCC remove all codepaths in which the this pointer is Null. However, the non-static cast_to() was supposed to be null safe. This patch makes cast_to() Null safe and removes the now redundant Null checks where they existed. It is explained in this article: https://www.viva64.com/en/b/0226/
* Makes all Godot API's methods Lower CaseIndah Sylvia2017-08-071-1/+1
|
* renamed all Rect3.pos to Rect3.positionalexholly2017-06-091-2/+2
|
* renamed all Rect2.pos to Rect2.positionalexholly2017-06-041-3/+3
|
* Removal of InputEvent as built-in Variant type..Juan Linietsky2017-05-201-41/+0
| | | | this might cause bugs I haven't found yet..
* Removal of Image from Variant, converted to a Resource.Juan Linietsky2017-05-171-38/+0
|
* Correct Variant::hash_compare()Hein-Pieter van Braam2017-04-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a logic error in #7815 which made Variant.hash_compare() == Variant.hash_compare() always true. In an attempt to short-circuit the NaN check I made an (in hindsight) obvious error: 10 == 12 || is_nan(10) == is_nan(12) This will be true for all inputs, except for the NaN, not-NaN case. The macro has been updated to now generate: (10 == 12) || (is_nan(10) && is_nan(10)) so: (10 == 12) || (is_nan(10) && is_nan(12)) = false False or (False and False) is False (10 == 10) || (is_nan(10) && is_nan(10)) = true True or (False and False) is True (Nan == 10) || (is_nan(NaN) && is_nan(10)) = false False or (True and False) is False (Nan == Nan) || (is_nan(NaN) && is_nan(NaN)) = true False or (True and True) is True Which is correct for all cases. This bug was triggered because the hash function for floating point numbers can very easily generate collisions for the tested Vector3(). I've also added an extra hashing step to the float hash function to make this less likely to occur. This fixes #8081 and probably many more random weirdness.
* Add "Godot Engine contributors" copyright lineRémi Verschelde2017-04-081-0/+1
|
* fixed ClassDB inconsistenciesKarroffel2017-03-131-1/+1
| | | | fixes #7960
* A Whole New World (clang-format edition)Rémi Verschelde2017-03-051-961/+862
| | | | | | | | | | | | | | | | | | | | | | | | 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
* really fixed PTRCALL nowKarroffel2017-03-051-5/+1
|
* Added PowerState casting operator to VariantKarroffel2017-03-051-0/+5
| | | | Without it Godot does not build with PTRCALL_ENABLED
* 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
* Correct hash behavior for floating point numbersHein-Pieter van Braam2017-02-161-5/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes HashMap where a key or part of a key is a floating point number. To fix this the following has been done: * HashMap now takes an extra template argument Comparator. This class gets used to compare keys. The default Comperator now works correctly for common types and floating point numbets. * Variant implements ::hash_compare() now. This function implements nan-safe comparison for all types with components that contain floating point numbers. * Variant now has a VariantComparator which uses Variant::hash_compare() safely compare floating point components of variant's types. * The hash functions for floating point numbers will now normalize NaN values so that all floating point numbers that are NaN hash to the same value. C++ module writers that want to use HashMap internally in their modules can now also safeguard against this crash by defining their on Comperator class that safely compares their types. GDScript users, or writers of modules that don't use HashMap internally in their modules don't need to do anything. This fixes #7354 and fixes #6947.
* Style: Fix statements ending with ';;'Rémi Verschelde2017-01-161-1/+1
|
* Style: Cleanups, added headers, renamed filesRémi Verschelde2017-01-161-0/+1
| | | | | | | | | 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).
* Both Array and Dictionary are always in shared mode (removed copy on write).Juan Linietsky2017-01-111-2/+2
|
* Type renames:Juan Linietsky2017-01-111-170/+170
| | | | | | | | | | | | 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-3/+3
|
* Made Variant::NIL printable as "Null". Please everyone be on the lookout of ↵Juan Linietsky2017-01-081-1/+1
| | | | bugs related to assigning an empty variant to a string, and expecting it to be not empty!
* Memory pool vectors (DVector) have been enormously simplified in code, and ↵Juan Linietsky2017-01-071-117/+117
| | | | renamed to PoolVector
* ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to ↵Juan Linietsky2017-01-021-2/+2
| | | | | | | | Variant. All usages of "type" to refer to classes were renamed to "class" ClassDB has been exposed to GDScript. OBJ_TYPE() macro is now GDCLASS()
* 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!
* fixes #6331, Variant::can_convertRăzvan Cosmin Rădulescu2016-10-041-11/+3
|
* Reverted printable null object, seems to cause bugs around and not sure why.Juan Linietsky2016-08-061-1/+1
| | | | Will have to check better, likely for 3.0
* Likely with bugs and with some features are missing, as well as profiler ↵Juan Linietsky2016-08-061-1/+1
| | | | support, but VisualScript should be more or less done!
* Fix regression with str() improvements for math typesIgnacio Etcheverry2016-07-281-6/+34
|
* Prettier str() for arraysIgnacio Etcheverry2016-07-021-6/+12
|
* Remove CHARTYPE_16BITS unused checksJ08nY2016-06-191-2/+2
| | | | fix #5263
* Made error when signal calls a method with the wrong number of parameters ↵Juan Linietsky2016-06-121-2/+2
| | | | more detailed, closes #4893
* -Added configuration warning system for nodesJuan Linietsky2016-05-171-0/+44
| | | | | -Added a new "add" and "instance" buttons for scene tree -Added a vformat() function to ease translation work
* Add missing Vector2Array case to Variant::operator String()Ignacio Etcheverry2016-05-041-0/+12
| | | | - Correcly display Vector2Array default arguments in the documentation
* remove trailing whitespaceHubert Jarosz2016-03-091-179/+179
|
* AnimationTreePlayer: blend value tracks (closes #2299)Josh Grams2016-03-011-0/+15
| | | | | | Variant: - zero() sets a Variant to the appropriate type of zero value - blend() blends part of one Variant on top of another.
* -make signals throw an error when target method is not found, fixes #2036Juan Linietsky2016-01-041-0/+29
| | | | | -removed 4 arguments limit for emit_signal() from script -remvoed 4 arguments limit for call_deferred() from script
* -Ability to roll-back script-exported properties to their default value on ↵Juan Linietsky2016-01-021-0/+11
| | | | the script, closes #2128
* Update copyright to 2016 in headersGeorge Marques2016-01-011-1/+1
|
* -Changed var2str and str2var in GDScript to use VariantWriter and VariantParserJuan Linietsky2015-12-311-126/+5
| | | | -It is now finally possible to parse back a variant from text!
* merged some stuff for okamJuan Linietsky2015-09-031-2/+10
|
* Several performance improvements, mainly in loading and instancing scenes ↵Juan Linietsky2015-06-291-0/+57
| | | | | | | | and resources. A general speedup should be apparent, with even more peformance increase when compiling optimized. WARNING: Tested and it seems to work, but if something breaks, please report.
* added conversion from int, string to colorJuan Linietsky2015-05-271-2/+6
| | | | fixes #1971
* Made type-checking for arguments less trict between bool, int real. Fixes #1816Juan Linietsky2015-05-051-4/+4
|
* -More strict argument type-checking, will make many bugs visible, fixes #1809Juan Linietsky2015-05-041-5/+255
| | | | -added NOTIFICATION_INSTANCED
* -invalidated string -> int automatic conversion, fixes #1788Juan Linietsky2015-05-041-3/+3
|
* added return keyword, fixes #1797Juan Linietsky2015-05-041-1/+1
|
* Sort xml files, so order is constantest312015-05-011-0/+9
| | | | Makes xml format work better with version control systems.
* Ability to convert from nodes or other non resource with a get_rid() ↵Juan Linietsky2015-04-241-2/+10
| | | | function to a rid
* Updated copyright year in all headersJuan Linietsky2015-04-181-1/+1
|
* begin new serialization frameworkJuan Linietsky2015-02-151-17/+26
| | | | also got rid of STL dependency on triangulator