summaryrefslogtreecommitdiffstats
path: root/core/object.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Undo support for locking and grouping for both 2D and 3DSintinium2019-04-261-0/+5
| | |
* | | Object::script may not be a valid Ref<Script>Hein-Pieter van Braam-Stewart2019-04-201-1/+4
|/ / | | | | | | | | | | It appears that Object::script may be a valid ScriptInstance but not be castable to Ref<Script>. There were only 5 places in the code that made this assumption. This commit fixes that.
* | Style: Apply new changes from clang-format 8.0Rémi Verschelde2019-04-091-1/+2
| | | | | | | | | | | | 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).
* | Print errors comming from callvBojidar Marinov2019-03-051-13/+12
| | | | | | | | Fixes #18386
* | Ensure all properties are refreshed when setting a script, fixes #24845Juan Linietsky2019-02-241-1/+1
| |
* | Fix warnings seen with warnings=all and recent GCC 8.2.marxin2019-02-181-16/+14
| |
* | Fix typos with codespellRémi Verschelde2019-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 1.14.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang doubleclick lod nd numer que te unselect EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```
* | Use script instance binding for objects constructed from C#Ignacio Etcheverry2019-02-091-3/+12
| | | | | | | | | | | | | | Only possible if the object class is a "native type". If the object class is a user class (that derives a "native type") then a script is needed. Since CSharpLanguage does cleanup of script instance bindings when finished, cases like #25621 will no longer cause problems. Fixed ~Object() trying to free script instance bindings after the language has already been removed, which would result in a NULL dereference.
* | Mono: Lifetime fixes for CSharpInstance and instance binding dataIgnacio Etcheverry2019-02-031-0/+5
| | | | | | | | | | | | | | Avoid CSharpInstance from accessing its state after self destructing (by deleting the Reference owner). It's now safe to replace the script instance without leaking or crashing. Also fixed godot_icall_Object_weakref return reference being freed before returning.
* | Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Allow signal connecting even if script is invalid (only when compiled with ↵Juan Linietsky2018-11-271-2/+14
| | | | tools), fixes #17070
* Massive speed up on deleting nodes, fixes #18673Juan Linietsky2018-11-181-13/+13
| | | | Also makes the editor exit faster
* -Make sure monitorable cant be flipped while flushing queries, fixes #17330Juan Linietsky2018-11-161-0/+6
| | | | -Also added set_deferred, this was missing.
* -Moved EditorDefaultValue to ClassDB, made it coreJuan Linietsky2018-11-081-3/+4
| | | | -Removed one and zero hints for properties, replaced by default value
* Moved folding outside the resource files, now saved outside the project.Juan Linietsky2018-10-291-25/+1
|
* Merge pull request #22297 from DualMatrix/no_more_method_not_found_errorRémi Verschelde2018-10-021-1/+4
|\ | | | | Fixed method not found error when connecting with signal that fires in editor
| * Fixed method not found error when connecting with signal that fires in editorDualMatrix2018-09-211-1/+4
| | | | | | | | | | | | | | | | Fixed method not found error when connecting with signal that fires in editor. This is a better solution to the problem than #22033. As discussed on IRC This properly fixes #13070 then.
* | Fix dirty read of ObjectID counter when threads are involvedMarc Gilleron2018-09-291-4/+5
| |
* | Fix warnings about wrong member initialization order [-Wreorder]Rémi Verschelde2018-09-281-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the following GCC 5 warnings: ``` core/object.h:193:11: warning: 'MethodInfo::flags' will be initialized after [-Wreorder] core/object.h:192:15: warning: 'PropertyInfo MethodInfo::return_val' [-Wreorder] core/object.cpp:278:1: warning: when initialized here [-Wreorder] core/script_debugger_remote.h:97:6: warning: 'ScriptDebuggerRemote::max_cps' will be initialized after [-Wreorder] core/script_debugger_remote.h:91:6: warning: 'int ScriptDebuggerRemote::max_messages_per_frame' [-Wreorder] core/script_debugger_remote.cpp:1086:1: warning: when initialized here [-Wreorder] core/script_debugger_remote.h:98:6: warning: 'ScriptDebuggerRemote::char_count' will be initialized after [-Wreorder] core/script_debugger_remote.h:92:6: warning: 'int ScriptDebuggerRemote::n_messages_dropped' [-Wreorder] core/script_debugger_remote.cpp:1086:1: warning: when initialized here [-Wreorder] modules/bullet/area_bullet.h:102:7: warning: 'AreaBullet::isScratched' will be initialized after [-Wreorder] modules/bullet/area_bullet.h:92:39: warning: 'PhysicsServer::AreaSpaceOverrideMode AreaBullet::spOv_mode' [-Wreorder] modules/bullet/area_bullet.cpp:46:1: warning: when initialized here [-Wreorder] modules/bullet/collision_object_bullet.h:127:15: warning: 'CollisionObjectBullet::space' will be initialized after [-Wreorder] modules/bullet/collision_object_bullet.h:117:7: warning: 'CollisionObjectBullet::Type CollisionObjectBullet::type' [-Wreorder] modules/bullet/collision_object_bullet.cpp:67:1: warning: when initialized here [-Wreorder] modules/bullet/godot_ray_world_algorithm.h:48:7: warning: 'GodotRayWorldAlgorithm::m_ownManifol1d' will be initialized after [-Wreorder] modules/bullet/godot_ray_world_algorithm.h:46:33: warning: 'const btDiscreteDynamicsWorld* GodotRayWorldAlgorithm::m_world' [-Wreorder] modules/bullet/godot_ray_world_algorithm.cpp:50:1: warning: when initialized here [-Wreorder] modules/bullet/godot_result_callbacks.h:91:18: warning: 'GodotAllConvexResultCallback::m_exclude' will be initialized after [-Wreorder] modules/bullet/godot_result_callbacks.h:89:6: warning: 'int GodotAllConvexResultCallback::m_resultMax' [-Wreorder] modules/bullet/godot_result_callbacks.h:93:2: warning: when initialized here [-Wreorder] modules/bullet/godot_result_callbacks.h:142:18: warning: 'GodotAllContactResultCallback::m_exclude' will be initialized after [-Wreorder] modules/bullet/godot_result_callbacks.h:140:6: warning: 'int GodotAllContactResultCallback::m_resultMax' [-Wreorder] modules/bullet/godot_result_callbacks.h:147:2: warning: when initialized here [-Wreorder] modules/bullet/godot_result_callbacks.h:168:18: warning: 'GodotContactPairContactResultCallback::m_exclude' will be initialized after [-Wreorder] modules/bullet/godot_result_callbacks.h:166:6: warning: 'int GodotContactPairContactResultCallback::m_resultMax' [-Wreorder] modules/bullet/godot_result_callbacks.h:173:2: warning: when initialized here [-Wreorder] modules/bullet/godot_result_callbacks.h:195:18: warning: 'GodotRestInfoContactResultCallback::m_exclude' will be initialized after [-Wreorder] modules/bullet/godot_result_callbacks.h:191:7: warning: 'bool GodotRestInfoContactResultCallback::m_collided' [-Wreorder] modules/bullet/godot_result_callbacks.h:199:2: warning: when initialized here [-Wreorder] modules/bullet/rigid_body_bullet.h:200:9: warning: 'RigidBodyBullet::gravity_scale' will be initialized after [-Wreorder] modules/bullet/rigid_body_bullet.h:199:9: warning: 'real_t RigidBodyBullet::mass' [-Wreorder] modules/bullet/rigid_body_bullet.cpp:258:1: warning: when initialized here [-Wreorder] modules/bullet/rigid_body_bullet.h:222:28: warning: 'RigidBodyBullet::force_integration_callback' will be initialized after [-Wreorder] modules/bullet/rigid_body_bullet.h:219:7: warning: 'bool RigidBodyBullet::isTransformChanged' [-Wreorder] modules/bullet/rigid_body_bullet.cpp:258:1: warning: when initialized here [-Wreorder] modules/bullet/rigid_body_bullet.h:220:7: warning: 'RigidBodyBullet::previousActiveState' will be initialized after [-Wreorder] modules/bullet/rigid_body_bullet.h:208:6: warning: 'int RigidBodyBullet::maxCollisionsDetection' [-Wreorder] modules/bullet/rigid_body_bullet.cpp:258:1: warning: when initialized here [-Wreorder] modules/bullet/soft_body_bullet.h:69:9: warning: 'SoftBodyBullet::total_mass' will be initialized after [-Wreorder] modules/bullet/soft_body_bullet.h:68:6: warning: 'int SoftBodyBullet::simulation_precision' [-Wreorder] modules/bullet/soft_body_bullet.cpp:38:1: warning: when initialized here [-Wreorder] modules/bullet/soft_body_bullet.h:76:9: warning: 'SoftBodyBullet::drag_coefficient' will be initialized after [-Wreorder] modules/bullet/soft_body_bullet.h:61:14: warning: 'btSoftBody* SoftBodyBullet::bt_soft_body' [-Wreorder] modules/bullet/soft_body_bullet.cpp:38:1: warning: when initialized here [-Wreorder] modules/bullet/space_bullet.h:97:22: warning: 'SpaceBullet::solver' will be initialized after [-Wreorder] modules/bullet/space_bullet.h:95:35: warning: 'btDefaultCollisionConfiguration* SpaceBullet::collisionConfiguration' [-Wreorder] modules/bullet/space_bullet.cpp:333:1: warning: when initialized here [-Wreorder] modules/bullet/space_bullet.h:101:23: warning: 'SpaceBullet::soft_body_world_info' will be initialized after [-Wreorder] modules/bullet/space_bullet.h:99:23: warning: 'btGhostPairCallback* SpaceBullet::ghostPairCallback' [-Wreorder] modules/bullet/space_bullet.cpp:333:1: warning: when initialized here [-Wreorder] modules/gdnative/nativescript/nativescript.h:79:13: warning: 'NativeScriptDesc::base_native_type' will be initialized after [-Wreorder] modules/gdnative/nativescript/nativescript.h:73:9: warning: 'String NativeScriptDesc::documentation' [-Wreorder] modules/gdnative/nativescript/nativescript.h:88:9: warning: when initialized here [-Wreorder] modules/gdscript/gdscript.h:296:6: warning: 'GDScriptWarning::line' will be initialized after [-Wreorder] modules/gdscript/gdscript.h:294:4: warning: 'GDScriptWarning::Code GDScriptWarning::code' [-Wreorder] modules/gdscript/gdscript.h:303:2: warning: when initialized here [-Wreorder] scene/3d/physics_body.h:544:7: warning: 'PhysicalBone::simulate_physics' will be initialized after [-Wreorder] scene/3d/physics_body.h:543:7: warning: 'bool PhysicalBone::_internal_static_body' [-Wreorder] scene/3d/physics_body.cpp:2502:1: warning: when initialized here [-Wreorder] scene/3d/physics_body.h:546:6: warning: 'PhysicalBone::bone_id' will be initialized after [-Wreorder] scene/3d/physics_body.h:539:12: warning: 'Skeleton* PhysicalBone::parent_skeleton' [-Wreorder] scene/3d/physics_body.cpp:2502:1: warning: when initialized here [-Wreorder] scene/3d/spring_arm.h:44:11: warning: 'SpringArm::mask' will be initialized after [-Wreorder] scene/3d/spring_arm.h:43:8: warning: 'float SpringArm::current_spring_length' [-Wreorder] scene/3d/spring_arm.cpp:37:1: warning: when initialized here [-Wreorder] scene/animation/skeleton_ik.h:159:11: warning: 'SkeletonIK::target_node_override' will be initialized after [-Wreorder] scene/animation/skeleton_ik.h:152:7: warning: 'bool SkeletonIK::use_magnet' [-Wreorder] scene/animation/skeleton_ik.cpp:418:1: warning: when initialized here [-Wreorder] scene/resources/tile_set.h:84:9: warning: 'TileSet::AutotileData::size' will be initialized after [-Wreorder] scene/resources/tile_set.h:83:7: warning: 'int TileSet::AutotileData::spacing' [-Wreorder] scene/resources/tile_set.h:92:12: warning: when initialized here [-Wreorder] scene/resources/tile_set.h:115:12: warning: 'TileSet::TileData::tile_mode' will be initialized after [-Wreorder] scene/resources/tile_set.h:114:9: warning: 'Color TileSet::TileData::modulate' [-Wreorder] scene/resources/tile_set.h:120:12: warning: when initialized here [-Wreorder] servers/physics/body_sw.h:84:19: warning: 'BodySW::direct_state_query_list' will be initialized after [-Wreorder] servers/physics/body_sw.h:57:11: warning: 'uint16_t BodySW::locked_axis' [-Wreorder] servers/physics/body_sw.cpp:756:1: warning: when initialized here [-Wreorder] ``` Nothing really relevant for us, but it's not a bad consistency improvement anyway so worth taking.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-8/+8
| | | | | | 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.
* Merge pull request #16927 from neikeq/rework-refcount-notifyJuan Linietsky2018-08-251-1/+6
|\ | | | | Notify instance binding data api of refcount increment/decrement
| * Notify instance binding data api of refcount increment/decrementIgnacio Etcheverry2018-08-231-1/+6
| |
* | Add print_verbose to print to stdout only in verbose modeRémi Verschelde2018-08-241-3/+3
| | | | | | | | | | | | Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
* | Crash fixes for material and animtreeJuan Linietsky2018-08-201-5/+11
| |
* | Massive rewrite to AnimationTree. Many APIs changed in order to:Juan Linietsky2018-08-201-3/+20
| | | | | | | | | | -Reuse resources -Expose properties in AnimationTree
* | Merge pull request #20583 from neikeq/issue-15371Rémi Verschelde2018-08-141-9/+64
|\ \ | | | | | | Fix case where exported properties value is lost
| * | Fix case where exported properties value is lostIgnacio Etcheverry2018-07-291-9/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes exported property modified values lost when creating a placeholder script instance with a failed script compilation - Object set/get will call PlaceHolderScriptInstance's new fallback set/get methods as a last resort. This way, placeholder script instances can keep the values for storage or until the script is compiled successfuly. - Script::can_instance() will only return true if a real script instance can be created. Otherwise, in the case of placeholder script instances, it will return false. - Object::set_script(script) is now in charge of requesting the creation of placeholder script instances. It's no longer Script::instance_create(owner)'s duty. - PlaceHolderScriptInstance has a new method set_build_failed(bool) to determine whether it should call into its script methods or not. - Fixed a few problems during reloading of C# scripts.
* | | Ensure one shot signals are not disconnected while edited, closes #7776Juan Linietsky2018-07-291-1/+9
|/ /
* | Reduce unnecessary COW on Vector by make writing explicitHein-Pieter van Braam2018-07-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit makes operator[] on Vector const and adds a write proxy to it. From now on writes to Vectors need to happen through the .write proxy. So for instance: Vector<int> vec; vec.push_back(10); std::cout << vec[0] << std::endl; vec.write[0] = 20; Failing to use the .write proxy will cause a compilation error. In addition COWable datatypes can now embed a CowData pointer to their data. This means that String, CharString, and VMap no longer use or derive from Vector. _ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug builds. This is a lot faster for Vector in the editor and while running tests. The reason why this difference used to exist is because force-inlined methods used to give a bad debugging experience. After extensive testing with modern compilers this is no longer the case.
* | Several improvements to editor inspector usability and styleJuan Linietsky2018-07-181-1/+5
| |
* | Fix return type of _get() virtual methodGeorge Marques2018-05-291-0/+1
| |
* | Add is_instance_valid() method to GDScript, ending more than a decade of pain.Juan Linietsky2018-05-071-4/+0
|/
* Bind many more properties to scriptsBojidar Marinov2018-01-121-2/+2
| | | | | | | Notable potentially breaking changes: - PROPERTY_USAGE_NOEDITOR is now PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_NETWORK, without PROPERTY_USAGE_INTERNAL - Some properties were renamed, and sometimes even shadowed by new ones - New getter methods (some virtual) were added
* 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!
* Style: Apply new clang-format 5.0 style to all filesRémi Verschelde2017-12-071-84/+84
|
* Made Vector::ptrw explicit for writing, compiler was sometimes using the ↵Juan Linietsky2017-11-251-2/+2
| | | | | | wrong function, leading to unnecesary copy on writes and reduced performance.
* Fix a crash in get_static_property_type_indexedBojidar Marinov2017-11-241-0/+7
| | | | Fixes #13243
* Allow for getting/setting indexed properties of objects using get/set_indexedBojidar Marinov2017-11-211-0/+123
| | | | Performance is around the same as using pure set() through GDScript.
* Fixed a bunch of typos, including an error code.Ross Hadden2017-09-211-1/+1
|
* Moved class_name and return_val to initializer listWilson E. Alvarez2017-09-141-6/+6
|
* DocData and type hints fixesIgnacio Etcheverry2017-08-291-1/+58
| | | | | | | - Makes vararg methods automatically use PROPERTY_USAGE_NIL_IS_VARIANT on return types - Completely removes the ":type" suffix for method names. Virtual methods must use the MethodInfo constructors that takes Variant::Type or PropertyHint as the first parameter for the return type (with CLASS_INFO as a helper to get the PropertyInfo). Parameters must use PROPERTY_HINT_RESOURCE_TYPE and hint string. - PROPERTY_USAGE_NIL_IS_VARIANT is no longer needed for parameters, because parameters cannot be void. - Adds missing PROPERTY_USAGE_NIL_IS_VARIANT to virtual and built-in methods that return Variant.
* Dead code tells no talesRémi Verschelde2017-08-271-196/+1
|
* Use HTTPS URL for Godot's website in the headersRémi Verschelde2017-08-271-1/+1
|
* Fix double single quotes in `connect` error printPoommetee Ketson2017-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/
* Changed MethodBind API to request information from methods. It's much claner ↵Juan Linietsky2017-08-231-0/+4
| | | | | | now. Also changed PropertyInfo to include informatino about class names.
* ClassDB: Provide the enum name of integer constantsIgnacio Etcheverry2017-08-201-3/+3
|
* Rename localization method to `tr` againRémi Verschelde2017-08-181-4/+4
| | | | Partial revert of #10380 based on contributor ~~bullying~~ feedback.
* Rename `XL_MESSAGE` aka `tr` to `localize`Rémi Verschelde2017-08-171-9/+3
| | | | | Also renames `set_message_translation` to `set_message_localization` for consistency.