diff options
Diffstat (limited to 'src/engine/graphics')
-rw-r--r-- | src/engine/graphics/scene.cpp | 5 | ||||
-rw-r--r-- | src/engine/graphics/scene.hpp | 3 | ||||
-rw-r--r-- | src/engine/graphics/statusline.cpp | 19 | ||||
-rw-r--r-- | src/engine/graphics/statusline.hpp | 10 | ||||
-rw-r--r-- | src/engine/graphics/window.cpp | 2 |
5 files changed, 15 insertions, 24 deletions
diff --git a/src/engine/graphics/scene.cpp b/src/engine/graphics/scene.cpp index d5cf89b..73c1292 100644 --- a/src/engine/graphics/scene.cpp +++ b/src/engine/graphics/scene.cpp @@ -11,10 +11,9 @@ Scene::Scene( IMatrixFactory<std::string_view> matrix_factory, std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window -) noexcept + 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)) { diff --git a/src/engine/graphics/scene.hpp b/src/engine/graphics/scene.hpp index aaf0095..5e74725 100644 --- a/src/engine/graphics/scene.hpp +++ b/src/engine/graphics/scene.hpp @@ -18,8 +18,7 @@ public: explicit Scene( IMatrixFactory<std::string_view> matrix_factory, std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window - ) noexcept; + std::shared_ptr<IWindow> window) noexcept; void enter() noexcept override; diff --git a/src/engine/graphics/statusline.cpp b/src/engine/graphics/statusline.cpp index 1abb87b..3968fae 100644 --- a/src/engine/graphics/statusline.cpp +++ b/src/engine/graphics/statusline.cpp @@ -8,8 +8,7 @@ StatusLine::StatusLine( std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window -) noexcept + std::shared_ptr<IWindow> window) noexcept : _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) { } @@ -29,8 +28,7 @@ void StatusLine::initialize_background() noexcept void StatusLine::set_status( const StatusLineSection §ion, const std::string_view &status, - std::size_t start -) noexcept + std::size_t start) noexcept { _clear_section(section, start); @@ -51,8 +49,7 @@ void StatusLine::set_status( void StatusLine::set_section_length( const StatusLineSection §ion, - uint32_t length -) noexcept + uint32_t length) noexcept { _sections_lengths[section] = length; } @@ -67,7 +64,7 @@ auto StatusLine::_move_to_statusline(int32_t x) noexcept -> Vector2 auto window_height = static_cast<Vector2::Value>(window_size.get_height()); - _cursor_controller->move_to(Vector2({ .x = x, .y = window_height }), true); + _cursor_controller->move_to(Vector2({.x = x, .y = window_height}), true); return previous_position; } @@ -87,9 +84,8 @@ auto StatusLine::_get_section_start_x(const StatusLineSection §ion) const no while (section_index > 0) { - section_start += - static_cast<int32_t>(_sections_lengths.at(StatusLineSection(section_index - 1) - )); + section_start += static_cast<int32_t>( + _sections_lengths.at(StatusLineSection(section_index - 1))); section_index--; } @@ -99,8 +95,7 @@ auto StatusLine::_get_section_start_x(const StatusLineSection §ion) const no void StatusLine::_clear_section( const StatusLineSection §ion, - std::size_t start -) noexcept + std::size_t start) noexcept { auto section_start = _get_section_start_x(section); diff --git a/src/engine/graphics/statusline.hpp b/src/engine/graphics/statusline.hpp index 181090d..add8e02 100644 --- a/src/engine/graphics/statusline.hpp +++ b/src/engine/graphics/statusline.hpp @@ -19,16 +19,14 @@ class StatusLine : public IStatusLine public: StatusLine( std::shared_ptr<ICursorController> cursor_controller, - std::shared_ptr<IWindow> window - ) noexcept; + std::shared_ptr<IWindow> window) noexcept; void initialize_background() noexcept override; void set_status( const StatusLineSection §ion, const std::string_view &status, - std::size_t start - ) noexcept override; + std::size_t start) noexcept override; void set_section_length(const StatusLineSection §ion, uint32_t length) noexcept override; @@ -43,8 +41,8 @@ private: void _move_back(Vector2 previous_position) noexcept; - [[nodiscard]] auto _get_section_start_x(const StatusLineSection §ion - ) const noexcept -> int32_t; + [[nodiscard]] auto + _get_section_start_x(const StatusLineSection §ion) const noexcept -> int32_t; void _clear_section(const StatusLineSection §ion, std::size_t start) noexcept; }; diff --git a/src/engine/graphics/window.cpp b/src/engine/graphics/window.cpp index 2d880fc..bb33402 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}); } |