Skip to content

Commit 095f26a

Browse files
ClobberXDSmallJoker
authored andcommittedAug 31, 2019
particles.cpp: Fix code-style
Mainly spacing and pointer placement
1 parent 96762af commit 095f26a

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed
 

‎src/client/particles.cpp

+17-12
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ Particle::Particle(
101101
m_glow = glow;
102102

103103
// Irrlicht stuff
104-
m_collisionbox = aabb3f
105-
(-size/2,-size/2,-size/2,size/2,size/2,size/2);
104+
m_collisionbox = aabb3f(
105+
-size / 2,
106+
-size / 2,
107+
-size / 2,
108+
size / 2,
109+
size / 2,
110+
size / 2);
106111
this->setAutomaticCulling(scene::EAC_OFF);
107112

108113
// Init lighting
@@ -122,7 +127,7 @@ void Particle::OnRegisterSceneNode()
122127

123128
void Particle::render()
124129
{
125-
video::IVideoDriver* driver = SceneManager->getVideoDriver();
130+
video::IVideoDriver *driver = SceneManager->getVideoDriver();
126131
driver->setMaterial(m_material);
127132
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
128133

@@ -293,9 +298,9 @@ ParticleSpawner::ParticleSpawner(
293298
m_animation = anim;
294299
m_glow = glow;
295300

296-
for (u16 i = 0; i<=m_amount; i++)
301+
for (u16 i = 0; i <= m_amount; i++)
297302
{
298-
float spawntime = (float)rand()/(float)RAND_MAX*m_spawntime;
303+
float spawntime = (float)rand() / (float)RAND_MAX * m_spawntime;
299304
m_spawntimes.push_back(spawntime);
300305
}
301306
}
@@ -359,7 +364,7 @@ void ParticleSpawner::spawnParticle(ClientEnvironment *env, float radius,
359364
));
360365
}
361366

362-
void ParticleSpawner::step(float dtime, ClientEnvironment* env)
367+
void ParticleSpawner::step(float dtime, ClientEnvironment *env)
363368
{
364369
m_time += dtime;
365370

@@ -381,7 +386,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment* env)
381386
for (std::vector<float>::iterator i = m_spawntimes.begin();
382387
i != m_spawntimes.end();) {
383388
if ((*i) <= m_time && m_amount > 0) {
384-
m_amount--;
389+
--m_amount;
385390

386391
// Pretend to, but don't actually spawn a particle if it is
387392
// attached to an unloaded object or distant from player.
@@ -408,7 +413,7 @@ void ParticleSpawner::step(float dtime, ClientEnvironment* env)
408413
}
409414

410415

411-
ParticleManager::ParticleManager(ClientEnvironment* env) :
416+
ParticleManager::ParticleManager(ClientEnvironment *env) :
412417
m_env(env)
413418
{}
414419

@@ -570,7 +575,7 @@ void ParticleManager::handleParticleEvent(ClientEvent *event, Client *client,
570575
// The final burst of particles when a node is finally dug, *not* particles
571576
// spawned during the digging of a node.
572577

573-
void ParticleManager::addDiggingParticles(IGameDef* gamedef,
578+
void ParticleManager::addDiggingParticles(IGameDef *gamedef,
574579
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
575580
{
576581
// No particles for "airlike" nodes
@@ -585,7 +590,7 @@ void ParticleManager::addDiggingParticles(IGameDef* gamedef,
585590
// During the digging of a node particles are spawned individually by this
586591
// function, called from Game::handleDigging() in game.cpp.
587592

588-
void ParticleManager::addNodeParticle(IGameDef* gamedef,
593+
void ParticleManager::addNodeParticle(IGameDef *gamedef,
589594
LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
590595
{
591596
// No particles for "airlike" nodes
@@ -637,7 +642,7 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef,
637642
else
638643
n.getColor(f, &color);
639644

640-
Particle* toadd = new Particle(
645+
Particle *toadd = new Particle(
641646
gamedef,
642647
player,
643648
m_env,
@@ -660,7 +665,7 @@ void ParticleManager::addNodeParticle(IGameDef* gamedef,
660665
addParticle(toadd);
661666
}
662667

663-
void ParticleManager::addParticle(Particle* toadd)
668+
void ParticleManager::addParticle(Particle *toadd)
664669
{
665670
MutexAutoLock lock(m_particle_list_lock);
666671
m_particles.push_back(toadd);

0 commit comments

Comments
 (0)
Please sign in to comment.