diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-08-20 19:37:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-20 19:37:29 +0200 |
commit | ae9b5e00989756bb676429530dfe81039009001c (patch) | |
tree | 119c9ac4b886c24d42f418e21e4175a942eb95ff /src/particles.cpp | |
parent | c8d3d1133945138108aa195e6b3c93b07c6e4fa0 (diff) | |
download | minetest-ae9b5e00989756bb676429530dfe81039009001c.tar.gz minetest-ae9b5e00989756bb676429530dfe81039009001c.tar.bz2 minetest-ae9b5e00989756bb676429530dfe81039009001c.zip |
Modernize code: very last fixes (#6290)
Last modernization fixes
Diffstat (limited to 'src/particles.cpp')
-rw-r--r-- | src/particles.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/particles.cpp b/src/particles.cpp index e756a88d1..815ae98c5 100644 --- a/src/particles.cpp +++ b/src/particles.cpp @@ -106,10 +106,6 @@ Particle::Particle( updateVertices(); } -Particle::~Particle() -{ -} - void Particle::OnRegisterSceneNode() { if (IsVisible) @@ -227,17 +223,16 @@ void Particle::updateVertices() 0, 0, 0, 0, m_color, tx0, ty0); v3s16 camera_offset = m_env->getCameraOffset(); - for(u16 i=0; i<4; i++) - { + for (video::S3DVertex &vertex : m_vertices) { if (m_vertical) { v3f ppos = m_player->getPosition()/BS; - m_vertices[i].Pos.rotateXZBy(atan2(ppos.Z-m_pos.Z, ppos.X-m_pos.X)/core::DEGTORAD+90); + vertex.Pos.rotateXZBy(atan2(ppos.Z-m_pos.Z, ppos.X-m_pos.X)/core::DEGTORAD+90); } else { - m_vertices[i].Pos.rotateYZBy(m_player->getPitch()); - m_vertices[i].Pos.rotateXZBy(m_player->getYaw()); + vertex.Pos.rotateYZBy(m_player->getPitch()); + vertex.Pos.rotateXZBy(m_player->getYaw()); } - m_box.addInternalPoint(m_vertices[i].Pos); - m_vertices[i].Pos += m_pos*BS - intToFloat(camera_offset, BS); + m_box.addInternalPoint(vertex.Pos); + vertex.Pos += m_pos*BS - intToFloat(camera_offset, BS); } } @@ -285,8 +280,6 @@ ParticleSpawner::ParticleSpawner(IGameDef *gamedef, LocalPlayer *player, } } -ParticleSpawner::~ParticleSpawner() {} - void ParticleSpawner::step(float dtime, ClientEnvironment* env) { m_time += dtime; |