diff options
author | HampusM <hampus@hampusmat.com> | 2022-06-27 22:08:43 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2022-06-27 22:08:43 +0200 |
commit | 6b0e2a25cf1e98d3f11d4e6c0305dd327048bbb8 (patch) | |
tree | a62c23f4e66949fe109e07dec95ad3a3e5229a7c /src/game/components/statusline.cpp | |
parent | 9d0fe1b42c9f6a5c09bab444966d347a71a4b905 (diff) |
refactor: use int types from std namespace
Diffstat (limited to 'src/game/components/statusline.cpp')
-rw-r--r-- | src/game/components/statusline.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
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<uint32_t>(fmt::color::white); + return static_cast<std::uint32_t>(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<int32_t>(_component_matrix->get_column_cnt()); + const auto column_cnt = static_cast<std::int32_t>(_component_matrix->get_column_cnt()); const auto section_length = _section_lengths[section]; - const auto status_len = static_cast<int32_t>(status.length()); + const auto status_len = static_cast<std::int32_t>(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<uint32_t>(final_status_length))); + status.substr(status_offset_start, static_cast<std::uint32_t>(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<int32_t>(section); + auto section_index = static_cast<std::int32_t>(section); while (section_index > 0) { const auto prev_section = static_cast<StatusLineSection>(section_index - 1); - section_start += static_cast<int32_t>(_section_lengths.at(prev_section)); + section_start += static_cast<std::int32_t>(_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); |