From 476efff9b9565e441b34782d32159bb79205362f Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Fri, 12 Jul 2024 23:24:49 +0200 Subject: [PATCH] Drop unused FormatReadableSize, FormatReadableSpeed --- src/openrct2/localisation/Localisation.cpp | 31 ---------------------- src/openrct2/localisation/Localisation.h | 10 ------- 2 files changed, 41 deletions(-) diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 6b6c5e3d94..a865939238 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -303,37 +303,6 @@ void FormatStringToUpper(utf8* dest, size_t size, StringId format, const void* a dest[upperString.size()] = '\0'; } -void FormatReadableSize(char* buf, size_t bufSize, uint64_t sizeBytes) -{ - constexpr uint32_t SizeTable[] = { - STR_SIZE_BYTE, STR_SIZE_KILOBYTE, STR_SIZE_MEGABYTE, STR_SIZE_GIGABYTE, STR_SIZE_TERABYTE, - }; - - double size = sizeBytes; - size_t idx = 0; - while (size >= 1024.0) - { - size /= 1024.0; - idx++; - } - - char sizeType[128] = {}; - OpenRCT2::FormatStringLegacy(sizeType, sizeof(sizeType), SizeTable[idx], nullptr); - - snprintf(buf, bufSize, "%.03f %s", size, sizeType); -} - -void FormatReadableSpeed(char* buf, size_t bufSize, uint64_t sizeBytes) -{ - char sizeText[128] = {}; - FormatReadableSize(sizeText, sizeof(sizeText), sizeBytes); - - const char* args[1] = { - sizeText, - }; - OpenRCT2::FormatStringLegacy(buf, bufSize, STR_NETWORK_SPEED_SEC, args); -} - money64 StringToMoney(const char* string_to_monetise) { const char* decimal_char = LanguageGetString(STR_LOCALE_DECIMAL_POINT); diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index 1b624ebd24..a65372ac4e 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -17,16 +17,6 @@ std::string FormatStringIDLegacy(StringId format, const void* args); void FormatStringToUpper(char* dest, size_t size, StringId format, const void* args); -/** - * Formats sizeBytes into buf as a human readable text, e.x.: "1024 MB" - */ -void FormatReadableSize(char* buf, size_t bufSize, uint64_t sizeBytes); - -/** - * Formats sizeBytesPerSec into buf as a human readable text, e.x.: "1024 MB/sec" - */ -void FormatReadableSpeed(char* buf, size_t bufSize, uint64_t sizeBytesPerSec); - // The maximum number of characters allowed for string/money conversions (anything above will risk integer overflow issues) constexpr size_t kMoneyStringMaxlength = 14; money64 StringToMoney(const char* string_to_monetise);