diff options
author | HampusM <hampus@hampusmat.com> | 2022-04-24 17:13:52 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-13 17:56:58 +0200 |
commit | db6edcd473a684420e9a7611b24462df21165c1b (patch) | |
tree | 9646bdb4f5f6e339a0a01873b44e0b185476ce56 /src/engine/graphics | |
parent | b36d072ad7a7b9c6e30fcb25d6bbb001a8393468 (diff) |
style: improve function and brace styling
Diffstat (limited to 'src/engine/graphics')
-rw-r--r-- | src/engine/graphics/scene.cpp | 13 | ||||
-rw-r--r-- | src/engine/graphics/scene.hpp | 12 | ||||
-rw-r--r-- | src/engine/graphics/window.cpp | 2 |
3 files changed, 16 insertions, 11 deletions
diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index c27a6d5..d5cf89b 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -8,11 +8,13 @@ #include <iostream> #include <utility> -Scene::Scene(IMatrixFactory<std::string_view> matrix_factory, - std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window) noexcept +Scene::Scene( + IMatrixFactory<std::string_view> matrix_factory, + std::shared_ptr<ICursorController> cursor_controller, + std::shared_ptr<IWindow> window +) noexcept : _is_shown(false), - _matrix(matrix_factory(window->size() - Bounds({.width = 0U, .height = 1U}))), + _matrix(matrix_factory(window->size() - Bounds({ .width = 0U, .height = 1U }))), _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) { @@ -45,7 +47,8 @@ void Scene::leave() noexcept _is_shown = false; } -auto Scene::get_matrix() const noexcept -> const std::shared_ptr<IMatrix<std::string_view>> & +auto Scene::get_matrix() const noexcept + -> const std::shared_ptr<IMatrix<std::string_view>> & { return _matrix; } diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index 3dcaa2d..aaf0095 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -15,16 +15,18 @@ constexpr fmt::string_view DISABLE_ALT_BUFFER = "{esc}[?1049l"; class Scene : public IScene { public: - explicit Scene(IMatrixFactory<std::string_view> matrix_factory, - std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window) noexcept; + explicit Scene( + IMatrixFactory<std::string_view> matrix_factory, + std::shared_ptr<ICursorController> cursor_controller, + std::shared_ptr<IWindow> window + ) noexcept; void enter() noexcept override; void leave() noexcept override; - [[nodiscard]] auto - get_matrix() const noexcept -> const std::shared_ptr<IMatrix<std::string_view>> & override; + [[nodiscard]] auto get_matrix() const noexcept + -> const std::shared_ptr<IMatrix<std::string_view>> & override; private: bool _is_shown; diff --git a/src/engine/graphics/window.cpp b/src/engine/graphics/window.cpp index bb33402..2d880fc 100644 --- a/src/engine/graphics/window.cpp +++ b/src/engine/graphics/window.cpp @@ -9,5 +9,5 @@ auto Window::size() const noexcept -> Bounds // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) ioctl(0, TIOCGWINSZ, &window_size); - return Bounds({window_size.ws_col, window_size.ws_row}); + return Bounds({ window_size.ws_col, window_size.ws_row }); } |