From 95a1400a2ac9de1a29fa305f45b928ce8e3044bd Mon Sep 17 00:00:00 2001 From: lupoDharkael Date: Thu, 2 Apr 2020 01:20:12 +0200 Subject: Replace NULL with nullptr --- scene/2d/animated_sprite_2d.cpp | 2 +- scene/2d/area_2d.cpp | 4 +- scene/2d/camera_2d.cpp | 6 +- scene/2d/collision_object_2d.cpp | 2 +- scene/2d/collision_object_2d.h | 2 +- scene/2d/collision_polygon_2d.cpp | 4 +- scene/2d/collision_shape_2d.cpp | 4 +- scene/2d/cpu_particles_2d.cpp | 2 +- scene/2d/joints_2d.cpp | 4 +- scene/2d/line_builder.cpp | 8 +- scene/2d/navigation_agent_2d.cpp | 28 ++--- scene/2d/navigation_obstacle_2d.cpp | 16 +-- scene/2d/navigation_region_2d.cpp | 6 +- scene/2d/path_2d.cpp | 4 +- scene/2d/physics_body_2d.cpp | 26 ++--- scene/2d/polygon_2d.cpp | 2 +- scene/2d/ray_cast_2d.cpp | 2 +- scene/2d/skeleton_2d.cpp | 14 +-- scene/2d/tile_map.cpp | 16 +-- scene/3d/area_3d.cpp | 4 +- scene/3d/arvr_nodes.cpp | 34 +++--- scene/3d/audio_stream_player_3d.cpp | 2 +- scene/3d/audio_stream_player_3d.h | 2 +- scene/3d/baked_lightmap.cpp | 6 +- scene/3d/camera_3d.cpp | 6 +- scene/3d/collision_object_3d.cpp | 2 +- scene/3d/collision_object_3d.h | 2 +- scene/3d/collision_polygon_3d.cpp | 4 +- scene/3d/collision_shape_3d.cpp | 8 +- scene/3d/cpu_particles_3d.cpp | 6 +- scene/3d/gi_probe.cpp | 8 +- scene/3d/gi_probe.h | 2 +- scene/3d/gpu_particles_3d.cpp | 4 +- scene/3d/listener_3d.cpp | 2 +- scene/3d/mesh_instance_3d.cpp | 8 +- scene/3d/navigation_agent_3d.cpp | 28 ++--- scene/3d/navigation_obstacle_3d.cpp | 16 +-- scene/3d/navigation_region_3d.cpp | 16 +-- scene/3d/node_3d.cpp | 20 ++-- scene/3d/path_3d.cpp | 4 +- scene/3d/physics_body_3d.cpp | 34 +++--- scene/3d/physics_joint_3d.cpp | 4 +- scene/3d/ray_cast_3d.cpp | 6 +- scene/3d/skeleton_3d.cpp | 10 +- scene/3d/skeleton_3d.h | 4 +- scene/3d/skeleton_ik_3d.cpp | 26 ++--- scene/3d/skeleton_ik_3d.h | 10 +- scene/3d/soft_body_3d.cpp | 8 +- scene/3d/sprite_3d.cpp | 12 +- scene/3d/vehicle_body_3d.cpp | 10 +- scene/animation/animation_blend_tree.cpp | 2 +- scene/animation/animation_cache.cpp | 4 +- scene/animation/animation_cache.h | 8 +- scene/animation/animation_node_state_machine.cpp | 4 +- scene/animation/animation_player.cpp | 12 +- scene/animation/animation_player.h | 18 +-- scene/animation/animation_tree.cpp | 36 +++--- scene/animation/animation_tree.h | 8 +- scene/animation/tween.cpp | 56 +++++----- scene/audio/audio_stream_player.cpp | 2 +- scene/debugger/scene_debugger.cpp | 28 ++--- scene/gui/base_button.cpp | 2 +- scene/gui/color_picker.cpp | 10 +- scene/gui/control.cpp | 94 ++++++++-------- scene/gui/file_dialog.cpp | 12 +- scene/gui/graph_edit.cpp | 8 +- scene/gui/graph_node.cpp | 2 +- scene/gui/label.cpp | 8 +- scene/gui/line_edit.cpp | 24 ++-- scene/gui/range.cpp | 2 +- scene/gui/rich_text_label.cpp | 64 +++++------ scene/gui/rich_text_label.h | 14 +-- scene/gui/scroll_bar.cpp | 8 +- scene/gui/spin_box.cpp | 2 +- scene/gui/split_container.cpp | 2 +- scene/gui/tab_container.cpp | 6 +- scene/gui/text_edit.cpp | 28 ++--- scene/gui/text_edit.h | 2 +- scene/gui/tree.cpp | 134 +++++++++++------------ scene/gui/tree.h | 4 +- scene/main/canvas_item.cpp | 24 ++-- scene/main/canvas_layer.cpp | 4 +- scene/main/http_request.cpp | 8 +- scene/main/instance_placeholder.cpp | 8 +- scene/main/node.cpp | 126 ++++++++++----------- scene/main/node.h | 4 +- scene/main/scene_tree.cpp | 26 ++--- scene/main/viewport.cpp | 134 +++++++++++------------ scene/main/viewport.h | 2 +- scene/main/window.cpp | 4 +- scene/resources/audio_stream_sample.cpp | 6 +- scene/resources/default_theme/default_theme.cpp | 10 +- scene/resources/dynamic_font.cpp | 18 +-- scene/resources/dynamic_font.h | 2 +- scene/resources/environment.cpp | 4 +- scene/resources/font.cpp | 6 +- scene/resources/font.h | 2 +- scene/resources/material.cpp | 10 +- scene/resources/mesh.cpp | 6 +- scene/resources/mesh_data_tool.cpp | 28 ++--- scene/resources/packed_scene.cpp | 62 +++++------ scene/resources/particles_material.cpp | 6 +- scene/resources/polygon_path_finder.cpp | 10 +- scene/resources/primitive_meshes.cpp | 2 +- scene/resources/resource_format_text.cpp | 10 +- scene/resources/resource_format_text.h | 2 +- scene/resources/shader.h | 4 +- scene/resources/shape_2d.cpp | 4 +- scene/resources/surface_tool.cpp | 6 +- scene/resources/texture.cpp | 14 +-- scene/resources/texture.h | 4 +- scene/resources/theme.cpp | 70 ++++++------ scene/resources/tile_set.cpp | 6 +- scene/resources/tile_set.h | 4 +- scene/resources/visual_shader.cpp | 14 +-- scene/resources/world_3d.cpp | 2 +- scene/scene_string_names.cpp | 2 +- scene/scene_string_names.h | 2 +- 118 files changed, 860 insertions(+), 860 deletions(-) (limited to 'scene') diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp index 4cedfc0c20..fc34f967ce 100644 --- a/scene/2d/animated_sprite_2d.cpp +++ b/scene/2d/animated_sprite_2d.cpp @@ -652,7 +652,7 @@ void AnimatedSprite2D::_reset_timeout() { void AnimatedSprite2D::set_animation(const StringName &p_animation) { - ERR_FAIL_COND_MSG(frames == NULL, vformat("There is no animation with name '%s'.", p_animation)); + ERR_FAIL_COND_MSG(frames == nullptr, vformat("There is no animation with name '%s'.", p_animation)); ERR_FAIL_COND_MSG(frames->get_animation_names().find(p_animation) == -1, vformat("There is no animation with name '%s'.", p_animation)); if (animation == p_animation) diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 4ccff07416..c46b6eeb5c 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -407,8 +407,8 @@ void Area2D::set_monitoring(bool p_enable) { PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout); } else { - PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName()); - PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName()); + PhysicsServer2D::get_singleton()->area_set_monitor_callback(get_rid(), nullptr, StringName()); + PhysicsServer2D::get_singleton()->area_set_area_monitor_callback(get_rid(), nullptr, StringName()); _clear_monitoring(); } } diff --git a/scene/2d/camera_2d.cpp b/scene/2d/camera_2d.cpp index 6d8d981974..d8af14a3fb 100644 --- a/scene/2d/camera_2d.cpp +++ b/scene/2d/camera_2d.cpp @@ -264,7 +264,7 @@ void Camera2D::_notification(int p_what) { } remove_from_group(group_name); remove_from_group(canvas_group_name); - viewport = NULL; + viewport = nullptr; } break; case NOTIFICATION_DRAW: { @@ -433,7 +433,7 @@ void Camera2D::clear_current() { current = false; if (is_inside_tree()) { - get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, group_name, "_make_current", (Object *)(NULL)); + get_tree()->call_group_flags(SceneTree::GROUP_CALL_REALTIME, group_name, "_make_current", (Object *)nullptr); } } @@ -794,7 +794,7 @@ Camera2D::Camera2D() { first = true; smoothing_enabled = false; limit_smoothing_enabled = false; - custom_viewport = NULL; + custom_viewport = nullptr; process_mode = CAMERA2D_PROCESS_IDLE; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index 5535043432..d82f4a2f2b 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -233,7 +233,7 @@ Transform2D CollisionObject2D::shape_owner_get_transform(uint32_t p_owner) const Object *CollisionObject2D::shape_owner_get_owner(uint32_t p_owner) const { - ERR_FAIL_COND_V(!shapes.has(p_owner), NULL); + ERR_FAIL_COND_V(!shapes.has(p_owner), nullptr); return shapes[p_owner].owner; } diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 8874f61bb7..e931f20f40 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -60,7 +60,7 @@ class CollisionObject2D : public Node2D { disabled = false; one_way_collision = false; one_way_collision_margin = 0; - owner = NULL; + owner = nullptr; } }; diff --git a/scene/2d/collision_polygon_2d.cpp b/scene/2d/collision_polygon_2d.cpp index 5880045e90..1e48b2d67f 100644 --- a/scene/2d/collision_polygon_2d.cpp +++ b/scene/2d/collision_polygon_2d.cpp @@ -129,7 +129,7 @@ void CollisionPolygon2D::_notification(int p_what) { parent->remove_shape_owner(owner_id); } owner_id = 0; - parent = NULL; + parent = nullptr; } break; case NOTIFICATION_DRAW: { @@ -319,7 +319,7 @@ CollisionPolygon2D::CollisionPolygon2D() { aabb = Rect2(-10, -10, 20, 20); build_mode = BUILD_SOLIDS; set_notify_local_transform(true); - parent = NULL; + parent = nullptr; owner_id = 0; disabled = false; one_way_collision = false; diff --git a/scene/2d/collision_shape_2d.cpp b/scene/2d/collision_shape_2d.cpp index cb2953cc15..b1dbc57c94 100644 --- a/scene/2d/collision_shape_2d.cpp +++ b/scene/2d/collision_shape_2d.cpp @@ -96,7 +96,7 @@ void CollisionShape2D::_notification(int p_what) { parent->remove_shape_owner(owner_id); } owner_id = 0; - parent = NULL; + parent = nullptr; } break; case NOTIFICATION_DRAW: { @@ -249,7 +249,7 @@ CollisionShape2D::CollisionShape2D() { rect = Rect2(-Point2(10, 10), Point2(20, 20)); set_notify_local_transform(true); owner_id = 0; - parent = NULL; + parent = nullptr; disabled = false; one_way_collision = false; one_way_collision_margin = 1.0; diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index 47465f727e..0a6b091a51 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -976,7 +976,7 @@ void CPUParticles2D::_update_particle_data_buffer() { int pc = particles.size(); int *ow; - int *order = NULL; + int *order = nullptr; float *w = particle_data.ptrw(); const Particle *r = particles.ptr(); diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 6cbb0d2a39..4d49f4762f 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -49,8 +49,8 @@ void Joint2D::_update_joint(bool p_only_free) { if (p_only_free || !is_inside_tree()) return; - Node *node_a = has_node(get_node_a()) ? get_node(get_node_a()) : (Node *)NULL; - Node *node_b = has_node(get_node_b()) ? get_node(get_node_b()) : (Node *)NULL; + Node *node_a = has_node(get_node_a()) ? get_node(get_node_a()) : (Node *)nullptr; + Node *node_b = has_node(get_node_b()) ? get_node(get_node_b()) : (Node *)nullptr; if (!node_a || !node_b) return; diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp index 3385f2fbe0..6b06f2227a 100644 --- a/scene/2d/line_builder.cpp +++ b/scene/2d/line_builder.cpp @@ -95,9 +95,9 @@ static inline Vector2 interpolate(const Rect2 &r, const Vector2 &v) { LineBuilder::LineBuilder() { joint_mode = Line2D::LINE_JOINT_SHARP; width = 10; - curve = NULL; + curve = nullptr; default_color = Color(0.4, 0.5, 1); - gradient = NULL; + gradient = nullptr; sharp_limit = 2.f; round_precision = 8; begin_cap_mode = Line2D::LINE_CAP_NONE; @@ -147,8 +147,8 @@ void LineBuilder::build() { float current_distance1 = 0.f; float total_distance = 0.f; float width_factor = 1.f; - _interpolate_color = gradient != NULL; - bool retrieve_curve = curve != NULL; + _interpolate_color = gradient != nullptr; + bool retrieve_curve = curve != nullptr; bool distance_required = _interpolate_color || retrieve_curve || texture_mode == Line2D::LINE_TEXTURE_TILE || diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index c70d5ab1fe..32da46e8a8 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -98,12 +98,12 @@ void NavigationAgent2D::_notification(int p_what) { // Search the navigation node and set it { - Navigation2D *nav = NULL; + Navigation2D *nav = nullptr; Node *p = get_parent(); - while (p != NULL) { + while (p != nullptr) { nav = Object::cast_to(p); - if (nav != NULL) - p = NULL; + if (nav != nullptr) + p = nullptr; else p = p->get_parent(); } @@ -114,8 +114,8 @@ void NavigationAgent2D::_notification(int p_what) { set_physics_process_internal(true); } break; case NOTIFICATION_EXIT_TREE: { - agent_parent = NULL; - set_navigation(NULL); + agent_parent = nullptr; + set_navigation(nullptr); set_physics_process_internal(false); } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { @@ -134,8 +134,8 @@ void NavigationAgent2D::_notification(int p_what) { } NavigationAgent2D::NavigationAgent2D() : - agent_parent(NULL), - navigation(NULL), + agent_parent(nullptr), + navigation(nullptr), agent(RID()), target_desired_distance(1.0), path_max_distance(3.0), @@ -160,12 +160,12 @@ void NavigationAgent2D::set_navigation(Navigation2D *p_nav) { return; // Pointless navigation = p_nav; - NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid()); + NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == nullptr ? RID() : navigation->get_rid()); } void NavigationAgent2D::set_navigation_node(Node *p_nav) { Navigation2D *nav = Object::cast_to(p_nav); - ERR_FAIL_COND(nav == NULL); + ERR_FAIL_COND(nav == nullptr); set_navigation(nav); } @@ -225,7 +225,7 @@ Vector2 NavigationAgent2D::get_target_location() const { Vector2 NavigationAgent2D::get_next_location() { update_navigation(); if (navigation_path.size() == 0) { - ERR_FAIL_COND_V(agent_parent == NULL, Vector2()); + ERR_FAIL_COND_V(agent_parent == nullptr, Vector2()); return agent_parent->get_global_transform().get_origin(); } else { return navigation_path[nav_path_index]; @@ -233,7 +233,7 @@ Vector2 NavigationAgent2D::get_next_location() { } real_t NavigationAgent2D::distance_to_target() const { - ERR_FAIL_COND_V(agent_parent == NULL, 0.0); + ERR_FAIL_COND_V(agent_parent == nullptr, 0.0); return agent_parent->get_global_transform().get_origin().distance_to(target_location); } @@ -288,8 +288,8 @@ String NavigationAgent2D::get_configuration_warning() const { void NavigationAgent2D::update_navigation() { - if (agent_parent == NULL) return; - if (navigation == NULL) return; + if (agent_parent == nullptr) return; + if (navigation == nullptr) return; if (update_frame_id == Engine::get_singleton()->get_physics_frames()) return; update_frame_id = Engine::get_singleton()->get_physics_frames(); diff --git a/scene/2d/navigation_obstacle_2d.cpp b/scene/2d/navigation_obstacle_2d.cpp index 4c6e777e73..50d02ca507 100644 --- a/scene/2d/navigation_obstacle_2d.cpp +++ b/scene/2d/navigation_obstacle_2d.cpp @@ -49,12 +49,12 @@ void NavigationObstacle2D::_notification(int p_what) { // Search the navigation node and set it { - Navigation2D *nav = NULL; + Navigation2D *nav = nullptr; Node *p = get_parent(); - while (p != NULL) { + while (p != nullptr) { nav = Object::cast_to(p); - if (nav != NULL) - p = NULL; + if (nav != nullptr) + p = nullptr; else p = p->get_parent(); } @@ -65,7 +65,7 @@ void NavigationObstacle2D::_notification(int p_what) { set_physics_process_internal(true); } break; case NOTIFICATION_EXIT_TREE: { - set_navigation(NULL); + set_navigation(nullptr); set_physics_process_internal(false); } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { @@ -79,7 +79,7 @@ void NavigationObstacle2D::_notification(int p_what) { } NavigationObstacle2D::NavigationObstacle2D() : - navigation(NULL), + navigation(nullptr), agent(RID()) { agent = NavigationServer2D::get_singleton()->agent_create(); } @@ -94,12 +94,12 @@ void NavigationObstacle2D::set_navigation(Navigation2D *p_nav) { return; // Pointless navigation = p_nav; - NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid()); + NavigationServer2D::get_singleton()->agent_set_map(agent, navigation == nullptr ? RID() : navigation->get_rid()); } void NavigationObstacle2D::set_navigation_node(Node *p_nav) { Navigation2D *nav = Object::cast_to(p_nav); - ERR_FAIL_COND(nav == NULL); + ERR_FAIL_COND(nav == nullptr); set_navigation(nav); } diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index f0839b4597..d77fd5b097 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -281,7 +281,7 @@ void NavigationPolygon::make_polygons_from_outlines() { for (int l = 0; l < olsize2; l++) { - if (Geometry::segment_intersects_segment_2d(r[0], outside_point, r2[l], r2[(l + 1) % olsize2], NULL)) { + if (Geometry::segment_intersects_segment_2d(r[0], outside_point, r2[l], r2[(l + 1) % olsize2], nullptr)) { interscount++; } } @@ -449,7 +449,7 @@ void NavigationRegion2D::_notification(int p_what) { NavigationServer2D::get_singleton()->region_set_map(region, RID()); } - navigation = NULL; + navigation = nullptr; } break; case NOTIFICATION_DRAW: { @@ -574,7 +574,7 @@ NavigationRegion2D::NavigationRegion2D() { set_notify_transform(true); region = NavigationServer2D::get_singleton()->region_create(); - navigation = NULL; + navigation = nullptr; } NavigationRegion2D::~NavigationRegion2D() { diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index 3e807f12dc..d55b21bc24 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -242,7 +242,7 @@ void PathFollow2D::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - path = NULL; + path = nullptr; } break; } } @@ -421,7 +421,7 @@ PathFollow2D::PathFollow2D() { offset = 0; h_offset = 0; v_offset = 0; - path = NULL; + path = nullptr; rotate = true; cubic = true; loop = true; diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index d866906ca5..21dc9537ec 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -362,7 +362,7 @@ struct _RigidBody2DInOut { bool RigidBody2D::_test_motion(const Vector2 &p_motion, bool p_infinite_inertia, float p_margin, const Ref &p_result) { - PhysicsServer2D::MotionResult *r = NULL; + PhysicsServer2D::MotionResult *r = nullptr; if (p_result.is_valid()) r = p_result->get_result_ptr(); return PhysicsServer2D::get_singleton()->body_test_motion(get_rid(), get_global_transform(), p_motion, p_infinite_inertia, p_margin, r); @@ -474,7 +474,7 @@ void RigidBody2D::_direct_state_changed(Object *p_state) { contact_monitor->locked = false; } - state = NULL; + state = nullptr; } void RigidBody2D::set_mode(Mode p_mode) { @@ -780,7 +780,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { } memdelete(contact_monitor); - contact_monitor = NULL; + contact_monitor = nullptr; } else { contact_monitor = memnew(ContactMonitor); @@ -790,7 +790,7 @@ void RigidBody2D::set_contact_monitor(bool p_enabled) { bool RigidBody2D::is_contact_monitor_enabled() const { - return contact_monitor != NULL; + return contact_monitor != nullptr; } void RigidBody2D::_notification(int p_what) { @@ -950,14 +950,14 @@ RigidBody2D::RigidBody2D() : angular_damp = -1; max_contacts_reported = 0; - state = NULL; + state = nullptr; angular_velocity = 0; sleeping = false; ccd_mode = CCD_MODE_DISABLED; custom_integrator = false; - contact_monitor = NULL; + contact_monitor = nullptr; can_sleep = true; PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed"); @@ -1281,7 +1281,7 @@ void KinematicBody2D::set_sync_to_physics(bool p_enable) { set_only_update_transform_changes(true); set_notify_local_transform(true); } else { - PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, ""); + PhysicsServer2D::get_singleton()->body_set_force_integration_callback(get_rid(), nullptr, ""); set_only_update_transform_changes(false); set_notify_local_transform(false); } @@ -1368,12 +1368,12 @@ KinematicBody2D::KinematicBody2D() : } KinematicBody2D::~KinematicBody2D() { if (motion_cache.is_valid()) { - motion_cache->owner = NULL; + motion_cache->owner = nullptr; } for (int i = 0; i < slide_colliders.size(); i++) { if (slide_colliders[i].is_valid()) { - slide_colliders.write[i]->owner = NULL; + slide_colliders.write[i]->owner = nullptr; } } } @@ -1394,7 +1394,7 @@ Vector2 KinematicCollision2D::get_remainder() const { return collision.remainder; } Object *KinematicCollision2D::get_local_shape() const { - if (!owner) return NULL; + if (!owner) return nullptr; uint32_t ownerid = owner->shape_find_owner(collision.local_shape); return owner->shape_owner_get_owner(ownerid); } @@ -1405,7 +1405,7 @@ Object *KinematicCollision2D::get_collider() const { return ObjectDB::get_instance(collision.collider); } - return NULL; + return nullptr; } ObjectID KinematicCollision2D::get_collider_id() const { @@ -1422,7 +1422,7 @@ Object *KinematicCollision2D::get_collider_shape() const { } } - return NULL; + return nullptr; } int KinematicCollision2D::get_collider_shape_index() const { @@ -1468,5 +1468,5 @@ KinematicCollision2D::KinematicCollision2D() { collision.collider_shape = 0; collision.local_shape = 0; - owner = NULL; + owner = nullptr; } diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index 8d20053c6e..84c1828b47 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -103,7 +103,7 @@ void Polygon2D::_notification(int p_what) { if (polygon.size() < 3) return; - Skeleton2D *skeleton_node = NULL; + Skeleton2D *skeleton_node = nullptr; if (has_node(skeleton)) { skeleton_node = Object::cast_to(get_node(skeleton)); } diff --git a/scene/2d/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp index ed971b1c3a..9d6c7304ce 100644 --- a/scene/2d/ray_cast_2d.cpp +++ b/scene/2d/ray_cast_2d.cpp @@ -79,7 +79,7 @@ bool RayCast2D::is_colliding() const { Object *RayCast2D::get_collider() const { if (against.is_null()) - return NULL; + return nullptr; return ObjectDB::get_instance(against); } diff --git a/scene/2d/skeleton_2d.cpp b/scene/2d/skeleton_2d.cpp index 2be6b6a75c..86c9ff6076 100644 --- a/scene/2d/skeleton_2d.cpp +++ b/scene/2d/skeleton_2d.cpp @@ -35,7 +35,7 @@ void Bone2D::_notification(int p_what) { if (p_what == NOTIFICATION_ENTER_TREE) { Node *parent = get_parent(); parent_bone = Object::cast_to(parent); - skeleton = NULL; + skeleton = nullptr; while (parent) { skeleton = Object::cast_to(parent); if (skeleton) @@ -73,9 +73,9 @@ void Bone2D::_notification(int p_what) { } } skeleton->_make_bone_setup_dirty(); - skeleton = NULL; + skeleton = nullptr; } - parent_bone = NULL; + parent_bone = nullptr; } } void Bone2D::_bind_methods() { @@ -157,8 +157,8 @@ String Bone2D::get_configuration_warning() const { } Bone2D::Bone2D() { - skeleton = NULL; - parent_bone = NULL; + skeleton = nullptr; + parent_bone = nullptr; skeleton_index = -1; default_length = 16; set_notify_local_transform(true); @@ -257,8 +257,8 @@ int Skeleton2D::get_bone_count() const { Bone2D *Skeleton2D::get_bone(int p_idx) { - ERR_FAIL_COND_V(!is_inside_tree(), NULL); - ERR_FAIL_INDEX_V(p_idx, bones.size(), NULL); + ERR_FAIL_COND_V(!is_inside_tree(), nullptr); + ERR_FAIL_INDEX_V(p_idx, bones.size(), nullptr); return bones[p_idx].bone; } diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index c468389040..1cf12e4421 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -103,8 +103,8 @@ void TileMap::_notification(int p_what) { q.occluder_instances.clear(); } - collision_parent = NULL; - navigation = NULL; + collision_parent = nullptr; + navigation = nullptr; } break; @@ -314,7 +314,7 @@ void TileMap::_add_shape(int &shape_idx, const Quadrant &p_q, const Ref int real_index = collision_parent->shape_owner_get_shape_index(p_q.shape_owner_id, shape_idx); RID rid = collision_parent->get_rid(); - if (Object::cast_to(collision_parent) != NULL) { + if (Object::cast_to(collision_parent) != nullptr) { ps->area_set_shape_transform(rid, real_index, get_transform() * xform); } else { ps->body_set_shape_transform(rid, real_index, get_transform() * xform); @@ -921,7 +921,7 @@ void TileMap::make_bitmask_area_dirty(const Vector2 &p_pos) { for (int x = p_pos.x - 1; x <= p_pos.x + 1; x++) { for (int y = p_pos.y - 1; y <= p_pos.y + 1; y++) { PosKey p(x, y); - if (dirty_bitmask.find(p) == NULL) { + if (dirty_bitmask.find(p) == nullptr) { dirty_bitmask.push_back(p); } } @@ -962,7 +962,7 @@ void TileMap::update_cell_bitmask(int p_x, int p_y) { ERR_FAIL_COND_MSG(tile_set.is_null(), "Cannot update cell bitmask if Tileset is not open."); PosKey p(p_x, p_y); Map::Element *E = tile_map.find(p); - if (E != NULL) { + if (E != nullptr) { int id = get_cell(p_x, p_y); if (tile_set->tile_get_tile_mode(id) == TileSet::AUTO_TILE) { uint16_t mask = 0; @@ -1368,7 +1368,7 @@ void TileMap::set_collision_use_parent(bool p_use_parent) { if (use_parent && is_inside_tree()) { collision_parent = Object::cast_to(get_parent()); } else { - collision_parent = NULL; + collision_parent = nullptr; } _recreate_quadrants(); @@ -1959,9 +1959,9 @@ TileMap::TileMap() { mode = MODE_SQUARE; half_offset = HALF_OFFSET_DISABLED; use_parent = false; - collision_parent = NULL; + collision_parent = nullptr; use_kinematic = false; - navigation = NULL; + navigation = nullptr; y_sort_mode = false; compatibility_mode = false; centered_textures = false; diff --git a/scene/3d/area_3d.cpp b/scene/3d/area_3d.cpp index 5b02a91793..17ae553e5e 100644 --- a/scene/3d/area_3d.cpp +++ b/scene/3d/area_3d.cpp @@ -301,8 +301,8 @@ void Area3D::set_monitoring(bool p_enable) { PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_body_inout); PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), this, SceneStringNames::get_singleton()->_area_inout); } else { - PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), NULL, StringName()); - PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), NULL, StringName()); + PhysicsServer3D::get_singleton()->area_set_monitor_callback(get_rid(), nullptr, StringName()); + PhysicsServer3D::get_singleton()->area_set_area_monitor_callback(get_rid(), nullptr, StringName()); _clear_monitoring(); } } diff --git a/scene/3d/arvr_nodes.cpp b/scene/3d/arvr_nodes.cpp index ce7c885a40..537c094ceb 100644 --- a/scene/3d/arvr_nodes.cpp +++ b/scene/3d/arvr_nodes.cpp @@ -40,14 +40,14 @@ void ARVRCamera::_notification(int p_what) { case NOTIFICATION_ENTER_TREE: { // need to find our ARVROrigin parent and let it know we're its camera! ARVROrigin *origin = Object::cast_to(get_parent()); - if (origin != NULL) { + if (origin != nullptr) { origin->set_tracked_camera(this); } }; break; case NOTIFICATION_EXIT_TREE: { // need to find our ARVROrigin parent and let it know we're no longer its camera! ARVROrigin *origin = Object::cast_to(get_parent()); - if (origin != NULL) { + if (origin != nullptr) { origin->clear_tracked_camera_if(this); } }; break; @@ -60,7 +60,7 @@ String ARVRCamera::get_configuration_warning() const { // must be child node of ARVROrigin! ARVROrigin *origin = Object::cast_to(get_parent()); - if (origin == NULL) { + if (origin == nullptr) { return TTR("ARVRCamera must have an ARVROrigin node as its parent."); }; @@ -192,7 +192,7 @@ void ARVRController::_notification(int p_what) { // find the tracker for our controller ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker == NULL) { + if (tracker == nullptr) { // this controller is currently turned off is_active = false; button_states = 0; @@ -279,7 +279,7 @@ String ARVRController::get_controller_name(void) const { ERR_FAIL_NULL_V(arvr_server, String()); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker == NULL) { + if (tracker == nullptr) { return String("Not connected"); }; @@ -292,7 +292,7 @@ int ARVRController::get_joystick_id() const { ERR_FAIL_NULL_V(arvr_server, 0); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker == NULL) { + if (tracker == nullptr) { // No tracker? no joystick id... (0 is our first joystick) return -1; }; @@ -324,7 +324,7 @@ real_t ARVRController::get_rumble() const { ERR_FAIL_NULL_V(arvr_server, 0.0); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker == NULL) { + if (tracker == nullptr) { return 0.0; }; @@ -337,7 +337,7 @@ void ARVRController::set_rumble(real_t p_rumble) { ERR_FAIL_NULL(arvr_server); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker != NULL) { + if (tracker != nullptr) { tracker->set_rumble(p_rumble); }; }; @@ -356,7 +356,7 @@ ARVRPositionalTracker::TrackerHand ARVRController::get_hand() const { ERR_FAIL_NULL_V(arvr_server, ARVRPositionalTracker::TRACKER_HAND_UNKNOWN); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_CONTROLLER, controller_id); - if (tracker == NULL) { + if (tracker == nullptr) { return ARVRPositionalTracker::TRACKER_HAND_UNKNOWN; }; @@ -369,7 +369,7 @@ String ARVRController::get_configuration_warning() const { // must be child node of ARVROrigin! ARVROrigin *origin = Object::cast_to(get_parent()); - if (origin == NULL) { + if (origin == nullptr) { return TTR("ARVRController must have an ARVROrigin node as its parent."); }; @@ -407,7 +407,7 @@ void ARVRAnchor::_notification(int p_what) { // find the tracker for our anchor ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id); - if (tracker == NULL) { + if (tracker == nullptr) { // this anchor is currently not available is_active = false; } else { @@ -479,7 +479,7 @@ String ARVRAnchor::get_anchor_name(void) const { ERR_FAIL_NULL_V(arvr_server, String()); ARVRPositionalTracker *tracker = arvr_server->find_by_type_and_id(ARVRServer::TRACKER_ANCHOR, anchor_id); - if (tracker == NULL) { + if (tracker == nullptr) { return String("Not connected"); }; @@ -496,7 +496,7 @@ String ARVRAnchor::get_configuration_warning() const { // must be child node of ARVROrigin! ARVROrigin *origin = Object::cast_to(get_parent()); - if (origin == NULL) { + if (origin == nullptr) { return TTR("ARVRAnchor must have an ARVROrigin node as its parent."); }; @@ -535,7 +535,7 @@ String ARVROrigin::get_configuration_warning() const { if (!is_visible() || !is_inside_tree()) return String(); - if (tracked_camera == NULL) + if (tracked_camera == nullptr) return TTR("ARVROrigin requires an ARVRCamera child node."); return String(); @@ -553,7 +553,7 @@ void ARVROrigin::set_tracked_camera(ARVRCamera *p_tracked_camera) { void ARVROrigin::clear_tracked_camera_if(ARVRCamera *p_tracked_camera) { if (tracked_camera == p_tracked_camera) { - tracked_camera = NULL; + tracked_camera = nullptr; }; }; @@ -591,7 +591,7 @@ void ARVROrigin::_notification(int p_what) { // check if we have a primary interface Ref arvr_interface = arvr_server->get_primary_interface(); - if (arvr_interface.is_valid() && tracked_camera != NULL) { + if (arvr_interface.is_valid() && tracked_camera != nullptr) { // get our positioning transform for our headset Transform t = arvr_interface->get_transform_for_eye(ARVRInterface::EYE_MONO, Transform()); @@ -613,7 +613,7 @@ void ARVROrigin::_notification(int p_what) { }; ARVROrigin::ARVROrigin() { - tracked_camera = NULL; + tracked_camera = nullptr; }; ARVROrigin::~ARVROrigin(){ diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp index 9f5170fa98..097368853e 100644 --- a/scene/3d/audio_stream_player_3d.cpp +++ b/scene/3d/audio_stream_player_3d.cpp @@ -401,7 +401,7 @@ void AudioStreamPlayer3D::_notification(int p_what) { PhysicsDirectSpaceState3D::ShapeResult sr[MAX_INTERSECT_AREAS]; int areas = space_state->intersect_point(global_pos, sr, MAX_INTERSECT_AREAS, Set(), area_mask, false, true); - Area3D *area = NULL; + Area3D *area = nullptr; for (int i = 0; i < areas; i++) { if (!sr[i].collider) diff --git a/scene/3d/audio_stream_player_3d.h b/scene/3d/audio_stream_player_3d.h index 1cce0c77d5..13e08339e2 100644 --- a/scene/3d/audio_stream_player_3d.h +++ b/scene/3d/audio_stream_player_3d.h @@ -82,7 +82,7 @@ private: Output() { filter_gain = 0; - viewport = NULL; + viewport = nullptr; reverb_bus_index = -1; bus_index = -1; } diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index 05e3f3fefa..6bde56104e 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -193,9 +193,9 @@ BakedLightmapData::~BakedLightmapData() { /////////////////////////// -BakedLightmap::BakeBeginFunc BakedLightmap::bake_begin_function = NULL; -BakedLightmap::BakeStepFunc BakedLightmap::bake_step_function = NULL; -BakedLightmap::BakeEndFunc BakedLightmap::bake_end_function = NULL; +BakedLightmap::BakeBeginFunc BakedLightmap::bake_begin_function = nullptr; +BakedLightmap::BakeStepFunc BakedLightmap::bake_step_function = nullptr; +BakedLightmap::BakeEndFunc BakedLightmap::bake_end_function = nullptr; void BakedLightmap::set_bake_cell_size(float p_cell_size) { bake_cell_size = p_cell_size; diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index 7980c15f89..30ab4d463b 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -138,7 +138,7 @@ void Camera3D::_notification(int p_what) { if (viewport) { viewport->_camera_remove(this); - viewport = NULL; + viewport = nullptr; } } break; @@ -241,7 +241,7 @@ void Camera3D::clear_current(bool p_enable_next) { return; if (get_viewport()->get_camera() == this) { - get_viewport()->_camera_set(NULL); + get_viewport()->_camera_set(nullptr); if (p_enable_next) { get_viewport()->_camera_make_next_current(this); @@ -703,7 +703,7 @@ Camera3D::Camera3D() { near = 0; far = 0; current = false; - viewport = NULL; + viewport = nullptr; force_change = false; mode = PROJECTION_PERSPECTIVE; set_perspective(70.0, 0.05, 100.0); diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index 6ee0512546..e6cd7bfe7e 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -245,7 +245,7 @@ Transform CollisionObject3D::shape_owner_get_transform(uint32_t p_owner) const { Object *CollisionObject3D::shape_owner_get_owner(uint32_t p_owner) const { - ERR_FAIL_COND_V(!shapes.has(p_owner), NULL); + ERR_FAIL_COND_V(!shapes.has(p_owner), nullptr); return shapes[p_owner].owner; } diff --git a/scene/3d/collision_object_3d.h b/scene/3d/collision_object_3d.h index 6a70f56caa..67d3aed3c8 100644 --- a/scene/3d/collision_object_3d.h +++ b/scene/3d/collision_object_3d.h @@ -56,7 +56,7 @@ class CollisionObject3D : public Node3D { ShapeData() { disabled = false; - owner = NULL; + owner = nullptr; } }; diff --git a/scene/3d/collision_polygon_3d.cpp b/scene/3d/collision_polygon_3d.cpp index 982205137b..66bd903eeb 100644 --- a/scene/3d/collision_polygon_3d.cpp +++ b/scene/3d/collision_polygon_3d.cpp @@ -112,7 +112,7 @@ void CollisionPolygon3D::_notification(int p_what) { parent->remove_shape_owner(owner_id); } owner_id = 0; - parent = NULL; + parent = nullptr; } break; } } @@ -201,7 +201,7 @@ CollisionPolygon3D::CollisionPolygon3D() { aabb = AABB(Vector3(-1, -1, -1), Vector3(2, 2, 2)); depth = 1.0; set_notify_local_transform(true); - parent = NULL; + parent = nullptr; owner_id = 0; disabled = false; } diff --git a/scene/3d/collision_shape_3d.cpp b/scene/3d/collision_shape_3d.cpp index 6aecfd08cc..a66e84ac3c 100644 --- a/scene/3d/collision_shape_3d.cpp +++ b/scene/3d/collision_shape_3d.cpp @@ -105,7 +105,7 @@ void CollisionShape3D::_notification(int p_what) { parent->remove_shape_owner(owner_id); } owner_id = 0; - parent = NULL; + parent = nullptr; } break; } } @@ -200,8 +200,8 @@ CollisionShape3D::CollisionShape3D() { //indicator = RenderingServer::get_singleton()->mesh_create(); disabled = false; - debug_shape = NULL; - parent = NULL; + debug_shape = nullptr; + parent = nullptr; owner_id = 0; set_notify_local_transform(true); } @@ -217,7 +217,7 @@ void CollisionShape3D::_update_debug_shape() { if (debug_shape) { debug_shape->queue_delete(); - debug_shape = NULL; + debug_shape = nullptr; } Ref s = get_shape(); diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 2226b0ed83..12c105b0f4 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -208,13 +208,13 @@ String CPUParticles3D::get_configuration_warning() const { if (get_mesh().is_valid()) { mesh_found = true; for (int j = 0; j < get_mesh()->get_surface_count(); j++) { - anim_material_found = Object::cast_to(get_mesh()->surface_get_material(j).ptr()) != NULL; + anim_material_found = Object::cast_to(get_mesh()->surface_get_material(j).ptr()) != nullptr; StandardMaterial3D *spat = Object::cast_to(get_mesh()->surface_get_material(j).ptr()); anim_material_found = anim_material_found || (spat && spat->get_billboard_mode() == StandardMaterial3D::BILLBOARD_PARTICLES); } } - anim_material_found = anim_material_found || Object::cast_to(get_material_override().ptr()) != NULL; + anim_material_found = anim_material_found || Object::cast_to(get_material_override().ptr()) != nullptr; StandardMaterial3D *spat = Object::cast_to(get_material_override().ptr()); anim_material_found = anim_material_found || (spat && spat->get_billboard_mode() == StandardMaterial3D::BILLBOARD_PARTICLES); @@ -1022,7 +1022,7 @@ void CPUParticles3D::_update_particle_data_buffer() { int pc = particles.size(); int *ow; - int *order = NULL; + int *order = nullptr; float *w = particle_data.ptrw(); const Particle *r = particles.ptr(); diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 607b176cdd..6d571ee4f2 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -403,9 +403,9 @@ void GIProbe::_find_meshes(Node *p_at_node, List &plot_meshes) { } } -GIProbe::BakeBeginFunc GIProbe::bake_begin_function = NULL; -GIProbe::BakeStepFunc GIProbe::bake_step_function = NULL; -GIProbe::BakeEndFunc GIProbe::bake_end_function = NULL; +GIProbe::BakeBeginFunc GIProbe::bake_begin_function = nullptr; +GIProbe::BakeStepFunc GIProbe::bake_step_function = nullptr; +GIProbe::BakeEndFunc GIProbe::bake_end_function = nullptr; Vector3i GIProbe::get_estimated_cell_size() const { static const int subdiv_value[SUBDIV_MAX] = { 6, 7, 8, 9 }; @@ -512,7 +512,7 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { void GIProbe::_debug_bake() { - bake(NULL, true); + bake(nullptr, true); } AABB GIProbe::get_aabb() const { diff --git a/scene/3d/gi_probe.h b/scene/3d/gi_probe.h index c00ee2cb73..28b533e82d 100644 --- a/scene/3d/gi_probe.h +++ b/scene/3d/gi_probe.h @@ -161,7 +161,7 @@ public: Vector3 get_extents() const; Vector3i get_estimated_cell_size() const; - void bake(Node *p_from_node = NULL, bool p_create_visual_debug = false); + void bake(Node *p_from_node = nullptr, bool p_create_visual_debug = false); virtual AABB get_aabb() const; virtual Vector get_faces(uint32_t p_usage_flags) const; diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 8646d4f290..7744c477cb 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -253,7 +253,7 @@ String GPUParticles3D::get_configuration_warning() const { if (draw_passes[i].is_valid()) { meshes_found = true; for (int j = 0; j < draw_passes[i]->get_surface_count(); j++) { - anim_material_found = Object::cast_to(draw_passes[i]->surface_get_material(j).ptr()) != NULL; + anim_material_found = Object::cast_to(draw_passes[i]->surface_get_material(j).ptr()) != nullptr; StandardMaterial3D *spat = Object::cast_to(draw_passes[i]->surface_get_material(j).ptr()); anim_material_found = anim_material_found || (spat && spat->get_billboard_mode() == StandardMaterial3D::BILLBOARD_PARTICLES); } @@ -261,7 +261,7 @@ String GPUParticles3D::get_configuration_warning() const { } } - anim_material_found = anim_material_found || Object::cast_to(get_material_override().ptr()) != NULL; + anim_material_found = anim_material_found || Object::cast_to(get_material_override().ptr()) != nullptr; StandardMaterial3D *spat = Object::cast_to(get_material_override().ptr()); anim_material_found = anim_material_found || (spat && spat->get_billboard_mode() == StandardMaterial3D::BILLBOARD_PARTICLES); diff --git a/scene/3d/listener_3d.cpp b/scene/3d/listener_3d.cpp index f352eb24b1..426e34ea80 100644 --- a/scene/3d/listener_3d.cpp +++ b/scene/3d/listener_3d.cpp @@ -131,7 +131,7 @@ void Listener3D::clear_current() { return; if (get_viewport()->get_listener() == this) { - get_viewport()->_listener_set(NULL); + get_viewport()->_listener_set(nullptr); get_viewport()->_listener_make_next_current(this); } } diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index 30aabf6e00..d56a095a5b 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -217,11 +217,11 @@ Vector MeshInstance3D::get_faces(uint32_t p_usage_flags) const { Node *MeshInstance3D::create_trimesh_collision_node() { if (mesh.is_null()) - return NULL; + return nullptr; Ref shape = mesh->create_trimesh_shape(); if (shape.is_null()) - return NULL; + return nullptr; StaticBody3D *static_body = memnew(StaticBody3D); CollisionShape3D *cshape = memnew(CollisionShape3D); @@ -247,11 +247,11 @@ void MeshInstance3D::create_trimesh_collision() { Node *MeshInstance3D::create_convex_collision_node() { if (mesh.is_null()) - return NULL; + return nullptr; Ref shape = mesh->create_convex_shape(); if (shape.is_null()) - return NULL; + return nullptr; StaticBody3D *static_body = memnew(StaticBody3D); CollisionShape3D *cshape = memnew(CollisionShape3D); diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index a131684a8a..0449ab15b7 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -106,12 +106,12 @@ void NavigationAgent3D::_notification(int p_what) { // Search the navigation node and set it { - Navigation3D *nav = NULL; + Navigation3D *nav = nullptr; Node *p = get_parent(); - while (p != NULL) { + while (p != nullptr) { nav = Object::cast_to(p); - if (nav != NULL) - p = NULL; + if (nav != nullptr) + p = nullptr; else p = p->get_parent(); } @@ -122,8 +122,8 @@ void NavigationAgent3D::_notification(int p_what) { set_physics_process_internal(true); } break; case NOTIFICATION_EXIT_TREE: { - agent_parent = NULL; - set_navigation(NULL); + agent_parent = nullptr; + set_navigation(nullptr); set_physics_process_internal(false); } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { @@ -142,8 +142,8 @@ void NavigationAgent3D::_notification(int p_what) { } NavigationAgent3D::NavigationAgent3D() : - agent_parent(NULL), - navigation(NULL), + agent_parent(nullptr), + navigation(nullptr), agent(RID()), target_desired_distance(1.0), navigation_height_offset(0.0), @@ -170,12 +170,12 @@ void NavigationAgent3D::set_navigation(Navigation3D *p_nav) { return; // Pointless navigation = p_nav; - NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid()); + NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == nullptr ? RID() : navigation->get_rid()); } void NavigationAgent3D::set_navigation_node(Node *p_nav) { Navigation3D *nav = Object::cast_to(p_nav); - ERR_FAIL_COND(nav == NULL); + ERR_FAIL_COND(nav == nullptr); set_navigation(nav); } @@ -244,7 +244,7 @@ Vector3 NavigationAgent3D::get_target_location() const { Vector3 NavigationAgent3D::get_next_location() { update_navigation(); if (navigation_path.size() == 0) { - ERR_FAIL_COND_V(agent_parent == NULL, Vector3()); + ERR_FAIL_COND_V(agent_parent == nullptr, Vector3()); return agent_parent->get_global_transform().origin; } else { return navigation_path[nav_path_index] - Vector3(0, navigation_height_offset, 0); @@ -252,7 +252,7 @@ Vector3 NavigationAgent3D::get_next_location() { } real_t NavigationAgent3D::distance_to_target() const { - ERR_FAIL_COND_V(agent_parent == NULL, 0.0); + ERR_FAIL_COND_V(agent_parent == nullptr, 0.0); return agent_parent->get_global_transform().origin.distance_to(target_location); } @@ -306,8 +306,8 @@ String NavigationAgent3D::get_configuration_warning() const { void NavigationAgent3D::update_navigation() { - if (agent_parent == NULL) return; - if (navigation == NULL) return; + if (agent_parent == nullptr) return; + if (navigation == nullptr) return; if (update_frame_id == Engine::get_singleton()->get_physics_frames()) return; update_frame_id = Engine::get_singleton()->get_physics_frames(); diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index fa976e5d18..2ee2008799 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -49,12 +49,12 @@ void NavigationObstacle3D::_notification(int p_what) { // Search the navigation node and set it { - Navigation3D *nav = NULL; + Navigation3D *nav = nullptr; Node *p = get_parent(); - while (p != NULL) { + while (p != nullptr) { nav = Object::cast_to(p); - if (nav != NULL) - p = NULL; + if (nav != nullptr) + p = nullptr; else p = p->get_parent(); } @@ -65,7 +65,7 @@ void NavigationObstacle3D::_notification(int p_what) { set_physics_process_internal(true); } break; case NOTIFICATION_EXIT_TREE: { - set_navigation(NULL); + set_navigation(nullptr); set_physics_process_internal(false); } break; case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { @@ -87,7 +87,7 @@ void NavigationObstacle3D::_notification(int p_what) { } NavigationObstacle3D::NavigationObstacle3D() : - navigation(NULL), + navigation(nullptr), agent(RID()) { agent = NavigationServer3D::get_singleton()->agent_create(); } @@ -102,12 +102,12 @@ void NavigationObstacle3D::set_navigation(Navigation3D *p_nav) { return; // Pointless navigation = p_nav; - NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == NULL ? RID() : navigation->get_rid()); + NavigationServer3D::get_singleton()->agent_set_map(agent, navigation == nullptr ? RID() : navigation->get_rid()); } void NavigationObstacle3D::set_navigation_node(Node *p_nav) { Navigation3D *nav = Object::cast_to(p_nav); - ERR_FAIL_COND(nav == NULL); + ERR_FAIL_COND(nav == nullptr); set_navigation(nav); } diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp index 08c0fbf4d1..043b816033 100644 --- a/scene/3d/navigation_region_3d.cpp +++ b/scene/3d/navigation_region_3d.cpp @@ -123,9 +123,9 @@ void NavigationRegion3D::_notification(int p_what) { if (debug_view) { debug_view->queue_delete(); - debug_view = NULL; + debug_view = nullptr; } - navigation = NULL; + navigation = nullptr; } break; } } @@ -184,18 +184,18 @@ void _bake_navigation_mesh(void *p_user_data) { } void NavigationRegion3D::bake_navigation_mesh() { - ERR_FAIL_COND(bake_thread != NULL); + ERR_FAIL_COND(bake_thread != nullptr); BakeThreadsArgs *args = memnew(BakeThreadsArgs); args->nav_region = this; bake_thread = Thread::create(_bake_navigation_mesh, args); - ERR_FAIL_COND(bake_thread == NULL); + ERR_FAIL_COND(bake_thread == nullptr); } void NavigationRegion3D::_bake_finished(Ref p_nav_mesh) { set_navigation_mesh(p_nav_mesh); - bake_thread = NULL; + bake_thread = nullptr; } String NavigationRegion3D::get_configuration_warning() const { @@ -247,9 +247,9 @@ NavigationRegion3D::NavigationRegion3D() { set_notify_transform(true); region = NavigationServer3D::get_singleton()->region_create(); - navigation = NULL; - debug_view = NULL; - bake_thread = NULL; + navigation = nullptr; + debug_view = nullptr; + bake_thread = nullptr; } NavigationRegion3D::~NavigationRegion3D() { diff --git a/scene/3d/node_3d.cpp b/scene/3d/node_3d.cpp index 7f444d59bf..0b7407e049 100644 --- a/scene/3d/node_3d.cpp +++ b/scene/3d/node_3d.cpp @@ -134,7 +134,7 @@ void Node3D::_notification(int p_what) { if (data.parent) data.C = data.parent->data.children.push_back(this); else - data.C = NULL; + data.C = nullptr; if (data.toplevel && !Engine::get_singleton()->is_editor_hint()) { @@ -158,14 +158,14 @@ void Node3D::_notification(int p_what) { get_tree()->xform_change_list.remove(&xform_change); if (data.C) data.parent->data.children.erase(data.C); - data.parent = NULL; - data.C = NULL; + data.parent = nullptr; + data.C = nullptr; data.toplevel_active = false; } break; case NOTIFICATION_ENTER_WORLD: { data.inside_world = true; - data.viewport = NULL; + data.viewport = nullptr; Node *parent = get_parent(); while (parent && !data.viewport) { data.viewport = Object::cast_to(parent); @@ -176,7 +176,7 @@ void Node3D::_notification(int p_what) { if (get_script_instance()) { - get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, NULL, 0); + get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_enter_world, nullptr, 0); } #ifdef TOOLS_ENABLED if (Engine::get_singleton()->is_editor_hint() && get_tree()->is_node_being_edited(this)) { @@ -208,10 +208,10 @@ void Node3D::_notification(int p_what) { if (get_script_instance()) { - get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_world, NULL, 0); + get_script_instance()->call_multilevel(SceneStringNames::get_singleton()->_exit_world, nullptr, 0); } - data.viewport = NULL; + data.viewport = nullptr; data.inside_world = false; } break; @@ -829,7 +829,7 @@ Node3D::Node3D() : data.toplevel = false; data.toplevel_active = false; data.scale = Vector3(1, 1, 1); - data.viewport = NULL; + data.viewport = nullptr; data.inside_world = false; data.visible = true; data.disable_scale = false; @@ -840,8 +840,8 @@ Node3D::Node3D() : #endif data.notify_local_transform = false; data.notify_transform = false; - data.parent = NULL; - data.C = NULL; + data.parent = nullptr; + data.C = nullptr; } Node3D::~Node3D() { diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index 0f1f9bb8a7..f06135f53d 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -229,7 +229,7 @@ void PathFollow3D::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - path = NULL; + path = nullptr; } break; } } @@ -409,7 +409,7 @@ PathFollow3D::PathFollow3D() { delta_offset = 0; h_offset = 0; v_offset = 0; - path = NULL; + path = nullptr; rotation_mode = ROTATION_XYZ; cubic = true; loop = true; diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index 37981f914c..2b6eb8ac8a 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -474,7 +474,7 @@ void RigidBody3D::_direct_state_changed(Object *p_state) { contact_monitor->locked = false; } - state = NULL; + state = nullptr; } void RigidBody3D::_notification(int p_what) { @@ -744,7 +744,7 @@ void RigidBody3D::set_contact_monitor(bool p_enabled) { } memdelete(contact_monitor); - contact_monitor = NULL; + contact_monitor = nullptr; } else { contact_monitor = memnew(ContactMonitor); @@ -754,7 +754,7 @@ void RigidBody3D::set_contact_monitor(bool p_enabled) { bool RigidBody3D::is_contact_monitor_enabled() const { - return contact_monitor != NULL; + return contact_monitor != nullptr; } void RigidBody3D::set_axis_lock(PhysicsServer3D::BodyAxis p_axis, bool p_lock) { @@ -910,7 +910,7 @@ RigidBody3D::RigidBody3D() : mass = 1; max_contacts_reported = 0; - state = NULL; + state = nullptr; gravity_scale = 1; linear_damp = -1; @@ -921,7 +921,7 @@ RigidBody3D::RigidBody3D() : ccd = false; custom_integrator = false; - contact_monitor = NULL; + contact_monitor = nullptr; can_sleep = true; PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), this, "_direct_state_changed"); @@ -1321,12 +1321,12 @@ KinematicBody3D::KinematicBody3D() : KinematicBody3D::~KinematicBody3D() { if (motion_cache.is_valid()) { - motion_cache->owner = NULL; + motion_cache->owner = nullptr; } for (int i = 0; i < slide_colliders.size(); i++) { if (slide_colliders[i].is_valid()) { - slide_colliders.write[i]->owner = NULL; + slide_colliders.write[i]->owner = nullptr; } } } @@ -1346,7 +1346,7 @@ Vector3 KinematicCollision3D::get_remainder() const { return collision.remainder; } Object *KinematicCollision3D::get_local_shape() const { - if (!owner) return NULL; + if (!owner) return nullptr; uint32_t ownerid = owner->shape_find_owner(collision.local_shape); return owner->shape_owner_get_owner(ownerid); } @@ -1357,7 +1357,7 @@ Object *KinematicCollision3D::get_collider() const { return ObjectDB::get_instance(collision.collider); } - return NULL; + return nullptr; } ObjectID KinematicCollision3D::get_collider_id() const { @@ -1374,7 +1374,7 @@ Object *KinematicCollision3D::get_collider_shape() const { } } - return NULL; + return nullptr; } int KinematicCollision3D::get_collider_shape_index() const { @@ -1420,7 +1420,7 @@ KinematicCollision3D::KinematicCollision3D() { collision.collider_shape = 0; collision.local_shape = 0; - owner = NULL; + owner = nullptr; } /////////////////////////////////////// @@ -2078,7 +2078,7 @@ void PhysicalBone3D::_notification(int p_what) { parent_skeleton->unbind_physical_bone_from_bone(bone_id); } } - parent_skeleton = NULL; + parent_skeleton = nullptr; if (joint.is_valid()) { PhysicsServer3D::get_singleton()->free(joint); joint = RID(); @@ -2181,7 +2181,7 @@ void PhysicalBone3D::_bind_methods() { Skeleton3D *PhysicalBone3D::find_skeleton_parent(Node *p_parent) { if (!p_parent) { - return NULL; + return nullptr; } Skeleton3D *s = Object::cast_to(p_parent); return s ? s : find_skeleton_parent(p_parent->get_parent()); @@ -2333,7 +2333,7 @@ void PhysicalBone3D::set_joint_type(JointType p_joint_type) { if (joint_data) memdelete(joint_data); - joint_data = NULL; + joint_data = nullptr; switch (p_joint_type) { case JOINT_TYPE_PIN: joint_data = memnew(PinJointData); @@ -2501,8 +2501,8 @@ PhysicalBone3D::PhysicalBone3D() : #ifdef TOOLS_ENABLED gizmo_move_joint(false), #endif - joint_data(NULL), - parent_skeleton(NULL), + joint_data(nullptr), + parent_skeleton(nullptr), simulate_physics(false), _internal_simulate_physics(false), bone_id(-1), @@ -2588,7 +2588,7 @@ void PhysicalBone3D::_stop_physics_simulation() { PhysicsServer3D::get_singleton()->body_set_collision_mask(get_rid(), 0); } if (_internal_simulate_physics) { - PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), NULL, ""); + PhysicsServer3D::get_singleton()->body_set_force_integration_callback(get_rid(), nullptr, ""); parent_skeleton->set_bone_global_pose_override(bone_id, Transform(), 0.0, false); set_as_toplevel(false); _internal_simulate_physics = false; diff --git a/scene/3d/physics_joint_3d.cpp b/scene/3d/physics_joint_3d.cpp index f6b3e79300..591c17a91e 100644 --- a/scene/3d/physics_joint_3d.cpp +++ b/scene/3d/physics_joint_3d.cpp @@ -45,8 +45,8 @@ void Joint3D::_update_joint(bool p_only_free) { if (p_only_free || !is_inside_tree()) return; - Node *node_a = has_node(get_node_a()) ? get_node(get_node_a()) : (Node *)NULL; - Node *node_b = has_node(get_node_b()) ? get_node(get_node_b()) : (Node *)NULL; + Node *node_a = has_node(get_node_a()) ? get_node(get_node_a()) : (Node *)nullptr; + Node *node_b = has_node(get_node_b()) ? get_node(get_node_b()) : (Node *)nullptr; PhysicsBody3D *body_a = Object::cast_to(node_a); PhysicsBody3D *body_b = Object::cast_to(node_b); diff --git a/scene/3d/ray_cast_3d.cpp b/scene/3d/ray_cast_3d.cpp index d00af3b128..a18da61656 100644 --- a/scene/3d/ray_cast_3d.cpp +++ b/scene/3d/ray_cast_3d.cpp @@ -81,7 +81,7 @@ bool RayCast3D::is_colliding() const { Object *RayCast3D::get_collider() const { if (against.is_null()) - return NULL; + return nullptr; return ObjectDB::get_instance(against); } @@ -387,7 +387,7 @@ void RayCast3D::_clear_debug_shape() { else memdelete(mi); - debug_shape = NULL; + debug_shape = nullptr; } RayCast3D::RayCast3D() { @@ -398,7 +398,7 @@ RayCast3D::RayCast3D() { against_shape = 0; collision_mask = 1; cast_to = Vector3(0, -1, 0); - debug_shape = NULL; + debug_shape = nullptr; exclude_parent_body = true; collide_with_areas = false; collide_with_bodies = true; diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 1b05641c9d..59a6e23005 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -685,19 +685,19 @@ void Skeleton3D::bind_physical_bone_to_bone(int p_bone, PhysicalBone3D *p_physic void Skeleton3D::unbind_physical_bone_from_bone(int p_bone) { ERR_FAIL_INDEX(p_bone, bones.size()); - bones.write[p_bone].physical_bone = NULL; + bones.write[p_bone].physical_bone = nullptr; _rebuild_physical_bones_cache(); } PhysicalBone3D *Skeleton3D::get_physical_bone(int p_bone) { - ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL); + ERR_FAIL_INDEX_V(p_bone, bones.size(), nullptr); return bones[p_bone].physical_bone; } PhysicalBone3D *Skeleton3D::get_physical_bone_parent(int p_bone) { - ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL); + ERR_FAIL_INDEX_V(p_bone, bones.size(), nullptr); if (bones[p_bone].cache_parent_physical_bone) { return bones[p_bone].cache_parent_physical_bone; @@ -707,11 +707,11 @@ PhysicalBone3D *Skeleton3D::get_physical_bone_parent(int p_bone) { } PhysicalBone3D *Skeleton3D::_get_physical_bone_parent(int p_bone) { - ERR_FAIL_INDEX_V(p_bone, bones.size(), NULL); + ERR_FAIL_INDEX_V(p_bone, bones.size(), nullptr); const int parent_bone = bones[p_bone].parent; if (0 > parent_bone) { - return NULL; + return nullptr; } PhysicalBone3D *pb = bones[parent_bone].physical_bone; diff --git a/scene/3d/skeleton_3d.h b/scene/3d/skeleton_3d.h index 2ae04aa575..08b8691658 100644 --- a/scene/3d/skeleton_3d.h +++ b/scene/3d/skeleton_3d.h @@ -112,8 +112,8 @@ private: global_pose_override_amount = 0; global_pose_override_reset = false; #ifndef _3D_DISABLED - physical_bone = NULL; - cache_parent_physical_bone = NULL; + physical_bone = nullptr; + cache_parent_physical_bone = nullptr; #endif // _3D_DISABLED } }; diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp index a6c3e25399..7366290ed3 100644 --- a/scene/3d/skeleton_ik_3d.cpp +++ b/scene/3d/skeleton_ik_3d.cpp @@ -42,7 +42,7 @@ FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::find_child return &children.write[i]; } } - return NULL; + return nullptr; } FabrikInverseKinematic::ChainItem *FabrikInverseKinematic::ChainItem::add_child(const BoneId p_bone_id) { @@ -65,7 +65,7 @@ bool FabrikInverseKinematic::build_chain(Task *p_task, bool p_force_simple_chain chain.chain_root.initial_transform = p_task->skeleton->get_bone_global_pose(chain.chain_root.bone); chain.chain_root.current_pos = chain.chain_root.initial_transform.origin; chain.chain_root.pb = p_task->skeleton->get_physical_bone(chain.chain_root.bone); - chain.middle_chain_item = NULL; + chain.middle_chain_item = nullptr; // Holds all IDs that are composing a single chain in reverse order Vector chain_ids; @@ -119,7 +119,7 @@ bool FabrikInverseKinematic::build_chain(Task *p_task, bool p_force_simple_chain } if (!middle_chain_item_id) - chain.middle_chain_item = NULL; + chain.middle_chain_item = nullptr; // Initialize current tip chain.tips.write[x].chain_item = sub_chain; @@ -226,14 +226,14 @@ void FabrikInverseKinematic::solve_simple_forwards(Chain &r_chain, bool p_solve_ if (p_solve_magnet && sub_chain_root == r_chain.middle_chain_item) { // In case of magnet solving this is the tip - sub_chain_root = NULL; + sub_chain_root = nullptr; } else { sub_chain_root = &child; } } else { // Is tip - sub_chain_root = NULL; + sub_chain_root = nullptr; } } } @@ -251,7 +251,7 @@ FabrikInverseKinematic::Task *FabrikInverseKinematic::create_simple_task(Skeleto if (!build_chain(task)) { free_task(task); - return NULL; + return nullptr; } return task; @@ -328,7 +328,7 @@ void FabrikInverseKinematic::solve(Task *p_task, real_t blending_delta, bool ove if (!ci->children.empty()) ci = &ci->children.write[0]; else - ci = NULL; + ci = nullptr; } } @@ -432,14 +432,14 @@ SkeletonIK3D::SkeletonIK3D() : use_magnet(false), min_distance(0.01), max_iterations(10), - skeleton(NULL), - target_node_override(NULL), - task(NULL) { + skeleton(nullptr), + target_node_override(nullptr), + task(nullptr) { } SkeletonIK3D::~SkeletonIK3D() { FabrikInverseKinematic::free_task(task); - task = NULL; + task = nullptr; } void SkeletonIK3D::set_root_bone(const StringName &p_root_bone) { @@ -479,7 +479,7 @@ const Transform &SkeletonIK3D::get_target_transform() const { void SkeletonIK3D::set_target_node(const NodePath &p_node) { target_node_path_override = p_node; - target_node_override = NULL; + target_node_override = nullptr; reload_goal(); } @@ -550,7 +550,7 @@ Transform SkeletonIK3D::_get_target_transform() { void SkeletonIK3D::reload_chain() { FabrikInverseKinematic::free_task(task); - task = NULL; + task = nullptr; if (!skeleton) return; diff --git a/scene/3d/skeleton_ik_3d.h b/scene/3d/skeleton_ik_3d.h index ebfebd1e66..5fbbe6e9e7 100644 --- a/scene/3d/skeleton_ik_3d.h +++ b/scene/3d/skeleton_ik_3d.h @@ -64,9 +64,9 @@ class FabrikInverseKinematic { Vector3 current_ori; ChainItem() : - parent_item(NULL), + parent_item(nullptr), bone(-1), - pb(NULL), + pb(nullptr), length(0) {} ChainItem *find_child(const BoneId p_bone_id); @@ -78,8 +78,8 @@ class FabrikInverseKinematic { const EndEffector *end_effector; ChainTip() : - chain_item(NULL), - end_effector(NULL) {} + chain_item(nullptr), + end_effector(nullptr) {} ChainTip(ChainItem *p_chain_item, const EndEffector *p_end_effector) : chain_item(p_chain_item), @@ -115,7 +115,7 @@ public: Transform goal_global_transform; Task() : - skeleton(NULL), + skeleton(nullptr), min_distance(0.01), max_iterations(10), root_bone(-1) {} diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp index 6d2808cfce..6092818252 100644 --- a/scene/3d/soft_body_3d.cpp +++ b/scene/3d/soft_body_3d.cpp @@ -99,7 +99,7 @@ void SoftBodyRenderingServerHandler::set_aabb(const AABB &p_aabb) { SoftBody3D::PinnedPoint::PinnedPoint() : point_index(-1), - spatial_attachment(NULL) { + spatial_attachment(nullptr) { } SoftBody3D::PinnedPoint::PinnedPoint(const PinnedPoint &obj_tocopy) { @@ -454,7 +454,7 @@ void SoftBody3D::prepare_physics_server() { if (get_mesh().is_valid()) PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, get_mesh()); else - PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, NULL); + PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, nullptr); return; } @@ -466,7 +466,7 @@ void SoftBody3D::prepare_physics_server() { RS::get_singleton()->connect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh)); } else { - PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, NULL); + PhysicsServer3D::get_singleton()->soft_body_set_mesh(physics_rid, nullptr); if (RS::get_singleton()->is_connected("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh))) { RS::get_singleton()->disconnect("frame_pre_draw", callable_mp(this, &SoftBody3D::_draw_soft_mesh)); } @@ -808,7 +808,7 @@ void SoftBody3D::_remove_pinned_point(int p_point_index) { int SoftBody3D::_get_pinned_point(int p_point_index, SoftBody3D::PinnedPoint *&r_point) const { const int id = _has_pinned_point(p_point_index); if (-1 == id) { - r_point = NULL; + r_point = nullptr; return -1; } else { r_point = const_cast(&pinned_points.ptr()[id]); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 360e95e76a..85e5ebc475 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -83,8 +83,8 @@ void SpriteBase3D::_notification(int p_what) { if (parent_sprite) { parent_sprite->children.erase(pI); - pI = NULL; - parent_sprite = NULL; + pI = nullptr; + parent_sprite = nullptr; } } } @@ -364,8 +364,8 @@ SpriteBase3D::SpriteBase3D() { centered = true; hflip = false; vflip = false; - parent_sprite = NULL; - pI = NULL; + parent_sprite = nullptr; + pI = nullptr; for (int i = 0; i < FLAG_MAX; i++) flags[i] = i == FLAG_TRANSPARENT || i == FLAG_DOUBLE_SIDED; @@ -441,7 +441,7 @@ void Sprite3D::_draw() { // Properly setup UVs for impostor textures (AtlasTexture). Ref atlas_tex = texture; - if (atlas_tex != NULL) { + if (atlas_tex != nullptr) { src_tsize[0] = atlas_tex->get_atlas()->get_width(); src_tsize[1] = atlas_tex->get_atlas()->get_height(); } @@ -775,7 +775,7 @@ void AnimatedSprite3D::_draw() { // Properly setup UVs for impostor textures (AtlasTexture). Ref atlas_tex = texture; - if (atlas_tex != NULL) { + if (atlas_tex != nullptr) { src_tsize[0] = atlas_tex->get_atlas()->get_width(); src_tsize[1] = atlas_tex->get_atlas()->get_height(); } diff --git a/scene/3d/vehicle_body_3d.cpp b/scene/3d/vehicle_body_3d.cpp index ac7608a3d5..5c2fa59a21 100644 --- a/scene/3d/vehicle_body_3d.cpp +++ b/scene/3d/vehicle_body_3d.cpp @@ -99,7 +99,7 @@ void VehicleWheel3D::_notification(int p_what) { if (!cb) return; cb->wheels.erase(this); - body = NULL; + body = nullptr; } } @@ -385,7 +385,7 @@ VehicleWheel3D::VehicleWheel3D() { m_clippedInvContactDotSuspension = 1.0; m_raycastInfo.m_isInContact = false; - body = NULL; + body = nullptr; } void VehicleBody3D::_update_wheel_transform(VehicleWheel3D &wheel, PhysicsDirectBodyState3D *s) { @@ -454,7 +454,7 @@ real_t VehicleBody3D::_ray_cast(int p_idx, PhysicsDirectBodyState3D *s) { bool col = ss->intersect_ray(source, target, rr, exclude); - wheel.m_raycastInfo.m_groundObject = 0; + wheel.m_raycastInfo.m_groundObject = nullptr; if (col) { param = source.distance_to(rr.position) / source.distance_to(target); @@ -917,7 +917,7 @@ void VehicleBody3D::_direct_state_changed(Object *p_state) { wheel.m_deltaRotation *= real_t(0.99); //damping of rotation when not in contact } - state = NULL; + state = nullptr; } void VehicleBody3D::set_engine_force(float p_engine_force) { @@ -988,7 +988,7 @@ VehicleBody3D::VehicleBody3D() { engine_force = 0; brake = 0; - state = NULL; + state = nullptr; ccd = false; exclude.insert(get_rid()); diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index 8ba7a38628..570735ad87 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -41,7 +41,7 @@ StringName AnimationNodeAnimation::get_animation() const { return animation; } -Vector (*AnimationNodeAnimation::get_editable_animation_list)() = NULL; +Vector (*AnimationNodeAnimation::get_editable_animation_list)() = nullptr; void AnimationNodeAnimation::get_parameter_list(List *r_list) const { r_list->push_back(PropertyInfo(Variant::FLOAT, time, PROPERTY_HINT_NONE, "", 0)); diff --git a/scene/animation/animation_cache.cpp b/scene/animation/animation_cache.cpp index 79a7c36e7f..ab8be47b4d 100644 --- a/scene/animation/animation_cache.cpp +++ b/scene/animation/animation_cache.cpp @@ -287,7 +287,7 @@ void AnimationCache::set_all(float p_time, float p_delta) { if (!args.size()) { - call_track(i, name, NULL, 0, err); + call_track(i, name, nullptr, 0, err); } else { Vector argptrs; @@ -332,7 +332,7 @@ void AnimationCache::set_root(Node *p_root) { AnimationCache::AnimationCache() { - root = NULL; + root = nullptr; cache_dirty = true; cache_valid = false; } diff --git a/scene/animation/animation_cache.h b/scene/animation/animation_cache.h index 20147f060b..23312ca7ec 100644 --- a/scene/animation/animation_cache.h +++ b/scene/animation/animation_cache.h @@ -50,12 +50,12 @@ class AnimationCache : public Object { Vector subpath; bool valid; Path() { - object = NULL; - skeleton = NULL; - node = NULL; + object = nullptr; + skeleton = nullptr; + node = nullptr; bone_idx = -1; valid = false; - spatial = NULL; + spatial = nullptr; } }; diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index 05c5e86491..9f5e06c43d 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -225,7 +225,7 @@ bool AnimationNodeStateMachinePlayback::_travel(AnimationNodeStateMachine *p_sta } //find the last cost transition - List::Element *least_cost_transition = NULL; + List::Element *least_cost_transition = nullptr; float least_cost = 1e20; for (List::Element *E = open_list.front(); E; E = E->next()) { @@ -530,7 +530,7 @@ void AnimationNodeStateMachine::get_parameter_list(List *r_list) c List advance_conditions; for (int i = 0; i < transitions.size(); i++) { StringName ac = transitions[i].transition->get_advance_condition_name(); - if (ac != StringName() && advance_conditions.find(ac) == NULL) { + if (ac != StringName() && advance_conditions.find(ac) == nullptr) { advance_conditions.push_back(ac); } } diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 6c870682a6..00f0dce0d6 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -244,7 +244,7 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) { for (int i = 0; i < a->get_track_count(); i++) { - p_anim->node_cache.write[i] = NULL; + p_anim->node_cache.write[i] = nullptr; RES resource; Vector leftover_path; Node *child = parent->get_node_and_resource(a->track_get_path(i), resource, leftover_path); @@ -293,13 +293,13 @@ void AnimationPlayer::_ensure_node_caches(AnimationData *p_anim) { p_anim->node_cache[i]->bone_idx = p_anim->node_cache[i]->skeleton->find_bone(bone_name); if (p_anim->node_cache[i]->bone_idx < 0) { // broken track (nonexistent bone) - p_anim->node_cache[i]->skeleton = NULL; - p_anim->node_cache[i]->spatial = NULL; + p_anim->node_cache[i]->skeleton = nullptr; + p_anim->node_cache[i]->spatial = nullptr; ERR_CONTINUE(p_anim->node_cache[i]->bone_idx < 0); } } else { // no property, just use spatialnode - p_anim->node_cache[i]->skeleton = NULL; + p_anim->node_cache[i]->skeleton = nullptr; } } } @@ -830,7 +830,7 @@ void AnimationPlayer::_animation_process2(float p_delta, bool p_started) { c.seeked = false; } - List::Element *prev = NULL; + List::Element *prev = nullptr; for (List::Element *E = c.blend.back(); E; E = prev) { Blend &b = E->get(); @@ -1296,7 +1296,7 @@ void AnimationPlayer::stop(bool p_reset) { Playback &c = playback; c.blend.clear(); if (p_reset) { - c.current.from = NULL; + c.current.from = nullptr; c.current.speed_scale = 1; c.current.pos = 0; } diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 32bed6f4d6..c134aff707 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -118,9 +118,9 @@ private: Variant capture; PropertyAnim() : - owner(NULL), + owner(nullptr), special(SP_NONE), - object(NULL), + object(nullptr), accum_pass(0) {} }; @@ -135,9 +135,9 @@ private: uint64_t accum_pass; BezierAnim() : - owner(NULL), + owner(nullptr), bezier_accum(0.0), - object(NULL), + object(nullptr), accum_pass(0) {} }; @@ -145,10 +145,10 @@ private: TrackNodeCache() : id(0), - node(NULL), - spatial(NULL), - node_2d(NULL), - skeleton(NULL), + node(nullptr), + spatial(nullptr), + node_2d(nullptr), + skeleton(nullptr), bone_idx(-1), accum_pass(0), audio_playing(false), @@ -212,7 +212,7 @@ private: pos = 0; speed_scale = 1.0; - from = NULL; + from = nullptr; } }; diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 0e1089cc6a..f8b3ca291b 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -128,8 +128,8 @@ float AnimationNode::_pre_process(const StringName &p_base_path, AnimationNode * float t = process(p_time, p_seek); - state = NULL; - parent = NULL; + state = nullptr; + parent = nullptr; base_path = StringName(); connections.clear(); @@ -164,7 +164,7 @@ float AnimationNode::blend_input(int p_input, float p_time, bool p_seek, float p //inputs.write[p_input].last_pass = state->last_pass; float activity = 0; - float ret = _blend_node(node_name, blend_tree->get_node_connection_array(node_name), NULL, node, p_time, p_seek, p_blend, p_filter, p_optimize, &activity); + float ret = _blend_node(node_name, blend_tree->get_node_connection_array(node_name), nullptr, node, p_time, p_seek, p_blend, p_filter, p_optimize, &activity); Vector *activity_ptr = state->tree->input_activity_map.getptr(base_path); @@ -202,7 +202,7 @@ float AnimationNode::_blend_node(const StringName &p_subpath, const Vectortrack_map.has(*K)) { continue; @@ -316,7 +316,7 @@ String AnimationNode::get_caption() const { void AnimationNode::add_input(const String &p_name) { //root nodes can't add inputs - ERR_FAIL_COND(Object::cast_to(this) != NULL); + ERR_FAIL_COND(Object::cast_to(this) != nullptr); Input input; ERR_FAIL_COND(p_name.find(".") != -1 || p_name.find("/") != -1); input.name = p_name; @@ -374,7 +374,7 @@ Array AnimationNode::_get_filters() const { Array paths; - const NodePath *K = NULL; + const NodePath *K = nullptr; while ((K = filter.next(K))) { paths.push_back(String(*K)); //use strings, so sorting is possible } @@ -453,8 +453,8 @@ void AnimationNode::_bind_methods() { AnimationNode::AnimationNode() { - state = NULL; - parent = NULL; + state = nullptr; + parent = nullptr; filter_enabled = false; } @@ -558,17 +558,17 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { NodePath path = anim->track_get_path(i); Animation::TrackType track_type = anim->track_get_type(i); - TrackCache *track = NULL; + TrackCache *track = nullptr; if (track_cache.has(path)) { track = track_cache.get(path); } //if not valid, delete track - if (track && (track->type != track_type || ObjectDB::get_instance(track->object_id) == NULL)) { + if (track && (track->type != track_type || ObjectDB::get_instance(track->object_id) == nullptr)) { playing_caches.erase(track); memdelete(track); track_cache.erase(path); - track = NULL; + track = nullptr; } if (!track) { @@ -615,7 +615,7 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { TrackCacheTransform *track_xform = memnew(TrackCacheTransform); track_xform->spatial = spatial; - track_xform->skeleton = NULL; + track_xform->skeleton = nullptr; track_xform->bone_idx = -1; if (path.get_subname_count() == 1 && Object::cast_to(spatial)) { @@ -700,7 +700,7 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { List to_delete; - const NodePath *K = NULL; + const NodePath *K = nullptr; while ((K = track_cache.next(K))) { TrackCache *tc = track_cache[*K]; if (tc->setup_pass != setup_pass) { @@ -717,7 +717,7 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { state.track_map.clear(); - K = NULL; + K = nullptr; int idx = 0; while ((K = track_cache.next(K))) { state.track_map[*K] = idx; @@ -733,7 +733,7 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { void AnimationTree::_clear_caches() { - const NodePath *K = NULL; + const NodePath *K = nullptr; while ((K = track_cache.next(K))) { memdelete(track_cache[*K]); } @@ -829,11 +829,11 @@ void AnimationTree::_process_graph(float p_delta) { if (started) { //if started, seek - root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, NULL, &state, 0, true, Vector()); + root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, nullptr, &state, 0, true, Vector()); started = false; } - root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, NULL, &state, p_delta, false, Vector()); + root->_pre_process(SceneStringNames::get_singleton()->parameters_base_path, nullptr, &state, p_delta, false, Vector()); } if (!state.valid) { @@ -1224,7 +1224,7 @@ void AnimationTree::_process_graph(float p_delta) { { // finally, set the tracks - const NodePath *K = NULL; + const NodePath *K = nullptr; while ((K = track_cache.next(K))) { TrackCache *track = track_cache[*K]; if (track->process_pass != process_pass) diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h index faf4333f1d..d558170f23 100644 --- a/scene/animation/animation_tree.h +++ b/scene/animation/animation_tree.h @@ -101,7 +101,7 @@ public: Array _get_filters() const; void _set_filters(const Array &p_filters); friend class AnimationNodeBlendTree; - float _blend_node(const StringName &p_subpath, const Vector &p_connections, AnimationNode *p_new_parent, Ref p_node, float p_time, bool p_seek, float p_blend, FilterAction p_filter = FILTER_IGNORE, bool p_optimize = true, float *r_max = NULL); + float _blend_node(const StringName &p_subpath, const Vector &p_connections, AnimationNode *p_new_parent, Ref p_node, float p_time, bool p_seek, float p_blend, FilterAction p_filter = FILTER_IGNORE, bool p_optimize = true, float *r_max = nullptr); protected: void blend_animation(const StringName &p_animation, float p_time, float p_delta, bool p_seeked, float p_blend); @@ -186,7 +186,7 @@ private: root_motion = false; setup_pass = 0; process_pass = 0; - object = NULL; + object = nullptr; } virtual ~TrackCache() {} }; @@ -202,9 +202,9 @@ private: TrackCacheTransform() { type = Animation::TYPE_TRANSFORM; - spatial = NULL; + spatial = nullptr; bone_idx = -1; - skeleton = NULL; + skeleton = nullptr; } }; diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 628568afbb..bc28c38e2c 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -297,7 +297,7 @@ Variant Tween::_get_initial_val(const InterpolateData &p_data) const { case TARGETING_METHOD: { // Get the object that is being targeted Object *object = ObjectDB::get_instance(p_data.target_id); - ERR_FAIL_COND_V(object == NULL, p_data.initial_val); + ERR_FAIL_COND_V(object == nullptr, p_data.initial_val); // Are we targeting a property or a method? Variant initial_val; @@ -309,7 +309,7 @@ Variant Tween::_get_initial_val(const InterpolateData &p_data) const { } else { // Call the method and get the initial value from it Callable::CallError error; - initial_val = object->call(p_data.target_key[0], NULL, 0, error); + initial_val = object->call(p_data.target_key[0], nullptr, 0, error); ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } return initial_val; @@ -329,7 +329,7 @@ Variant Tween::_get_final_val(const InterpolateData &p_data) const { case FOLLOW_METHOD: { // Get the object that is being followed Object *target = ObjectDB::get_instance(p_data.target_id); - ERR_FAIL_COND_V(target == NULL, p_data.initial_val); + ERR_FAIL_COND_V(target == nullptr, p_data.initial_val); // We want to figure out the final value Variant final_val; @@ -341,7 +341,7 @@ Variant Tween::_get_final_val(const InterpolateData &p_data) const { } else { // We're looking at a method. Call the method on the target object Callable::CallError error; - final_val = target->call(p_data.target_key[0], NULL, 0, error); + final_val = target->call(p_data.target_key[0], nullptr, 0, error); ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } @@ -371,7 +371,7 @@ Variant &Tween::_get_delta_val(InterpolateData &p_data) { case FOLLOW_METHOD: { // We're following an object, so grab that instance Object *target = ObjectDB::get_instance(p_data.target_id); - ERR_FAIL_COND_V(target == NULL, p_data.initial_val); + ERR_FAIL_COND_V(target == nullptr, p_data.initial_val); // We want to figure out the final value Variant final_val; @@ -383,7 +383,7 @@ Variant &Tween::_get_delta_val(InterpolateData &p_data) { } else { // We're looking at a method. Call the method on the target object Callable::CallError error; - final_val = target->call(p_data.target_key[0], NULL, 0, error); + final_val = target->call(p_data.target_key[0], nullptr, 0, error); ERR_FAIL_COND_V(error.error != Callable::CallError::CALL_OK, p_data.initial_val); } @@ -607,7 +607,7 @@ bool Tween::_apply_tween_value(InterpolateData &p_data, Variant &value) { // Get the object we want to apply the new value to Object *object = ObjectDB::get_instance(p_data.id); - ERR_FAIL_COND_V(object == NULL, false); + ERR_FAIL_COND_V(object == nullptr, false); // What kind of data are we mutating? switch (p_data.type) { @@ -634,7 +634,7 @@ bool Tween::_apply_tween_value(InterpolateData &p_data, Variant &value) { object->call(p_data.key[0], (const Variant **)arg, 1, error); } else { // Don't pass any argument - object->call(p_data.key[0], NULL, 0, error); + object->call(p_data.key[0], nullptr, 0, error); } // Did we get an error from the function call? @@ -700,7 +700,7 @@ void Tween::_tween_process(float p_delta) { // Get the target object for this interpolation Object *object = ObjectDB::get_instance(data.id); - if (object == NULL) + if (object == nullptr) continue; // Are we still delaying this tween? @@ -860,7 +860,7 @@ void Tween::reset(Object *p_object, StringName p_key) { // Get the target object InterpolateData &data = E->get(); Object *object = ObjectDB::get_instance(data.id); - if (object == NULL) + if (object == nullptr) continue; // Do we have the correct object and key? @@ -901,7 +901,7 @@ void Tween::stop(Object *p_object, StringName p_key) { // Get the object the tween is targeting InterpolateData &data = E->get(); Object *object = ObjectDB::get_instance(data.id); - if (object == NULL) + if (object == nullptr) continue; // Is this the correct object and does it have the given key? @@ -937,7 +937,7 @@ void Tween::resume(Object *p_object, StringName p_key) { // Grab the object InterpolateData &data = E->get(); Object *object = ObjectDB::get_instance(data.id); - if (object == NULL) + if (object == nullptr) continue; // If the object and string key match, activate it @@ -975,7 +975,7 @@ void Tween::remove(Object *p_object, StringName p_key) { // Get the target object InterpolateData &data = E->get(); Object *object = ObjectDB::get_instance(data.id); - if (object == NULL) + if (object == nullptr) continue; // If the target object and string key match, queue it for removal @@ -1264,7 +1264,7 @@ void Tween::_build_interpolation(InterpolateType p_interpolation_type, Object *p // Validate and apply interpolation data // Give it the object - ERR_FAIL_COND_MSG(p_object == NULL, "Invalid object provided to Tween."); + ERR_FAIL_COND_MSG(p_object == nullptr, "Invalid object provided to Tween."); data.id = p_object->get_instance_id(); // Validate the initial and final values @@ -1335,7 +1335,7 @@ void Tween::interpolate_property(Object *p_object, NodePath p_property, Variant if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Build the interpolation data - _build_interpolation(INTER_PROPERTY, p_object, &p_property, NULL, p_initial_val, p_final_val, p_duration, p_trans_type, p_ease_type, p_delay); + _build_interpolation(INTER_PROPERTY, p_object, &p_property, nullptr, p_initial_val, p_final_val, p_duration, p_trans_type, p_ease_type, p_delay); } void Tween::interpolate_method(Object *p_object, StringName p_method, Variant p_initial_val, Variant p_final_val, real_t p_duration, TransitionType p_trans_type, EaseType p_ease_type, real_t p_delay) { @@ -1350,7 +1350,7 @@ void Tween::interpolate_method(Object *p_object, StringName p_method, Variant p_ if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Build the interpolation data - _build_interpolation(INTER_METHOD, p_object, NULL, &p_method, p_initial_val, p_final_val, p_duration, p_trans_type, p_ease_type, p_delay); + _build_interpolation(INTER_METHOD, p_object, nullptr, &p_method, p_initial_val, p_final_val, p_duration, p_trans_type, p_ease_type, p_delay); } void Tween::interpolate_callback(Object *p_object, real_t p_duration, String p_callback, VARIANT_ARG_DECLARE) { @@ -1361,7 +1361,7 @@ void Tween::interpolate_callback(Object *p_object, real_t p_duration, String p_c } // Check that the target object is valid - ERR_FAIL_COND(p_object == NULL); + ERR_FAIL_COND(p_object == nullptr); // Duration cannot be negative ERR_FAIL_COND(p_duration < 0); @@ -1418,7 +1418,7 @@ void Tween::interpolate_deferred_callback(Object *p_object, real_t p_duration, S } // Check that the target object is valid - ERR_FAIL_COND(p_object == NULL); + ERR_FAIL_COND(p_object == nullptr); // No negative durations allowed ERR_FAIL_COND(p_duration < 0); @@ -1486,8 +1486,8 @@ void Tween::follow_property(Object *p_object, NodePath p_property, Variant p_ini if (p_initial_val.get_type() == Variant::INT) p_initial_val = p_initial_val.operator real_t(); // Confirm the source and target objects are valid - ERR_FAIL_COND(p_object == NULL); - ERR_FAIL_COND(p_target == NULL); + ERR_FAIL_COND(p_object == nullptr); + ERR_FAIL_COND(p_target == nullptr); // No negative durations ERR_FAIL_COND(p_duration < 0); @@ -1547,8 +1547,8 @@ void Tween::follow_method(Object *p_object, StringName p_method, Variant p_initi if (p_initial_val.get_type() == Variant::INT) p_initial_val = p_initial_val.operator real_t(); // Verify the source and target objects are valid - ERR_FAIL_COND(p_object == NULL); - ERR_FAIL_COND(p_target == NULL); + ERR_FAIL_COND(p_object == nullptr); + ERR_FAIL_COND(p_target == nullptr); // No negative durations ERR_FAIL_COND(p_duration < 0); @@ -1566,7 +1566,7 @@ void Tween::follow_method(Object *p_object, StringName p_method, Variant p_initi // Call the method to get the target value Callable::CallError error; - Variant target_val = p_target->call(p_target_method, NULL, 0, error); + Variant target_val = p_target->call(p_target_method, nullptr, 0, error); ERR_FAIL_COND(error.error != Callable::CallError::CALL_OK); // Convert target INT values to FLOAT as they are better for interpolation @@ -1610,8 +1610,8 @@ void Tween::targeting_property(Object *p_object, NodePath p_property, Object *p_ if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Verify both objects are valid - ERR_FAIL_COND(p_object == NULL); - ERR_FAIL_COND(p_initial == NULL); + ERR_FAIL_COND(p_object == nullptr); + ERR_FAIL_COND(p_initial == nullptr); // No negative durations ERR_FAIL_COND(p_duration < 0); @@ -1676,8 +1676,8 @@ void Tween::targeting_method(Object *p_object, StringName p_method, Object *p_in if (p_final_val.get_type() == Variant::INT) p_final_val = p_final_val.operator real_t(); // Make sure the given objects are valid - ERR_FAIL_COND(p_object == NULL); - ERR_FAIL_COND(p_initial == NULL); + ERR_FAIL_COND(p_object == nullptr); + ERR_FAIL_COND(p_initial == nullptr); // No negative durations ERR_FAIL_COND(p_duration < 0); @@ -1695,7 +1695,7 @@ void Tween::targeting_method(Object *p_object, StringName p_method, Object *p_in // Call the method to get the initial value Callable::CallError error; - Variant initial_val = p_initial->call(p_initial_method, NULL, 0, error); + Variant initial_val = p_initial->call(p_initial_method, nullptr, 0, error); ERR_FAIL_COND(error.error != Callable::CallError::CALL_OK); // Convert initial INT values to FLOAT as they aer better for interpolation diff --git a/scene/audio/audio_stream_player.cpp b/scene/audio/audio_stream_player.cpp index 2582bab200..f612944a62 100644 --- a/scene/audio/audio_stream_player.cpp +++ b/scene/audio/audio_stream_player.cpp @@ -36,7 +36,7 @@ void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames, int p_amount) { int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus); - AudioFrame *targets[4] = { NULL, NULL, NULL, NULL }; + AudioFrame *targets[4] = { nullptr, nullptr, nullptr, nullptr }; if (AudioServer::get_singleton()->get_speaker_mode() == AudioServer::SPEAKER_MODE_STEREO) { targets[0] = AudioServer::get_singleton()->thread_get_channel_mix_buffer(bus_index, 0); diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index 359f936793..8cb63c4ab5 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -40,7 +40,7 @@ void SceneDebugger::initialize() { #ifdef DEBUG_ENABLED LiveEditor::singleton = memnew(LiveEditor); - EngineDebugger::register_message_capture("scene", EngineDebugger::Capture(NULL, SceneDebugger::parse_message)); + EngineDebugger::register_message_capture("scene", EngineDebugger::Capture(nullptr, SceneDebugger::parse_message)); #endif } @@ -51,7 +51,7 @@ void SceneDebugger::deinitialize() { if (EngineDebugger::has_capture("scene")) EngineDebugger::unregister_message_capture("scene"); memdelete(LiveEditor::singleton); - LiveEditor::singleton = NULL; + LiveEditor::singleton = nullptr; } #endif } @@ -279,7 +279,7 @@ SceneDebuggerObject::SceneDebuggerObject(ObjectID p_id) { } } else if (Script *s = Object::cast_to