From 368aeba5bcfafe445b3af5748f3798aa75003bf2 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Wed, 27 Nov 2024 10:35:06 +0100 Subject: implemented feedback on PR40 and made camera sizes ivec2 --- src/crepe/system/RenderSystem.cpp | 8 +++----- src/crepe/system/RenderSystem.h | 4 +--- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src/crepe/system') diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index 564fc79..beed9ce 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include #include @@ -10,7 +9,6 @@ #include "../api/ParticleEmitter.h" #include "../api/Sprite.h" #include "../api/Transform.h" -#include "../api/Vector2.h" #include "../facade/SDLContext.h" #include "RenderSystem.h" @@ -30,7 +28,7 @@ void RenderSystem::update_camera() { for (Camera & cam : cameras) { if (!cam.active) continue; - this->context.set_camera(cam, this->scale); + this->context.set_camera(cam); this->curr_cam_ref = &cam; } } @@ -73,13 +71,13 @@ bool RenderSystem::render_particle(const Sprite & sprite, const double & scale) for (const Particle & p : em.data.particles) { if (!p.active) continue; this->context.draw_particle(sprite, p.position, p.angle, scale, - *this->curr_cam_ref, this->scale); + *this->curr_cam_ref); } } return rendering_particles; } void RenderSystem::render_normal(const Sprite & sprite, const Transform & tm) { - this->context.draw(sprite, tm, *this->curr_cam_ref, this->scale); + this->context.draw(sprite, tm, *this->curr_cam_ref); } void RenderSystem::render() { diff --git a/src/crepe/system/RenderSystem.h b/src/crepe/system/RenderSystem.h index 97222f3..08930b0 100644 --- a/src/crepe/system/RenderSystem.h +++ b/src/crepe/system/RenderSystem.h @@ -77,10 +77,8 @@ private: private: //! Pointer to the current active camera for rendering - Camera * curr_cam_ref = nullptr; // TODO: needs a better solution - - vec2 scale; + Camera * curr_cam_ref = nullptr; SDLContext & context = SDLContext::get_instance(); }; -- cgit v1.2.3