From 6e2c5e1b57210b10f8781f103e5c46308544339f Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Wed, 23 Oct 2024 22:23:36 +0200 Subject: more nitpicking --- src/crepe/api/ParticleEmitter.cpp | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/crepe/api/ParticleEmitter.cpp') diff --git a/src/crepe/api/ParticleEmitter.cpp b/src/crepe/api/ParticleEmitter.cpp index 298a5ec..2e07562 100644 --- a/src/crepe/api/ParticleEmitter.cpp +++ b/src/crepe/api/ParticleEmitter.cpp @@ -1,29 +1,28 @@ -#include "ParticleEmitter.h" -#include "Particle.h" #include #include +#include "Particle.h" +#include "ParticleEmitter.h" + using namespace crepe; -ParticleEmitter::ParticleEmitter(uint32_t gameObjectId, uint32_t max_particles, - uint32_t emission_rate, uint32_t speed, - uint32_t speed_offset, uint32_t angle, - uint32_t angleOffset, float m_begin_lifespan, - float m_end_lifespan) - : Component(gameObjectId), m_max_particles(max_particles), - m_emission_rate(emission_rate), m_speed(speed), m_speed_offset(speed_offset), - m_position{0, 0}, m_begin_lifespan(m_begin_lifespan), - m_end_lifespan(m_end_lifespan) { +ParticleEmitter::ParticleEmitter(uint32_t game_object_id, + uint32_t max_particles, uint32_t emission_rate, + uint32_t speed, uint32_t speed_offset, + uint32_t angle, uint32_t angleOffset, + float begin_lifespan, float end_lifespan) + : Component(game_object_id), max_particles(max_particles), + emission_rate(emission_rate), speed(speed), speed_offset(speed_offset), + position{0, 0}, begin_lifespan(begin_lifespan), + end_lifespan(end_lifespan) { std::srand( static_cast(std::time(nullptr))); // initialize random seed std::cout << "Create emitter" << std::endl; - m_min_angle - = (360 + angle - (angleOffset % 360)) % 360; // calculate minAngle - m_max_angle - = (360 + angle + (angleOffset % 360)) % 360; // calculate maxAngle - m_position.x = 400; - m_position.y = 400; - for (size_t i = 0; i < m_max_particles; i++) { + min_angle = (360 + angle - (angleOffset % 360)) % 360; // calculate minAngle + max_angle = (360 + angle + (angleOffset % 360)) % 360; // calculate maxAngle + position.x = 400; + position.y = 400; + for (size_t i = 0; i < max_particles; i++) { this->particles.emplace_back(); } } -- cgit v1.2.3