diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-14 20:18:19 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-14 20:18:19 +0100 |
commit | e25aa67c4263b3a940ae9e92f2fcd31a4486f407 (patch) | |
tree | 58da786958ce45cdd1b6279772227a288c73c906 /src/crepe/system | |
parent | 032f8560b91b76cad5f32a6a9ebfc0ac845ed69a (diff) |
adjusted based on feedback of PR#31
Diffstat (limited to 'src/crepe/system')
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 6 | ||||
-rw-r--r-- | src/crepe/system/RenderSystem.h | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index 17a2337..6ecd604 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -85,13 +85,13 @@ void RenderSystem::render() { auto sprites = mgr.get_components_by_type<Sprite>(); for (const Sprite & sprite : sprites) { if (!sprite.active) continue; - auto transform = mgr.get_components_by_id<Transform>(sprite.game_object_id); + auto transform = mgr.get_components_by_id<Transform>(sprite.game_object_id).front().get(); - bool rendered_particles = this->render_particle(sprite, transform[0].get()); + bool rendered_particles = this->render_particle(sprite, transform); if (rendered_particles) continue; - this->render_normal(sprite, transform[0].get()); + this->render_normal(sprite, transform); } } diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h index 6a87eec..3d6286f 100644 --- a/src/crepe/system/RenderSystem.h +++ b/src/crepe/system/RenderSystem.h @@ -31,6 +31,12 @@ public: */ void update() override; + + RenderSystem(const RenderSystem &) = delete; + RenderSystem(RenderSystem &&) = delete; + RenderSystem & operator=(const RenderSystem &) = delete; + RenderSystem & operator=(RenderSystem &&) = delete; + private: // Private constructor to enforce singleton pattern. RenderSystem(); |