From 6b0e2a25cf1e98d3f11d4e6c0305dd327048bbb8 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 27 Jun 2022 22:08:43 +0200 Subject: refactor: use int types from std namespace --- src/game/components/statusline.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/game/components/statusline.cpp') diff --git a/src/game/components/statusline.cpp b/src/game/components/statusline.cpp index 3903792..c2fe7ea 100644 --- a/src/game/components/statusline.cpp +++ b/src/game/components/statusline.cpp @@ -30,12 +30,12 @@ void StatusLine::set_need_render(bool need_render) noexcept _need_render = need_render; } -auto StatusLine::get_foreground_color() const noexcept -> uint32_t +auto StatusLine::get_foreground_color() const noexcept -> std::uint32_t { - return static_cast(fmt::color::white); + return static_cast(fmt::color::white); } -auto StatusLine::get_background_color() const noexcept -> uint32_t +auto StatusLine::get_background_color() const noexcept -> std::uint32_t { return STATUSLINE_COLOR; } @@ -43,7 +43,7 @@ auto StatusLine::get_background_color() const noexcept -> uint32_t void StatusLine::set_section_status( StatusLineSection section, const std::string_view &status, - int32_t start) noexcept + std::int32_t start) noexcept { if (status.length() == 0U) { @@ -56,11 +56,11 @@ void StatusLine::set_section_status( auto pos = Vector2({.x = section_start + start, .y = 0}); - const auto column_cnt = static_cast(_component_matrix->get_column_cnt()); + const auto column_cnt = static_cast(_component_matrix->get_column_cnt()); const auto section_length = _section_lengths[section]; - const auto status_len = static_cast(status.length()); + const auto status_len = static_cast(status.length()); const auto section_style = _section_styles.contains(section) ? _section_styles.at(section) : Style(); @@ -104,7 +104,7 @@ void StatusLine::set_section_status( _matrix_write_string( pos, - status.substr(status_offset_start, static_cast(final_status_length))); + status.substr(status_offset_start, static_cast(final_status_length))); pos = pos.to_direction(Vector2::right(), final_status_length); @@ -120,7 +120,7 @@ void StatusLine::set_section_status( set_need_render(true); } -void StatusLine::set_section_length(StatusLineSection section, int32_t length) noexcept +void StatusLine::set_section_length(StatusLineSection section, std::int32_t length) noexcept { _section_lengths[section] = length; } @@ -144,17 +144,17 @@ void StatusLine::_matrix_write_string( } } -auto StatusLine::_get_section_start_x(StatusLineSection section) const noexcept -> int32_t +auto StatusLine::_get_section_start_x(StatusLineSection section) const noexcept -> std::int32_t { - int32_t section_start = 0; + std::int32_t section_start = 0; - auto section_index = static_cast(section); + auto section_index = static_cast(section); while (section_index > 0) { const auto prev_section = static_cast(section_index - 1); - section_start += static_cast(_section_lengths.at(prev_section)); + section_start += static_cast(_section_lengths.at(prev_section)); section_index--; } @@ -162,7 +162,7 @@ auto StatusLine::_get_section_start_x(StatusLineSection section) const noexcept return section_start; } -void StatusLine::_clear_section(StatusLineSection section, int32_t start) noexcept +void StatusLine::_clear_section(StatusLineSection section, std::int32_t start) noexcept { auto section_start = _get_section_start_x(section); -- cgit v1.2.3-18-g5258