diff options
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/platform/Color.cpp | 4 | ||||
-rw-r--r-- | src/platform/gui/Keyboard.cpp | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/platform/CMakeLists.txt b/src/platform/CMakeLists.txt index e831c544..0288bed0 100644 --- a/src/platform/CMakeLists.txt +++ b/src/platform/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(cru_platform_base PUBLIC ${CRU_PLATFORM_BASE_INCLUDE_DIR}/Check.hpp ${CRU_PLATFORM_BASE_INCLUDE_DIR}/Color.hpp ${CRU_PLATFORM_BASE_INCLUDE_DIR}/Exception.hpp - ${CRU_PLATFORM_BASE_INCLUDE_DIR}/GraphBase.hpp + ${CRU_PLATFORM_BASE_INCLUDE_DIR}/GraphicsBase.hpp ${CRU_PLATFORM_BASE_INCLUDE_DIR}/HeapDebug.hpp ${CRU_PLATFORM_BASE_INCLUDE_DIR}/Matrix.hpp ${CRU_PLATFORM_BASE_INCLUDE_DIR}/Resource.hpp diff --git a/src/platform/Color.cpp b/src/platform/Color.cpp index 52534048..cced498c 100644 --- a/src/platform/Color.cpp +++ b/src/platform/Color.cpp @@ -13,11 +13,11 @@ String Color::ToString() const { return v >= 10 ? v - 10 + u'a' : v + u'0'; }; - auto to_two_hex_digit = [to_hex](std::uint8_t v) -> std::u16string { + auto to_two_hex_digit = [to_hex](std::uint8_t v) -> String { return {to_hex(v /= 16), to_hex(v %= 16)}; }; - std::u16string result = u"#"; + String result = u"#"; result.append(to_two_hex_digit(red)); result.append(to_two_hex_digit(green)); result.append(to_two_hex_digit(blue)); diff --git a/src/platform/gui/Keyboard.cpp b/src/platform/gui/Keyboard.cpp index 24880e00..7d4903e5 100644 --- a/src/platform/gui/Keyboard.cpp +++ b/src/platform/gui/Keyboard.cpp @@ -5,8 +5,7 @@ #include <string_view> namespace cru::platform::gui { -constexpr std::array<std::u16string_view, - static_cast<int>(KeyCode::NumPad9) + 1> +const std::array<StringView, static_cast<int>(KeyCode::NumPad9) + 1> key_code_string_list{u"Unknown", u"LeftButton", u"MiddleButton", @@ -106,13 +105,13 @@ constexpr std::array<std::u16string_view, u"NumPad8", u"NumPad9"}; -std::u16string_view ToString(KeyCode key_code) { +String ToString(KeyCode key_code) { if (static_cast<int>(key_code) < 0 || static_cast<int>(key_code) >= static_cast<int>(key_code_string_list.size())) return u"UNKNOWN_KEYCODENAME"; - return key_code_string_list[static_cast<int>(key_code)]; + return key_code_string_list[static_cast<int>(key_code)].ToString(); } std::u16string ToString(KeyModifier key_modifier, |