summaryrefslogtreecommitdiffstats
path: root/core/object.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Ensure object metadata is uniqueBojidar Marinov2019-09-281-1/+1
| | | | Closes #32415
* Added some obvious errors explanationsqarmin2019-09-251-3/+3
|
* Merge pull request #31423 from Calinou/improve-node-signal-group-tooltipRémi Verschelde2019-08-181-5/+6
|\ | | | | Improve the scene tree signals/groups tooltip
| * Improve the scene tree signals/groups tooltipHugo Locurcio2019-08-171-5/+6
| | | | | | | | | | The tooltip now displays the number of connections and groups that are assigned to the hovered node.
* | Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'Braden Bodily2019-08-171-49/+19
|/ | | | | | | | | Condensed some if and ERR statements. Added dots to end of error messages Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?), core/os/memory.cpp, drivers/png/png_driver_common.cpp, drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
* Revert "Expose "meta" to the Inspector"Rémi Verschelde2019-07-221-6/+3
|
* Merge pull request #22642 from YeldhamDev/inspector_metadataRémi Verschelde2019-07-191-3/+6
|\ | | | | Expose "meta" to the Inspector
| * Expose "meta" to the InspectorMichael Alexsander Silva Dias2018-12-081-3/+6
| |
* | Merge pull request #30126 from qarmin/remove_unnecessary_codeRémi Verschelde2019-07-011-4/+2
|\ \ | | | | | | Remove unnecessary code and add some error explanations
| * | Remove unnecessary code and add some error explanationsqarmin2019-07-011-4/+2
| | |
* | | Merge pull request #30096 from akien-mga/doc-misc-updatesRémi Verschelde2019-06-271-7/+1
|\ \ \ | |/ / |/| | doc: Proofread and complete various nodes
| * | doc: Proofread and complete various nodesRémi Verschelde2019-06-261-7/+1
| | | | | | | | | | | | | | | | | | | | | All 100% completed: MainLoop, Node, Object, Path, Performance, Reference, Resource, SceneState, SceneTree, UndoRedo. Also fixed some en_GB occurrences as the reference spelling is en_US.
* | | Some code changed with Clang-Tidyqarmin2019-06-261-9/+4
|/ /
* | Merge pull request #27886 from LeonardMeagher2/obj_to_stringRémi Verschelde2019-05-201-0/+12
|\ \ | | | | | | Allow overriding how scripted objects are converted to strings
| * | Allow overriding how scripted objects are converted to stringsLeonard Meagher2019-05-031-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | solves #26796 - ADD `String to_string()` method to Object which can be overriden by `String _to_string()` in scripts - ADD `String to_string(r_valid)` method to ScriptInstance to allow langauges to control how scripted objects are converted to strings - IMPLEMENT to_string for GDScriptInstance, VisualScriptInstance, and NativeScriptInstance - ADD Documentation about `Object.to_string` and `Object._to_string` - Changed `Variant::operator String` to use `obj->to_string()`
* | | Fix Object::get_indexed for simple properties.Fabio Alessandrelli2019-05-161-7/+5
| | | | | | | | | | | | | | | | | | Object::get_indexed was not correctly reporting invalid keys if the name was a direct property (not a subproperty), causing for example Tween to not report correctly a bad interpolate_property key.
* | | Change "ID" to lowercase "id"Aaron Franke2019-05-091-5/+5
| | | | | | | | | | | | Reasoning: ID is not an acronym, it is simply short for identification, so it logically should not be capitalized. But even if it was an acronym, other acronyms in Godot are not capitalized, like p_rid, p_ip, and p_json.
* | | 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