summaryrefslogtreecommitdiff
path: root/modules/csg
diff options
context:
space:
mode:
authorlupoDharkael <izhe@hotmail.es>2020-04-02 01:20:12 +0200
committerlupoDharkael <izhe@hotmail.es>2020-04-02 13:38:00 +0200
commit95a1400a2ac9de1a29fa305f45b928ce8e3044bd (patch)
treebe0cd59e5a90926e9d653fed9f3b1b77e735ca2f /modules/csg
parent5f11e1557156617366d2c316a97716172103980d (diff)
Replace NULL with nullptr
Diffstat (limited to 'modules/csg')
-rw-r--r--modules/csg/csg_shape.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 1ed48a573c..5557da3014 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -156,7 +156,7 @@ CSGBrush *CSGShape3D::_get_brush() {
if (brush) {
memdelete(brush);
}
- brush = NULL;
+ brush = nullptr;
CSGBrush *n = _build_brush();
@@ -427,7 +427,7 @@ void CSGShape3D::_update_shape() {
mkif.m_getPosition = mikktGetPosition;
mkif.m_getTexCoord = mikktGetTexCoord;
mkif.m_setTSpace = mikktSetTSpaceDefault;
- mkif.m_setTSpaceBasic = NULL;
+ mkif.m_setTSpaceBasic = nullptr;
SMikkTSpaceContext msc;
msc.m_pInterface = &mkif;
@@ -536,7 +536,7 @@ void CSGShape3D::_notification(int p_what) {
if (parent)
parent->_make_dirty();
- parent = NULL;
+ parent = nullptr;
if (use_collision && is_root_shape() && root_collision_instance.is_valid()) {
PhysicsServer3D::get_singleton()->free(root_collision_instance);
@@ -636,8 +636,8 @@ void CSGShape3D::_bind_methods() {
CSGShape3D::CSGShape3D() {
operation = OPERATION_UNION;
- parent = NULL;
- brush = NULL;
+ parent = nullptr;
+ brush = nullptr;
dirty = false;
snap = 0.001;
use_collision = false;
@@ -650,14 +650,14 @@ CSGShape3D::CSGShape3D() {
CSGShape3D::~CSGShape3D() {
if (brush) {
memdelete(brush);
- brush = NULL;
+ brush = nullptr;
}
}
//////////////////////////////////
CSGBrush *CSGCombiner3D::_build_brush() {
- return NULL; //does not build anything
+ return nullptr; //does not build anything
}
CSGCombiner3D::CSGCombiner3D() {
@@ -713,7 +713,7 @@ CSGPrimitive3D::CSGPrimitive3D() {
CSGBrush *CSGMesh3D::_build_brush() {
if (!mesh.is_valid())
- return NULL;
+ return nullptr;
Vector<Vector3> vertices;
Vector<bool> smooth;
@@ -731,7 +731,7 @@ CSGBrush *CSGMesh3D::_build_brush() {
if (arrays.size() == 0) {
_make_dirty();
- ERR_FAIL_COND_V(arrays.size() == 0, NULL);
+ ERR_FAIL_COND_V(arrays.size() == 0, nullptr);
}
Vector<Vector3> avertices = arrays[Mesh::ARRAY_VERTEX];
@@ -741,13 +741,13 @@ CSGBrush *CSGMesh3D::_build_brush() {
const Vector3 *vr = avertices.ptr();
Vector<Vector3> anormals = arrays[Mesh::ARRAY_NORMAL];
- const Vector3 *nr = NULL;
+ const Vector3 *nr = nullptr;
if (anormals.size()) {
nr = anormals.ptr();
}
Vector<Vector2> auvs = arrays[Mesh::ARRAY_TEX_UV];
- const Vector2 *uvr = NULL;
+ const Vector2 *uvr = nullptr;
if (auvs.size()) {
uvr = auvs.ptr();
}
@@ -853,7 +853,7 @@ CSGBrush *CSGMesh3D::_build_brush() {
}
if (vertices.size() == 0)
- return NULL;
+ return nullptr;
return _create_brush_from_arrays(vertices, uvs, smooth, materials);
}
@@ -1535,7 +1535,7 @@ CSGBrush *CSGTorus3D::_build_brush() {
float max_radius = outer_radius;
if (min_radius == max_radius)
- return NULL; //sorry, can't
+ return nullptr; //sorry, can't
if (min_radius > max_radius) {
SWAP(min_radius, max_radius);
@@ -1760,7 +1760,7 @@ CSGBrush *CSGPolygon3D::_build_brush() {
// set our bounding box
if (polygon.size() < 3)
- return NULL;
+ return nullptr;
Vector<Point2> final_polygon = polygon;
@@ -1771,9 +1771,9 @@ CSGBrush *CSGPolygon3D::_build_brush() {
Vector<int> triangles = Geometry::triangulate_polygon(final_polygon);
if (triangles.size() < 3)
- return NULL;
+ return nullptr;
- Path3D *path = NULL;
+ Path3D *path = nullptr;
Ref<Curve3D> curve;
// get bounds for our polygon
@@ -1796,32 +1796,32 @@ CSGBrush *CSGPolygon3D::_build_brush() {
if (mode == MODE_PATH) {
if (!has_node(path_node))
- return NULL;
+ return nullptr;
Node *n = get_node(path_node);
if (!n)
- return NULL;
+ return nullptr;
path = Object::cast_to<Path3D>(n);
if (!path)
- return NULL;
+ return nullptr;
if (path != path_cache) {
if (path_cache) {
path_cache->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
path_cache->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
- path_cache = NULL;
+ path_cache = nullptr;
}
path_cache = path;
path_cache->connect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
path_cache->connect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
- path_cache = NULL;
+ path_cache = nullptr;
}
curve = path->get_curve();
if (curve.is_null())
- return NULL;
+ return nullptr;
if (curve->get_baked_length() <= 0)
- return NULL;
+ return nullptr;
}
CSGBrush *brush = memnew(CSGBrush);
@@ -2232,7 +2232,7 @@ void CSGPolygon3D::_notification(int p_what) {
if (path_cache) {
path_cache->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited));
path_cache->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed));
- path_cache = NULL;
+ path_cache = nullptr;
}
}
}
@@ -2257,7 +2257,7 @@ void CSGPolygon3D::_path_changed() {
}
void CSGPolygon3D::_path_exited() {
- path_cache = NULL;
+ path_cache = nullptr;
}
void CSGPolygon3D::_bind_methods() {
@@ -2483,5 +2483,5 @@ CSGPolygon3D::CSGPolygon3D() {
path_local = false;
path_continuous_u = false;
path_joined = false;
- path_cache = NULL;
+ path_cache = nullptr;
}