1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Drop unused FormatReadableSize, FormatReadableSpeed

This commit is contained in:
Aaron van Geffen
2024-07-12 23:24:49 +02:00
parent 7f2a98cb54
commit 476efff9b9
2 changed files with 0 additions and 41 deletions

View File

@@ -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);

View File

@@ -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);