diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 21:07:26 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 21:07:26 +0100 |
commit | 66bbea079bf1ae84c355349d337db468c18eac32 (patch) | |
tree | 68a3d8baf7e8104a375b0d5a2c515cdd8b03951f /src/crepe/system/RenderSystem.cpp | |
parent | bae2501c9e2604497db152d5e3df6a018cdd6858 (diff) |
feedback from PR#38 implemented
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index bf5dade..11c20f5 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -22,7 +22,7 @@ void RenderSystem::update_camera() { for (Camera & cam : cameras) { SDLContext::get_instance().camera(cam); - this->curr_cam = &cam; + this->curr_cam_ref = &cam; } } @@ -35,7 +35,6 @@ bool sorting_comparison(const Sprite & a, const Sprite & b) { std::vector<std::reference_wrapper<Sprite>> RenderSystem::sort(std::vector<std::reference_wrapper<Sprite>> & objs) { - if (objs.empty()) return {}; std::vector<std::reference_wrapper<Sprite>> sorted_objs(objs); std::sort(sorted_objs.begin(), sorted_objs.end(), sorting_comparison); @@ -52,7 +51,7 @@ void RenderSystem::render_sprites() { SDLContext & render = SDLContext::get_instance(); for (const Sprite & sprite : sorted_sprites) { auto transforms = mgr.get_components_by_id<Transform>(sprite.game_object_id); - render.draw(sprite, transforms[0], *curr_cam); + render.draw(sprite, transforms[0], *this->curr_cam_ref); } } |