diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:39:07 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:39:07 +0100 |
commit | e8cd950b8ebd152d76d588d4fedc7f4c239b0835 (patch) | |
tree | 7919d13a79d52f1365bc19bf1b435a6264ee5512 /src/crepe/system/RenderSystem.cpp | |
parent | 5bee4515c1089ce3499bc3b74780db94f0c02306 (diff) | |
parent | 9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (diff) |
merge `master` into `loek/cleanup`
Diffstat (limited to 'src/crepe/system/RenderSystem.cpp')
-rw-r--r-- | src/crepe/system/RenderSystem.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/crepe/system/RenderSystem.cpp b/src/crepe/system/RenderSystem.cpp index 0d37808..19493f7 100644 --- a/src/crepe/system/RenderSystem.cpp +++ b/src/crepe/system/RenderSystem.cpp @@ -15,14 +15,11 @@ void RenderSystem::clear_screen() const { SDLContext::get_instance().clear_screen(); } -void RenderSystem::present_screen() const { - SDLContext::get_instance().present_screen(); -} +void RenderSystem::present_screen() const { SDLContext::get_instance().present_screen(); } void RenderSystem::update_camera() { ComponentManager & mgr = this->component_manager; - std::vector<std::reference_wrapper<Camera>> cameras - = mgr.get_components_by_type<Camera>(); + std::vector<std::reference_wrapper<Camera>> cameras = mgr.get_components_by_type<Camera>(); for (Camera & cam : cameras) { SDLContext::get_instance().camera(cam); @@ -32,13 +29,11 @@ void RenderSystem::update_camera() { void RenderSystem::render_sprites() const { ComponentManager & mgr = this->component_manager; - std::vector<std::reference_wrapper<Sprite>> sprites - = mgr.get_components_by_type<Sprite>(); + std::vector<std::reference_wrapper<Sprite>> sprites = mgr.get_components_by_type<Sprite>(); SDLContext & render = SDLContext::get_instance(); for (const Sprite & sprite : sprites) { - auto transforms - = mgr.get_components_by_id<Transform>(sprite.game_object_id); + auto transforms = mgr.get_components_by_id<Transform>(sprite.game_object_id); render.draw(sprite, transforms[0], *curr_cam); } } |