From 3f72121ac41741d53e4916f1275cbd4f93259c4d Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 25 May 2019 22:40:15 +0800 Subject: Massive code refactor en cours! Less complain from compilers: - use nullptr instead of NULL - use types for event fields - explicit type casting added Stop saving parameters of meta events in p1/p2 fields of SEvent. callback_t now uses std::function, deprecating ICallback. Not recommended for daily usage, or even testing: the code refactor is still a work in progress. --- visualization/extrasmeltutils.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'visualization/extrasmeltutils.cpp') diff --git a/visualization/extrasmeltutils.cpp b/visualization/extrasmeltutils.cpp index 6c8dd93..7e766f4 100644 --- a/visualization/extrasmeltutils.cpp +++ b/visualization/extrasmeltutils.cpp @@ -3,9 +3,9 @@ #include #include #include "extrasmeltutils.hpp" -SMELT* smEntity3DBuffer::sm=NULL; -SMELT* smParticle::sm=NULL; -SMELT* smParticleSystem::sm=NULL; +SMELT* smEntity3DBuffer::sm=nullptr; +SMELT* smParticle::sm=nullptr; +SMELT* smParticleSystem::sm=nullptr; smVertex makeVertex(float x,float y,float z,DWORD color,float tx,float ty) {smVertex v;v.x=x;v.y=y;v.z=z;v.col=color;v.tx=tx;v.ty=ty;return v;} void smEntity3D::addVerices(int n,...) @@ -93,7 +93,7 @@ void smParticle::update() q.v[3].x=v3.x+pos.x;q.v[3].y=v3.y+pos.y;q.v[3].z=v3.z+pos.z; } smParticleSystem::smParticleSystem() -{sm=smGetInterface(SMELT_APILEVEL);particles.clear();posGenerator=NULL;active=false;} +{sm=smGetInterface(SMELT_APILEVEL);particles.clear();posGenerator=nullptr;active=false;} smParticleSystem::~smParticleSystem() {for(unsigned i=0;idead) - {delete particles.back();particles.back()=NULL;particles.pop_back();} + {delete particles.back();particles.back()=nullptr;particles.pop_back();} } void smParticleSystem::renderPS() {for(unsigned i=0;irender();} -- cgit v1.2.3