Explorar el Código

misc: replace NULL with nullptr in most places.

undefined
Sam Hocevar hace 9 años
padre
commit
103f60d48b
Se han modificado 10 ficheros con 69 adiciones y 59 borrados
  1. +3
    -3
      doc/samples/btphystest.cpp
  2. +11
    -9
      doc/samples/physics/easycharactercontroller.h
  3. +14
    -14
      doc/samples/physics/easyconstraint.h
  4. +9
    -9
      doc/samples/physics/easyphysics.cpp
  5. +2
    -2
      doc/samples/physics/easyphysics.h
  6. +15
    -9
      doc/samples/physics/lolphysics.h
  7. +3
    -3
      doc/tutorial/11_fractal.cpp
  8. +1
    -1
      src/easymesh/easymeshlua.cpp
  9. +1
    -1
      src/lol/algorithm/portal.h
  10. +10
    -8
      src/lol/math/geometry.h

+ 3
- 3
doc/samples/btphystest.cpp Ver fichero

@@ -206,7 +206,7 @@ void BtPhysTest::InitApp()
}
#endif //USE_WALL

PhysicsObject* BasePhyobj = NULL;
PhysicsObject* BasePhyobj = nullptr;
#if USE_PLATFORM
{
quat NewRotation = quat::fromeuler_xyz(0.f, 0.f, 0.f);
@@ -617,7 +617,7 @@ void BtPhysTest::TickGame(float seconds)
if (m_simulation->RayHits(HitResult, ERT_Closest, Character->GetTransform()[3].xyz, (Character->GetTransform()[3].xyz + vec3(.0f, -1.f, .0f)), Character))
Character->AttachTo(HitResult.m_collider_list[0], true, true);
else
Character->AttachTo(NULL);
Character->AttachTo(nullptr);
}
}
#endif //USE_CHARACTER
@@ -690,7 +690,7 @@ void BtPhysTest::TickDraw(float seconds, Scene &scene)
m_cat_sdata->m_tex_uniform = m_cat_texture->GetTexture()->GetTextureUniform();
m_cat_sdata->m_sprite_flip = ((rand(2) == 1)?(1.f):(0.f)) / (float)(NB_SPRITE * PARTICLE_SIZE);
PhysObj->SetCustomShaderData(m_cat_sdata);
m_cat_sdata = NULL;
m_cat_sdata = nullptr;
}
#endif //USE_BODIES
#endif //CAT_MODE


+ 11
- 9
doc/samples/physics/easycharactercontroller.h Ver fichero

@@ -1,12 +1,14 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2009—2015 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
// © 2010—2015 Sam Hocevar <sam@hocevar.net>
//
// This library is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once
@@ -40,8 +42,8 @@ class EasyCharacterController : public EasyPhysic,
public:
EasyCharacterController(WorldEntity* NewOwnerEntity) :
EasyPhysic(NewOwnerEntity),
m_pair_caching_object(NULL),
m_character(NULL),
m_pair_caching_object(nullptr),
m_character(nullptr),
m_step_height(.0f),
m_base_is_updating(false),
m_base_cached_movement(vec3(0.f)),


+ 14
- 14
doc/samples/physics/easyconstraint.h Ver fichero

@@ -36,15 +36,15 @@ class EasyConstraint

public:
EasyConstraint() :
m_typed_constraint(NULL),
m_p2p_constraint(NULL),
m_hinge_constraint(NULL),
m_slider_constraint(NULL),
m_cone_twist_constraint(NULL),
m_6dof_constraint(NULL),
m_owner_simulation(NULL),
m_a_physobj(NULL),
m_b_physobj(NULL),
m_typed_constraint(nullptr),
m_p2p_constraint(nullptr),
m_hinge_constraint(nullptr),
m_slider_constraint(nullptr),
m_cone_twist_constraint(nullptr),
m_6dof_constraint(nullptr),
m_owner_simulation(nullptr),
m_a_physobj(nullptr),
m_b_physobj(nullptr),
m_a_transform(lol::mat4(1.f)),
m_b_transform(lol::mat4(1.f)),
m_using_ref_a(false),
@@ -55,11 +55,11 @@ public:
~EasyConstraint()
{
delete m_typed_constraint;
m_p2p_constraint = NULL;
m_hinge_constraint = NULL;
m_slider_constraint = NULL;
m_cone_twist_constraint = NULL;
m_6dof_constraint = NULL;
m_p2p_constraint = nullptr;
m_hinge_constraint = nullptr;
m_slider_constraint = nullptr;
m_cone_twist_constraint = nullptr;
m_6dof_constraint = nullptr;
}

void AddToSimulation(class Simulation* current_simulation);


+ 9
- 9
doc/samples/physics/easyphysics.cpp Ver fichero

@@ -30,26 +30,26 @@ namespace phys
//--

EasyPhysic::EasyPhysic(WorldEntity* NewOwnerEntity) :
m_collision_object(NULL),
m_ghost_object(NULL),
m_rigid_body(NULL),
m_collision_object(nullptr),
m_ghost_object(nullptr),
m_rigid_body(nullptr),
m_local_inertia(btVector3(.0f, .0f, .0f)),
m_collision_shape(NULL),
m_convex_shape(NULL),
m_motion_state(NULL),
m_collision_shape(nullptr),
m_convex_shape(nullptr),
m_motion_state(nullptr),
m_mass(.0f),
m_hit_restitution(.0f),
m_collision_group(1),
m_collision_mask(1),
m_owner_entity(NewOwnerEntity),
m_owner_simulation(NULL),
m_base_physic(NULL)
m_owner_simulation(nullptr),
m_base_physic(nullptr)
{
}

EasyPhysic::~EasyPhysic()
{
m_rigid_body = NULL;
m_rigid_body = nullptr;
delete m_collision_object;
delete m_collision_shape;
delete m_motion_state;


+ 2
- 2
doc/samples/physics/easyphysics.h Ver fichero

@@ -46,7 +46,7 @@ public:
virtual void SetShapeToCylinder(lol::vec3& cyl_size);
virtual void SetShapeToCapsule(float radius, float height);

virtual bool CanChangeCollisionChannel() { return (m_rigid_body == NULL); }
virtual bool CanChangeCollisionChannel() { return (m_rigid_body == nullptr); }
virtual mat4 GetTransform();
virtual void SetTransform(const vec3& base_location, const quat& base_rotation = quat(mat3(1.0f)));
protected:
@@ -130,7 +130,7 @@ public:
for (int i = 0; i < m_base_physic->m_based_physic_list.count(); ++i)
if (m_base_physic->m_based_physic_list[i] == this)
m_base_physic->m_based_physic_list.remove(i--);
m_base_physic = NULL;
m_base_physic = nullptr;
}
}



+ 15
- 9
doc/samples/physics/lolphysics.h Ver fichero

@@ -1,8 +1,14 @@
//
// LolPhysics
// Lol Engine
//
// Copyright: (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
// (c) 2012 Sam Hocevar <sam@hocevar.net>
// Copyright © 2012—2015 Sam Hocevar <sam@hocevar.net>
// © 2009—2013 Benjamin “Touky” Huet <huet.benjamin@gmail.com>
//
// This library is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once
@@ -154,11 +160,11 @@ public:
};

//Returns true when hitting something. If SourceCaster is set, it will be ignored by Raycast.
bool RayHits(RayCastResult& HitResult, eRaycastType RaycastType, const vec3& RayFrom, const vec3& RayTo, EasyPhysic* SourceCaster=NULL)
bool RayHits(RayCastResult& HitResult, eRaycastType RaycastType, const vec3& RayFrom, const vec3& RayTo, EasyPhysic* SourceCaster = nullptr)
{
bool bResult = false;

btCollisionWorld::RayResultCallback* BtRayResult = NULL;
btCollisionWorld::RayResultCallback* BtRayResult = nullptr;
btCollisionWorld::ClosestRayResultCallback* BtRayResult_Closest;
btCollisionWorld::AllHitsRayResultCallback* BtRayResult_AllHits;

@@ -334,7 +340,7 @@ private:
//Adds the given EasyPhysic to the correct list.
void ObjectRegistration(bool AddObject, EasyPhysic* NewEP, eEasyPhysicType CurType)
{
array<EasyPhysic*>* SearchList = NULL;
array<EasyPhysic*>* SearchList = nullptr;
switch(CurType)
{
case EEPT_Dynamic:
@@ -375,13 +381,13 @@ private:
}
else
{
NewEP->m_owner_simulation = NULL;
NewEP->m_owner_simulation = nullptr;
SearchList->remove_item(NewEP);
}
}
void ObjectRegistration(bool AddObject, EasyConstraint* NewEC)
{
array<EasyConstraint*>* SearchList = NULL;
array<EasyConstraint*>* SearchList = nullptr;
SearchList = &m_constraint_list;

if (AddObject)
@@ -391,7 +397,7 @@ private:
}
else
{
NewEC->m_owner_simulation = NULL;
NewEC->m_owner_simulation = nullptr;
SearchList->remove_item(NewEC);
}
}


+ 3
- 3
doc/tutorial/11_fractal.cpp Ver fichero

@@ -106,15 +106,15 @@ public:
}

#if !defined __native_client__
m_centertext = new Text(NULL, "data/font/ascii.png");
m_centertext = new Text(nullptr, "data/font/ascii.png");
m_centertext->SetPos(vec3(5, (float)m_window_size.y - 15, 1));
Ticker::Ref(m_centertext);

m_mousetext = new Text(NULL, "data/font/ascii.png");
m_mousetext = new Text(nullptr, "data/font/ascii.png");
m_mousetext->SetPos(vec3(5, (float)m_window_size.y - 29, 1));
Ticker::Ref(m_mousetext);

m_zoomtext = new Text(NULL, "data/font/ascii.png");
m_zoomtext = new Text(nullptr, "data/font/ascii.png");
m_zoomtext->SetPos(vec3(5, (float)m_window_size.y - 43, 1));
Ticker::Ref(m_zoomtext);
#endif


+ 1
- 1
src/easymesh/easymeshlua.cpp Ver fichero

@@ -1,7 +1,7 @@
//
// MY CLASS TYPE
//
// Copyright © 2009-2015 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
// Copyright © 2009-2015 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it


+ 1
- 1
src/lol/algorithm/portal.h Ver fichero

@@ -252,7 +252,7 @@ class PortalRoom
friend class PortalDoor<TE>;

public:
PortalRoom(TE* element=nullptr)
PortalRoom(TE* element = nullptr)
{
m_element = element;
}


+ 10
- 8
src/lol/math/geometry.h Ver fichero

@@ -1,12 +1,14 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// (c) 2010-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net>
// © 2010—2015 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
//
// This library is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once
@@ -277,7 +279,7 @@ typedef SafeEnum<RayIntersectBase> RayIntersect;
int TestRayVsRay(vec3 const &ray_p00, vec3 const &ray_p01,
vec3 const &ray_p10, vec3 const &ray_p11,
vec3 &isec_p);
bool TestPointVsFrustum(const vec3& point, const mat4& frustum, vec3* result_point=nullptr);
bool TestPointVsFrustum(const vec3& point, const mat4& frustum, vec3* result_point = nullptr);

//Ray/Plane : Normal must be given normalized. returns 1 if succeeded.
template <typename TV>


Cargando…
Cancelar
Guardar