From d3a04fb1e8b119017375caab74c43674006a7348 Mon Sep 17 00:00:00 2001 From: JAROWMR Date: Thu, 12 Dec 2024 22:04:49 +0100 Subject: broken particle test --- src/crepe/api/ParticleEmitter.cpp | 2 +- src/crepe/api/ParticleEmitter.h | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/crepe/api') diff --git a/src/crepe/api/ParticleEmitter.cpp b/src/crepe/api/ParticleEmitter.cpp index 1cfdceb..1e9cfaa 100644 --- a/src/crepe/api/ParticleEmitter.cpp +++ b/src/crepe/api/ParticleEmitter.cpp @@ -7,6 +7,6 @@ ParticleEmitter::ParticleEmitter(game_object_id_t game_object_id, const Sprite & : Component(game_object_id), sprite(sprite), data(data) { for (size_t i = 0; i < this->data.max_particles; i++) { - this->data.particles.emplace_back(); + this->particles.emplace_back(); } } diff --git a/src/crepe/api/ParticleEmitter.h b/src/crepe/api/ParticleEmitter.h index cc54ffb..e0b117a 100644 --- a/src/crepe/api/ParticleEmitter.h +++ b/src/crepe/api/ParticleEmitter.h @@ -3,9 +3,11 @@ #include #include +#include "system/ParticleSystem.h" +#include "system/RenderSystem.h" + #include "Component.h" #include "Particle.h" -#include "system/ParticleSystem.h" #include "types.h" namespace crepe { @@ -69,9 +71,6 @@ public: vec2 force_over_time; //! particle boundary Boundary boundary; - //! collection of particles - std::vector particles; - }; public: @@ -87,7 +86,10 @@ public: private: //! Saves time left over from last update event. friend ParticleSystem; + friend RenderSystem; float spawn_accumulator = 0; + //! collection of particles + std::vector particles; }; } // namespace crepe -- cgit v1.2.3