aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/RenderSystem.cpp
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 11:35:25 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-20 11:35:25 +0100
commit52e84ca0a81210cd1dc61e096c228586649c9bfc (patch)
tree6442c070d225b4e348a3bc4603a52ad23f090da0 /src/crepe/system/RenderSystem.cpp
parent193e837fce92dcc169f995f670c9261f853ea1c3 (diff)
updated adjsuted rendering based on feedback
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r--src/crepe/system/RenderSystem.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp
index 39e0e3f..1ae5ca7 100644
--- a/src/crepe/system/RenderSystem.cpp
+++ b/src/crepe/system/RenderSystem.cpp
@@ -27,7 +27,7 @@ void RenderSystem::update_camera() {
}
bool RenderSystem::render_particle(const Sprite & sprite,
- Transform tm) {
+ const double & scale) {
ComponentManager & mgr = this->component_manager;
SDLContext & render = SDLContext::get_instance();
@@ -44,9 +44,7 @@ bool RenderSystem::render_particle(const Sprite & sprite,
for (const Particle & p : em.data.particles) {
if (!p.active) continue;
- tm.position = p.position;
- tm.rotation = p.angle;
- render.draw(em.data.sprite, tm, *curr_cam);
+ render.draw_particle(sprite, p.position, p.angle, scale, *this->curr_cam);
}
}
return rendering_particles;
@@ -68,7 +66,7 @@ void RenderSystem::render() {
if (!sprite.active) continue;
auto transform = mgr.get_components_by_id<Transform>(sprite.game_object_id).front().get();
- bool rendered_particles = this->render_particle(sprite, transform);
+ bool rendered_particles = this->render_particle(sprite, transform.scale);
if (rendered_particles) continue;